Front-end: Fix default layout(component) widths and correct for doubles.

Replaces PR #372.
This commit is contained in:
John Kessenich
2016-07-21 15:43:00 -06:00
parent bc9e1d118a
commit c8f6903b1d
5 changed files with 52 additions and 16 deletions

View File

@@ -63,16 +63,16 @@ layout(location = 1, component = 1) out; // ERROR, no global set
layout(location = 50, component = 3) out int be;
layout(location = 50, component = 0) out vec3 bf;
//layout(location = 51, component = 1) out double dfo; // ERROR, odd component
//layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow
//layout(location = 53) out double dfo2;
//layout(location = 53, component = 2) out vec2 ffv2; // okay, fits
//layout(location = 54) out dvec4 dvec4out; // uses up location 55 too
//layout(location = 55) out float overf; // ERROR, collides with previous dvec4
//layout(location = 56, component = 1) out vec2 df2o;
//layout(location = 56, component = 3) out float sf2o;
//layout(location = 57, component = 2) out vec2 dv3o;
//layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component
layout(location = 51, component = 1) out double dfo; // ERROR, odd component
layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow
layout(location = 53) out double dfo2;
layout(location = 53, component = 2) out vec2 ffv2; // okay, fits
layout(location = 54) out dvec4 dvec4out; // uses up location 55 too
layout(location = 55) out float overf; // ERROR, collides with previous dvec4
layout(location = 56, component = 1) out vec2 df2o;
layout(location = 56, component = 3) out float sf2o;
layout(location = 57, component = 2) out vec2 dv3o;
layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component
out bblck1 {
vec4 bbv;

View File

@@ -19,6 +19,10 @@ ERROR: 0:55: 'component' : type overflows the available 4 components
ERROR: 0:57: 'component' : cannot apply to a matrix, structure, or block
ERROR: 0:58: 'component' : cannot apply to a matrix, structure, or block
ERROR: 0:61: 'location/component/index' : cannot declare a default, use a full declaration
ERROR: 0:66: 'component' : doubles cannot start on an odd-numbered component
ERROR: 0:67: 'component' : type overflows the available 4 components
ERROR: 0:71: 'location' : overlapping use of location 55
ERROR: 0:75: 'location' : overlapping use of location 57
ERROR: 0:92: 'xfb layout qualifier' : can only be used on an output
ERROR: 0:98: 'xfb_offset' : cannot declare a default, use a full declaration
ERROR: 0:108: 'xfb_buffer' : member cannot contradict block (or what block inherited from global)
@@ -49,7 +53,7 @@ ERROR: 0:184: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shad
ERROR: 0:185: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input)
ERROR: 0:186: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input)
ERROR: 0:187: 'glBaseInstanceARB' : undeclared identifier
ERROR: 49 compilation errors. No code generated.
ERROR: 53 compilation errors. No code generated.
Shader version: 440
@@ -119,6 +123,16 @@ ERROR: node is still EOpNull!
0:? 'bd' (out block{layout(location=40 component=2 ) out float u, layout(location=40 component=0 ) out float v, layout(location=40 component=3 ) out float w, layout(location=40 component=1 ) out 2-component vector of float x, layout(location=41 component=3 ) out 2-component vector of float y, layout(location=42 component=1 ) out 4-component vector of float z, layout(location=42 component=1 ) out 4X4 matrix of float ba, layout(location=43 component=1 ) out structure{global int a} Ss})
0:? 'be' (layout(location=50 component=3 ) smooth out int)
0:? 'bf' (layout(location=50 component=0 ) smooth out 3-component vector of float)
0:? 'dfo' (layout(location=51 component=1 ) smooth out double)
0:? 'dvo' (layout(location=52 component=2 ) smooth out 2-component vector of double)
0:? 'dfo2' (layout(location=53 ) smooth out double)
0:? 'ffv2' (layout(location=53 component=2 ) smooth out 2-component vector of float)
0:? 'dvec4out' (layout(location=54 ) smooth out 4-component vector of double)
0:? 'overf' (layout(location=55 ) smooth out float)
0:? 'df2o' (layout(location=56 component=1 ) smooth out 2-component vector of float)
0:? 'sf2o' (layout(location=56 component=3 ) smooth out float)
0:? 'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
0:? 'sf4o' (layout(location=57 component=3 ) smooth out float)
0:? 'bbinst1' (out block{out 4-component vector of float bbv})
0:? 'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
0:? 'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})
@@ -219,6 +233,16 @@ ERROR: node is still EOpNull!
0:? 'bd' (out block{layout(location=40 component=2 ) out float u, layout(location=40 component=0 ) out float v, layout(location=40 component=3 ) out float w, layout(location=40 component=1 ) out 2-component vector of float x, layout(location=41 component=3 ) out 2-component vector of float y, layout(location=42 component=1 ) out 4-component vector of float z, layout(location=42 component=1 ) out 4X4 matrix of float ba, layout(location=43 component=1 ) out structure{global int a} Ss})
0:? 'be' (layout(location=50 component=3 ) smooth out int)
0:? 'bf' (layout(location=50 component=0 ) smooth out 3-component vector of float)
0:? 'dfo' (layout(location=51 component=1 ) smooth out double)
0:? 'dvo' (layout(location=52 component=2 ) smooth out 2-component vector of double)
0:? 'dfo2' (layout(location=53 ) smooth out double)
0:? 'ffv2' (layout(location=53 component=2 ) smooth out 2-component vector of float)
0:? 'dvec4out' (layout(location=54 ) smooth out 4-component vector of double)
0:? 'overf' (layout(location=55 ) smooth out float)
0:? 'df2o' (layout(location=56 component=1 ) smooth out 2-component vector of float)
0:? 'sf2o' (layout(location=56 component=3 ) smooth out float)
0:? 'dv3o' (layout(location=57 component=2 ) smooth out 2-component vector of float)
0:? 'sf4o' (layout(location=57 component=3 ) smooth out float)
0:? 'bbinst1' (out block{out 4-component vector of float bbv})
0:? 'bbinst2' (out block{layout(xfb_buffer=0 xfb_offset=64 ) out 4-component vector of float bbv})
0:? 'bbinst3' (out block{layout(xfb_buffer=3 xfb_offset=16 ) out 4-component vector of float bbv})