On Tue, 2015-10-27 at 15:34 +0000, Emil Velikov wrote: > From: Emil Velikov <emil.veli...@collabora.com> > > Check if the linker throws an error when the offset across two > identically named blocks' members are not the same. > > Signed-off-by: Emil Velikov <emil.veli...@collabora.com> > --- > ...sbo-different-offset-across-shaders.shader_test | 35 > ++++++++++++++++++++++ > ...ubo-different-offset-across-shaders.shader_test | 32 > ++++++++++++++++++++ > 2 files changed, 67 insertions(+) > create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit > -offsets/ssbo-different-offset-across-shaders.shader_test > create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit > -offsets/ubo-different-offset-across-shaders.shader_test > > diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo > -different-offset-across-shaders.shader_test > b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different > -offset-across-shaders.shader_test > new file mode 100644 > index 0000000..5cfba90 > --- /dev/null > +++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different > -offset-across-shaders.shader_test > @@ -0,0 +1,35 @@ > +[require] > +GLSL >= 4.30 > +GL_ARB_enhanced_layouts > +GL_ARB_shader_storage_buffer_object > + > +[vertex shader] > +#version 430 > +#extension GL_ARB_enhanced_layouts : enable > +#extension GL_ARB_shader_storage_buffer_object : enable > + > +layout(std140) buffer b { > + layout(offset = 0) vec4 var1; > + layout(offset = 32) vec4 var2; > +}; > + > +void main() > +{ > +} > + > +[vertex shader]
Change this to [fragment shader] to make it an iterstage test. If you want to also test intrastage shaders you need to replace on of the mains with a function and declare and call it from the other. Same goes for the ubo test. > +#version 430 > +#extension GL_ARB_enhanced_layouts : enable > +#extension GL_ARB_shader_storage_buffer_object : enable > + > +layout(std140) buffer b { > + layout(offset = 0) vec4 var1; > + layout(offset = 64) vec4 var2; // Wrong: members and their > respective offset must across identically named blocks > +}; > + > +void main() > +{ > +} > + > +[test] > +link error > diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo > -different-offset-across-shaders.shader_test > b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different > -offset-across-shaders.shader_test > new file mode 100644 > index 0000000..ce278ce > --- /dev/null > +++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different > -offset-across-shaders.shader_test > @@ -0,0 +1,32 @@ > +[require] > +GLSL >= 1.40 > +GL_ARB_enhanced_layouts > + > +[vertex shader] > +#version 140 > +#extension GL_ARB_enhanced_layouts : enable > + > +layout(std140) uniform b { > + layout(offset = 0) vec4 var1; > + layout(offset = 32) vec4 var2; > +}; > + > +void main() > +{ > +} > + > +[vertex shader] > +#version 140 > +#extension GL_ARB_enhanced_layouts : enable > + > +layout(std140) uniform b { > + layout(offset = 0) vec4 var1; > + layout(offset = 64) vec4 var2; // Wrong: members and their > respective offset must across identically named blocks > +}; > + > +void main() > +{ > +} > + > +[test] > +link error _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit