diff options
Diffstat (limited to 'glsl')
-rw-r--r-- | glsl/shader_2d.frag.glsl | 2 | ||||
-rw-r--r-- | glsl/shader_2d.vert.glsl | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/glsl/shader_2d.frag.glsl b/glsl/shader_2d.frag.glsl index 1edbbbb..54ab1be 100644 --- a/glsl/shader_2d.frag.glsl +++ b/glsl/shader_2d.frag.glsl @@ -21,7 +21,7 @@ layout(location = 0) in vec2 in_texture_coord; layout(location = 0) out vec4 out_color; -layout(set = 0, binding = 1) uniform sampler2D texture_sampler; +layout(set = 1, binding = 1) uniform sampler2D texture_sampler; void main() diff --git a/glsl/shader_2d.vert.glsl b/glsl/shader_2d.vert.glsl index 6e8ac59..b053fec 100644 --- a/glsl/shader_2d.vert.glsl +++ b/glsl/shader_2d.vert.glsl @@ -21,7 +21,12 @@ layout(location = 0) in vec2 in_texture_coord; layout(location = 0) out vec2 out_texture_coord; -layout(set = 0, binding = 0) uniform UBOSpritePositions +layout(set = 0, binding = 0) uniform UBOProjection +{ + mat4 proj; +} ubo_projection; + +layout(set = 1, binding = 0) uniform UBOSpritePositions { vec4 positions[128]; } ubo_sprite_positions; @@ -49,5 +54,5 @@ main() coordinate = vec2(position.z, position.w); break; } - gl_Position = vec4(coordinate, 0.0, 1.0); + gl_Position = ubo_projection.proj * vec4(coordinate, 0.0, 1.0); } |