This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
369: Implement SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING r=kvark a=cwfitzgerald This implements gfx-rs/wgpu#715 in wgpu-rs. I haven't changed the example, as I want to actually think up a better example to use and didn't want that to block this. It will change in the future however. Co-authored-by: Connor Fitzgerald <[email protected]>
- Loading branch information
Showing
13 changed files
with
201 additions
and
39 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
Binary file renamed
BIN
+1.32 KB
examples/texture-arrays/shader.frag.spv → examples/texture-arrays/constant.frag.spv
Binary file not shown.
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,14 @@ | ||
#version 450 | ||
|
||
#extension GL_EXT_nonuniform_qualifier : require | ||
|
||
layout(location = 0) in vec2 v_TexCoord; | ||
layout(location = 1) flat in int v_Index; // dynamically non-uniform | ||
layout(location = 0) out vec4 o_Color; | ||
|
||
layout(set = 0, binding = 0) uniform texture2D u_Textures[2]; | ||
layout(set = 0, binding = 1) uniform sampler u_Sampler; | ||
|
||
void main() { | ||
o_Color = vec4(texture(sampler2D(u_Textures[v_Index], u_Sampler), v_TexCoord).rgb, 1.0); | ||
} |
Binary file not shown.
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,15 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec2 v_TexCoord; | ||
layout(location = 1) flat in int v_Index; // dynamically non-uniform | ||
layout(location = 0) out vec4 o_Color; | ||
|
||
layout(set = 0, binding = 0) uniform texture2D u_Textures[2]; | ||
layout(set = 0, binding = 1) uniform sampler u_Sampler; | ||
layout(set = 1, binding = 0) uniform Uniforms { | ||
int u_Index; // dynamically uniform | ||
}; | ||
|
||
void main() { | ||
o_Color = vec4(texture(sampler2D(u_Textures[u_Index], u_Sampler), v_TexCoord).rgb, 1.0); | ||
} |
Binary file not shown.
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,14 @@ | ||
#version 450 | ||
|
||
#extension GL_EXT_nonuniform_qualifier : require | ||
|
||
layout(location = 0) in vec2 v_TexCoord; | ||
layout(location = 1) flat in int v_Index; // dynamically non-uniform | ||
layout(location = 0) out vec4 o_Color; | ||
|
||
layout(set = 0, binding = 0) uniform texture2D u_Textures[]; | ||
layout(set = 0, binding = 1) uniform sampler u_Sampler; | ||
|
||
void main() { | ||
o_Color = vec4(texture(sampler2D(u_Textures[v_Index], u_Sampler), v_TexCoord).rgb, 1.0); | ||
} |
Binary file not shown.
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.