Merge pull request #3015 from spnda/remove_nv_c_interface
[platform/upstream/glslang.git] / Test / 430.vert
index 6912fb4..84c3220 100644 (file)
@@ -2,7 +2,7 @@
 \r
 layout(location = 3) vec4 v4;  // ERROR\r
 \r
-layout(location = 3) uniform vec4 uv4;\r
+layout(location = 4) uniform vec4 uv4;\r
 \r
 layout(location = 2) in   inb1 { vec4 v; } b1;  // ERROR\r
 layout(location = 2) out outb1 { vec4 v; } b2;  // ERROR\r
@@ -30,4 +30,194 @@ void foo3(invariant vec4 v4,                 // ERROR
           layout(location = 3) vec2 v2,      // ERROR\r
           centroid vec3 cv3)                 // ERROR\r
 {\r
-}
\ No newline at end of file
+}\r
+\r
+struct S {\r
+    mat3x2 m[7];  // needs 7*3 locations\r
+    float f;      // needs 1 location\r
+};                // needs 22 locations\r
+\r
+layout(location = 10) out S cs[2];     // 10 through 10 + 2 * 22 - 1 = 53\r
+layout(location = 54) out float cf;\r
+layout(location = 53) out float cg; // ERROR, collision at 31\r
+\r
+layout(location = 10) in vec4 alias1;\r
+layout(location = 10) in vec4 alias2;  // okay for vertex input on desktop\r
+\r
+out float gl_ClipDistance[17];  // ERROR, size too big\r
+\r
+// enhanced_layouts (most tests are in 440.*)\r
+\r
+layout(location = start*start - 2 - 4) in vec4 v6e;    // ERROR\r
+\r
+layout(location = 28) in inblock2e {\r
+    layout(location = 25) float f2;                     // ERROR\r
+} ininst2e;\r
+\r
+in ublock4e {\r
+    layout(location = 50) float f1;                      // ERROR\r
+    layout(location = 51) float f2;                      // ERROR\r
+} in4e;\r
+\r
+layout(align=16, std140) uniform  ubl4e { int a; } inst4e;// ERROR\r
+\r
+layout(align=32) uniform ubl9e {                          // ERROR\r
+    layout(offset=12, align=4) float f;                   // ERROR\r
+    layout(offset=20) float g;                            // ERROR\r
+} inst9e;\r
+\r
+layout(std140) uniform blocke {\r
+                        vec4   a;\r
+    layout(offset = 32) vec3   b;                          // ERROR\r
+} spinste;\r
+\r
+int aconste[gl_MaxTransformFeedbackBuffers];               // ERROR\r
+int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR\r
+\r
+out bblck2 {\r
+    layout(xfb_offset=64) vec4 bbv;                              // ERROR\r
+} bbinst2;\r
+\r
+layout(xfb_buffer = 3, xfb_stride = 64) out;                     // ERROR\r
+\r
+layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR\r
+layout(              xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR\r
+\r
+layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR\r
+    vec4 bbv1;\r
+    vec4 bbv2;\r
+} bbinst4e;\r
+\r
+out bblck5e {\r
+    layout(xfb_offset=0) vec4 bbv1;                               // ERROR\r
+    layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR\r
+} bbinst5e;\r
+\r
+#extension GL_ARB_enhanced_layouts : enable\r
+\r
+layout(align=16, std140) uniform  ubl4 { int a; } inst4;\r
+layout(std430) uniform;\r
+\r
+layout(align=32) uniform ubl9 {\r
+    layout(offset=12, align=4) float f;\r
+    layout(offset=20) float g;\r
+} inst9;\r
+\r
+layout(std140) uniform block {\r
+                        vec4   a;     // a takes offsets 0-15\r
+    layout(offset = 32) vec3   b;     // b takes offsets 32-43\r
+} spinst;\r
+\r
+int aconst[gl_MaxTransformFeedbackBuffers];\r
+int bconst[gl_MaxTransformFeedbackInterleavedComponents];\r
+\r
+const int start2 = 5;\r
+layout(location = start2 * start2 - 2 - 4) in vec4 v6;\r
+\r
+layout(location = 28) in inblock2 {  // ERROR, input block in vertex shader, other errors are valid checks still...\r
+    bool b1;\r
+    float f1;\r
+    layout(location = 25) float f2;\r
+} ininst2;\r
+\r
+in ublock4 {                         // ERROR, input block in vertex shader, other errors are valid checks still...\r
+    layout(location = 50) float f1;\r
+    layout(location = 51) float f2;\r
+} in4;\r
+\r
+out bblck2g {\r
+    layout(xfb_offset=64) vec4 bbv;\r
+} bbinst2g;\r
+\r
+layout(xfb_buffer = 1, xfb_stride = 80) out;  // default buffer is 3\r
+\r
+layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg;\r
+layout(              xfb_offset=32, xfb_stride=80) out vec4 bh;\r
+\r
+layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 {\r
+    vec4 bbv1;\r
+} bbinst4;\r
+\r
+out bblck5 {\r
+    layout(xfb_offset=0) vec4 bbv1;\r
+    layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2;\r
+} bbinst5;\r
+\r
+shared vec4 sharedv;                // ERROR\r
+\r
+void fooBarrier()\r
+{\r
+    barrier();                       // ERROR\r
+    memoryBarrier();\r
+    memoryBarrierAtomicCounter();\r
+    memoryBarrierBuffer();\r
+    memoryBarrierShared();           // ERROR\r
+    memoryBarrierImage();\r
+    groupMemoryBarrier();            // ERROR\r
+}\r
+\r
+buffer vec4 v;  // ERROR\r
+\r
+uniform sampler2DMS s2dms;\r
+uniform usampler2DMSArray us2dmsa;\r
+layout(rgba32i) uniform iimage2DMS ii2dms;\r
+layout(rgba32f) uniform image2DMSArray i2dmsa;\r
+\r
+void fooq()\r
+{\r
+    int s = textureSamples(s2dms); // ERROR\r
+    s += textureSamples(us2dmsa);  // ERROR\r
+    s += imageSamples(ii2dms);     // ERROR\r
+    s += imageSamples(i2dmsa);     // ERROR\r
+}\r
+\r
+#extension GL_ARB_shader_texture_image_samples : enable\r
+\r
+void fooq2()\r
+{\r
+    int s = textureSamples(s2dms);\r
+    s += textureSamples(us2dmsa); \r
+    s += imageSamples(ii2dms);    \r
+    s += imageSamples(i2dmsa);    \r
+}\r
+\r
+uniform sampler1D samp1D;\r
+uniform usampler2D usamp2D;\r
+uniform isampler3D isamp3D;\r
+uniform isamplerCube isampCube; \r
+uniform isampler1DArray isamp1DA;\r
+uniform sampler2DArray samp2DA;\r
+uniform usamplerCubeArray usampCubeA;\r
+\r
+uniform sampler1DShadow samp1Ds;\r
+uniform sampler2DShadow samp2Ds;\r
+uniform samplerCubeShadow sampCubes;\r
+uniform sampler1DArrayShadow samp1DAs;\r
+uniform sampler2DArrayShadow samp2DAs;\r
+uniform samplerCubeArrayShadow sampCubeAs;\r
+\r
+uniform samplerBuffer sampBuf;\r
+uniform sampler2DRect sampRect;\r
+\r
+void qlod()\r
+{\r
+    int levels;\r
+\r
+    levels = textureQueryLevels(samp1D);\r
+    levels = textureQueryLevels(usamp2D);\r
+    levels = textureQueryLevels(isamp3D);\r
+    levels = textureQueryLevels(isampCube);\r
+    levels = textureQueryLevels(isamp1DA);\r
+    levels = textureQueryLevels(samp2DA);\r
+    levels = textureQueryLevels(usampCubeA);\r
+\r
+    levels = textureQueryLevels(samp1Ds);\r
+    levels = textureQueryLevels(samp2Ds);\r
+    levels = textureQueryLevels(sampCubes);\r
+    levels = textureQueryLevels(samp1DAs);\r
+    levels = textureQueryLevels(samp2DAs);\r
+    levels = textureQueryLevels(sampCubeAs);\r
+\r
+    levels = textureQueryLevels(sampBuf);    // ERROR\r
+    levels = textureQueryLevels(sampRect);   // ERROR\r
+}\r