Test that unsized arrays in uniform blocks work when extension is enabled.
| 48 | |
| 49 | // Test that unsized arrays in uniform blocks work when extension is enabled. |
| 50 | TEST_F(UboUnsizedArrayTest, BasicFunctionality) |
| 51 | { |
| 52 | const std::string code = R"( |
| 53 | #version 450 |
| 54 | #extension GL_EXT_uniform_buffer_unsized_array : require |
| 55 | |
| 56 | layout(std140, binding=0) uniform DataBlock { |
| 57 | float scale; |
| 58 | float values[]; // unsized array as last member |
| 59 | }; |
| 60 | |
| 61 | void main() { |
| 62 | gl_Position = vec4(values[0] * scale, 0.0, 0.0, 1.0); |
| 63 | } |
| 64 | )"; |
| 65 | |
| 66 | glslang::TShader shader(EShLangVertex); |
| 67 | EShMessages controls = static_cast<EShMessages>(EShMsgDefault | EShMsgSpvRules | EShMsgVulkanRules); |
| 68 | EXPECT_TRUE(compile(&shader, code, "", controls)); |
| 69 | } |
| 70 | |
| 71 | // Test that unsized arrays work when extension is enabled. |
| 72 | TEST_F(UboUnsizedArrayTest, ExtensionRequired) |
nothing calls this directly
no test coverage detected