changed the pipeline to use 16 bit int as coords

thank you renderdoc for making me feel less stupid
This commit is contained in:
Alessandro Mauri 2025-06-03 09:16:51 +02:00
parent 712ce50631
commit 24bc2c67bc
5 changed files with 17 additions and 23 deletions

View file

@ -5,21 +5,24 @@ layout(set = 1, binding = 0) uniform Viewport {
ivec2 off;
};
layout(location = 0) in vec2 position;
layout(location = 1) in vec2 uv;
layout(location = 0) in ivec2 position;
layout(location = 1) in ivec2 uv;
layout(location = 2) in ivec4 color;
layout(location = 0) out vec4 col;
void main()
{
//vec2 shift = vec2(0);
// per vertex shift
vec2 shift;
shift.x = float(off.x) / view.x;
shift.y = -(float(off.y) / view.y);
vec2 pos = position + shift;
// vertex position
vec2 pos;
pos.x = float(position.x)*2.0 / view.x - 1.0;
pos.y = -(float(position.y)*2.0 / view.y - 1.0);
gl_Position = vec4(pos.x, pos.y, 0.0, 1.0);
gl_Position = vec4(pos+shift, 0.0, 1.0);
col = vec4(color) / 255.0;
}