MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / TEST_F

Function TEST_F

gtests/UboUnsizedArray.cpp:50–69  ·  view source on GitHub ↗

Test that unsized arrays in uniform blocks work when extension is enabled.

Source from the content-addressed store, hash-verified

48
49// Test that unsized arrays in uniform blocks work when extension is enabled.
50TEST_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.
72TEST_F(UboUnsizedArrayTest, ExtensionRequired)

Callers

nothing calls this directly

Calls 9

GetDefaultResourcesFunction · 0.85
GlslangToSpvFunction · 0.85
DisassembleFunction · 0.85
c_strMethod · 0.80
setStringsMethod · 0.80
getInfoLogMethod · 0.80
parseMethod · 0.45
linkMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected