forked from KhronosGroup/glslang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request KhronosGroup#3066 from ShchchowAMD/shaochi/bindless
[glslang][extension] Add support for ARB_bindless_texture.
- Loading branch information
Showing
19 changed files
with
608 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#version 460 compatibility | ||
|
||
#extension GL_ARB_bindless_texture: require | ||
|
||
#if !defined GL_ARB_bindless_texture | ||
# error GL_ARB_bindless_texture is not defined | ||
#elif GL_ARB_bindless_texture != 1 | ||
# error GL_ARB_bindless_texture is not equal to 1 | ||
#endif | ||
|
||
// Valid usage cases | ||
layout(bindless_sampler) uniform sampler2D s0; // case0: bindless layout | ||
in sampler2D s1; // case1: sampler as an input | ||
uniform uvec2 s2; // case2: uvec2 as sampler constructor | ||
uniform ivec2 s3; // case3: ivec2 as sampler constructor | ||
uniform int index; | ||
in sampler2D s4[2][3]; // case4: sampler arrays of arrays | ||
uniform BB {sampler2D s5;} bbs5[2]; // case5: uniform block member as a sampler | ||
in samplerBuffer s6; // case6: samplerBuffer input | ||
uniform UBO9 {samplerBuffer s7;}; // case7: samplerBuffer as an uniform block member | ||
buffer SSBO10 {samplerBuffer s8;}; // case8: samplerBuffer as an ssbo member | ||
layout(rgba8, bindless_image) in image2D i9; // case9: bindless image as an input | ||
|
||
|
||
uniform vec2 coord; // bindless coord 2-D | ||
uniform int icoord; // bindless coord 1-D | ||
out vec4 color0; | ||
out vec4 color1; | ||
out vec4 color2; | ||
out vec4 color3; | ||
out vec4 color4; | ||
out vec4 color5; | ||
out vec4 color6; | ||
out vec4 color7; | ||
out vec4 color8; | ||
out vec4 color9; | ||
|
||
void main() | ||
{ | ||
color0 = texture(s0, coord); | ||
color1 = texture(s1, coord); | ||
color2 = texture(sampler2D(s2), coord); | ||
color3 = texture(sampler2D(s3), coord); | ||
color4 = texture(s4[index][index], coord); | ||
color5 = texture(bbs5[index].s5, coord); | ||
color6 = texelFetch(s6, icoord); | ||
color7 = texelFetch(s7, icoord); | ||
color8 = texelFetch(s8, icoord); | ||
color9 = imageLoad(i9, ivec2(0,0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
GL_ARB_bindless_texture.frag | ||
Shader version: 460 | ||
Requested GL_ARB_bindless_texture | ||
0:? Sequence | ||
0:38 Function Definition: main( ( global void) | ||
0:38 Function Parameters: | ||
0:40 Sequence | ||
0:40 move second child to first child ( temp 4-component vector of float) | ||
0:40 'color0' ( out 4-component vector of float) | ||
0:40 texture ( global 4-component vector of float) | ||
0:40 's0' ( uniform sampler2D) | ||
0:40 'coord' ( uniform 2-component vector of float) | ||
0:41 move second child to first child ( temp 4-component vector of float) | ||
0:41 'color1' ( out 4-component vector of float) | ||
0:41 texture ( global 4-component vector of float) | ||
0:41 's1' ( smooth in sampler2D) | ||
0:41 'coord' ( uniform 2-component vector of float) | ||
0:42 move second child to first child ( temp 4-component vector of float) | ||
0:42 'color2' ( out 4-component vector of float) | ||
0:42 texture ( global 4-component vector of float) | ||
0:42 packUint2x32 ( temp sampler2D) | ||
0:42 's2' ( uniform 2-component vector of uint) | ||
0:42 'coord' ( uniform 2-component vector of float) | ||
0:43 move second child to first child ( temp 4-component vector of float) | ||
0:43 'color3' ( out 4-component vector of float) | ||
0:43 texture ( global 4-component vector of float) | ||
0:43 packUint2x32 ( temp sampler2D) | ||
0:43 's3' ( uniform 2-component vector of int) | ||
0:43 'coord' ( uniform 2-component vector of float) | ||
0:44 move second child to first child ( temp 4-component vector of float) | ||
0:44 'color4' ( out 4-component vector of float) | ||
0:44 texture ( global 4-component vector of float) | ||
0:44 indirect index ( smooth temp sampler2D) | ||
0:44 indirect index ( smooth temp 3-element array of sampler2D) | ||
0:44 's4' ( smooth in 2-element array of 3-element array of sampler2D) | ||
0:44 'index' ( uniform int) | ||
0:44 'index' ( uniform int) | ||
0:44 'coord' ( uniform 2-component vector of float) | ||
0:45 move second child to first child ( temp 4-component vector of float) | ||
0:45 'color5' ( out 4-component vector of float) | ||
0:45 texture ( global 4-component vector of float) | ||
0:45 s5: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform sampler2D) | ||
0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:45 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:45 'index' ( uniform int) | ||
0:45 Constant: | ||
0:45 0 (const int) | ||
0:45 'coord' ( uniform 2-component vector of float) | ||
0:46 move second child to first child ( temp 4-component vector of float) | ||
0:46 'color6' ( out 4-component vector of float) | ||
0:46 textureFetch ( global 4-component vector of float) | ||
0:46 's6' ( smooth in samplerBuffer) | ||
0:46 'icoord' ( uniform int) | ||
0:47 move second child to first child ( temp 4-component vector of float) | ||
0:47 'color7' ( out 4-component vector of float) | ||
0:47 textureFetch ( global 4-component vector of float) | ||
0:47 s7: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform samplerBuffer) | ||
0:47 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7}) | ||
0:47 Constant: | ||
0:47 0 (const uint) | ||
0:47 'icoord' ( uniform int) | ||
0:48 move second child to first child ( temp 4-component vector of float) | ||
0:48 'color8' ( out 4-component vector of float) | ||
0:48 textureFetch ( global 4-component vector of float) | ||
0:48 s8: direct index for structure (layout( column_major shared layoutBindlessSampler) buffer samplerBuffer) | ||
0:48 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8}) | ||
0:48 Constant: | ||
0:48 0 (const uint) | ||
0:48 'icoord' ( uniform int) | ||
0:49 move second child to first child ( temp 4-component vector of float) | ||
0:49 'color9' ( out 4-component vector of float) | ||
0:49 imageLoad ( global 4-component vector of float) | ||
0:49 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D) | ||
0:49 Constant: | ||
0:49 0 (const int) | ||
0:49 0 (const int) | ||
0:? Linker Objects | ||
0:? 's0' ( uniform sampler2D) | ||
0:? 's1' ( smooth in sampler2D) | ||
0:? 's2' ( uniform 2-component vector of uint) | ||
0:? 's3' ( uniform 2-component vector of int) | ||
0:? 'index' ( uniform int) | ||
0:? 's4' ( smooth in 2-element array of 3-element array of sampler2D) | ||
0:? 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:? 's6' ( smooth in samplerBuffer) | ||
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7}) | ||
0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8}) | ||
0:? 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D) | ||
0:? 'coord' ( uniform 2-component vector of float) | ||
0:? 'icoord' ( uniform int) | ||
0:? 'color0' ( out 4-component vector of float) | ||
0:? 'color1' ( out 4-component vector of float) | ||
0:? 'color2' ( out 4-component vector of float) | ||
0:? 'color3' ( out 4-component vector of float) | ||
0:? 'color4' ( out 4-component vector of float) | ||
0:? 'color5' ( out 4-component vector of float) | ||
0:? 'color6' ( out 4-component vector of float) | ||
0:? 'color7' ( out 4-component vector of float) | ||
0:? 'color8' ( out 4-component vector of float) | ||
0:? 'color9' ( out 4-component vector of float) | ||
|
||
|
||
Linked fragment stage: | ||
|
||
|
||
Shader version: 460 | ||
Requested GL_ARB_bindless_texture | ||
0:? Sequence | ||
0:38 Function Definition: main( ( global void) | ||
0:38 Function Parameters: | ||
0:40 Sequence | ||
0:40 move second child to first child ( temp 4-component vector of float) | ||
0:40 'color0' ( out 4-component vector of float) | ||
0:40 texture ( global 4-component vector of float) | ||
0:40 's0' ( uniform sampler2D) | ||
0:40 'coord' ( uniform 2-component vector of float) | ||
0:41 move second child to first child ( temp 4-component vector of float) | ||
0:41 'color1' ( out 4-component vector of float) | ||
0:41 texture ( global 4-component vector of float) | ||
0:41 's1' ( smooth in sampler2D) | ||
0:41 'coord' ( uniform 2-component vector of float) | ||
0:42 move second child to first child ( temp 4-component vector of float) | ||
0:42 'color2' ( out 4-component vector of float) | ||
0:42 texture ( global 4-component vector of float) | ||
0:42 packUint2x32 ( temp sampler2D) | ||
0:42 's2' ( uniform 2-component vector of uint) | ||
0:42 'coord' ( uniform 2-component vector of float) | ||
0:43 move second child to first child ( temp 4-component vector of float) | ||
0:43 'color3' ( out 4-component vector of float) | ||
0:43 texture ( global 4-component vector of float) | ||
0:43 packUint2x32 ( temp sampler2D) | ||
0:43 's3' ( uniform 2-component vector of int) | ||
0:43 'coord' ( uniform 2-component vector of float) | ||
0:44 move second child to first child ( temp 4-component vector of float) | ||
0:44 'color4' ( out 4-component vector of float) | ||
0:44 texture ( global 4-component vector of float) | ||
0:44 indirect index ( smooth temp sampler2D) | ||
0:44 indirect index ( smooth temp 3-element array of sampler2D) | ||
0:44 's4' ( smooth in 2-element array of 3-element array of sampler2D) | ||
0:44 'index' ( uniform int) | ||
0:44 'index' ( uniform int) | ||
0:44 'coord' ( uniform 2-component vector of float) | ||
0:45 move second child to first child ( temp 4-component vector of float) | ||
0:45 'color5' ( out 4-component vector of float) | ||
0:45 texture ( global 4-component vector of float) | ||
0:45 s5: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform sampler2D) | ||
0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:45 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:45 'index' ( uniform int) | ||
0:45 Constant: | ||
0:45 0 (const int) | ||
0:45 'coord' ( uniform 2-component vector of float) | ||
0:46 move second child to first child ( temp 4-component vector of float) | ||
0:46 'color6' ( out 4-component vector of float) | ||
0:46 textureFetch ( global 4-component vector of float) | ||
0:46 's6' ( smooth in samplerBuffer) | ||
0:46 'icoord' ( uniform int) | ||
0:47 move second child to first child ( temp 4-component vector of float) | ||
0:47 'color7' ( out 4-component vector of float) | ||
0:47 textureFetch ( global 4-component vector of float) | ||
0:47 s7: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform samplerBuffer) | ||
0:47 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7}) | ||
0:47 Constant: | ||
0:47 0 (const uint) | ||
0:47 'icoord' ( uniform int) | ||
0:48 move second child to first child ( temp 4-component vector of float) | ||
0:48 'color8' ( out 4-component vector of float) | ||
0:48 textureFetch ( global 4-component vector of float) | ||
0:48 s8: direct index for structure (layout( column_major shared layoutBindlessSampler) buffer samplerBuffer) | ||
0:48 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8}) | ||
0:48 Constant: | ||
0:48 0 (const uint) | ||
0:48 'icoord' ( uniform int) | ||
0:49 move second child to first child ( temp 4-component vector of float) | ||
0:49 'color9' ( out 4-component vector of float) | ||
0:49 imageLoad ( global 4-component vector of float) | ||
0:49 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D) | ||
0:49 Constant: | ||
0:49 0 (const int) | ||
0:49 0 (const int) | ||
0:? Linker Objects | ||
0:? 's0' ( uniform sampler2D) | ||
0:? 's1' ( smooth in sampler2D) | ||
0:? 's2' ( uniform 2-component vector of uint) | ||
0:? 's3' ( uniform 2-component vector of int) | ||
0:? 'index' ( uniform int) | ||
0:? 's4' ( smooth in 2-element array of 3-element array of sampler2D) | ||
0:? 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5}) | ||
0:? 's6' ( smooth in samplerBuffer) | ||
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7}) | ||
0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8}) | ||
0:? 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D) | ||
0:? 'coord' ( uniform 2-component vector of float) | ||
0:? 'icoord' ( uniform int) | ||
0:? 'color0' ( out 4-component vector of float) | ||
0:? 'color1' ( out 4-component vector of float) | ||
0:? 'color2' ( out 4-component vector of float) | ||
0:? 'color3' ( out 4-component vector of float) | ||
0:? 'color4' ( out 4-component vector of float) | ||
0:? 'color5' ( out 4-component vector of float) | ||
0:? 'color6' ( out 4-component vector of float) | ||
0:? 'color7' ( out 4-component vector of float) | ||
0:? 'color8' ( out 4-component vector of float) | ||
0:? 'color9' ( out 4-component vector of float) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.