summaryrefslogtreecommitdiffstats
path: root/third_party/rust/gfx-backend-dx12/shaders
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/gfx-backend-dx12/shaders
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/gfx-backend-dx12/shaders')
-rw-r--r--third_party/rust/gfx-backend-dx12/shaders/blit.hlsl29
1 files changed, 29 insertions, 0 deletions
diff --git a/third_party/rust/gfx-backend-dx12/shaders/blit.hlsl b/third_party/rust/gfx-backend-dx12/shaders/blit.hlsl
new file mode 100644
index 0000000000..bd15200980
--- /dev/null
+++ b/third_party/rust/gfx-backend-dx12/shaders/blit.hlsl
@@ -0,0 +1,29 @@
+
+Texture2DArray BlitSource : register(t0);
+SamplerState BlitSampler : register(s0);
+
+cbuffer Region : register(b0) {
+ float2 offset;
+ float2 extent;
+ float z;
+ float level;
+};
+
+struct VsOutput {
+ float4 pos: SV_POSITION;
+ float4 uv: TEXCOORD0;
+};
+
+// Create a screen filling triangle
+VsOutput vs_blit_2d(uint id: SV_VertexID) {
+ float2 coord = float2((id << 1) & 2, id & 2);
+ VsOutput output = {
+ float4(float2(-1.0, 1.0) + coord * float2(2.0, -2.0), 0.0, 1.0),
+ float4(offset + coord * extent, z, level)
+ };
+ return output;
+}
+
+float4 ps_blit_2d(VsOutput input) : SV_TARGET {
+ return BlitSource.SampleLevel(BlitSampler, input.uv.xyz, input.uv.w);
+}