mirror of
https://github.com/rt64/rt64.git
synced 2024-12-28 00:24:26 +00:00
21cfeae50c
* Add graphics test [WIP] * Ignore IDEA files * Explicit cast from size_t to uint64_t * Build statically when buiding examples * Remove unused file * Runs on ARM64 Linux * Update .gitignore
19 lines
506 B
HLSL
19 lines
506 B
HLSL
//
|
|
// RT64
|
|
//
|
|
|
|
struct Constants {
|
|
float4 colorAdd;
|
|
uint textureIndex;
|
|
};
|
|
|
|
[[vk::push_constant]] ConstantBuffer<Constants> gConstants : register(b0);
|
|
|
|
SamplerState gSampler : register(s1);
|
|
Texture2D<float4> gTexture[] : register(t2);
|
|
|
|
float4 PSMain(in float4 pos : SV_Position, in float2 uv : TEXCOORD) : SV_TARGET {
|
|
float4 result = float4(gTexture[NonUniformResourceIndex(gConstants.textureIndex)].SampleLevel(gSampler, uv, 0).rgb, 1.0f);
|
|
result += gConstants.colorAdd;
|
|
return result;
|
|
} |