-
Notifications
You must be signed in to change notification settings - Fork 170
Add ConvertUBOToPushConstantsTestVk.cpp #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ConvertUBOToPushConstantsTestVk.cpp #745
Conversation
| # Add SPIRV-Tools include directories if needed for SPIRVTools.hpp | ||
| # Test files that include SPIRVTools.hpp need access to spirv-tools headers | ||
| # SPIRVTools.hpp includes "spirv-tools/libspirv.h", so we need the include directory | ||
| if (TARGET SPIRV-Tools-opt) | ||
| get_target_property(SPIRV_TOOLS_SOURCE_DIR SPIRV-Tools-opt SOURCE_DIR) | ||
| get_target_property(SPIRV_TOOLS_BINARY_DIR SPIRV-Tools-opt BINARY_DIR) | ||
| get_filename_component(SPIRV_TOOLS_ROOT_DIR "${SPIRV_TOOLS_SOURCE_DIR}/../.." ABSOLUTE) | ||
| get_filename_component(SPIRV_TOOLS_ROOT_BINARY_DIR "${SPIRV_TOOLS_BINARY_DIR}/../.." ABSOLUTE) | ||
| # Add include subdirectory for public headers like spirv-tools/libspirv.h | ||
| target_include_directories(DiligentCoreAPITest PRIVATE | ||
| ${SPIRV_TOOLS_ROOT_DIR}/include | ||
| ${SPIRV_TOOLS_ROOT_DIR} | ||
| ${SPIRV_TOOLS_ROOT_BINARY_DIR} | ||
| ) | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is annoying.
I pushed a change that removes dependency on libspirv.h, so SPIRVTools.hpp can be included without issues.
TheMostDiligent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boy is Vulkan verbose
| void main() | ||
| { | ||
| // Access deeply nested member to generate multiple OpAccessChain instructions | ||
| // This tests PropagateStorageClass with multiple levels of pointer indirection | ||
| out_Color = vec4(in_Color, 1.0) * cb.Data.Nested.Inner.Factor; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making the use of push constants a bit more sophisticated: at a minimum, read colors from push constants instead of getting them from the VS.
Maybe also pass structs to a function.
| GLSLangUtils::SpirvVersion Version = GLSLangUtils::SpirvVersion::Vk100; | ||
| if (ShaderType == SHADER_TYPE_RAY_GEN || | ||
| ShaderType == SHADER_TYPE_RAY_MISS || | ||
| ShaderType == SHADER_TYPE_RAY_CLOSEST_HIT || | ||
| ShaderType == SHADER_TYPE_RAY_ANY_HIT || | ||
| ShaderType == SHADER_TYPE_RAY_INTERSECTION || | ||
| ShaderType == SHADER_TYPE_CALLABLE) | ||
| { | ||
| Version = GLSLangUtils::SpirvVersion::Vk110_Spirv14; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not planning to test ray tracing here, so this is not needed.
No description provided.