diff options
Diffstat (limited to '')
-rw-r--r-- | gfx/2d/ShadersD2D1.h | 1186 | ||||
-rw-r--r-- | gfx/2d/ShadersD2D1.hlsl | 162 |
2 files changed, 1348 insertions, 0 deletions
diff --git a/gfx/2d/ShadersD2D1.h b/gfx/2d/ShadersD2D1.h new file mode 100644 index 0000000000..9df2858da5 --- /dev/null +++ b/gfx/2d/ShadersD2D1.h @@ -0,0 +1,1186 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer radialGradientConstants +// { +// +// float3 diff; // Offset: 0 Size: 12 +// float2 center1; // Offset: 16 Size: 8 +// float A; // Offset: 24 Size: 4 +// float radius1; // Offset: 28 Size: 4 +// float sq_radius1; // Offset: 32 Size: 4 +// float repeat_correct; // Offset: 36 Size: 4 +// float allow_odd; // Offset: 40 Size: 4 +// float3x2 transform; // Offset: 48 Size: 28 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// InputSampler sampler NA NA 0 1 +// GradientSampler sampler NA NA 1 1 +// InputTexture texture float4 2d 0 1 +// GradientTexture texture float4 2d 1 1 +// radialGradientConstants cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// SCENE_POSITION 0 xyzw 1 NONE float xy +// TEXCOORD 0 xyzw 2 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Target 0 xyzw 0 TARGET float xyzw +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c0 cb0 0 5 ( FLT, FLT, FLT, FLT) +// +// +// Sampler/Resource to DX9 shader sampler mappings: +// +// Target Sampler Source Sampler Source Resource +// -------------- --------------- ---------------- +// s0 s0 t0 +// s1 s1 t1 +// +// +// Level9 shader bytecode: +// + ps_2_x + def c5, 0.5, 1, 0, 0 + def c6, 1, -1, 0, -0 + dcl t0 + dcl t1 + dcl_2d s0 + dcl_2d s1 + dp2add r0.x, t0, c3, c3.z + dp2add r0.y, t0, c4, c4.z + add r0.xy, r0, -c1 + dp2add r0.w, r0, r0, -c2.x + mul r0.w, r0.w, c1.z + mov r0.z, c1.w + dp3 r0.x, r0, c0 + mad r0.y, r0.x, r0.x, -r0.w + abs r0.z, r0.y + cmp r0.y, r0.y, c5.y, c5.z + rsq r0.z, r0.z + rcp r1.x, r0.z + mov r1.yz, -r1.x + add r0.xzw, r0.x, r1.xyyz + rcp r1.x, c1.z + mul r0.xzw, r0, r1.x + mov r1.w, c1.w + mad r1.xyz, r0.xzww, c0.z, r1.w + cmp r1.w, r1.x, r0.x, r0.w + cmp r0.xzw, r1.xyyz, c6.xyxy, c6.zyzw + frc r1.x, r1.w + add r1.x, -r1.x, r1.w + mul r1.y, r1.x, c5.x + abs r1.y, r1.y + frc r1.y, r1.y + cmp r1.y, r1.x, r1.y, -r1.y + add r1.x, -r1.x, r1.w + add r1.y, r1.y, r1.y + abs r1.y, r1.y + mul r1.y, r1.y, c2.z + frc r1.z, -r1.w + lrp r2.w, r1.y, r1.z, r1.x + lrp r3.x, c2.y, r2.w, r1.w + mov r3.y, c5.x + texld r1, t1, s0 + texld r2, r3, s1 + mul r2.xyz, r2.w, r2 + mul r1, r1, r2 + add r0.w, r0.w, r0.x + cmp r0.x, r0.w, r0.x, r0.z + mul r1, r0.x, r1 + mul r0, r0.y, r1 + mov oC0, r0 + +// approximately 46 instruction slots used (2 texture, 44 arithmetic) +ps_4_0 +dcl_constantbuffer cb0[5], immediateIndexed +dcl_sampler s0, mode_default +dcl_sampler s1, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t1 +dcl_input_ps linear v1.xy +dcl_input_ps linear v2.xy +dcl_output o0.xyzw +dcl_temps 3 +dp2 r0.x, v1.xyxx, cb0[3].xyxx +add r0.x, r0.x, cb0[3].z +dp2 r0.z, v1.xyxx, cb0[4].xyxx +add r0.y, r0.z, cb0[4].z +add r0.xy, r0.xyxx, -cb0[1].xyxx +dp2 r0.w, r0.xyxx, r0.xyxx +add r0.w, r0.w, -cb0[2].x +mul r0.w, r0.w, cb0[1].z +mov r0.z, cb0[1].w +dp3 r0.x, r0.xyzx, cb0[0].xyzx +mad r0.y, r0.x, r0.x, -r0.w +sqrt r1.x, |r0.y| +ge r0.y, r0.y, l(0.000000) +and r0.y, r0.y, l(0x3f800000) +mov r1.y, -r1.x +add r0.xz, r0.xxxx, r1.xxyx +div r0.xz, r0.xxzx, cb0[1].zzzz +add r0.w, -r0.z, r0.x +mul r1.xy, r0.xzxx, cb0[0].zzzz +ge r1.xy, r1.xyxx, -cb0[1].wwww +and r1.xy, r1.xyxx, l(0x3f800000, 0x3f800000, 0, 0) +mad r0.x, r1.x, r0.w, r0.z +max r0.z, r1.y, r1.x +ge r0.z, l(0.000000), r0.z +movc r0.z, r0.z, l(-0.000000), l(1.000000) +round_pi r0.w, r0.x +add r0.w, -r0.x, r0.w +round_ni r1.x, r0.x +mul r1.y, r1.x, l(0.500000) +add r1.x, r0.x, -r1.x +ge r1.z, r1.y, -r1.y +frc r1.y, |r1.y| +movc r1.y, r1.z, r1.y, -r1.y +add r1.y, r1.y, r1.y +mul r1.z, |r1.y|, cb0[2].z +mad r1.y, -|r1.y|, cb0[2].z, l(1.000000) +mul r0.w, r0.w, r1.z +mad r0.w, r1.x, r1.y, r0.w +mul r0.w, r0.w, cb0[2].y +add r1.x, l(1.000000), -cb0[2].y +mad r1.x, r0.x, r1.x, r0.w +mov r1.y, l(0.500000) +sample r1.xyzw, r1.xyxx, t1.xyzw, s1 +mul r1.xyz, r1.wwww, r1.xyzx +sample r2.xyzw, v2.xyxx, t0.xyzw, s0 +mul r1.xyzw, r1.xyzw, r2.xyzw +mul r1.xyzw, r0.zzzz, r1.xyzw +mul o0.xyzw, r0.yyyy, r1.xyzw +ret +// Approximately 49 instruction slots used +#endif + +const BYTE SampleRadialGradientPS[] = { + 68, 88, 66, 67, 221, 203, 207, 240, 164, 242, 31, 220, 34, 19, 29, + 61, 18, 184, 230, 185, 1, 0, 0, 0, 196, 13, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, 136, 3, 0, 0, 232, 9, 0, 0, 100, + 10, 0, 0, 20, 13, 0, 0, 144, 13, 0, 0, 65, 111, 110, 57, + 72, 3, 0, 0, 72, 3, 0, 0, 0, 2, 255, 255, 16, 3, 0, + 0, 56, 0, 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, + 56, 0, 2, 0, 36, 0, 0, 0, 56, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 255, 255, 81, 0, 0, 5, 5, 0, 15, 160, 0, 0, 0, + 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, + 0, 5, 6, 0, 15, 160, 0, 0, 128, 63, 0, 0, 128, 191, 0, + 0, 0, 0, 0, 0, 0, 128, 31, 0, 0, 2, 0, 0, 0, 128, + 0, 0, 15, 176, 31, 0, 0, 2, 0, 0, 0, 128, 1, 0, 15, + 176, 31, 0, 0, 2, 0, 0, 0, 144, 0, 8, 15, 160, 31, 0, + 0, 2, 0, 0, 0, 144, 1, 8, 15, 160, 90, 0, 0, 4, 0, + 0, 1, 128, 0, 0, 228, 176, 3, 0, 228, 160, 3, 0, 170, 160, + 90, 0, 0, 4, 0, 0, 2, 128, 0, 0, 228, 176, 4, 0, 228, + 160, 4, 0, 170, 160, 2, 0, 0, 3, 0, 0, 3, 128, 0, 0, + 228, 128, 1, 0, 228, 161, 90, 0, 0, 4, 0, 0, 8, 128, 0, + 0, 228, 128, 0, 0, 228, 128, 2, 0, 0, 161, 5, 0, 0, 3, + 0, 0, 8, 128, 0, 0, 255, 128, 1, 0, 170, 160, 1, 0, 0, + 2, 0, 0, 4, 128, 1, 0, 255, 160, 8, 0, 0, 3, 0, 0, + 1, 128, 0, 0, 228, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, + 0, 2, 128, 0, 0, 0, 128, 0, 0, 0, 128, 0, 0, 255, 129, + 35, 0, 0, 2, 0, 0, 4, 128, 0, 0, 85, 128, 88, 0, 0, + 4, 0, 0, 2, 128, 0, 0, 85, 128, 5, 0, 85, 160, 5, 0, + 170, 160, 7, 0, 0, 2, 0, 0, 4, 128, 0, 0, 170, 128, 6, + 0, 0, 2, 1, 0, 1, 128, 0, 0, 170, 128, 1, 0, 0, 2, + 1, 0, 6, 128, 1, 0, 0, 129, 2, 0, 0, 3, 0, 0, 13, + 128, 0, 0, 0, 128, 1, 0, 148, 128, 6, 0, 0, 2, 1, 0, + 1, 128, 1, 0, 170, 160, 5, 0, 0, 3, 0, 0, 13, 128, 0, + 0, 228, 128, 1, 0, 0, 128, 1, 0, 0, 2, 1, 0, 8, 128, + 1, 0, 255, 160, 4, 0, 0, 4, 1, 0, 7, 128, 0, 0, 248, + 128, 0, 0, 170, 160, 1, 0, 255, 128, 88, 0, 0, 4, 1, 0, + 8, 128, 1, 0, 0, 128, 0, 0, 0, 128, 0, 0, 255, 128, 88, + 0, 0, 4, 0, 0, 13, 128, 1, 0, 148, 128, 6, 0, 68, 160, + 6, 0, 230, 160, 19, 0, 0, 2, 1, 0, 1, 128, 1, 0, 255, + 128, 2, 0, 0, 3, 1, 0, 1, 128, 1, 0, 0, 129, 1, 0, + 255, 128, 5, 0, 0, 3, 1, 0, 2, 128, 1, 0, 0, 128, 5, + 0, 0, 160, 35, 0, 0, 2, 1, 0, 2, 128, 1, 0, 85, 128, + 19, 0, 0, 2, 1, 0, 2, 128, 1, 0, 85, 128, 88, 0, 0, + 4, 1, 0, 2, 128, 1, 0, 0, 128, 1, 0, 85, 128, 1, 0, + 85, 129, 2, 0, 0, 3, 1, 0, 1, 128, 1, 0, 0, 129, 1, + 0, 255, 128, 2, 0, 0, 3, 1, 0, 2, 128, 1, 0, 85, 128, + 1, 0, 85, 128, 35, 0, 0, 2, 1, 0, 2, 128, 1, 0, 85, + 128, 5, 0, 0, 3, 1, 0, 2, 128, 1, 0, 85, 128, 2, 0, + 170, 160, 19, 0, 0, 2, 1, 0, 4, 128, 1, 0, 255, 129, 18, + 0, 0, 4, 2, 0, 8, 128, 1, 0, 85, 128, 1, 0, 170, 128, + 1, 0, 0, 128, 18, 0, 0, 4, 3, 0, 1, 128, 2, 0, 85, + 160, 2, 0, 255, 128, 1, 0, 255, 128, 1, 0, 0, 2, 3, 0, + 2, 128, 5, 0, 0, 160, 66, 0, 0, 3, 1, 0, 15, 128, 1, + 0, 228, 176, 0, 8, 228, 160, 66, 0, 0, 3, 2, 0, 15, 128, + 3, 0, 228, 128, 1, 8, 228, 160, 5, 0, 0, 3, 2, 0, 7, + 128, 2, 0, 255, 128, 2, 0, 228, 128, 5, 0, 0, 3, 1, 0, + 15, 128, 1, 0, 228, 128, 2, 0, 228, 128, 2, 0, 0, 3, 0, + 0, 8, 128, 0, 0, 255, 128, 0, 0, 0, 128, 88, 0, 0, 4, + 0, 0, 1, 128, 0, 0, 255, 128, 0, 0, 0, 128, 0, 0, 170, + 128, 5, 0, 0, 3, 1, 0, 15, 128, 0, 0, 0, 128, 1, 0, + 228, 128, 5, 0, 0, 3, 0, 0, 15, 128, 0, 0, 85, 128, 1, + 0, 228, 128, 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, 68, 82, 88, 6, 0, 0, 64, 0, 0, + 0, 150, 1, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, + 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 1, 0, 0, 0, + 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, + 0, 88, 24, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, + 16, 0, 3, 50, 16, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 3, 0, 0, + 0, 15, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 15, 0, 0, 8, 66, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 128, 32, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 42, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, + 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 9, 50, 0, + 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, + 128, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 15, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, + 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, + 0, 0, 0, 10, 128, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 56, 0, 0, 8, 130, 0, 16, 0, 0, 0, 0, + 0, 58, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 54, 0, 0, 6, 66, 0, 16, 0, 0, + 0, 0, 0, 58, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 16, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, + 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 0, 0, 10, 34, 0, 16, 0, 0, 0, 0, 0, 10, + 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, + 58, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, + 6, 18, 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 128, 129, 0, + 0, 0, 0, 0, 0, 0, 29, 0, 0, 7, 34, 0, 16, 0, 0, + 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 7, 34, 0, 16, 0, 0, 0, 0, + 0, 26, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, + 128, 63, 54, 0, 0, 6, 34, 0, 16, 0, 1, 0, 0, 0, 10, + 0, 16, 128, 65, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, + 82, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0, 0, + 0, 6, 1, 16, 0, 1, 0, 0, 0, 14, 0, 0, 8, 82, 0, + 16, 0, 0, 0, 0, 0, 6, 2, 16, 0, 0, 0, 0, 0, 166, + 138, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 0, 0, 0, 0, 42, 0, 16, 128, 65, 0, 0, + 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 56, 0, + 0, 8, 50, 0, 16, 0, 1, 0, 0, 0, 134, 0, 16, 0, 0, + 0, 0, 0, 166, 138, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 9, 50, 0, 16, 0, 1, 0, 0, 0, 70, 0, 16, + 0, 1, 0, 0, 0, 246, 143, 32, 128, 65, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 1, 0, 0, 10, 50, 0, 16, 0, 1, + 0, 0, 0, 70, 0, 16, 0, 1, 0, 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 0, 0, 9, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 42, + 0, 16, 0, 0, 0, 0, 0, 52, 0, 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, 10, 0, 16, + 0, 1, 0, 0, 0, 29, 0, 0, 7, 66, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 42, 0, 16, 0, 0, + 0, 0, 0, 55, 0, 0, 9, 66, 0, 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, + 128, 1, 64, 0, 0, 0, 0, 128, 63, 66, 0, 0, 5, 130, 0, + 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 8, 130, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 128, + 65, 0, 0, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, + 0, 65, 0, 0, 5, 18, 0, 16, 0, 1, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 34, 0, 16, 0, 1, + 0, 0, 0, 10, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 8, 18, 0, 16, 0, 1, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, 29, 0, 0, 8, 66, 0, 16, 0, 1, + 0, 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 128, + 65, 0, 0, 0, 1, 0, 0, 0, 26, 0, 0, 6, 34, 0, 16, + 0, 1, 0, 0, 0, 26, 0, 16, 128, 129, 0, 0, 0, 1, 0, + 0, 0, 55, 0, 0, 10, 34, 0, 16, 0, 1, 0, 0, 0, 42, + 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, + 26, 0, 16, 128, 65, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 7, 34, 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 0, 1, 0, + 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, 56, 0, 0, 9, 66, + 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 128, 129, 0, 0, 0, + 1, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 50, 0, 0, 11, 34, 0, 16, 0, 1, 0, 0, 0, 26, 0, + 16, 128, 193, 0, 0, 0, 1, 0, 0, 0, 42, 128, 32, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, + 0, 0, 0, 0, 0, 42, 0, 16, 0, 1, 0, 0, 0, 50, 0, + 0, 9, 130, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 1, + 0, 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 8, 130, 0, 16, 0, 0, 0, 0, + 0, 58, 0, 16, 0, 0, 0, 0, 0, 26, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 9, 18, 0, 16, 0, 1, + 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, 0, + 9, 18, 0, 16, 0, 1, 0, 0, 0, 10, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, 1, 0, 0, 0, 58, 0, 16, 0, 0, + 0, 0, 0, 54, 0, 0, 5, 34, 0, 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, 0, 63, 69, 0, 0, 9, 242, 0, 16, + 0, 1, 0, 0, 0, 70, 0, 16, 0, 1, 0, 0, 0, 70, 126, + 16, 0, 1, 0, 0, 0, 0, 96, 16, 0, 1, 0, 0, 0, 56, + 0, 0, 7, 114, 0, 16, 0, 1, 0, 0, 0, 246, 15, 16, 0, + 1, 0, 0, 0, 70, 2, 16, 0, 1, 0, 0, 0, 69, 0, 0, + 9, 242, 0, 16, 0, 2, 0, 0, 0, 70, 16, 16, 0, 2, 0, + 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, + 0, 0, 0, 56, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 1, 0, 0, 0, 70, 14, 16, 0, 2, 0, 0, + 0, 56, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, 0, 56, + 0, 0, 7, 242, 32, 16, 0, 0, 0, 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, 0, 62, 0, 0, + 1, 83, 84, 65, 84, 116, 0, 0, 0, 49, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 40, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, + 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 82, 68, 69, 70, 168, 2, 0, 0, 1, 0, + 0, 0, 16, 1, 0, 0, 5, 0, 0, 0, 28, 0, 0, 0, 0, + 4, 255, 255, 0, 1, 0, 0, 116, 2, 0, 0, 188, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 201, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 217, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, + 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, + 0, 0, 230, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, + 0, 0, 0, 255, 255, 255, 255, 1, 0, 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, 73, 110, 112, 117, 116, 83, 97, 109, 112, + 108, 101, 114, 0, 71, 114, 97, 100, 105, 101, 110, 116, 83, 97, 109, + 112, 108, 101, 114, 0, 73, 110, 112, 117, 116, 84, 101, 120, 116, 117, + 114, 101, 0, 71, 114, 97, 100, 105, 101, 110, 116, 84, 101, 120, 116, + 117, 114, 101, 0, 114, 97, 100, 105, 97, 108, 71, 114, 97, 100, 105, + 101, 110, 116, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 171, + 246, 0, 0, 0, 8, 0, 0, 0, 40, 1, 0, 0, 80, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, + 0, 0, 12, 0, 0, 0, 2, 0, 0, 0, 240, 1, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, + 2, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 24, 2, 0, + 0, 24, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 28, 2, + 0, 0, 0, 0, 0, 0, 44, 2, 0, 0, 28, 0, 0, 0, 4, + 0, 0, 0, 2, 0, 0, 0, 28, 2, 0, 0, 0, 0, 0, 0, + 52, 2, 0, 0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 28, 2, 0, 0, 0, 0, 0, 0, 63, 2, 0, 0, 36, 0, + 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 28, 2, 0, 0, 0, + 0, 0, 0, 78, 2, 0, 0, 40, 0, 0, 0, 4, 0, 0, 0, + 2, 0, 0, 0, 28, 2, 0, 0, 0, 0, 0, 0, 88, 2, 0, + 0, 48, 0, 0, 0, 28, 0, 0, 0, 2, 0, 0, 0, 100, 2, + 0, 0, 0, 0, 0, 0, 100, 105, 102, 102, 0, 171, 171, 171, 1, + 0, 3, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 101, 110, 116, 101, 114, 49, 0, 1, 0, 3, 0, 1, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 171, 171, 0, 0, + 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, + 97, 100, 105, 117, 115, 49, 0, 115, 113, 95, 114, 97, 100, 105, 117, + 115, 49, 0, 114, 101, 112, 101, 97, 116, 95, 99, 111, 114, 114, 101, + 99, 116, 0, 97, 108, 108, 111, 119, 95, 111, 100, 100, 0, 116, 114, + 97, 110, 115, 102, 111, 114, 109, 0, 171, 171, 3, 0, 3, 0, 3, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, + 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51, 56, 52, + 0, 171, 171, 73, 83, 71, 78, 116, 0, 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, + 0, 0, 0, 15, 3, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 15, 3, 0, + 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 83, 67, + 69, 78, 69, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, 0, 79, 83, 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171}; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer radialGradientConstants +// { +// +// float3 diff; // Offset: 0 Size: 12 +// float2 center1; // Offset: 16 Size: 8 +// float A; // Offset: 24 Size: 4 [unused] +// float radius1; // Offset: 28 Size: 4 +// float sq_radius1; // Offset: 32 Size: 4 [unused] +// float repeat_correct; // Offset: 36 Size: 4 +// float allow_odd; // Offset: 40 Size: 4 +// float3x2 transform; // Offset: 48 Size: 28 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// InputSampler sampler NA NA 0 1 +// GradientSampler sampler NA NA 1 1 +// InputTexture texture float4 2d 0 1 +// GradientTexture texture float4 2d 1 1 +// radialGradientConstants cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// SCENE_POSITION 0 xyzw 1 NONE float xy +// TEXCOORD 0 xyzw 2 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Target 0 xyzw 0 TARGET float xyzw +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c0 cb0 0 5 ( FLT, FLT, FLT, FLT) +// +// +// Sampler/Resource to DX9 shader sampler mappings: +// +// Target Sampler Source Sampler Source Resource +// -------------- --------------- ---------------- +// s0 s0 t0 +// s1 s1 t1 +// +// +// Level9 shader bytecode: +// + ps_2_x + def c5, 0.5, -0, 1, 0 + dcl t0 + dcl t1 + dcl_2d s0 + dcl_2d s1 + dp2add r0.x, t0, c3, c3.z + dp2add r0.y, t0, c4, c4.z + add r0.xy, r0, -c1 + mul r0.w, c1.w, c1.w + dp2add r0.w, r0, r0, -r0.w + mul r0.w, r0.w, c5.x + mov r0.z, c1.w + dp3 r0.x, r0, c0 + rcp r0.x, r0.x + mul r0.y, r0.x, r0.w + frc r0.z, r0.y + add r0.z, -r0.z, r0.y + mul r1.w, r0.z, c5.x + abs r1.x, r1.w + frc r1.x, r1.x + cmp r1.x, r0.z, r1.x, -r1.x + mad r0.x, r0.w, r0.x, -r0.z + add r0.z, r1.x, r1.x + abs r0.z, r0.z + mul r0.z, r0.z, c2.z + frc r0.w, -r0.y + lrp r1.x, r0.z, r0.w, r0.x + lrp r2.x, c2.y, r1.x, r0.y + mov r0.w, c1.w + mad r0.x, r0.y, -c0.z, -r0.w + cmp r0.x, r0.x, c5.y, c5.z + mov r2.y, c5.x + texld r1, t1, s0 + texld r2, r2, s1 + mul r2.xyz, r2.w, r2 + mul r1, r1, r2 + mul r0, r0.x, r1 + mov oC0, r0 + +// approximately 36 instruction slots used (2 texture, 34 arithmetic) +ps_4_0 +dcl_constantbuffer cb0[5], immediateIndexed +dcl_sampler s0, mode_default +dcl_sampler s1, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t1 +dcl_input_ps linear v1.xy +dcl_input_ps linear v2.xy +dcl_output o0.xyzw +dcl_temps 3 +dp2 r0.x, v1.xyxx, cb0[3].xyxx +add r0.x, r0.x, cb0[3].z +dp2 r0.z, v1.xyxx, cb0[4].xyxx +add r0.y, r0.z, cb0[4].z +add r0.xy, r0.xyxx, -cb0[1].xyxx +dp2 r0.w, r0.xyxx, r0.xyxx +mad r0.w, -cb0[1].w, cb0[1].w, r0.w +mul r0.w, r0.w, l(0.500000) +mov r0.z, cb0[1].w +dp3 r0.x, r0.xyzx, cb0[0].xyzx +div r0.x, r0.w, r0.x +round_pi r0.y, r0.x +round_ni r0.z, r0.x +mul r0.w, r0.z, l(0.500000) +add r0.yz, -r0.xxzx, r0.yyxy +ge r1.x, r0.w, -r0.w +frc r0.w, |r0.w| +movc r0.w, r1.x, r0.w, -r0.w +add r0.w, r0.w, r0.w +mul r1.x, |r0.w|, cb0[2].z +mad r0.w, -|r0.w|, cb0[2].z, l(1.000000) +mul r0.y, r0.y, r1.x +mad r0.y, r0.z, r0.w, r0.y +mul r0.y, r0.y, cb0[2].y +add r0.z, l(1.000000), -cb0[2].y +mad r1.x, r0.x, r0.z, r0.y +mul r0.x, r0.x, cb0[0].z +ge r0.x, -cb0[1].w, r0.x +movc r0.x, r0.x, l(-0.000000), l(1.000000) +mov r1.y, l(0.500000) +sample r1.xyzw, r1.xyxx, t1.xyzw, s1 +mul r1.xyz, r1.wwww, r1.xyzx +sample r2.xyzw, v2.xyxx, t0.xyzw, s0 +mul r1.xyzw, r1.xyzw, r2.xyzw +mul o0.xyzw, r0.xxxx, r1.xyzw +ret +// Approximately 36 instruction slots used +#endif + +const BYTE SampleRadialGradientA0PS[] = { + 68, 88, 66, 67, 251, 98, 227, 203, 98, 180, 0, 199, 88, 100, 39, + 81, 223, 130, 11, 15, 1, 0, 0, 0, 136, 11, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, 212, 2, 0, 0, 172, 7, 0, 0, 40, + 8, 0, 0, 216, 10, 0, 0, 84, 11, 0, 0, 65, 111, 110, 57, + 148, 2, 0, 0, 148, 2, 0, 0, 0, 2, 255, 255, 92, 2, 0, + 0, 56, 0, 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, + 56, 0, 2, 0, 36, 0, 0, 0, 56, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 255, 255, 81, 0, 0, 5, 5, 0, 15, 160, 0, 0, 0, + 63, 0, 0, 0, 128, 0, 0, 128, 63, 0, 0, 0, 0, 31, 0, + 0, 2, 0, 0, 0, 128, 0, 0, 15, 176, 31, 0, 0, 2, 0, + 0, 0, 128, 1, 0, 15, 176, 31, 0, 0, 2, 0, 0, 0, 144, + 0, 8, 15, 160, 31, 0, 0, 2, 0, 0, 0, 144, 1, 8, 15, + 160, 90, 0, 0, 4, 0, 0, 1, 128, 0, 0, 228, 176, 3, 0, + 228, 160, 3, 0, 170, 160, 90, 0, 0, 4, 0, 0, 2, 128, 0, + 0, 228, 176, 4, 0, 228, 160, 4, 0, 170, 160, 2, 0, 0, 3, + 0, 0, 3, 128, 0, 0, 228, 128, 1, 0, 228, 161, 5, 0, 0, + 3, 0, 0, 8, 128, 1, 0, 255, 160, 1, 0, 255, 160, 90, 0, + 0, 4, 0, 0, 8, 128, 0, 0, 228, 128, 0, 0, 228, 128, 0, + 0, 255, 129, 5, 0, 0, 3, 0, 0, 8, 128, 0, 0, 255, 128, + 5, 0, 0, 160, 1, 0, 0, 2, 0, 0, 4, 128, 1, 0, 255, + 160, 8, 0, 0, 3, 0, 0, 1, 128, 0, 0, 228, 128, 0, 0, + 228, 160, 6, 0, 0, 2, 0, 0, 1, 128, 0, 0, 0, 128, 5, + 0, 0, 3, 0, 0, 2, 128, 0, 0, 0, 128, 0, 0, 255, 128, + 19, 0, 0, 2, 0, 0, 4, 128, 0, 0, 85, 128, 2, 0, 0, + 3, 0, 0, 4, 128, 0, 0, 170, 129, 0, 0, 85, 128, 5, 0, + 0, 3, 1, 0, 8, 128, 0, 0, 170, 128, 5, 0, 0, 160, 35, + 0, 0, 2, 1, 0, 1, 128, 1, 0, 255, 128, 19, 0, 0, 2, + 1, 0, 1, 128, 1, 0, 0, 128, 88, 0, 0, 4, 1, 0, 1, + 128, 0, 0, 170, 128, 1, 0, 0, 128, 1, 0, 0, 129, 4, 0, + 0, 4, 0, 0, 1, 128, 0, 0, 255, 128, 0, 0, 0, 128, 0, + 0, 170, 129, 2, 0, 0, 3, 0, 0, 4, 128, 1, 0, 0, 128, + 1, 0, 0, 128, 35, 0, 0, 2, 0, 0, 4, 128, 0, 0, 170, + 128, 5, 0, 0, 3, 0, 0, 4, 128, 0, 0, 170, 128, 2, 0, + 170, 160, 19, 0, 0, 2, 0, 0, 8, 128, 0, 0, 85, 129, 18, + 0, 0, 4, 1, 0, 1, 128, 0, 0, 170, 128, 0, 0, 255, 128, + 0, 0, 0, 128, 18, 0, 0, 4, 2, 0, 1, 128, 2, 0, 85, + 160, 1, 0, 0, 128, 0, 0, 85, 128, 1, 0, 0, 2, 0, 0, + 8, 128, 1, 0, 255, 160, 4, 0, 0, 4, 0, 0, 1, 128, 0, + 0, 85, 128, 0, 0, 170, 161, 0, 0, 255, 129, 88, 0, 0, 4, + 0, 0, 1, 128, 0, 0, 0, 128, 5, 0, 85, 160, 5, 0, 170, + 160, 1, 0, 0, 2, 2, 0, 2, 128, 5, 0, 0, 160, 66, 0, + 0, 3, 1, 0, 15, 128, 1, 0, 228, 176, 0, 8, 228, 160, 66, + 0, 0, 3, 2, 0, 15, 128, 2, 0, 228, 128, 1, 8, 228, 160, + 5, 0, 0, 3, 2, 0, 7, 128, 2, 0, 255, 128, 2, 0, 228, + 128, 5, 0, 0, 3, 1, 0, 15, 128, 1, 0, 228, 128, 2, 0, + 228, 128, 5, 0, 0, 3, 0, 0, 15, 128, 0, 0, 0, 128, 1, + 0, 228, 128, 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, 68, 82, 208, 4, 0, 0, 64, 0, 0, + 0, 52, 1, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, + 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 1, 0, 0, 0, + 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, + 0, 88, 24, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, + 16, 0, 3, 50, 16, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 3, 0, 0, + 0, 15, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 15, 0, 0, 8, 66, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 128, 32, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 42, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, + 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 9, 50, 0, + 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, + 128, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 15, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, + 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 50, 0, + 0, 12, 130, 0, 16, 0, 0, 0, 0, 0, 58, 128, 32, 128, 65, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 58, 128, 32, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, + 0, 56, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 63, 54, + 0, 0, 6, 66, 0, 16, 0, 0, 0, 0, 0, 58, 128, 32, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 8, 18, 0, 16, + 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 7, 18, + 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, 0, 0, 66, 0, 0, 5, 34, 0, 16, + 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 65, 0, + 0, 5, 66, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, + 0, 0, 0, 56, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, + 63, 0, 0, 0, 8, 98, 0, 16, 0, 0, 0, 0, 0, 6, 2, + 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, 86, 4, 16, 0, 0, + 0, 0, 0, 29, 0, 0, 8, 18, 0, 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 128, 65, 0, 0, + 0, 0, 0, 0, 0, 26, 0, 0, 6, 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 128, 129, 0, 0, 0, 0, 0, 0, 0, 55, + 0, 0, 10, 130, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, + 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 58, + 0, 16, 0, 0, 0, 0, 0, 56, 0, 0, 9, 18, 0, 16, 0, + 1, 0, 0, 0, 58, 0, 16, 128, 129, 0, 0, 0, 0, 0, 0, + 0, 42, 128, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, + 0, 11, 130, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 128, 193, + 0, 0, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 56, 0, 0, + 7, 34, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, 1, 0, 0, 0, 50, 0, 0, 9, 34, + 0, 16, 0, 0, 0, 0, 0, 42, 0, 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, + 0, 56, 0, 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, 26, 128, 32, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 9, 66, 0, 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, 128, 63, 26, 128, 32, 128, 65, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 18, 0, + 16, 0, 1, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 42, + 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, + 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 0, 9, 18, 0, 16, 0, 0, 0, 0, 0, 58, + 128, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 0, 0, 0, 0, 55, 0, 0, 9, 18, 0, 16, + 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 128, 1, 64, 0, 0, 0, 0, 128, 63, 54, + 0, 0, 5, 34, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, + 0, 0, 0, 63, 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, 0, + 0, 70, 0, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, 1, 0, 0, 0, 56, 0, 0, 7, 114, + 0, 16, 0, 1, 0, 0, 0, 246, 15, 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, + 0, 2, 0, 0, 0, 70, 16, 16, 0, 2, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 56, + 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 70, 14, 16, 0, 2, 0, 0, 0, 56, 0, 0, + 7, 242, 32, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, + 84, 65, 84, 116, 0, 0, 0, 36, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 82, 68, 69, 70, 168, 2, 0, 0, 1, 0, 0, 0, + 16, 1, 0, 0, 5, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, + 255, 0, 1, 0, 0, 116, 2, 0, 0, 188, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 201, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 217, 0, + 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, + 230, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, + 0, 255, 255, 255, 255, 1, 0, 0, 0, 1, 0, 0, 0, 13, 0, + 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 73, 110, 112, 117, 116, 83, 97, 109, 112, 108, 101, + 114, 0, 71, 114, 97, 100, 105, 101, 110, 116, 83, 97, 109, 112, 108, + 101, 114, 0, 73, 110, 112, 117, 116, 84, 101, 120, 116, 117, 114, 101, + 0, 71, 114, 97, 100, 105, 101, 110, 116, 84, 101, 120, 116, 117, 114, + 101, 0, 114, 97, 100, 105, 97, 108, 71, 114, 97, 100, 105, 101, 110, + 116, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 171, 246, 0, + 0, 0, 8, 0, 0, 0, 40, 1, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 2, 0, 0, 0, 240, 1, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, 2, 0, + 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 24, 2, 0, 0, 24, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 28, 2, 0, 0, + 0, 0, 0, 0, 44, 2, 0, 0, 28, 0, 0, 0, 4, 0, 0, + 0, 2, 0, 0, 0, 28, 2, 0, 0, 0, 0, 0, 0, 52, 2, + 0, 0, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 28, + 2, 0, 0, 0, 0, 0, 0, 63, 2, 0, 0, 36, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 0, 0, 28, 2, 0, 0, 0, 0, 0, + 0, 78, 2, 0, 0, 40, 0, 0, 0, 4, 0, 0, 0, 2, 0, + 0, 0, 28, 2, 0, 0, 0, 0, 0, 0, 88, 2, 0, 0, 48, + 0, 0, 0, 28, 0, 0, 0, 2, 0, 0, 0, 100, 2, 0, 0, + 0, 0, 0, 0, 100, 105, 102, 102, 0, 171, 171, 171, 1, 0, 3, + 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 101, + 110, 116, 101, 114, 49, 0, 1, 0, 3, 0, 1, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 65, 0, 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 97, 100, + 105, 117, 115, 49, 0, 115, 113, 95, 114, 97, 100, 105, 117, 115, 49, + 0, 114, 101, 112, 101, 97, 116, 95, 99, 111, 114, 114, 101, 99, 116, + 0, 97, 108, 108, 111, 119, 95, 111, 100, 100, 0, 116, 114, 97, 110, + 115, 102, 111, 114, 109, 0, 171, 171, 3, 0, 3, 0, 3, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, + 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51, 56, 52, 0, 171, + 171, 73, 83, 71, 78, 116, 0, 0, 0, 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, + 0, 15, 3, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 15, 3, 0, 0, 83, + 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 83, 67, 69, 78, + 69, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171}; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer conicGradientConstants +// { +// +// float2 center; // Offset: 0 Size: 8 +// float angle; // Offset: 8 Size: 4 +// float start_offset; // Offset: 12 Size: 4 +// float end_offset; // Offset: 16 Size: 4 +// float repeat_correct_conic; // Offset: 20 Size: 4 [unused] +// float allow_odd_conic; // Offset: 24 Size: 4 [unused] +// float3x2 transform_conic; // Offset: 32 Size: 28 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// InputSampler sampler NA NA 0 1 +// GradientSampler sampler NA NA 1 1 +// InputTexture texture float4 2d 0 1 +// GradientTexture texture float4 2d 1 1 +// conicGradientConstants cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// SCENE_POSITION 0 xyzw 1 NONE float xy +// TEXCOORD 0 xyzw 2 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Target 0 xyzw 0 TARGET float xyzw +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c0 cb0 0 4 ( FLT, FLT, FLT, FLT) +// +// +// Sampler/Resource to DX9 shader sampler mappings: +// +// Target Sampler Source Sampler Source Resource +// -------------- --------------- ---------------- +// s0 s0 t0 +// s1 s1 t1 +// +// +// Level9 shader bytecode: +// + ps_2_x + def c4, 0.0208350997, -0.0851330012, 0.180141002, -0.330299497 + def c5, 0.999866009, 0, 1, 3.14159274 + def c6, -2, 1.57079637, 0.159154937, 0.5 + dcl t0 + dcl t1 + dcl_2d s0 + dcl_2d s1 + dp2add r0.w, t0, c2, c2.z + add r0.x, -r0.w, c0.x + dp2add r0.z, t0, c3, c3.z + add r0.z, -r0.z, c0.y + abs r0.yw, r0.xxzz + max r1.w, r0.y, r0.w + rcp r1.x, r1.w + min r1.y, r0.w, r0.y + add r0.y, -r0.y, r0.w + cmp r0.y, r0.y, c5.y, c5.z + mul r0.w, r1.x, r1.y + mul r1.x, r0.w, r0.w + mad r1.y, r1.x, c4.x, c4.y + mad r1.y, r1.x, r1.y, c4.z + mad r1.y, r1.x, r1.y, c4.w + mad r1.x, r1.x, r1.y, c5.x + mul r0.w, r0.w, r1.x + mad r1.x, r0.w, c6.x, c6.y + mad r0.y, r1.x, r0.y, r0.w + cmp r0.w, -r0.z, -c5.y, -c5.w + add r0.y, r0.w, r0.y + add r0.w, r0.y, r0.y + max r1.x, r0.x, -r0.z + min r1.y, -r0.z, r0.x + cmp r0.x, r1.x, c5.z, c5.y + cmp r0.x, r1.y, c5.y, r0.x + mad r0.x, r0.x, -r0.w, r0.y + add r0.x, r0.x, -c0.z + mov r0.w, c0.w + add r0.y, -r0.w, c1.x + rcp r0.y, r0.y + mul r0.x, r0.x, r0.y + mov r0.z, c6.z + mad r0.x, r0.x, r0.z, c1.x + add r0.x, r0.x, -c0.w + add r0.x, r0.x, c6.w + abs r0.y, r0.x + frc r0.y, r0.y + cmp r0.x, r0.x, r0.y, -r0.y + mov r0.y, c6.w + texld r1, t1, s0 + texld r0, r0, s1 + mul r0.xyz, r0.w, r0 + mul r0, r1, r0 + mov oC0, r0 + +// approximately 47 instruction slots used (2 texture, 45 arithmetic) +ps_4_0 +dcl_constantbuffer cb0[4], immediateIndexed +dcl_sampler s0, mode_default +dcl_sampler s1, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t1 +dcl_input_ps linear v1.xy +dcl_input_ps linear v2.xy +dcl_output o0.xyzw +dcl_temps 2 +dp2 r0.x, v1.xyxx, cb0[2].xyxx +add r0.x, r0.x, cb0[2].z +dp2 r0.y, v1.xyxx, cb0[3].xyxx +add r0.y, r0.y, cb0[3].z +add r0.xy, -r0.xyxx, cb0[0].xyxx +max r0.z, |r0.y|, |r0.x| +div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z +min r0.w, |r0.y|, |r0.x| +mul r0.z, r0.z, r0.w +mul r0.w, r0.z, r0.z +mad r1.x, r0.w, l(0.020835), l(-0.085133) +mad r1.x, r0.w, r1.x, l(0.180141) +mad r1.x, r0.w, r1.x, l(-0.330299) +mad r0.w, r0.w, r1.x, l(0.999866) +mul r1.x, r0.w, r0.z +mad r1.x, r1.x, l(-2.000000), l(1.570796) +lt r1.y, |r0.y|, |r0.x| +and r1.x, r1.y, r1.x +mad r0.z, r0.z, r0.w, r1.x +lt r0.w, -r0.y, r0.y +and r0.w, r0.w, l(0xc0490fdb) +add r0.z, r0.w, r0.z +min r0.w, -r0.y, r0.x +max r0.x, -r0.y, r0.x +ge r0.x, r0.x, -r0.x +lt r0.y, r0.w, -r0.w +and r0.x, r0.x, r0.y +movc r0.x, r0.x, -r0.z, r0.z +add r0.x, r0.x, -cb0[0].z +add r0.y, -cb0[0].w, cb0[1].x +div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y +mul r0.x, r0.x, r0.y +mad r0.x, r0.x, l(0.159155), cb0[1].x +add r0.x, r0.x, -cb0[0].w +add r0.x, r0.x, l(0.500000) +ge r0.y, r0.x, -r0.x +frc r0.x, |r0.x| +movc r0.x, r0.y, r0.x, -r0.x +mov r0.y, l(0.500000) +sample r0.xyzw, r0.xyxx, t1.xyzw, s1 +mul r0.xyz, r0.wwww, r0.xyzx +sample r1.xyzw, v2.xyxx, t0.xyzw, s0 +mul o0.xyzw, r0.xyzw, r1.xyzw +ret +// Approximately 44 instruction slots used +#endif + +const BYTE SampleConicGradientPS[] = { + 68, 88, 66, 67, 111, 210, 133, 71, 96, 114, 123, 208, 6, 154, 50, + 242, 194, 61, 177, 240, 1, 0, 0, 0, 184, 13, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, 224, 3, 0, 0, 240, 9, 0, 0, 108, + 10, 0, 0, 8, 13, 0, 0, 132, 13, 0, 0, 65, 111, 110, 57, + 160, 3, 0, 0, 160, 3, 0, 0, 0, 2, 255, 255, 104, 3, 0, + 0, 56, 0, 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, + 56, 0, 2, 0, 36, 0, 0, 0, 56, 0, 0, 0, 0, 0, 1, + 1, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 255, 255, 81, 0, 0, 5, 4, 0, 15, 160, 95, 174, 170, + 60, 54, 90, 174, 189, 226, 118, 56, 62, 4, 29, 169, 190, 81, 0, + 0, 5, 5, 0, 15, 160, 56, 247, 127, 63, 0, 0, 0, 0, 0, + 0, 128, 63, 219, 15, 73, 64, 81, 0, 0, 5, 6, 0, 15, 160, + 0, 0, 0, 192, 219, 15, 201, 63, 131, 249, 34, 62, 0, 0, 0, + 63, 31, 0, 0, 2, 0, 0, 0, 128, 0, 0, 15, 176, 31, 0, + 0, 2, 0, 0, 0, 128, 1, 0, 15, 176, 31, 0, 0, 2, 0, + 0, 0, 144, 0, 8, 15, 160, 31, 0, 0, 2, 0, 0, 0, 144, + 1, 8, 15, 160, 90, 0, 0, 4, 0, 0, 8, 128, 0, 0, 228, + 176, 2, 0, 228, 160, 2, 0, 170, 160, 2, 0, 0, 3, 0, 0, + 1, 128, 0, 0, 255, 129, 0, 0, 0, 160, 90, 0, 0, 4, 0, + 0, 4, 128, 0, 0, 228, 176, 3, 0, 228, 160, 3, 0, 170, 160, + 2, 0, 0, 3, 0, 0, 4, 128, 0, 0, 170, 129, 0, 0, 85, + 160, 35, 0, 0, 2, 0, 0, 10, 128, 0, 0, 160, 128, 11, 0, + 0, 3, 1, 0, 8, 128, 0, 0, 85, 128, 0, 0, 255, 128, 6, + 0, 0, 2, 1, 0, 1, 128, 1, 0, 255, 128, 10, 0, 0, 3, + 1, 0, 2, 128, 0, 0, 255, 128, 0, 0, 85, 128, 2, 0, 0, + 3, 0, 0, 2, 128, 0, 0, 85, 129, 0, 0, 255, 128, 88, 0, + 0, 4, 0, 0, 2, 128, 0, 0, 85, 128, 5, 0, 85, 160, 5, + 0, 170, 160, 5, 0, 0, 3, 0, 0, 8, 128, 1, 0, 0, 128, + 1, 0, 85, 128, 5, 0, 0, 3, 1, 0, 1, 128, 0, 0, 255, + 128, 0, 0, 255, 128, 4, 0, 0, 4, 1, 0, 2, 128, 1, 0, + 0, 128, 4, 0, 0, 160, 4, 0, 85, 160, 4, 0, 0, 4, 1, + 0, 2, 128, 1, 0, 0, 128, 1, 0, 85, 128, 4, 0, 170, 160, + 4, 0, 0, 4, 1, 0, 2, 128, 1, 0, 0, 128, 1, 0, 85, + 128, 4, 0, 255, 160, 4, 0, 0, 4, 1, 0, 1, 128, 1, 0, + 0, 128, 1, 0, 85, 128, 5, 0, 0, 160, 5, 0, 0, 3, 0, + 0, 8, 128, 0, 0, 255, 128, 1, 0, 0, 128, 4, 0, 0, 4, + 1, 0, 1, 128, 0, 0, 255, 128, 6, 0, 0, 160, 6, 0, 85, + 160, 4, 0, 0, 4, 0, 0, 2, 128, 1, 0, 0, 128, 0, 0, + 85, 128, 0, 0, 255, 128, 88, 0, 0, 4, 0, 0, 8, 128, 0, + 0, 170, 129, 5, 0, 85, 161, 5, 0, 255, 161, 2, 0, 0, 3, + 0, 0, 2, 128, 0, 0, 255, 128, 0, 0, 85, 128, 2, 0, 0, + 3, 0, 0, 8, 128, 0, 0, 85, 128, 0, 0, 85, 128, 11, 0, + 0, 3, 1, 0, 1, 128, 0, 0, 0, 128, 0, 0, 170, 129, 10, + 0, 0, 3, 1, 0, 2, 128, 0, 0, 170, 129, 0, 0, 0, 128, + 88, 0, 0, 4, 0, 0, 1, 128, 1, 0, 0, 128, 5, 0, 170, + 160, 5, 0, 85, 160, 88, 0, 0, 4, 0, 0, 1, 128, 1, 0, + 85, 128, 5, 0, 85, 160, 0, 0, 0, 128, 4, 0, 0, 4, 0, + 0, 1, 128, 0, 0, 0, 128, 0, 0, 255, 129, 0, 0, 85, 128, + 2, 0, 0, 3, 0, 0, 1, 128, 0, 0, 0, 128, 0, 0, 170, + 161, 1, 0, 0, 2, 0, 0, 8, 128, 0, 0, 255, 160, 2, 0, + 0, 3, 0, 0, 2, 128, 0, 0, 255, 129, 1, 0, 0, 160, 6, + 0, 0, 2, 0, 0, 2, 128, 0, 0, 85, 128, 5, 0, 0, 3, + 0, 0, 1, 128, 0, 0, 0, 128, 0, 0, 85, 128, 1, 0, 0, + 2, 0, 0, 4, 128, 6, 0, 170, 160, 4, 0, 0, 4, 0, 0, + 1, 128, 0, 0, 0, 128, 0, 0, 170, 128, 1, 0, 0, 160, 2, + 0, 0, 3, 0, 0, 1, 128, 0, 0, 0, 128, 0, 0, 255, 161, + 2, 0, 0, 3, 0, 0, 1, 128, 0, 0, 0, 128, 6, 0, 255, + 160, 35, 0, 0, 2, 0, 0, 2, 128, 0, 0, 0, 128, 19, 0, + 0, 2, 0, 0, 2, 128, 0, 0, 85, 128, 88, 0, 0, 4, 0, + 0, 1, 128, 0, 0, 0, 128, 0, 0, 85, 128, 0, 0, 85, 129, + 1, 0, 0, 2, 0, 0, 2, 128, 6, 0, 255, 160, 66, 0, 0, + 3, 1, 0, 15, 128, 1, 0, 228, 176, 0, 8, 228, 160, 66, 0, + 0, 3, 0, 0, 15, 128, 0, 0, 228, 128, 1, 8, 228, 160, 5, + 0, 0, 3, 0, 0, 7, 128, 0, 0, 255, 128, 0, 0, 228, 128, + 5, 0, 0, 3, 0, 0, 15, 128, 1, 0, 228, 128, 0, 0, 228, + 128, 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, 255, 255, + 0, 0, 83, 72, 68, 82, 8, 6, 0, 0, 64, 0, 0, 0, 130, + 1, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, + 0, 90, 0, 0, 3, 0, 96, 16, 0, 1, 0, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, + 24, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85, 85, 0, 0, + 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, 16, 0, + 3, 50, 16, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 2, 0, 0, 0, 15, + 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 15, 0, 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 8, 34, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, 42, 128, 32, 0, 0, + 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 9, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, + 0, 70, 128, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, + 0, 9, 66, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 128, 129, + 0, 0, 0, 0, 0, 0, 0, 10, 0, 16, 128, 129, 0, 0, 0, + 0, 0, 0, 0, 14, 0, 0, 10, 66, 0, 16, 0, 0, 0, 0, + 0, 2, 64, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, 42, 0, 16, 0, 0, 0, 0, 0, 51, + 0, 0, 9, 130, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 128, + 129, 0, 0, 0, 0, 0, 0, 0, 10, 0, 16, 128, 129, 0, 0, + 0, 0, 0, 0, 0, 56, 0, 0, 7, 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, + 0, 0, 0, 56, 0, 0, 7, 130, 0, 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 42, 0, 16, 0, 0, 0, 0, + 0, 50, 0, 0, 9, 18, 0, 16, 0, 1, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 95, 174, 170, 60, 1, + 64, 0, 0, 54, 90, 174, 189, 50, 0, 0, 9, 18, 0, 16, 0, + 1, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, + 0, 1, 0, 0, 0, 1, 64, 0, 0, 226, 118, 56, 62, 50, 0, + 0, 9, 18, 0, 16, 0, 1, 0, 0, 0, 58, 0, 16, 0, 0, + 0, 0, 0, 10, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, + 4, 29, 169, 190, 50, 0, 0, 9, 130, 0, 16, 0, 0, 0, 0, + 0, 58, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 1, 0, + 0, 0, 1, 64, 0, 0, 56, 247, 127, 63, 56, 0, 0, 7, 18, + 0, 16, 0, 1, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 50, 0, 0, 9, 18, 0, 16, + 0, 1, 0, 0, 0, 10, 0, 16, 0, 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 192, 1, 64, 0, 0, 219, 15, 201, 63, 49, + 0, 0, 9, 34, 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, 128, + 129, 0, 0, 0, 0, 0, 0, 0, 10, 0, 16, 128, 129, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 7, 18, 0, 16, 0, 1, 0, + 0, 0, 26, 0, 16, 0, 1, 0, 0, 0, 10, 0, 16, 0, 1, + 0, 0, 0, 50, 0, 0, 9, 66, 0, 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, + 0, 10, 0, 16, 0, 1, 0, 0, 0, 49, 0, 0, 8, 130, 0, + 16, 0, 0, 0, 0, 0, 26, 0, 16, 128, 65, 0, 0, 0, 0, + 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, 1, 0, 0, 7, + 130, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, + 0, 1, 64, 0, 0, 219, 15, 73, 192, 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 42, + 0, 16, 0, 0, 0, 0, 0, 51, 0, 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 26, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, 0, 52, 0, 0, 8, 18, 0, + 16, 0, 0, 0, 0, 0, 26, 0, 16, 128, 65, 0, 0, 0, 0, + 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 29, 0, 0, 8, + 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, + 0, 10, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, 49, 0, + 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, + 0, 0, 0, 58, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, + 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, 55, 0, + 0, 10, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, + 0, 0, 0, 42, 0, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 0, 16, + 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 42, 128, + 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 10, 34, 0, 16, 0, 0, 0, 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 128, 32, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 10, 34, 0, + 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 128, 63, 0, + 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 26, 0, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 10, 18, 0, 16, 0, 0, 0, 0, 0, 10, + 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 131, 249, 34, 62, + 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 9, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, + 0, 0, 58, 128, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, + 63, 29, 0, 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, 10, 0, 16, 128, 65, 0, 0, 0, 0, + 0, 0, 0, 26, 0, 0, 6, 18, 0, 16, 0, 0, 0, 0, 0, + 10, 0, 16, 128, 129, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, + 10, 18, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 128, 65, + 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 34, 0, 16, 0, + 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 63, 69, 0, 0, + 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, + 0, 0, 70, 126, 16, 0, 1, 0, 0, 0, 0, 96, 16, 0, 1, + 0, 0, 0, 56, 0, 0, 7, 114, 0, 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, + 0, 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, 0, 0, 70, 16, + 16, 0, 2, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, + 96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 70, 14, 16, + 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, + 0, 0, 44, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, + 69, 70, 148, 2, 0, 0, 1, 0, 0, 0, 16, 1, 0, 0, 5, + 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, + 96, 2, 0, 0, 188, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, 201, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 217, 0, 0, 0, 2, 0, 0, + 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 230, 0, 0, 0, 2, + 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, + 1, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 246, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 73, + 110, 112, 117, 116, 83, 97, 109, 112, 108, 101, 114, 0, 71, 114, 97, + 100, 105, 101, 110, 116, 83, 97, 109, 112, 108, 101, 114, 0, 73, 110, + 112, 117, 116, 84, 101, 120, 116, 117, 114, 101, 0, 71, 114, 97, 100, + 105, 101, 110, 116, 84, 101, 120, 116, 117, 114, 101, 0, 99, 111, 110, + 105, 99, 71, 114, 97, 100, 105, 101, 110, 116, 67, 111, 110, 115, 116, + 97, 110, 116, 115, 0, 171, 171, 171, 246, 0, 0, 0, 7, 0, 0, + 0, 40, 1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 1, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, + 0, 0, 0, 216, 1, 0, 0, 0, 0, 0, 0, 232, 1, 0, 0, + 8, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 240, 1, 0, + 0, 0, 0, 0, 0, 0, 2, 0, 0, 12, 0, 0, 0, 4, 0, + 0, 0, 2, 0, 0, 0, 240, 1, 0, 0, 0, 0, 0, 0, 13, + 2, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, + 240, 1, 0, 0, 0, 0, 0, 0, 24, 2, 0, 0, 20, 0, 0, + 0, 4, 0, 0, 0, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, + 0, 0, 45, 2, 0, 0, 24, 0, 0, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 240, 1, 0, 0, 0, 0, 0, 0, 61, 2, 0, 0, + 32, 0, 0, 0, 28, 0, 0, 0, 2, 0, 0, 0, 80, 2, 0, + 0, 0, 0, 0, 0, 99, 101, 110, 116, 101, 114, 0, 171, 1, 0, + 3, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, + 110, 103, 108, 101, 0, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 116, 97, 114, 116, 95, 111, + 102, 102, 115, 101, 116, 0, 101, 110, 100, 95, 111, 102, 102, 115, 101, + 116, 0, 114, 101, 112, 101, 97, 116, 95, 99, 111, 114, 114, 101, 99, + 116, 95, 99, 111, 110, 105, 99, 0, 97, 108, 108, 111, 119, 95, 111, + 100, 100, 95, 99, 111, 110, 105, 99, 0, 116, 114, 97, 110, 115, 102, + 111, 114, 109, 95, 99, 111, 110, 105, 99, 0, 171, 171, 171, 3, 0, + 3, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, + 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, + 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 116, 0, 0, 0, 3, + 0, 0, 0, 8, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, 15, 3, 0, 0, 107, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, + 15, 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, + 0, 83, 67, 69, 78, 69, 95, 80, 79, 83, 73, 84, 73, 79, 78, + 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 79, 83, 71, 78, 44, + 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, + 171, 171}; diff --git a/gfx/2d/ShadersD2D1.hlsl b/gfx/2d/ShadersD2D1.hlsl new file mode 100644 index 0000000000..163b6b388f --- /dev/null +++ b/gfx/2d/ShadersD2D1.hlsl @@ -0,0 +1,162 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +Texture2D InputTexture : register(t0); +SamplerState InputSampler : register(s0); +Texture2D GradientTexture : register(t1); +SamplerState GradientSampler : register(s1); + +cbuffer radialGradientConstants : register(b0) +{ + // Precalculate as much as we can! + float3 diff : packoffset(c0.x); + float2 center1 : packoffset(c1.x); + float A : packoffset(c1.z); + float radius1 : packoffset(c1.w); + float sq_radius1 : packoffset(c2.x); + + // The next two values are used for a hack to compensate for an apparent + // bug in D2D where the GradientSampler SamplerState doesn't get the + // correct addressing modes. + float repeat_correct : packoffset(c2.y); + float allow_odd : packoffset(c2.z); + + float3x2 transform : packoffset(c3.x); +} + +cbuffer conicGradientConstants : register(b0) +{ + float2 center : packoffset(c0.x); + float angle : packoffset(c0.z); + float start_offset : packoffset(c0.w); + float end_offset : packoffset(c1.x); + + // The next two values are used for a hack to compensate for an apparent + // bug in D2D where the GradientSampler SamplerState doesn't get the + // correct addressing modes. + float repeat_correct_conic : packoffset(c1.y); + float allow_odd_conic : packoffset(c1.z); + + float3x2 transform_conic : packoffset(c2.x); +} + + +static const float M_PI = 3.14159265f; + +float4 SampleConicGradientPS( + float4 clipSpaceOutput : SV_POSITION, + float4 sceneSpaceOutput : SCENE_POSITION, + float4 texelSpaceInput0 : TEXCOORD0 + ) : SV_Target +{ + float2 p = float2(sceneSpaceOutput.x * transform_conic._11 + sceneSpaceOutput.y * transform_conic._21 + transform_conic._31, + sceneSpaceOutput.x * transform_conic._12 + sceneSpaceOutput.y * transform_conic._22 + transform_conic._32); + float2 dir = float2( + -(center.y - p.y), + (center.x - p.x)); + float vstart = start_offset; + float vend = end_offset; + float n = 1/(vend-vstart); + float current_angle = atan2(dir.y, dir.x)-angle; + float lambda = fmod(n*current_angle/M_PI/2+vend-vstart+.5,1); + float offset = lambda; + float4 output = GradientTexture.Sample(GradientSampler, float2(offset, 0.5)); + // Premultiply + output.rgb *= output.a; + // Multiply the output color by the input mask for the operation. + output *= InputTexture.Sample(InputSampler, texelSpaceInput0.xy); + + return output; +}; + +float4 SampleRadialGradientPS( + float4 clipSpaceOutput : SV_POSITION, + float4 sceneSpaceOutput : SCENE_POSITION, + float4 texelSpaceInput0 : TEXCOORD0 + ) : SV_Target +{ + // Radial gradient painting is defined as the set of circles whose centers + // are described by C(t) = (C2 - C1) * t + C1; with radii + // R(t) = (R2 - R1) * t + R1; for R(t) > 0. This shader solves the + // quadratic equation that arises when calculating t for pixel (x, y). + // + // A more extensive derrivation can be found in the pixman radial gradient + // code. + + float2 p = float2(sceneSpaceOutput.x * transform._11 + sceneSpaceOutput.y * transform._21 + transform._31, + sceneSpaceOutput.x * transform._12 + sceneSpaceOutput.y * transform._22 + transform._32); + float3 dp = float3(p - center1, radius1); + + // dpx * dcx + dpy * dcy + r * dr + float B = dot(dp, diff); + + float C = pow(dp.x, 2) + pow(dp.y, 2) - sq_radius1; + + float det = pow(B, 2) - A * C; + + float sqrt_det = sqrt(abs(det)); + + float2 t = (B + float2(sqrt_det, -sqrt_det)) / A; + + float2 isValid = step(float2(-radius1, -radius1), t * diff.z); + + float upper_t = lerp(t.y, t.x, isValid.x); + + // Addressing mode bug work-around.. first let's see if we should consider odd repetitions separately. + float oddeven = abs(fmod(floor(upper_t), 2)) * allow_odd; + + // Now let's calculate even or odd addressing in a branchless manner. + float upper_t_repeated = ((upper_t - floor(upper_t)) * (1.0f - oddeven)) + ((ceil(upper_t) - upper_t) * oddeven); + + float4 output = GradientTexture.Sample(GradientSampler, float2(upper_t * (1.0f - repeat_correct) + upper_t_repeated * repeat_correct, 0.5)); + // Premultiply + output.rgb *= output.a; + // Multiply the output color by the input mask for the operation. + output *= InputTexture.Sample(InputSampler, texelSpaceInput0.xy); + + // In order to compile for PS_4_0_level_9_3 we need to be branchless. + // This is essentially returning nothing, i.e. bailing early if: + // det < 0 || max(isValid.x, isValid.y) <= 0 + return output * abs(step(max(isValid.x, isValid.y), 0) - 1.0f) * step(0, det); +}; + +float4 SampleRadialGradientA0PS( + float4 clipSpaceOutput : SV_POSITION, + float4 sceneSpaceOutput : SCENE_POSITION, + float4 texelSpaceInput0 : TEXCOORD0 + ) : SV_Target +{ + // This simpler shader is used for the degenerate case where A is 0, + // i.e. we're actually solving a linear equation. + + float2 p = float2(sceneSpaceOutput.x * transform._11 + sceneSpaceOutput.y * transform._21 + transform._31, + sceneSpaceOutput.x * transform._12 + sceneSpaceOutput.y * transform._22 + transform._32); + float3 dp = float3(p - center1, radius1); + + // dpx * dcx + dpy * dcy + r * dr + float B = dot(dp, diff); + + float C = pow(dp.x, 2) + pow(dp.y, 2) - pow(radius1, 2); + + float t = 0.5 * C / B; + + // Addressing mode bug work-around.. first let's see if we should consider odd repetitions separately. + float oddeven = abs(fmod(floor(t), 2)) * allow_odd; + + // Now let's calculate even or odd addressing in a branchless manner. + float t_repeated = ((t - floor(t)) * (1.0f - oddeven)) + ((ceil(t) - t) * oddeven); + + float4 output = GradientTexture.Sample(GradientSampler, float2(t * (1.0f - repeat_correct) + t_repeated * repeat_correct, 0.5)); + // Premultiply + output.rgb *= output.a; + // Multiply the output color by the input mask for the operation. + output *= InputTexture.Sample(InputSampler, texelSpaceInput0.xy); + + // In order to compile for PS_4_0_level_9_3 we need to be branchless. + // This is essentially returning nothing, i.e. bailing early if: + // -radius1 >= t * diff.z + return output * abs(step(t * diff.z, -radius1) - 1.0f); +}; + |