28 lines
445 B
Plaintext
28 lines
445 B
Plaintext
uint32_t hash32(uint32_t x) {
|
|
x = ((x >> 16) ^ x) * 0x45d9f3b;
|
|
x = ((x >> 16) ^ x) * 0x45d9f3b;
|
|
x = (x >> 16) ^ x;
|
|
return x;
|
|
}
|
|
|
|
[[vk::binding(1)]]
|
|
uniform Sampler2D textures[];
|
|
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 position: SV_Position;
|
|
float2 uv: TEXCOORD0;
|
|
};
|
|
|
|
float4 main(
|
|
VertexOutput input,
|
|
uint triid: SV_PrimitiveID,
|
|
uniform uint textureID,
|
|
) : SV_TARGET
|
|
{
|
|
return float4(textures[textureID].Sample(input.uv).xyz, 1);
|
|
|
|
}
|
|
|