Home | History | Annotate | Download | only in Test
      1 #version 310 es
      2 
      3 #extension GL_OES_tessellation_shader : enable
      4 
      5 layout(vertices = 4) out;
      6 out int outa[gl_out.length()];
      7 
      8 layout(quads) in;                   // ERROR
      9 layout(ccw) out;                    // ERROR
     10 layout(fractional_even_spacing) in; // ERROR
     11 
     12 patch in vec4 patchIn;              // ERROR
     13 patch out vec4 patchOut;
     14 
     15 void main()
     16 {
     17     barrier();
     18 
     19     int a = gl_MaxTessControlInputComponents +
     20             gl_MaxTessControlOutputComponents +
     21             gl_MaxTessControlTextureImageUnits +
     22             gl_MaxTessControlUniformComponents +
     23             gl_MaxTessControlTotalOutputComponents;
     24 
     25     vec4 p = gl_in[1].gl_Position;
     26     float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
     27     float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
     28 
     29     int pvi = gl_PatchVerticesIn;
     30     int pid = gl_PrimitiveID;
     31     int iid = gl_InvocationID;
     32 
     33     gl_out[gl_InvocationID].gl_Position = p;
     34     gl_out[gl_InvocationID].gl_PointSize = ps;        // ERROR, need point_size extension
     35     gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;  // ERROR, not in ES
     36 
     37     gl_TessLevelOuter[3] = 3.2;
     38     gl_TessLevelInner[1] = 1.3;
     39 
     40     if (a > 10)
     41         barrier();           // ERROR
     42     else
     43         barrier();           // ERROR
     44 
     45     barrier();
     46 
     47     do {
     48         barrier();           // ERROR
     49     } while (a > 10);
     50 
     51     switch (a) {
     52     default:
     53         barrier();           // ERROR
     54         break;
     55     }
     56     a < 12 ? a : (barrier(), a); // ERROR
     57     {
     58         barrier();
     59     }
     60 
     61     return;
     62 
     63     barrier();               // ERROR
     64 }
     65 
     66 layout(vertices = 4) in;    // ERROR, not on in
     67 layout(vertices = 5) out;   // ERROR, changing #
     68 
     69 void foo()
     70 {
     71     gl_out[4].gl_Position;  // ERROR, out of range
     72 
     73     barrier();              // ERROR, not in main
     74 }
     75 
     76 in vec2 ina;                // ERROR, not array
     77 in vec2 inb[];
     78 in vec2 inc[18];            // ERROR, wrong size
     79 in vec2 ind[gl_MaxPatchVertices];
     80 patch out float implA[];    // ERROR, not sized
     81 
     82 #extension GL_ARB_separate_shader_objects : enable
     83 
     84 layout(location = 3) in vec4 ivla[];
     85 layout(location = 4) in vec4 ivlb[];
     86 layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping
     87 
     88 layout(location = 3) out vec4 ovla[];
     89 layout(location = 4) out vec4 ovlb[];
     90 layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping
     91 
     92 void foop()
     93 {
     94     precise float d;                  // ERROR without gpu_shader5
     95     d = fma(d, d, d);                 // ERROR without gpu_shader5
     96 }
     97 
     98 patch out pinbn {
     99     int a;
    100 } pinbi;
    101 
    102 centroid out vec3 myColor2[];
    103 centroid in vec3 centr[];
    104 sample out vec4 perSampleColor[];   // ERROR without sample extensions
    105 
    106 layout(vertices = 4) out float badlay[];   // ERROR, not on a variable
    107 out float misSized[5];              // ERROR, size doesn't match
    108 out float okaySize[4];
    109 
    110 #extension GL_OES_tessellation_point_size : enable
    111 
    112 void pointSize2()
    113 {
    114     float ps = gl_in[1].gl_PointSize;
    115     gl_out[gl_InvocationID].gl_PointSize = ps;
    116 }
    117 
    118 #extension GL_OES_gpu_shader5 : enable
    119 
    120 precise vec3 pv3;
    121 
    122 void goodfoop()
    123 {
    124     precise float d;
    125 
    126     pv3 *= pv3;
    127     pv3 = fma(pv3, pv3, pv3);
    128     d = fma(d, d, d);
    129 }
    130 
    131 void bbBad()
    132 {
    133     gl_BoundingBoxOES;  // ERROR without GL_OES_primitive_bounding_box 
    134 }
    135 
    136 #extension GL_OES_primitive_bounding_box : enable
    137 
    138 void bb()
    139 {
    140     gl_BoundingBoxOES[0] = vec4(0.0);
    141     gl_BoundingBoxOES[1] = vec4(1.0);
    142     gl_BoundingBoxOES[2] = vec4(2.0);  // ERROR, overflow
    143 }
    144 
    145 out patch badpatchBName {  // ERROR, array size required
    146     float f;
    147 } badpatchIName[];
    148 
    149 out patch patchBName {
    150     float f;
    151 } patchIName[4];
    152 
    153 void outputtingOutparam(out int a)
    154 {
    155     a = 2;
    156 }
    157 
    158 void outputting()
    159 {
    160     outa[gl_InvocationID] = 2;
    161     outa[1] = 2;                         // ERROR, not gl_InvocationID
    162     gl_out[0].gl_Position = vec4(1.0);   // ERROR, not gl_InvocationID
    163     outa[1];
    164     gl_out[0];
    165     outputtingOutparam(outa[0]);         // ERROR, not gl_InvocationID
    166     outputtingOutparam(outa[gl_InvocationID]);
    167     patchIName[1].f = 3.14;
    168     outa[(gl_InvocationID)] = 2;
    169 }
    170