Tests are splitted into samplers and images. That way someone who cares about implementing ARB_bindless_texture without ARB_shader_image_load_store will be able to run some tests.
Signed-off-by: Samuel Pitoiset <[email protected]> --- .../compiler/images/arith-expr.vert | 32 ++++++ .../compiler/images/bindless-global.vert | 25 +++++ .../compiler/images/bindless-local.vert | 25 +++++ .../compiler/images/bindless-nonuniform.vert | 23 +++++ .../compiler/images/bound-global.vert | 25 +++++ .../compiler/images/bound-local.vert | 25 +++++ .../compiler/images/bound-nonuniform.vert | 23 +++++ .../compiler/images/explicit-conversions.vert | 86 ++++++++++++++++ .../compiler/images/flat-input.frag | 28 +++++ .../compiler/images/implicit_conversions.vert | 22 ++++ .../compiler/images/indexing.vert | 30 ++++++ .../compiler/images/inout-struct.frag | 29 ++++++ .../compiler/images/inout.frag | 24 +++++ .../compiler/images/input.frag | 28 +++++ .../compiler/images/input.vert | 25 +++++ .../compiler/images/interface-block.vert | 27 +++++ .../compiler/images/out-struct.frag | 29 ++++++ .../arb_bindless_texture/compiler/images/out.frag | 24 +++++ .../compiler/images/output.frag | 22 ++++ .../compiler/images/output.vert | 24 +++++ .../compiler/images/return-struct.frag | 32 ++++++ .../compiler/images/return.frag | 26 +++++ .../compiler/images/temporary.vert | 21 ++++ .../compiler/samplers/arith-expr.vert | 31 ++++++ .../compiler/samplers/bindless-global.vert | 24 +++++ .../compiler/samplers/bindless-local.vert | 24 +++++ .../compiler/samplers/bindless-nonuniform.vert | 22 ++++ .../compiler/samplers/bound-global.vert | 24 +++++ .../compiler/samplers/bound-local.vert | 24 +++++ .../compiler/samplers/bound-nonuniform.vert | 22 ++++ .../compiler/samplers/explicit-conversions.vert | 114 +++++++++++++++++++++ .../compiler/samplers/flat-input.frag | 27 +++++ .../compiler/samplers/implicit-conversions.vert | 21 ++++ .../compiler/samplers/indexing.vert | 29 ++++++ .../compiler/samplers/inout-struct.frag | 28 +++++ .../compiler/samplers/inout.frag | 23 +++++ .../compiler/samplers/input.frag | 27 +++++ .../compiler/samplers/input.vert | 24 +++++ .../compiler/samplers/interface-block.vert | 26 +++++ .../compiler/samplers/out-struct.frag | 28 +++++ .../compiler/samplers/out.frag | 23 +++++ .../compiler/samplers/output.frag | 21 ++++ .../compiler/samplers/output.vert | 23 +++++ .../compiler/samplers/return-struct.frag | 31 ++++++ .../compiler/samplers/return.frag | 25 +++++ .../compiler/samplers/temporary.vert | 20 ++++ 46 files changed, 1316 insertions(+) create mode 100644 tests/spec/arb_bindless_texture/compiler/images/arith-expr.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bindless-global.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bindless-local.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bindless-nonuniform.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bound-global.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bound-local.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/bound-nonuniform.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/explicit-conversions.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/flat-input.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/implicit_conversions.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/indexing.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/inout-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/inout.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/input.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/input.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/interface-block.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/out-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/out.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/output.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/output.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/images/return-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/return.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/images/temporary.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/arith-expr.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bindless-global.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bindless-local.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bindless-nonuniform.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bound-global.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bound-local.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/bound-nonuniform.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/explicit-conversions.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/flat-input.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/implicit-conversions.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/indexing.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/inout-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/inout.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/input.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/input.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/interface-block.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/out-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/out.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/output.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/output.vert create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/return-struct.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/return.frag create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/temporary.vert diff --git a/tests/spec/arb_bindless_texture/compiler/images/arith-expr.vert b/tests/spec/arb_bindless_texture/compiler/images/arith-expr.vert new file mode 100644 index 000000000..d36bf6e50 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/arith-expr.vert @@ -0,0 +1,32 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images may not be implicitly converted to and from 64-bit integers, +// and may not be used in arithmetic expressions." + +uniform uvec2 u; + +void main() +{ + writeonly image2D img; + uvec2 r; + + r = img + u; + r = img - u; + r = img * u; + r = img / u; + r = img % u; + img++; + img--; +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bindless-global.vert b/tests/spec/arb_bindless_texture/compiler/images/bindless-global.vert new file mode 100644 index 000000000..447bb7b4a --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bindless-global.vert @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "These layouts may be specified at global scope to control the default +// behavior of uniforms of the corresponding types, e.g." +// +// layout (bindless_sampler) uniform; + +layout (bindless_image) uniform; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bindless-local.vert b/tests/spec/arb_bindless_texture/compiler/images/bindless-local.vert new file mode 100644 index 000000000..b5d5bb564 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bindless-local.vert @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "They may also be specified on a uniform variable declaration of a +// corresponding type, e.g." +// +// layout (bindless_sampler) uniform sampler2D mySampler; + +layout (bindless_image) writeonly uniform image2D img; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bindless-nonuniform.vert b/tests/spec/arb_bindless_texture/compiler/images/bindless-nonuniform.vert new file mode 100644 index 000000000..4c479249e --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bindless-nonuniform.vert @@ -0,0 +1,23 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "If these layout qualifiers are applied to other types of default block +// uniforms, or variables with non-uniform storage, a compile-time error +// will be generated." + +layout (bindless_image) uint i; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bound-global.vert b/tests/spec/arb_bindless_texture/compiler/images/bound-global.vert new file mode 100644 index 000000000..0018bfdf9 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bound-global.vert @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "These layouts may be specified at global scope to control the default +// behavior of uniforms of the corresponding types, e.g." +// +// layout (bindless_sampler) uniform; + +layout (bound_image) uniform; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bound-local.vert b/tests/spec/arb_bindless_texture/compiler/images/bound-local.vert new file mode 100644 index 000000000..d14117e57 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bound-local.vert @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "They may also be specified on a uniform variable declaration of a +// corresponding type, e.g." +// +// layout (bindless_sampler) uniform sampler2D mySampler; + +layout (bound_image) writeonly uniform image2D img; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/bound-nonuniform.vert b/tests/spec/arb_bindless_texture/compiler/images/bound-nonuniform.vert new file mode 100644 index 000000000..ed65e4ce0 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/bound-nonuniform.vert @@ -0,0 +1,23 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "If these layout qualifiers are applied to other types of default block +// uniforms, or variables with non-uniform storage, a compile-time error +// will be generated." + +layout (bound_image) uint i; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/explicit-conversions.vert b/tests/spec/arb_bindless_texture/compiler/images/explicit-conversions.vert new file mode 100644 index 000000000..9837f5f2a --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/explicit-conversions.vert @@ -0,0 +1,86 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 5.4.1, Conversion and Scalar Constructors, p. 60" +// +// (add the following constructors:) +// +// "In the following four constructors, the low 32 bits of the image +// type correspond to the .x component of the uvec2 and the high 32 bits +// correspond to the .y component." +// +// "Converts an image type to a pair of 32-bit unsigned integers: +// uvec2(any image type)" +// +// "Converts a pair of 32-bit unsigned integers to an image type: +// any image type(uvec2)" + +void any_image_type_to_uvec2() +{ + uvec2 pair = uvec2(0, 0); + + writeonly imageBuffer ibuf; + pair = uvec2(ibuf); + + writeonly image1D i1d; + pair = uvec2(i1d); + + writeonly image1DArray i1darr; + pair = uvec2(i1darr); + + writeonly image2D i2d; + pair = uvec2(i2d); + + writeonly image2DMS i2dms; + pair = uvec2(i2dms); + + writeonly image2DArray i2darr; + pair = uvec2(i2darr); + + writeonly image2DMSArray i2dmsarr; + pair = uvec2(i2dmsarr); + + writeonly image2DRect i2drect; + pair = uvec2(i2drect); + + writeonly image3D i3d; + pair = uvec2(i3d); + + writeonly imageCube icube; + pair = uvec2(icube); + + writeonly imageCubeArray icubearr; + pair = uvec2(icubearr); +} + +void uvec2_to_any_image_type() +{ + uvec2 pair = uvec2(0, 0); + + writeonly imageBuffer ibuf = imageBuffer(pair); + writeonly image1D i1d = image1D(pair); + writeonly image1DArray i1darr = image1DArray(pair); + writeonly image2D i2d = image2D(pair); + writeonly image2DMS i2dms = image2DMS(pair); + writeonly image2DArray i2darr = image2DArray(pair); + writeonly image2DMSArray i2dmsarr = image2DMSArray(pair); + writeonly image2DRect i2drect = image2DRect(pair); + writeonly image3D i3d = image3D(pair); + writeonly imageCube icube = imageCube(pair); + writeonly imageCubeArray icubearr = imageCubeArray(pair); +} + +void main() +{ + any_image_type_to_uvec2(); + uvec2_to_any_image_type(); +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/flat-input.frag b/tests/spec/arb_bindless_texture/compiler/images/flat-input.frag new file mode 100644 index 000000000..394e9d2a3 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/flat-input.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify last paragraph, p. 35, allowing samplers and images as fragment +// shader inputs) ... Fragment inputs can only be signed and unsigned +// integers and integer vectors, floating point scalars, floating-point +// vectors, matrices, sampler and image types, or arrays or structures of +// these. Fragment shader inputs that are signed or unsigned integers, +// integer vectors, or any double-precision floating- point type, or any +// sampler or image type must be qualified with the interpolation qualifier +// "flat"." + +flat in writeonly image2D sampler; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/implicit_conversions.vert b/tests/spec/arb_bindless_texture/compiler/images/implicit_conversions.vert new file mode 100644 index 000000000..7d06f6d57 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/implicit_conversions.vert @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images may not be implicitly converted to and from 64-bit integers, +// and may not be used in arithmetic expressions." + +void main() +{ + image2D img = uvec2(0, 0); + uvec2 pair = img; +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/indexing.vert b/tests/spec/arb_bindless_texture/compiler/images/indexing.vert new file mode 100644 index 000000000..dd865b22f --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/indexing.vert @@ -0,0 +1,30 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images may be aggregated into arrays within a shader (using square +// brackets []) and can be indexed with general integer expressions." + +uniform writeonly image2D imgs[64]; +uniform uint a, b; + +void main() +{ + writeonly image2D img; + uint idx = 42u; + + img = imgs[42]; + img = imgs[idx]; + img = imgs[idx + idx]; + img = imgs[a * b]; +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/inout-struct.frag b/tests/spec/arb_bindless_texture/compiler/images/inout-struct.frag new file mode 100644 index 000000000..09f24a0a1 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/inout-struct.frag @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + writeonly image2D img; +}; + +void f(inout foo p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/inout.frag b/tests/spec/arb_bindless_texture/compiler/images/inout.frag new file mode 100644 index 000000000..b19f0ba8f --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/inout.frag @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +void f(inout sampler2D p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/input.frag b/tests/spec/arb_bindless_texture/compiler/images/input.frag new file mode 100644 index 000000000..ec82c857b --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/input.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify last paragraph, p. 35, allowing samplers and images as fragment +// shader inputs) ... Fragment inputs can only be signed and unsigned +// integers and integer vectors, floating point scalars, floating-point +// vectors, matrices, sampler and image types, or arrays or structures of +// these. Fragment shader inputs that are signed or unsigned integers, +// integer vectors, or any double-precision floating- point type, or any +// sampler or image type must be qualified with the interpolation qualifier +// "flat"." + +in writeonly image2D image; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/input.vert b/tests/spec/arb_bindless_texture/compiler/images/input.vert new file mode 100644 index 000000000..9e0a893f5 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/input.vert @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify third paragraph of the section to allow sampler and image types) +// ... Vertex shader inputs can only be float, single-precision +// floating-point scalars, single-precision floating-point vectors, +// matrices, signed and unsigned integers and integer vectors, sampler and +// image types." + +in writeonly image2D image; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/interface-block.vert b/tests/spec/arb_bindless_texture/compiler/images/interface-block.vert new file mode 100644 index 000000000..721353f00 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/interface-block.vert @@ -0,0 +1,27 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "(remove the following bullet from the last list on p. 39, thereby +// permitting sampler types in interface blocks; image types are also +// permitted in blocks by this extension)" +// +// * sampler types are not allowed + +uniform Images { + writeonly image2D image; +}; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/out-struct.frag b/tests/spec/arb_bindless_texture/compiler/images/out-struct.frag new file mode 100644 index 000000000..7e32fa283 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/out-struct.frag @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + writeonly image2D img; +}; + +void f(out foo p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/out.frag b/tests/spec/arb_bindless_texture/compiler/images/out.frag new file mode 100644 index 000000000..1898b61d6 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/out.frag @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +void f(out image2D p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/output.frag b/tests/spec/arb_bindless_texture/compiler/images/output.frag new file mode 100644 index 000000000..c3b63a3ca --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/output.frag @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.6, Outputs, p. 36" +// +// "(do not modify the last paragraph, p. 38; samplers and images are not +// allowed as fragment shader outputs)" + +out writeonly image2D image; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/output.vert b/tests/spec/arb_bindless_texture/compiler/images/output.vert new file mode 100644 index 000000000..450672a4f --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/output.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.6, Outputs, p. 36" +// +// "(modify second paragraph, p. 37, to allow sampler and image outputs) +// ... Output variables can only be floating-point scalars, floating-point +// vectors, matrices, signed or unsigned integers or integer vectors, +// sampler or image types, or arrays or structures of any these." + +out writeonly image2D img; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/return-struct.frag b/tests/spec/arb_bindless_texture/compiler/images/return-struct.frag new file mode 100644 index 000000000..98a1990ab --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/return-struct.frag @@ -0,0 +1,32 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + writeonly image2D img; +}; + +uniform foo u; + +foo f() +{ + return u; +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/return.frag b/tests/spec/arb_bindless_texture/compiler/images/return.frag new file mode 100644 index 000000000..204a1885d --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/return.frag @@ -0,0 +1,26 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +writeonly image2D f() +{ + writeonly image2D img; + return img; +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/images/temporary.vert b/tests/spec/arb_bindless_texture/compiler/images/temporary.vert new file mode 100644 index 000000000..65b6fb161 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/temporary.vert @@ -0,0 +1,21 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.X, (Images)" +// +// "Images may be declared as shader inputs and outputs, as uniform +// variables, as temporary variables, and as function parameters." + +void main() +{ + writeonly image2D img; +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/arith-expr.vert b/tests/spec/arb_bindless_texture/compiler/samplers/arith-expr.vert new file mode 100644 index 000000000..ca1ea744e --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/arith-expr.vert @@ -0,0 +1,31 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers may not be implicitly converted to and from 64-bit integers, +// and may not be used in arithmetic expressions." + +uniform uvec2 u; + +void main() +{ + sampler2D tex; + uvec2 r; + + r = tex + u; + r = tex - u; + r = tex * u; + r = tex / u; + r = tex % u; + tex++; + tex--; +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bindless-global.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-global.vert new file mode 100644 index 000000000..48ba8daba --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-global.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "These layouts may be specified at global scope to control the default +// behavior of uniforms of the corresponding types, e.g." +// +// layout (bindless_sampler) uniform; + +layout (bindless_sampler) uniform; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bindless-local.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-local.vert new file mode 100644 index 000000000..3ce0144d6 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-local.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "They may also be specified on a uniform variable declaration of a +// corresponding type, e.g." +// +// layout (bindless_sampler) uniform sampler2D mySampler; + +layout (bindless_sampler) uniform sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bindless-nonuniform.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-nonuniform.vert new file mode 100644 index 000000000..7667038d0 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bindless-nonuniform.vert @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "If these layout qualifiers are applied to other types of default block +// uniforms, or variables with non-uniform storage, a compile-time error +// will be generated." + +layout (bindless_sampler) uint i; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bound-global.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bound-global.vert new file mode 100644 index 000000000..8cb4dd6ef --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bound-global.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "These layouts may be specified at global scope to control the default +// behavior of uniforms of the corresponding types, e.g." +// +// layout (bindless_sampler) uniform; + +layout (bound_sampler) uniform; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bound-local.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bound-local.vert new file mode 100644 index 000000000..32475a6de --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bound-local.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.4.6 Opaque-Uniform Layout Qualifiers of the GLSL 4.30 +// spec" +// +// "They may also be specified on a uniform variable declaration of a +// corresponding type, e.g." +// +// layout (bindless_sampler) uniform sampler2D mySampler; + +layout (bound_sampler) uniform sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/bound-nonuniform.vert b/tests/spec/arb_bindless_texture/compiler/samplers/bound-nonuniform.vert new file mode 100644 index 000000000..420ceab3d --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/bound-nonuniform.vert @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "If these layout qualifiers are applied to other types of default block +// uniforms, or variables with non-uniform storage, a compile-time error +// will be generated." + +layout (bound_sampler) uint i; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/explicit-conversions.vert b/tests/spec/arb_bindless_texture/compiler/samplers/explicit-conversions.vert new file mode 100644 index 000000000..1ea1b9d42 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/explicit-conversions.vert @@ -0,0 +1,114 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_texture_cube_map_array: enable + +// The ARB_bindless_texture spec says: +// +// "Modify Section 5.4.1, Conversion and Scalar Constructors, p. 60" +// +// (add the following constructors:) +// +// "In the following four constructors, the low 32 bits of the sampler +// type correspond to the .x component of the uvec2 and the high 32 bits +// correspond to the .y component." +// +// "Converts a sampler type to a pair of 32-bit unsigned integers: +// uvec2(any sampler type)" +// +// "Converts a pair of 32-bit unsigned integers to a sampler type: +// any sampler type(uvec2)" + +void any_sampler_type_to_uvec2() +{ + uvec2 pair = uvec2(0, 0); + + samplerBuffer sbuf; + pair = uvec2(sbuf); + + sampler1D s1d; + pair = uvec2(s1d); + + sampler1DArray s1darr; + pair = uvec2(s1darr); + + sampler2D s2d; + pair = uvec2(s2d); + + sampler2DMS s2dms; + pair = uvec2(s2dms); + + sampler2DArray s2darr; + pair = uvec2(s2darr); + + sampler2DMSArray s2dmsarr; + pair = uvec2(s2dmsarr); + + sampler2DRect s2drect; + pair = uvec2(s2drect); + + sampler3D s3d; + pair = uvec2(s3d); + + samplerCube scube; + pair = uvec2(scube); + + samplerCubeArray scubearr; + pair = uvec2(scubearr); + + sampler1DShadow s1ds; + pair = uvec2(s1ds); + + sampler2DShadow s2ds; + pair = uvec2(s2ds); + + samplerCubeShadow scubes; + pair = uvec2(scubes); + + sampler2DRectShadow s2drects; + pair = uvec2(s2drects); + + sampler1DArrayShadow s1darrs; + pair = uvec2(s1darrs); + + sampler2DArrayShadow s2darrs; + pair = uvec2(s2darrs); + + samplerCubeArrayShadow scubearrs; + pair = uvec2(scubearrs); +} + +void uvec2_to_any_sampler_type() +{ + uvec2 pair = uvec2(0, 0); + + samplerBuffer sbuf = samplerBuffer(pair); + sampler1D s1d = sampler1D(pair); + sampler1DArray s1darr = sampler1DArray(pair); + sampler2D s2d = sampler2D(pair); + sampler2DMS s2dms = sampler2DMS(pair); + sampler2DArray s2darr = sampler2DArray(pair); + sampler2DMSArray s2dmsarr = sampler2DMSArray(pair); + sampler2DRect s2drect = sampler2DRect(pair); + sampler3D s3d = sampler3D(pair); + samplerCube scube = samplerCube(pair); + samplerCubeArray scubearr = samplerCubeArray(pair); + sampler1DShadow s1ds = sampler1DShadow(pair); + sampler2DShadow s2ds = sampler2DShadow(pair); + samplerCubeShadow scubes = samplerCubeShadow(pair); + sampler2DRectShadow s2drects = sampler2DRectShadow(pair); + sampler1DArrayShadow s1darrs = sampler1DArrayShadow(pair); + sampler2DArrayShadow s2darrs = sampler2DArrayShadow(pair); + samplerCubeArrayShadow scubearrs = samplerCubeArrayShadow(pair); +} + +void main() +{ + any_sampler_type_to_uvec2(); + uvec2_to_any_sampler_type(); +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/flat-input.frag b/tests/spec/arb_bindless_texture/compiler/samplers/flat-input.frag new file mode 100644 index 000000000..01846e927 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/flat-input.frag @@ -0,0 +1,27 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify last paragraph, p. 35, allowing samplers and images as fragment +// shader inputs) ... Fragment inputs can only be signed and unsigned +// integers and integer vectors, floating point scalars, floating-point +// vectors, matrices, sampler and image types, or arrays or structures of +// these. Fragment shader inputs that are signed or unsigned integers, +// integer vectors, or any double-precision floating- point type, or any +// sampler or image type must be qualified with the interpolation qualifier +// "flat"." + +flat in sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/implicit-conversions.vert b/tests/spec/arb_bindless_texture/compiler/samplers/implicit-conversions.vert new file mode 100644 index 000000000..bb5bc9373 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/implicit-conversions.vert @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers may not be implicitly converted to and from 64-bit integers, +// and may not be used in arithmetic expressions." + +void main() +{ + sampler2D tex = uvec2(0, 0); + uvec2 pair = tex; +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/indexing.vert b/tests/spec/arb_bindless_texture/compiler/samplers/indexing.vert new file mode 100644 index 000000000..c73668c1d --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/indexing.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers aggregated into arrays within a shader (using square +// brackets []) can be indexed with arbitrary integer expressions." + +uniform sampler2D texs[64]; +uniform uint a, b; + +void main() +{ + sampler2D tex; + uint idx = 42u; + + tex = texs[42]; + tex = texs[idx]; + tex = texs[idx + idx]; + tex = texs[a * b]; +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/inout-struct.frag b/tests/spec/arb_bindless_texture/compiler/samplers/inout-struct.frag new file mode 100644 index 000000000..01729065d --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/inout-struct.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + sampler2D tex; +}; + +void f(inout foo p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/inout.frag b/tests/spec/arb_bindless_texture/compiler/samplers/inout.frag new file mode 100644 index 000000000..61d6e52d5 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/inout.frag @@ -0,0 +1,23 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +void f(inout sampler2D p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/input.frag b/tests/spec/arb_bindless_texture/compiler/samplers/input.frag new file mode 100644 index 000000000..0803d3017 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/input.frag @@ -0,0 +1,27 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify last paragraph, p. 35, allowing samplers and images as fragment +// shader inputs) ... Fragment inputs can only be signed and unsigned +// integers and integer vectors, floating point scalars, floating-point +// vectors, matrices, sampler and image types, or arrays or structures of +// these. Fragment shader inputs that are signed or unsigned integers, +// integer vectors, or any double-precision floating- point type, or any +// sampler or image type must be qualified with the interpolation qualifier +// "flat"." + +in sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/input.vert b/tests/spec/arb_bindless_texture/compiler/samplers/input.vert new file mode 100644 index 000000000..e8f830af7 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/input.vert @@ -0,0 +1,24 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.4, Inputs, p. 34" +// +// "(modify third paragraph of the section to allow sampler and image types) +// ... Vertex shader inputs can only be float, single-precision +// floating-point scalars, single-precision floating-point vectors, +// matrices, signed and unsigned integers and integer vectors, sampler and +// image types." + +in sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/interface-block.vert b/tests/spec/arb_bindless_texture/compiler/samplers/interface-block.vert new file mode 100644 index 000000000..97f9c4ad8 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/interface-block.vert @@ -0,0 +1,26 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.7, Interface Blocks, p. 38" +// +// "(remove the following bullet from the last list on p. 39, thereby +// permitting sampler types in interface blocks; image types are also +// permitted in blocks by this extension)" +// +// * sampler types are not allowed + +uniform Samplers { + sampler2D tex; +}; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/out-struct.frag b/tests/spec/arb_bindless_texture/compiler/samplers/out-struct.frag new file mode 100644 index 000000000..1d60d3b87 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/out-struct.frag @@ -0,0 +1,28 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + sampler2D tex; +}; + +void f(out foo p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/out.frag b/tests/spec/arb_bindless_texture/compiler/samplers/out.frag new file mode 100644 index 000000000..b7e427177 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/out.frag @@ -0,0 +1,23 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +void f(out sampler2D p) +{ +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/output.frag b/tests/spec/arb_bindless_texture/compiler/samplers/output.frag new file mode 100644 index 000000000..36cc52298 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/output.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.6, Outputs, p. 36" +// +// "(do not modify the last paragraph, p. 38; samplers and images are not +// allowed as fragment shader outputs)" + +out sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/output.vert b/tests/spec/arb_bindless_texture/compiler/samplers/output.vert new file mode 100644 index 000000000..141e6b7c1 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/output.vert @@ -0,0 +1,23 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Modify Section 4.3.6, Outputs, p. 36" +// +// "(modify second paragraph, p. 37, to allow sampler and image outputs) +// ... Output variables can only be floating-point scalars, floating-point +// vectors, matrices, signed or unsigned integers or integer vectors, +// sampler or image types, or arrays or structures of any these." + +out sampler2D tex; + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/return-struct.frag b/tests/spec/arb_bindless_texture/compiler/samplers/return-struct.frag new file mode 100644 index 000000000..05b0fde08 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/return-struct.frag @@ -0,0 +1,31 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +struct foo { + float x; + sampler2D tex; +}; + +uniform foo u; + +foo f() +{ + return u; +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/return.frag b/tests/spec/arb_bindless_texture/compiler/samplers/return.frag new file mode 100644 index 000000000..a3ae163ce --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/return.frag @@ -0,0 +1,25 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers can be used as l-values, so can be assigned into and used as +// "out" and "inout" function parameters." + +sampler2D f() +{ + sampler2D tex; + return tex; +} + +void main() +{ +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/temporary.vert b/tests/spec/arb_bindless_texture/compiler/samplers/temporary.vert new file mode 100644 index 000000000..492d15a2a --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/temporary.vert @@ -0,0 +1,20 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +// The ARB_bindless_texture spec says: +// +// "Replace Section 4.1.7 (Samplers), p. 25" +// +// "Samplers may be declared as shader inputs and outputs, as uniform +// variables, as temporary variables, and as function parameters." + +void main() +{ + sampler2D tex; +} -- 2.12.1 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
