Fix type checker not promoting ints. Fix some issues in the codegen.

This commit is contained in:
2024-09-11 07:24:10 +02:00
parent 517209c886
commit ff668b6c95
5 changed files with 98 additions and 24 deletions

View File

@@ -9,7 +9,7 @@ p :: properties {
PS_Input :: struct {
uv : float2 @uv;
pos : float2 @pos;
pos : float4 @pos;
}
vertex main :: (pos : float4 @position) -> PS_Input {
@@ -28,7 +28,7 @@ vertex main :: (pos : float4 @position) -> PS_Input {
src_half_size : float2 = (src_p1 - src_p0) / 2;
src_center : float2 = (src_p1 + src_p0) / 2;
src_pos : float2 = pos * src_half_size + src_center;
src_pos : float2 = float2(pos.x, pos.y) * src_half_size + src_center;
result.uv = float2(1, 1);
result.pos = float4(2.0 * dst_pos.x / res.x - 1, 2.0 * dst_pos.y / res.y - 1, 0.0, 1.0);