summaryrefslogtreecommitdiff
path: root/noop_copyplane_planemask_clipmask.hlps
diff options
context:
space:
mode:
Diffstat (limited to 'noop_copyplane_planemask_clipmask.hlps')
-rw-r--r--noop_copyplane_planemask_clipmask.hlps62
1 files changed, 62 insertions, 0 deletions
diff --git a/noop_copyplane_planemask_clipmask.hlps b/noop_copyplane_planemask_clipmask.hlps
new file mode 100644
index 0000000..4bd807b
--- /dev/null
+++ b/noop_copyplane_planemask_clipmask.hlps
@@ -0,0 +1,62 @@
+/* Automatically generated file; do not edit */
+
+/* noop shader for copyplane with planemask and clipmask */
+
+SamplerState point_sample;
+
+Texture2D<uint4> tile : register(t0);
+Texture2D clipmask : register(t1);
+Texture2D<uint4> output : register(t2);
+
+cbuffer colors :register(b0) {
+ uint4 foreground;
+ uint4 background;
+ uint4 planemask;
+}
+
+cbuffer tile_stats :register(b1) {
+ uint4 plane;
+ uint2 tile_wh;
+}
+
+struct PS_INPUT {
+ float2 tile_pos : TEXCOORD0;
+ float2 clip_pos : TEXCOORD1;
+ float2 out_pos : TEXCOORD2;
+};
+
+uint4 main(PS_INPUT input) : SV_TARGET
+{
+ // Test clip mask
+ float4 cm = clipmask.Sample(point_sample, input.clip_pos);
+ if (cm.r < 0.5) {
+ discard;
+ return 0;
+ }
+
+ uint4 color;
+
+ // Load input color
+ int3 tp;
+ tp.xy = input.tile_pos.xy % tile_wh.xy;
+ tp.z = 0;
+ color = tile.Load(tp);
+ if (any(color & plane))
+ color = foreground;
+ else
+ color = background;
+
+ // Load output color
+ int3 pos;
+ pos.xy = input.out_pos.xy;
+ pos.z = 0;
+ uint4 out_color = output.Load(pos);
+
+ // rop
+ discard;
+
+ // planemask
+ color = (color & planemask) | (out_color & ~planemask);
+
+ return color;
+}