Skip to content

Commit

Permalink
Add some bindless shader code
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Oct 13, 2024
1 parent b3c1cd4 commit 3906a58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Bindless/Shaders/shaders.kong
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ fun pos(input: vertex_in): vertex_out {
}

#[set(everything)]
const tex: tex2d;
const textures: tex2d[];

#[set(everything)]
const sam: sampler;

fun pix(input: vertex_out): float4 {
var color: float4 = sample(tex, sam, input.tex);
uint index = uint(input.tex.x * 9);
var color: float4 = sample(textures[index], sam, float2(input.tex.x * 9 - index, input.tex.y));
return float4(color.r, color.g, color.b, 1.0);
}

Expand Down

0 comments on commit 3906a58

Please sign in to comment.