Fix static array. Add constant buffers. Beginning of textures.

This commit is contained in:
2024-06-26 13:42:13 +02:00
parent 3bbbc1d556
commit 1bf829d42f
8 changed files with 217 additions and 59 deletions

23
test/texture_sample.shd Normal file
View File

@@ -0,0 +1,23 @@
p :: properties {
texture : texture2D;
sampler : sampler;
}
PS_Input :: struct {
uv : float2 @uv;
pos : float4 @position;
}
vertex main :: (pos : float4 @position, uv : float2 @uv) -> PS_Input {
result : PS_Input;
result.uv = uv;
result.pos = pos;
return result;
}
pixel main :: (input : PS_Input) -> float4 @target {
color : float4 = sample(p.texture, input.uv, p.sampler);
return color;
}