diff options
author | 2020-01-13 15:33:12 +0100 | |
---|---|---|
committer | 2020-02-25 13:26:50 +0100 | |
commit | 2f77a6bf5ac1b657c1f54ea0b589b1e115b95e6b (patch) | |
tree | 36ac71c22c829ce18c7197870943c9b9b8842d67 /wgpu/src/shader/image.vert | |
parent | 8562a4c986ff48d478be794c8c4268047a9a57d7 (diff) | |
download | iced-2f77a6bf5ac1b657c1f54ea0b589b1e115b95e6b.tar.gz iced-2f77a6bf5ac1b657c1f54ea0b589b1e115b95e6b.tar.bz2 iced-2f77a6bf5ac1b657c1f54ea0b589b1e115b95e6b.zip |
Use array of atlases instead of one growing indefinitely.
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/shader/image.vert | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wgpu/src/shader/image.vert b/wgpu/src/shader/image.vert index 953840d2..0ce7dd6b 100644 --- a/wgpu/src/shader/image.vert +++ b/wgpu/src/shader/image.vert @@ -5,15 +5,16 @@ layout(location = 1) in vec2 i_Pos; layout(location = 2) in vec2 i_Scale; layout(location = 3) in vec2 i_Atlas_Pos; layout(location = 4) in vec2 i_Atlas_Scale; +layout(location = 5) in float i_Layer; layout (set = 0, binding = 0) uniform Globals { mat4 u_Transform; }; -layout(location = 0) out vec2 o_Uv; +layout(location = 0) out vec3 o_Uv; void main() { - o_Uv = v_Pos * i_Atlas_Scale + i_Atlas_Pos; + o_Uv = vec3(v_Pos * i_Atlas_Scale + i_Atlas_Pos, i_Layer); mat4 i_Transform = mat4( vec4(i_Scale.x, 0.0, 0.0, 0.0), |