Scale SDR content to SDR whitelevel when HDR is enabled

This commit is contained in:
Sam Lantinga
2024-02-05 10:23:25 -08:00
parent e97b2061b4
commit 240158f3e8
15 changed files with 3295 additions and 2410 deletions

426
src/render/direct3d11/D3D11_PixelShader_Colors.h Executable file → Normal file
View File

@@ -1,134 +1,292 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// // Buffer Definitions:
// Input signature: //
// // cbuffer Constants
// Name Index Mask Register SysValue Format Used // {
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_POSITION 0 xyzw 0 POS float // float scRGB_output; // Offset: 0 Size: 4
// TEXCOORD 0 xy 1 NONE float // float SDR_whitelevel; // Offset: 4 Size: 4
// COLOR 0 xyzw 2 NONE float xyzw // float HDR_whitelevel; // Offset: 8 Size: 4 [unused]
// // float maxCLL; // Offset: 12 Size: 4 [unused]
// // float4 Yoffset; // Offset: 16 Size: 16 [unused]
// Output signature: // float4 Rcoeff; // Offset: 32 Size: 16 [unused]
// // float4 Gcoeff; // Offset: 48 Size: 16 [unused]
// Name Index Mask Register SysValue Format Used // float4 Bcoeff; // Offset: 64 Size: 16 [unused]
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_TARGET 0 xyzw 0 TARGET float xyzw // }
// //
// //
// Level9 shader bytecode: // Resource Bindings:
// //
ps_2_0 // Name Type Format Dim HLSL Bind Count
dcl t1 // ------------------------------ ---------- ------- ----------- -------------- ------
mov oC0, t1 // Constants cbuffer NA NA cb0 1
//
// approximately 1 instruction slot used //
ps_4_0 //
dcl_input_ps linear v2.xyzw // Input signature:
dcl_output o0.xyzw //
mov o0.xyzw, v2.xyzw // Name Index Mask Register SysValue Format Used
ret // -------------------- ----- ------ -------- -------- ------- ------
// Approximately 2 instruction slots used // SV_POSITION 0 xyzw 0 POS float
#endif // TEXCOORD 0 xy 1 NONE float
// COLOR 0 xyzw 2 NONE float xyzw
const BYTE g_main[] = //
{ //
68, 88, 66, 67, 226, 124, // Output signature:
10, 63, 141, 181, 49, 167, //
218, 135, 248, 147, 77, 222, // Name Index Mask Register SysValue Format Used
95, 123, 1, 0, 0, 0, // -------------------- ----- ------ -------- -------- ------- ------
52, 2, 0, 0, 6, 0, // SV_TARGET 0 xyzw 0 TARGET float xyzw
0, 0, 56, 0, 0, 0, //
132, 0, 0, 0, 196, 0, //
0, 0, 64, 1, 0, 0, // Constant buffer to DX9 shader constant mappings:
140, 1, 0, 0, 0, 2, //
0, 0, 65, 111, 110, 57, // Target Reg Buffer Start Reg # of Regs Data Conversion
68, 0, 0, 0, 68, 0, // ---------- ------- --------- --------- ----------------------
0, 0, 0, 2, 255, 255, // c0 cb0 0 1 ( FLT, FLT, FLT, FLT)
32, 0, 0, 0, 36, 0, //
0, 0, 0, 0, 36, 0, //
0, 0, 36, 0, 0, 0, // Level9 shader bytecode:
36, 0, 0, 0, 36, 0, //
0, 0, 36, 0, 0, 2, ps_2_0
255, 255, 31, 0, 0, 2, def c1, 0.0125000002, 1, 0, 0
0, 0, 0, 128, 1, 0, dcl t1
15, 176, 1, 0, 0, 2, mul r0.w, c0.x, c0.x
0, 8, 15, 128, 1, 0, mov r0.x, c1.x
228, 176, 255, 255, 0, 0, mul r0.x, r0.x, c0.y
83, 72, 68, 82, 56, 0, cmp r0.xyz, -r0.w, c1.y, r0.x
0, 0, 64, 0, 0, 0, mov r0.w, c1.y
14, 0, 0, 0, 98, 16, mul r0, r0, t1
0, 3, 242, 16, 16, 0, mov oC0, r0
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, // approximately 7 instruction slots used
0, 0, 0, 0, 54, 0, ps_4_0
0, 5, 242, 32, 16, 0, dcl_constantbuffer CB0[1], immediateIndexed
0, 0, 0, 0, 70, 30, dcl_input_ps linear v2.xyzw
16, 0, 2, 0, 0, 0, dcl_output o0.xyzw
62, 0, 0, 1, 83, 84, dcl_temps 1
65, 84, 116, 0, 0, 0, ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x
2, 0, 0, 0, 0, 0, mul r0.y, cb0[0].y, l(0.012500)
0, 0, 0, 0, 0, 0, movc r0.xyz, r0.xxxx, r0.yyyy, l(1.000000,1.000000,1.000000,0)
2, 0, 0, 0, 0, 0, mov r0.w, l(1.000000)
0, 0, 0, 0, 0, 0, mul o0.xyzw, r0.xyzw, v2.xyzw
0, 0, 0, 0, 1, 0, ret
0, 0, 0, 0, 0, 0, // Approximately 6 instruction slots used
0, 0, 0, 0, 0, 0, #endif
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, const BYTE g_main[] =
0, 0, 0, 0, 0, 0, {
0, 0, 0, 0, 0, 0, 68, 88, 66, 67, 132, 13,
0, 0, 0, 0, 0, 0, 165, 35, 17, 157, 163, 217,
0, 0, 0, 0, 1, 0, 158, 71, 117, 171, 46, 252,
0, 0, 0, 0, 0, 0, 9, 215, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 224, 4, 0, 0, 6, 0,
0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0, 0, 0, 112, 2, 0, 0,
0, 0, 0, 0, 0, 0, 56, 4, 0, 0, 172, 4,
0, 0, 82, 68, 69, 70, 0, 0, 65, 111, 110, 57,
68, 0, 0, 0, 0, 0, 196, 0, 0, 0, 196, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 255, 255,
0, 0, 0, 0, 28, 0, 148, 0, 0, 0, 48, 0,
0, 0, 0, 4, 255, 255, 0, 0, 1, 0, 36, 0,
0, 1, 0, 0, 28, 0, 0, 0, 48, 0, 0, 0,
0, 0, 77, 105, 99, 114, 48, 0, 0, 0, 36, 0,
111, 115, 111, 102, 116, 32, 0, 0, 48, 0, 0, 0,
40, 82, 41, 32, 72, 76, 0, 0, 1, 0, 0, 0,
83, 76, 32, 83, 104, 97, 0, 0, 0, 0, 0, 2,
100, 101, 114, 32, 67, 111, 255, 255, 81, 0, 0, 5,
109, 112, 105, 108, 101, 114, 1, 0, 15, 160, 205, 204,
32, 49, 48, 46, 49, 0, 76, 60, 0, 0, 128, 63,
73, 83, 71, 78, 108, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 31, 0, 0, 2,
8, 0, 0, 0, 80, 0, 0, 0, 0, 128, 1, 0,
0, 0, 0, 0, 0, 0, 15, 176, 5, 0, 0, 3,
1, 0, 0, 0, 3, 0, 0, 0, 8, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 160,
15, 0, 0, 0, 92, 0, 1, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 0, 1, 128, 1, 0, 0, 160,
0, 0, 0, 0, 3, 0, 5, 0, 0, 3, 0, 0,
0, 0, 1, 0, 0, 0, 1, 128, 0, 0, 0, 128,
3, 0, 0, 0, 101, 0, 0, 0, 85, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 7, 128,
0, 0, 0, 0, 3, 0, 0, 0, 255, 129, 1, 0,
0, 0, 2, 0, 0, 0, 85, 160, 0, 0, 0, 128,
15, 15, 0, 0, 83, 86, 1, 0, 0, 2, 0, 0,
95, 80, 79, 83, 73, 84, 8, 128, 1, 0, 85, 160,
73, 79, 78, 0, 84, 69, 5, 0, 0, 3, 0, 0,
88, 67, 79, 79, 82, 68, 15, 128, 0, 0, 228, 128,
0, 67, 79, 76, 79, 82, 1, 0, 228, 176, 1, 0,
0, 171, 79, 83, 71, 78, 0, 2, 0, 8, 15, 128,
44, 0, 0, 0, 1, 0, 0, 0, 228, 128, 255, 255,
0, 0, 8, 0, 0, 0, 0, 0, 83, 72, 68, 82,
32, 0, 0, 0, 0, 0, 232, 0, 0, 0, 64, 0,
0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0,
3, 0, 0, 0, 0, 0, 89, 0, 0, 4, 70, 142,
0, 0, 15, 0, 0, 0, 32, 0, 0, 0, 0, 0,
83, 86, 95, 84, 65, 82, 1, 0, 0, 0, 98, 16,
71, 69, 84, 0, 171, 171 0, 3, 242, 16, 16, 0,
}; 2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 1, 0, 0, 0,
57, 0, 0, 11, 18, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 10, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 56, 0, 0, 8,
34, 0, 16, 0, 0, 0,
0, 0, 26, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 1, 64, 0, 0,
205, 204, 76, 60, 55, 0,
0, 12, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
86, 5, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 0, 0, 54, 0,
0, 5, 130, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
56, 0, 0, 7, 242, 32,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
2, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 6, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 2, 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,
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, 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, 192, 1,
0, 0, 1, 0, 0, 0,
72, 0, 0, 0, 1, 0,
0, 0, 28, 0, 0, 0,
0, 4, 255, 255, 0, 1,
0, 0, 149, 1, 0, 0,
60, 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, 67, 111, 110, 115,
116, 97, 110, 116, 115, 0,
171, 171, 60, 0, 0, 0,
8, 0, 0, 0, 96, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 32, 1, 0, 0,
0, 0, 0, 0, 4, 0,
0, 0, 2, 0, 0, 0,
48, 1, 0, 0, 0, 0,
0, 0, 64, 1, 0, 0,
4, 0, 0, 0, 4, 0,
0, 0, 2, 0, 0, 0,
48, 1, 0, 0, 0, 0,
0, 0, 79, 1, 0, 0,
8, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
48, 1, 0, 0, 0, 0,
0, 0, 94, 1, 0, 0,
12, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
48, 1, 0, 0, 0, 0,
0, 0, 101, 1, 0, 0,
16, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
112, 1, 0, 0, 0, 0,
0, 0, 128, 1, 0, 0,
32, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
112, 1, 0, 0, 0, 0,
0, 0, 135, 1, 0, 0,
48, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
112, 1, 0, 0, 0, 0,
0, 0, 142, 1, 0, 0,
64, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
112, 1, 0, 0, 0, 0,
0, 0, 115, 99, 82, 71,
66, 95, 111, 117, 116, 112,
117, 116, 0, 171, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 83, 68,
82, 95, 119, 104, 105, 116,
101, 108, 101, 118, 101, 108,
0, 72, 68, 82, 95, 119,
104, 105, 116, 101, 108, 101,
118, 101, 108, 0, 109, 97,
120, 67, 76, 76, 0, 89,
111, 102, 102, 115, 101, 116,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
0, 0, 0, 0, 0, 0,
0, 0, 82, 99, 111, 101,
102, 102, 0, 71, 99, 111,
101, 102, 102, 0, 66, 99,
111, 101, 102, 102, 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, 49, 48,
46, 49, 0, 171, 171, 171,
73, 83, 71, 78, 108, 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,
3, 0, 0, 0, 101, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 15, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84,
73, 79, 78, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 171, 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, 65, 82,
71, 69, 84, 0, 171, 171
};

View File

@@ -1,11 +1,7 @@
struct PixelShaderInput
{ #include "D3D11_PixelShader_Common.incl"
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
float4 main(PixelShaderInput input) : SV_TARGET float4 main(PixelShaderInput input) : SV_TARGET
{ {
return input.color; return GetOutputColor(1.0) * input.color;
} }

View File

@@ -0,0 +1,75 @@
struct PixelShaderInput
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
cbuffer Constants : register(b0)
{
float scRGB_output;
float SDR_whitelevel;
float HDR_whitelevel;
float maxCLL;
float4 Yoffset;
float4 Rcoeff;
float4 Gcoeff;
float4 Bcoeff;
};
float3 scRGBtoNits(float3 v)
{
return v * 80.0;
}
float3 scRGBfromNits(float3 v)
{
return v / 80.0;
}
float sRGBtoLinear(float v)
{
if (v <= 0.04045) {
v = (v / 12.92);
} else {
v = pow(abs(v + 0.055) / 1.055, 2.4);
}
return v;
}
float sRGBfromLinear(float v)
{
if (v <= 0.0031308) {
v = (v * 12.92);
} else {
v = (pow(abs(v), 1.0 / 2.4) * 1.055 - 0.055);
}
return v;
}
float4 GetOutputColor(float4 rgba)
{
if (scRGB_output) {
rgba.rgb = scRGBfromNits(rgba.rgb * SDR_whitelevel);
}
return rgba;
}
float4 GetOutputColorFromSRGB(float3 rgb)
{
float4 output;
if (scRGB_output) {
output.r = sRGBtoLinear(rgb.r);
output.g = sRGBtoLinear(rgb.g);
output.b = sRGBtoLinear(rgb.b);
rgb = scRGBfromNits(rgb * SDR_whitelevel);
} else {
output.rgb = rgb.rgb;
}
output.a = 1.0;
return output;
}

1030
src/render/direct3d11/D3D11_PixelShader_HDR10.h Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,41 +2,7 @@ Texture2D theTextureY : register(t0);
Texture2D theTextureUV : register(t1); Texture2D theTextureUV : register(t1);
SamplerState theSampler : register(s0); SamplerState theSampler : register(s0);
struct PixelShaderInput #include "D3D11_PixelShader_Common.incl"
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
cbuffer Constants : register(b0)
{
float4 Yoffset;
float4 Rcoeff;
float4 Gcoeff;
float4 Bcoeff;
float scRGB_output;
float SDR_whitelevel;
float HDR_whitelevel;
float maxCLL;
};
float3 scRGBfromNits(float3 v)
{
return v / 80.0;
}
float sRGBfromLinear(float v)
{
if (v <= 0.0031308) {
v = (v * 12.92);
} else {
v = (pow(abs(v), 1.0 / 2.4) * 1.055 - 0.055);
}
return v;
}
float3 PQtoNits(float3 v) float3 PQtoNits(float3 v)
{ {
@@ -58,6 +24,7 @@ float4 main(PixelShaderInput input) : SV_TARGET
-0.124547, 1.132895, -0.008348, -0.124547, 1.132895, -0.008348,
-0.018154, -0.100597, 1.118751 -0.018154, -0.100597, 1.118751
}; };
float4 Output;
float3 yuv; float3 yuv;
yuv.x = theTextureY.Sample(theSampler, input.tex).r; yuv.x = theTextureY.Sample(theSampler, input.tex).r;
@@ -84,9 +51,8 @@ float4 main(PixelShaderInput input) : SV_TARGET
rgb.rgb = clamp(rgb.rgb, 0.0, 1.0); rgb.rgb = clamp(rgb.rgb, 0.0, 1.0);
} }
float4 Output;
Output.rgb = rgb.rgb; Output.rgb = rgb.rgb;
Output.a = 1.0f; Output.a = 1.0;
return Output * input.color; return Output * input.color;
} }

884
src/render/direct3d11/D3D11_PixelShader_NV12.h Executable file → Normal file
View File

@@ -1,347 +1,537 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// Buffer Definitions: // Buffer Definitions:
// //
// cbuffer Constants // cbuffer Constants
// { // {
// //
// float4 Yoffset; // Offset: 0 Size: 16 // float scRGB_output; // Offset: 0 Size: 4
// float4 Rcoeff; // Offset: 16 Size: 16 // float SDR_whitelevel; // Offset: 4 Size: 4 [unused]
// float4 Gcoeff; // Offset: 32 Size: 16 // float HDR_whitelevel; // Offset: 8 Size: 4 [unused]
// float4 Bcoeff; // Offset: 48 Size: 16 // float maxCLL; // Offset: 12 Size: 4 [unused]
// // float4 Yoffset; // Offset: 16 Size: 16
// } // float4 Rcoeff; // Offset: 32 Size: 16
// // float4 Gcoeff; // Offset: 48 Size: 16
// // float4 Bcoeff; // Offset: 64 Size: 16
// Resource Bindings: //
// // }
// Name Type Format Dim HLSL Bind Count //
// ------------------------------ ---------- ------- ----------- -------------- ------ //
// theSampler sampler NA NA s0 1 // Resource Bindings:
// theTextureY texture float4 2d t0 1 //
// theTextureUV texture float4 2d t1 1 // Name Type Format Dim HLSL Bind Count
// Constants cbuffer NA NA cb0 1 // ------------------------------ ---------- ------- ----------- -------------- ------
// // theSampler sampler NA NA s0 1
// // theTextureY texture float4 2d t0 1
// // theTextureUV texture float4 2d t1 1
// Input signature: // Constants cbuffer NA NA cb0 1
// //
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_POSITION 0 xyzw 0 POS float // Input signature:
// TEXCOORD 0 xy 1 NONE float xy //
// COLOR 0 xyzw 2 NONE float xyzw // Name Index Mask Register SysValue Format Used
// // -------------------- ----- ------ -------- -------- ------- ------
// // SV_POSITION 0 xyzw 0 POS float
// Output signature: // TEXCOORD 0 xy 1 NONE float xy
// // COLOR 0 xyzw 2 NONE float xyzw
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_TARGET 0 xyzw 0 TARGET float xyzw // Output signature:
// //
// // Name Index Mask Register SysValue Format Used
// Constant buffer to DX9 shader constant mappings: // -------------------- ----- ------ -------- -------- ------- ------
// // SV_TARGET 0 xyzw 0 TARGET float xyzw
// Target Reg Buffer Start Reg # of Regs Data Conversion //
// ---------- ------- --------- --------- ---------------------- //
// c0 cb0 0 4 ( FLT, FLT, FLT, FLT) // Constant buffer to DX9 shader constant mappings:
// //
// // Target Reg Buffer Start Reg # of Regs Data Conversion
// Sampler/Resource to DX9 shader sampler mappings: // ---------- ------- --------- --------- ----------------------
// // c0 cb0 0 5 ( FLT, FLT, FLT, FLT)
// Target Sampler Source Sampler Source Resource //
// -------------- --------------- ---------------- //
// s0 s0 t0 // Sampler/Resource to DX9 shader sampler mappings:
// s1 s0 t1 //
// // Target Sampler Source Sampler Source Resource
// // -------------- --------------- ----------------
// Level9 shader bytecode: // s0 s0 t0
// // s1 s0 t1
ps_2_0 //
def c4, 1, 0, 0, 0 //
dcl t0.xy // Level9 shader bytecode:
dcl t1 //
dcl_2d s0 ps_2_0
dcl_2d s1 def c5, 0.0404499993, 0.0773993805, 0.0549999997, 0.947867334
texld r0, t0, s0 def c6, 2.4000001, 1, 0, 0
texld r1, t0, s1 dcl t0.xy
mov r0.yz, r1.zxyw dcl t1
add r0.xyz, r0, c0 dcl_2d s0
dp3 r1.x, r0, c1 dcl_2d s1
dp3 r1.y, r0, c2 texld r0, t0, s0
dp3 r1.z, r0, c3 texld r1, t0, s1
mov r1.w, c4.x mov r0.yz, r1.zxyw
mul r0, r1, t1 add r0.xyz, r0, c1
mov oC0, r0 dp3 r1.x, r0, c2
add r0.w, r1.x, c5.z
// approximately 10 instruction slots used (2 texture, 8 arithmetic) abs r0.w, r0.w
ps_4_0 mul r0.w, r0.w, c5.w
dcl_constantbuffer CB0[4], immediateIndexed pow r1.w, r0.w, c6.x
dcl_sampler s0, mode_default add r0.w, -r1.x, c5.x
dcl_resource_texture2d (float,float,float,float) t0 mul r2.w, r1.x, c5.y
dcl_resource_texture2d (float,float,float,float) t1 cmp r2.x, r0.w, r2.w, r1.w
dcl_input_ps linear v1.xy dp3 r1.y, r0, c3
dcl_input_ps linear v2.xyzw dp3 r1.z, r0, c4
dcl_output o0.xyzw add r1.w, r1.y, c5.z
dcl_temps 2 abs r1.w, r1.w
sample r0.xyzw, v1.xyxx, t0.xyzw, s0 mul r1.w, r1.w, c5.w
sample r1.xyzw, v1.xyxx, t1.xyzw, s0 pow r2.w, r1.w, c6.x
mov r0.yz, r1.xxyx add r1.w, -r1.y, c5.x
add r0.xyz, r0.xyzx, cb0[0].xyzx mul r0.x, r1.y, c5.y
dp3 r1.x, r0.xyzx, cb0[1].xyzx cmp r2.y, r1.w, r0.x, r2.w
dp3 r1.y, r0.xyzx, cb0[2].xyzx add r1.w, r1.z, c5.z
dp3 r1.z, r0.xyzx, cb0[3].xyzx abs r1.w, r1.w
mov r1.w, l(1.000000) mul r1.w, r1.w, c5.w
mul o0.xyzw, r1.xyzw, v2.xyzw pow r2.w, r1.w, c6.x
ret add r1.w, -r1.z, c5.x
// Approximately 10 instruction slots used mul r0.x, r1.z, c5.y
#endif cmp r2.z, r1.w, r0.x, r2.w
mul r1.w, c0.x, c0.x
const BYTE g_main[] = cmp r0.xyz, -r1.w, r1, r2
{ mov r0.w, c6.y
68, 88, 66, 67, 141, 213, mul r0, r0, t1
118, 74, 78, 95, 162, 4, mov oC0, r0
201, 30, 199, 78, 91, 203,
113, 9, 1, 0, 0, 0, // approximately 39 instruction slots used (2 texture, 37 arithmetic)
172, 5, 0, 0, 6, 0, ps_4_0
0, 0, 56, 0, 0, 0, dcl_constantbuffer CB0[5], immediateIndexed
92, 1, 0, 0, 228, 2, dcl_sampler s0, mode_default
0, 0, 96, 3, 0, 0, dcl_resource_texture2d (float,float,float,float) t0
4, 5, 0, 0, 120, 5, dcl_resource_texture2d (float,float,float,float) t1
0, 0, 65, 111, 110, 57, dcl_input_ps linear v1.xy
28, 1, 0, 0, 28, 1, dcl_input_ps linear v2.xyzw
0, 0, 0, 2, 255, 255, dcl_output o0.xyzw
228, 0, 0, 0, 56, 0, dcl_temps 4
0, 0, 1, 0, 44, 0, sample r0.xyzw, v1.xyxx, t0.xyzw, s0
0, 0, 56, 0, 0, 0, sample r1.xyzw, v1.xyxx, t1.zxyw, s0
56, 0, 2, 0, 36, 0, mov r1.x, r0.x
0, 0, 56, 0, 0, 0, add r0.xyz, r1.xyzx, cb0[1].xyzx
0, 0, 1, 0, 1, 0, dp3 r1.x, r0.xyzx, cb0[2].xyzx
0, 0, 0, 0, 4, 0, dp3 r1.y, r0.xyzx, cb0[3].xyzx
0, 0, 0, 0, 0, 0, dp3 r1.z, r0.xyzx, cb0[4].xyzx
0, 2, 255, 255, 81, 0, ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x
0, 5, 4, 0, 15, 160, if_nz r0.x
0, 0, 128, 63, 0, 0, ge r0.xyz, l(0.040450, 0.040450, 0.040450, 0.000000), r1.xyzx
0, 0, 0, 0, 0, 0, mul r2.xyz, r1.xyzx, l(0.077399, 0.077399, 0.077399, 0.000000)
0, 0, 0, 0, 31, 0, add r3.xyz, r1.xyzx, l(0.055000, 0.055000, 0.055000, 0.000000)
0, 2, 0, 0, 0, 128, mul r3.xyz, |r3.xyzx|, l(0.947867, 0.947867, 0.947867, 0.000000)
0, 0, 3, 176, 31, 0, log r3.xyz, r3.xyzx
0, 2, 0, 0, 0, 128, mul r3.xyz, r3.xyzx, l(2.400000, 2.400000, 2.400000, 0.000000)
1, 0, 15, 176, 31, 0, exp r3.xyz, r3.xyzx
0, 2, 0, 0, 0, 144, movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx
0, 8, 15, 160, 31, 0, endif
0, 2, 0, 0, 0, 144, mov r1.w, l(1.000000)
1, 8, 15, 160, 66, 0, mul o0.xyzw, r1.xyzw, v2.xyzw
0, 3, 0, 0, 15, 128, ret
0, 0, 228, 176, 0, 8, // Approximately 21 instruction slots used
228, 160, 66, 0, 0, 3, #endif
1, 0, 15, 128, 0, 0,
228, 176, 1, 8, 228, 160, const BYTE g_main[] =
1, 0, 0, 2, 0, 0, {
6, 128, 1, 0, 210, 128, 68, 88, 66, 67, 57, 206,
2, 0, 0, 3, 0, 0, 5, 226, 160, 185, 110, 25,
7, 128, 0, 0, 228, 128, 70, 167, 109, 22, 187, 226,
0, 0, 228, 160, 8, 0, 244, 122, 1, 0, 0, 0,
0, 3, 1, 0, 1, 128, 52, 9, 0, 0, 6, 0,
0, 0, 228, 128, 1, 0, 0, 0, 56, 0, 0, 0,
228, 160, 8, 0, 0, 3, 232, 2, 0, 0, 196, 5,
1, 0, 2, 128, 0, 0, 0, 0, 64, 6, 0, 0,
228, 128, 2, 0, 228, 160, 140, 8, 0, 0, 0, 9,
8, 0, 0, 3, 1, 0, 0, 0, 65, 111, 110, 57,
4, 128, 0, 0, 228, 128, 168, 2, 0, 0, 168, 2,
3, 0, 228, 160, 1, 0, 0, 0, 0, 2, 255, 255,
0, 2, 1, 0, 8, 128, 112, 2, 0, 0, 56, 0,
4, 0, 0, 160, 5, 0, 0, 0, 1, 0, 44, 0,
0, 3, 0, 0, 15, 128, 0, 0, 56, 0, 0, 0,
1, 0, 228, 128, 1, 0, 56, 0, 2, 0, 36, 0,
228, 176, 1, 0, 0, 2, 0, 0, 56, 0, 0, 0,
0, 8, 15, 128, 0, 0, 0, 0, 1, 0, 1, 0,
228, 128, 255, 255, 0, 0, 0, 0, 0, 0, 5, 0,
83, 72, 68, 82, 128, 1, 0, 0, 0, 0, 0, 0,
0, 0, 64, 0, 0, 0, 0, 2, 255, 255, 81, 0,
96, 0, 0, 0, 89, 0, 0, 5, 5, 0, 15, 160,
0, 4, 70, 142, 32, 0, 230, 174, 37, 61, 145, 131,
0, 0, 0, 0, 4, 0, 158, 61, 174, 71, 97, 61,
0, 0, 90, 0, 0, 3, 111, 167, 114, 63, 81, 0,
0, 96, 16, 0, 0, 0, 0, 5, 6, 0, 15, 160,
0, 0, 88, 24, 0, 4, 154, 153, 25, 64, 0, 0,
0, 112, 16, 0, 0, 0, 128, 63, 0, 0, 0, 0,
0, 0, 85, 85, 0, 0, 0, 0, 0, 0, 31, 0,
88, 24, 0, 4, 0, 112, 0, 2, 0, 0, 0, 128,
16, 0, 1, 0, 0, 0, 0, 0, 3, 176, 31, 0,
85, 85, 0, 0, 98, 16, 0, 2, 0, 0, 0, 128,
0, 3, 50, 16, 16, 0, 1, 0, 15, 176, 31, 0,
1, 0, 0, 0, 98, 16, 0, 2, 0, 0, 0, 144,
0, 3, 242, 16, 16, 0, 0, 8, 15, 160, 31, 0,
2, 0, 0, 0, 101, 0, 0, 2, 0, 0, 0, 144,
0, 3, 242, 32, 16, 0, 1, 8, 15, 160, 66, 0,
0, 0, 0, 0, 104, 0, 0, 3, 0, 0, 15, 128,
0, 2, 2, 0, 0, 0, 0, 0, 228, 176, 0, 8,
69, 0, 0, 9, 242, 0, 228, 160, 66, 0, 0, 3,
16, 0, 0, 0, 0, 0, 1, 0, 15, 128, 0, 0,
70, 16, 16, 0, 1, 0, 228, 176, 1, 8, 228, 160,
0, 0, 70, 126, 16, 0, 1, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 96, 6, 128, 1, 0, 210, 128,
16, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0,
69, 0, 0, 9, 242, 0, 7, 128, 0, 0, 228, 128,
16, 0, 1, 0, 0, 0, 1, 0, 228, 160, 8, 0,
70, 16, 16, 0, 1, 0, 0, 3, 1, 0, 1, 128,
0, 0, 70, 126, 16, 0, 0, 0, 228, 128, 2, 0,
1, 0, 0, 0, 0, 96, 228, 160, 2, 0, 0, 3,
16, 0, 0, 0, 0, 0, 0, 0, 8, 128, 1, 0,
54, 0, 0, 5, 98, 0, 0, 128, 5, 0, 170, 160,
16, 0, 0, 0, 0, 0, 35, 0, 0, 2, 0, 0,
6, 1, 16, 0, 1, 0, 8, 128, 0, 0, 255, 128,
0, 0, 0, 0, 0, 8, 5, 0, 0, 3, 0, 0,
114, 0, 16, 0, 0, 0, 8, 128, 0, 0, 255, 128,
0, 0, 70, 2, 16, 0, 5, 0, 255, 160, 32, 0,
0, 0, 0, 0, 70, 130, 0, 3, 1, 0, 8, 128,
32, 0, 0, 0, 0, 0, 0, 0, 255, 128, 6, 0,
0, 0, 0, 0, 16, 0, 0, 160, 2, 0, 0, 3,
0, 8, 18, 0, 16, 0, 0, 0, 8, 128, 1, 0,
1, 0, 0, 0, 70, 2, 0, 129, 5, 0, 0, 160,
16, 0, 0, 0, 0, 0, 5, 0, 0, 3, 2, 0,
70, 130, 32, 0, 0, 0, 8, 128, 1, 0, 0, 128,
0, 0, 1, 0, 0, 0, 5, 0, 85, 160, 88, 0,
16, 0, 0, 8, 34, 0, 0, 4, 2, 0, 1, 128,
16, 0, 1, 0, 0, 0, 0, 0, 255, 128, 2, 0,
70, 2, 16, 0, 0, 0, 255, 128, 1, 0, 255, 128,
0, 0, 70, 130, 32, 0, 8, 0, 0, 3, 1, 0,
0, 0, 0, 0, 2, 0, 2, 128, 0, 0, 228, 128,
0, 0, 16, 0, 0, 8, 3, 0, 228, 160, 8, 0,
66, 0, 16, 0, 1, 0, 0, 3, 1, 0, 4, 128,
0, 0, 70, 2, 16, 0, 0, 0, 228, 128, 4, 0,
0, 0, 0, 0, 70, 130, 228, 160, 2, 0, 0, 3,
32, 0, 0, 0, 0, 0, 1, 0, 8, 128, 1, 0,
3, 0, 0, 0, 54, 0, 85, 128, 5, 0, 170, 160,
0, 5, 130, 0, 16, 0, 35, 0, 0, 2, 1, 0,
1, 0, 0, 0, 1, 64, 8, 128, 1, 0, 255, 128,
0, 0, 0, 0, 128, 63, 5, 0, 0, 3, 1, 0,
56, 0, 0, 7, 242, 32, 8, 128, 1, 0, 255, 128,
16, 0, 0, 0, 0, 0, 5, 0, 255, 160, 32, 0,
70, 14, 16, 0, 1, 0, 0, 3, 2, 0, 8, 128,
0, 0, 70, 30, 16, 0, 1, 0, 255, 128, 6, 0,
2, 0, 0, 0, 62, 0, 0, 160, 2, 0, 0, 3,
0, 1, 83, 84, 65, 84, 1, 0, 8, 128, 1, 0,
116, 0, 0, 0, 10, 0, 85, 129, 5, 0, 0, 160,
0, 0, 2, 0, 0, 0, 5, 0, 0, 3, 0, 0,
0, 0, 0, 0, 3, 0, 1, 128, 1, 0, 85, 128,
0, 0, 5, 0, 0, 0, 5, 0, 85, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 2, 128,
0, 0, 1, 0, 0, 0, 1, 0, 255, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 128, 2, 0, 255, 128,
0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 8, 128, 1, 0, 170, 128,
0, 0, 0, 0, 0, 0, 5, 0, 170, 160, 35, 0,
2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 8, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 128, 5, 0,
0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 8, 128,
0, 0, 2, 0, 0, 0, 1, 0, 255, 128, 5, 0,
0, 0, 0, 0, 0, 0, 255, 160, 32, 0, 0, 3,
0, 0, 0, 0, 0, 0, 2, 0, 8, 128, 1, 0,
0, 0, 0, 0, 0, 0, 255, 128, 6, 0, 0, 160,
0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 8, 128, 1, 0, 170, 129,
0, 0, 0, 0, 0, 0, 5, 0, 0, 160, 5, 0,
82, 68, 69, 70, 156, 1, 0, 3, 0, 0, 1, 128,
0, 0, 1, 0, 0, 0, 1, 0, 170, 128, 5, 0,
204, 0, 0, 0, 4, 0, 85, 160, 88, 0, 0, 4,
0, 0, 28, 0, 0, 0, 2, 0, 4, 128, 1, 0,
0, 4, 255, 255, 0, 1, 255, 128, 0, 0, 0, 128,
0, 0, 113, 1, 0, 0, 2, 0, 255, 128, 5, 0,
156, 0, 0, 0, 3, 0, 0, 3, 1, 0, 8, 128,
0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0,
0, 0, 0, 0, 0, 0, 0, 160, 88, 0, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 7, 128, 1, 0,
1, 0, 0, 0, 1, 0, 255, 129, 1, 0, 228, 128,
0, 0, 167, 0, 0, 0, 2, 0, 228, 128, 1, 0,
2, 0, 0, 0, 5, 0, 0, 2, 0, 0, 8, 128,
0, 0, 4, 0, 0, 0, 6, 0, 85, 160, 5, 0,
255, 255, 255, 255, 0, 0, 0, 3, 0, 0, 15, 128,
0, 0, 1, 0, 0, 0, 0, 0, 228, 128, 1, 0,
13, 0, 0, 0, 179, 0, 228, 176, 1, 0, 0, 2,
0, 0, 2, 0, 0, 0, 0, 8, 15, 128, 0, 0,
5, 0, 0, 0, 4, 0, 228, 128, 255, 255, 0, 0,
0, 0, 255, 255, 255, 255, 83, 72, 68, 82, 212, 2,
1, 0, 0, 0, 1, 0, 0, 0, 64, 0, 0, 0,
0, 0, 13, 0, 0, 0, 181, 0, 0, 0, 89, 0,
192, 0, 0, 0, 0, 0, 0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 88, 24, 0, 4,
0, 0, 116, 104, 101, 83, 0, 112, 16, 0, 0, 0,
97, 109, 112, 108, 101, 114, 0, 0, 85, 85, 0, 0,
0, 116, 104, 101, 84, 101, 88, 24, 0, 4, 0, 112,
120, 116, 117, 114, 101, 89, 16, 0, 1, 0, 0, 0,
0, 116, 104, 101, 84, 101, 85, 85, 0, 0, 98, 16,
120, 116, 117, 114, 101, 85, 0, 3, 50, 16, 16, 0,
86, 0, 67, 111, 110, 115, 1, 0, 0, 0, 98, 16,
116, 97, 110, 116, 115, 0, 0, 3, 242, 16, 16, 0,
171, 171, 192, 0, 0, 0, 2, 0, 0, 0, 101, 0,
4, 0, 0, 0, 228, 0, 0, 3, 242, 32, 16, 0,
0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0,
0, 0, 68, 1, 0, 0, 69, 0, 0, 9, 242, 0,
0, 0, 0, 0, 16, 0, 16, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 70, 16, 16, 0, 1, 0,
76, 1, 0, 0, 0, 0, 0, 0, 70, 126, 16, 0,
0, 0, 92, 1, 0, 0, 0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 16, 0, 16, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 69, 0, 0, 9, 242, 0,
76, 1, 0, 0, 0, 0, 16, 0, 1, 0, 0, 0,
0, 0, 99, 1, 0, 0, 70, 16, 16, 0, 1, 0,
32, 0, 0, 0, 16, 0, 0, 0, 38, 125, 16, 0,
0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 96,
76, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
0, 0, 106, 1, 0, 0, 54, 0, 0, 5, 18, 0,
48, 0, 0, 0, 16, 0, 16, 0, 1, 0, 0, 0,
0, 0, 2, 0, 0, 0, 10, 0, 16, 0, 0, 0,
76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
0, 0, 89, 111, 102, 102, 114, 0, 16, 0, 0, 0,
115, 101, 116, 0, 1, 0, 0, 0, 70, 2, 16, 0,
3, 0, 1, 0, 4, 0, 1, 0, 0, 0, 70, 130,
0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
0, 0, 82, 99, 111, 101, 1, 0, 0, 0, 16, 0,
102, 102, 0, 71, 99, 111, 0, 8, 18, 0, 16, 0,
101, 102, 102, 0, 66, 99, 1, 0, 0, 0, 70, 2,
111, 101, 102, 102, 0, 77, 16, 0, 0, 0, 0, 0,
105, 99, 114, 111, 115, 111, 70, 130, 32, 0, 0, 0,
102, 116, 32, 40, 82, 41, 0, 0, 2, 0, 0, 0,
32, 72, 76, 83, 76, 32, 16, 0, 0, 8, 34, 0,
83, 104, 97, 100, 101, 114, 16, 0, 1, 0, 0, 0,
32, 67, 111, 109, 112, 105, 70, 2, 16, 0, 0, 0,
108, 101, 114, 32, 49, 48, 0, 0, 70, 130, 32, 0,
46, 49, 0, 171, 171, 171, 0, 0, 0, 0, 3, 0,
73, 83, 71, 78, 108, 0, 0, 0, 16, 0, 0, 8,
0, 0, 3, 0, 0, 0, 66, 0, 16, 0, 1, 0,
8, 0, 0, 0, 80, 0, 0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 130,
1, 0, 0, 0, 3, 0, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 57, 0,
15, 0, 0, 0, 92, 0, 0, 11, 18, 0, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 3, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 10, 128, 32, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 31, 0, 4, 3, 10, 0,
15, 15, 0, 0, 83, 86, 16, 0, 0, 0, 0, 0,
95, 80, 79, 83, 73, 84, 29, 0, 0, 10, 114, 0,
73, 79, 78, 0, 84, 69, 16, 0, 0, 0, 0, 0,
88, 67, 79, 79, 82, 68, 2, 64, 0, 0, 230, 174,
0, 67, 79, 76, 79, 82, 37, 61, 230, 174, 37, 61,
0, 171, 79, 83, 71, 78, 230, 174, 37, 61, 0, 0,
44, 0, 0, 0, 1, 0, 0, 0, 70, 2, 16, 0,
0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 56, 0,
32, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 70, 2,
3, 0, 0, 0, 0, 0, 16, 0, 1, 0, 0, 0,
0, 0, 15, 0, 0, 0, 2, 64, 0, 0, 145, 131,
83, 86, 95, 84, 65, 82, 158, 61, 145, 131, 158, 61,
71, 69, 84, 0, 171, 171 145, 131, 158, 61, 0, 0,
}; 0, 0, 0, 0, 0, 10,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 174, 71, 97, 61,
174, 71, 97, 61, 174, 71,
97, 61, 0, 0, 0, 0,
56, 0, 0, 11, 114, 0,
16, 0, 3, 0, 0, 0,
70, 2, 16, 128, 129, 0,
0, 0, 3, 0, 0, 0,
2, 64, 0, 0, 111, 167,
114, 63, 111, 167, 114, 63,
111, 167, 114, 63, 0, 0,
0, 0, 47, 0, 0, 5,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 56, 0,
0, 10, 114, 0, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
2, 64, 0, 0, 154, 153,
25, 64, 154, 153, 25, 64,
154, 153, 25, 64, 0, 0,
0, 0, 25, 0, 0, 5,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 55, 0,
0, 9, 114, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 21, 0,
0, 1, 54, 0, 0, 5,
130, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 56, 0,
0, 7, 242, 32, 16, 0,
0, 0, 0, 0, 70, 14,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 2, 0,
0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0,
0, 0, 21, 0, 0, 0,
4, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
12, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 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, 2, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 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, 68, 2, 0, 0,
1, 0, 0, 0, 204, 0,
0, 0, 4, 0, 0, 0,
28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0,
25, 2, 0, 0, 156, 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,
167, 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, 179, 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, 192, 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,
116, 104, 101, 83, 97, 109,
112, 108, 101, 114, 0, 116,
104, 101, 84, 101, 120, 116,
117, 114, 101, 89, 0, 116,
104, 101, 84, 101, 120, 116,
117, 114, 101, 85, 86, 0,
67, 111, 110, 115, 116, 97,
110, 116, 115, 0, 171, 171,
192, 0, 0, 0, 8, 0,
0, 0, 228, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
164, 1, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 4, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
211, 1, 0, 0, 8, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
226, 1, 0, 0, 12, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
233, 1, 0, 0, 16, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
4, 2, 0, 0, 32, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
11, 2, 0, 0, 48, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
18, 2, 0, 0, 64, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
115, 99, 82, 71, 66, 95,
111, 117, 116, 112, 117, 116,
0, 171, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 83, 68, 82, 95,
119, 104, 105, 116, 101, 108,
101, 118, 101, 108, 0, 72,
68, 82, 95, 119, 104, 105,
116, 101, 108, 101, 118, 101,
108, 0, 109, 97, 120, 67,
76, 76, 0, 89, 111, 102,
102, 115, 101, 116, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0,
82, 99, 111, 101, 102, 102,
0, 71, 99, 111, 101, 102,
102, 0, 66, 99, 111, 101,
102, 102, 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, 49, 48, 46, 49,
0, 171, 171, 171, 73, 83,
71, 78, 108, 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, 3, 3,
0, 0, 101, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 15,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 67,
79, 76, 79, 82, 0, 171,
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, 65, 82, 71, 69,
84, 0, 171, 171
};

View File

@@ -2,21 +2,7 @@ Texture2D theTextureY : register(t0);
Texture2D theTextureUV : register(t1); Texture2D theTextureUV : register(t1);
SamplerState theSampler : register(s0); SamplerState theSampler : register(s0);
struct PixelShaderInput #include "D3D11_PixelShader_Common.incl"
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
cbuffer Constants : register(b0)
{
float4 Yoffset;
float4 Rcoeff;
float4 Gcoeff;
float4 Bcoeff;
};
float4 main(PixelShaderInput input) : SV_TARGET float4 main(PixelShaderInput input) : SV_TARGET
{ {
@@ -26,11 +12,11 @@ float4 main(PixelShaderInput input) : SV_TARGET
yuv.x = theTextureY.Sample(theSampler, input.tex).r; yuv.x = theTextureY.Sample(theSampler, input.tex).r;
yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg; yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
float3 rgb;
yuv += Yoffset.xyz; yuv += Yoffset.xyz;
Output.r = dot(yuv, Rcoeff.xyz); rgb.r = dot(yuv, Rcoeff.xyz);
Output.g = dot(yuv, Gcoeff.xyz); rgb.g = dot(yuv, Gcoeff.xyz);
Output.b = dot(yuv, Bcoeff.xyz); rgb.b = dot(yuv, Bcoeff.xyz);
Output.a = 1.0f;
return Output * input.color; return GetOutputColorFromSRGB(rgb) * input.color;
} }

890
src/render/direct3d11/D3D11_PixelShader_NV21.h Executable file → Normal file
View File

@@ -1,350 +1,540 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// Buffer Definitions: // Buffer Definitions:
// //
// cbuffer Constants // cbuffer Constants
// { // {
// //
// float4 Yoffset; // Offset: 0 Size: 16 // float scRGB_output; // Offset: 0 Size: 4
// float4 Rcoeff; // Offset: 16 Size: 16 // float SDR_whitelevel; // Offset: 4 Size: 4 [unused]
// float4 Gcoeff; // Offset: 32 Size: 16 // float HDR_whitelevel; // Offset: 8 Size: 4 [unused]
// float4 Bcoeff; // Offset: 48 Size: 16 // float maxCLL; // Offset: 12 Size: 4 [unused]
// // float4 Yoffset; // Offset: 16 Size: 16
// } // float4 Rcoeff; // Offset: 32 Size: 16
// // float4 Gcoeff; // Offset: 48 Size: 16
// // float4 Bcoeff; // Offset: 64 Size: 16
// Resource Bindings: //
// // }
// Name Type Format Dim HLSL Bind Count //
// ------------------------------ ---------- ------- ----------- -------------- ------ //
// theSampler sampler NA NA s0 1 // Resource Bindings:
// theTextureY texture float4 2d t0 1 //
// theTextureUV texture float4 2d t1 1 // Name Type Format Dim HLSL Bind Count
// Constants cbuffer NA NA cb0 1 // ------------------------------ ---------- ------- ----------- -------------- ------
// // theSampler sampler NA NA s0 1
// // theTextureY texture float4 2d t0 1
// // theTextureUV texture float4 2d t1 1
// Input signature: // Constants cbuffer NA NA cb0 1
// //
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_POSITION 0 xyzw 0 POS float // Input signature:
// TEXCOORD 0 xy 1 NONE float xy //
// COLOR 0 xyzw 2 NONE float xyzw // Name Index Mask Register SysValue Format Used
// // -------------------- ----- ------ -------- -------- ------- ------
// // SV_POSITION 0 xyzw 0 POS float
// Output signature: // TEXCOORD 0 xy 1 NONE float xy
// // COLOR 0 xyzw 2 NONE float xyzw
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_TARGET 0 xyzw 0 TARGET float xyzw // Output signature:
// //
// // Name Index Mask Register SysValue Format Used
// Constant buffer to DX9 shader constant mappings: // -------------------- ----- ------ -------- -------- ------- ------
// // SV_TARGET 0 xyzw 0 TARGET float xyzw
// Target Reg Buffer Start Reg # of Regs Data Conversion //
// ---------- ------- --------- --------- ---------------------- //
// c0 cb0 0 4 ( FLT, FLT, FLT, FLT) // Constant buffer to DX9 shader constant mappings:
// //
// // Target Reg Buffer Start Reg # of Regs Data Conversion
// Sampler/Resource to DX9 shader sampler mappings: // ---------- ------- --------- --------- ----------------------
// // c0 cb0 0 5 ( FLT, FLT, FLT, FLT)
// Target Sampler Source Sampler Source Resource //
// -------------- --------------- ---------------- //
// s0 s0 t0 // Sampler/Resource to DX9 shader sampler mappings:
// s1 s0 t1 //
// // Target Sampler Source Sampler Source Resource
// // -------------- --------------- ----------------
// Level9 shader bytecode: // s0 s0 t0
// // s1 s0 t1
ps_2_0 //
def c4, 1, 0, 0, 0 //
dcl t0.xy // Level9 shader bytecode:
dcl t1 //
dcl_2d s0 ps_2_0
dcl_2d s1 def c5, 0.0404499993, 0.0773993805, 0.0549999997, 0.947867334
texld r0, t0, s0 def c6, 2.4000001, 1, 0, 0
texld r1, t0, s1 dcl t0.xy
mov r0.y, r1.y dcl t1
mov r0.z, r1.x dcl_2d s0
add r0.xyz, r0, c0 dcl_2d s1
dp3 r1.x, r0, c1 texld r0, t0, s0
dp3 r1.y, r0, c2 texld r1, t0, s1
dp3 r1.z, r0, c3 mov r0.y, r1.y
mov r1.w, c4.x mov r0.z, r1.x
mul r0, r1, t1 add r0.xyz, r0, c1
mov oC0, r0 dp3 r1.x, r0, c2
add r0.w, r1.x, c5.z
// approximately 11 instruction slots used (2 texture, 9 arithmetic) abs r0.w, r0.w
ps_4_0 mul r0.w, r0.w, c5.w
dcl_constantbuffer CB0[4], immediateIndexed pow r1.w, r0.w, c6.x
dcl_sampler s0, mode_default add r0.w, -r1.x, c5.x
dcl_resource_texture2d (float,float,float,float) t0 mul r2.w, r1.x, c5.y
dcl_resource_texture2d (float,float,float,float) t1 cmp r2.x, r0.w, r2.w, r1.w
dcl_input_ps linear v1.xy dp3 r1.y, r0, c3
dcl_input_ps linear v2.xyzw dp3 r1.z, r0, c4
dcl_output o0.xyzw add r1.w, r1.y, c5.z
dcl_temps 2 abs r1.w, r1.w
sample r0.xyzw, v1.xyxx, t0.xyzw, s0 mul r1.w, r1.w, c5.w
sample r1.xyzw, v1.xyxx, t1.xyzw, s0 pow r2.w, r1.w, c6.x
mov r0.yz, r1.yyxy add r1.w, -r1.y, c5.x
add r0.xyz, r0.xyzx, cb0[0].xyzx mul r0.x, r1.y, c5.y
dp3 r1.x, r0.xyzx, cb0[1].xyzx cmp r2.y, r1.w, r0.x, r2.w
dp3 r1.y, r0.xyzx, cb0[2].xyzx add r1.w, r1.z, c5.z
dp3 r1.z, r0.xyzx, cb0[3].xyzx abs r1.w, r1.w
mov r1.w, l(1.000000) mul r1.w, r1.w, c5.w
mul o0.xyzw, r1.xyzw, v2.xyzw pow r2.w, r1.w, c6.x
ret add r1.w, -r1.z, c5.x
// Approximately 10 instruction slots used mul r0.x, r1.z, c5.y
#endif cmp r2.z, r1.w, r0.x, r2.w
mul r1.w, c0.x, c0.x
const BYTE g_main[] = cmp r0.xyz, -r1.w, r1, r2
{ mov r0.w, c6.y
68, 88, 66, 67, 142, 144, mul r0, r0, t1
79, 192, 175, 21, 0, 8, mov oC0, r0
7, 119, 219, 202, 53, 69,
174, 234, 1, 0, 0, 0, // approximately 40 instruction slots used (2 texture, 38 arithmetic)
184, 5, 0, 0, 6, 0, ps_4_0
0, 0, 56, 0, 0, 0, dcl_constantbuffer CB0[5], immediateIndexed
104, 1, 0, 0, 240, 2, dcl_sampler s0, mode_default
0, 0, 108, 3, 0, 0, dcl_resource_texture2d (float,float,float,float) t0
16, 5, 0, 0, 132, 5, dcl_resource_texture2d (float,float,float,float) t1
0, 0, 65, 111, 110, 57, dcl_input_ps linear v1.xy
40, 1, 0, 0, 40, 1, dcl_input_ps linear v2.xyzw
0, 0, 0, 2, 255, 255, dcl_output o0.xyzw
240, 0, 0, 0, 56, 0, dcl_temps 4
0, 0, 1, 0, 44, 0, sample r0.xyzw, v1.xyxx, t0.xyzw, s0
0, 0, 56, 0, 0, 0, sample r1.xyzw, v1.xyxx, t1.zyxw, s0
56, 0, 2, 0, 36, 0, mov r1.x, r0.x
0, 0, 56, 0, 0, 0, add r0.xyz, r1.xyzx, cb0[1].xyzx
0, 0, 1, 0, 1, 0, dp3 r1.x, r0.xyzx, cb0[2].xyzx
0, 0, 0, 0, 4, 0, dp3 r1.y, r0.xyzx, cb0[3].xyzx
0, 0, 0, 0, 0, 0, dp3 r1.z, r0.xyzx, cb0[4].xyzx
0, 2, 255, 255, 81, 0, ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x
0, 5, 4, 0, 15, 160, if_nz r0.x
0, 0, 128, 63, 0, 0, ge r0.xyz, l(0.040450, 0.040450, 0.040450, 0.000000), r1.xyzx
0, 0, 0, 0, 0, 0, mul r2.xyz, r1.xyzx, l(0.077399, 0.077399, 0.077399, 0.000000)
0, 0, 0, 0, 31, 0, add r3.xyz, r1.xyzx, l(0.055000, 0.055000, 0.055000, 0.000000)
0, 2, 0, 0, 0, 128, mul r3.xyz, |r3.xyzx|, l(0.947867, 0.947867, 0.947867, 0.000000)
0, 0, 3, 176, 31, 0, log r3.xyz, r3.xyzx
0, 2, 0, 0, 0, 128, mul r3.xyz, r3.xyzx, l(2.400000, 2.400000, 2.400000, 0.000000)
1, 0, 15, 176, 31, 0, exp r3.xyz, r3.xyzx
0, 2, 0, 0, 0, 144, movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx
0, 8, 15, 160, 31, 0, endif
0, 2, 0, 0, 0, 144, mov r1.w, l(1.000000)
1, 8, 15, 160, 66, 0, mul o0.xyzw, r1.xyzw, v2.xyzw
0, 3, 0, 0, 15, 128, ret
0, 0, 228, 176, 0, 8, // Approximately 21 instruction slots used
228, 160, 66, 0, 0, 3, #endif
1, 0, 15, 128, 0, 0,
228, 176, 1, 8, 228, 160, const BYTE g_main[] =
1, 0, 0, 2, 0, 0, {
2, 128, 1, 0, 85, 128, 68, 88, 66, 67, 103, 251,
1, 0, 0, 2, 0, 0, 56, 113, 174, 118, 96, 85,
4, 128, 1, 0, 0, 128, 191, 91, 87, 213, 153, 143,
2, 0, 0, 3, 0, 0, 217, 253, 1, 0, 0, 0,
7, 128, 0, 0, 228, 128, 64, 9, 0, 0, 6, 0,
0, 0, 228, 160, 8, 0, 0, 0, 56, 0, 0, 0,
0, 3, 1, 0, 1, 128, 244, 2, 0, 0, 208, 5,
0, 0, 228, 128, 1, 0, 0, 0, 76, 6, 0, 0,
228, 160, 8, 0, 0, 3, 152, 8, 0, 0, 12, 9,
1, 0, 2, 128, 0, 0, 0, 0, 65, 111, 110, 57,
228, 128, 2, 0, 228, 160, 180, 2, 0, 0, 180, 2,
8, 0, 0, 3, 1, 0, 0, 0, 0, 2, 255, 255,
4, 128, 0, 0, 228, 128, 124, 2, 0, 0, 56, 0,
3, 0, 228, 160, 1, 0, 0, 0, 1, 0, 44, 0,
0, 2, 1, 0, 8, 128, 0, 0, 56, 0, 0, 0,
4, 0, 0, 160, 5, 0, 56, 0, 2, 0, 36, 0,
0, 3, 0, 0, 15, 128, 0, 0, 56, 0, 0, 0,
1, 0, 228, 128, 1, 0, 0, 0, 1, 0, 1, 0,
228, 176, 1, 0, 0, 2, 0, 0, 0, 0, 5, 0,
0, 8, 15, 128, 0, 0, 0, 0, 0, 0, 0, 0,
228, 128, 255, 255, 0, 0, 0, 2, 255, 255, 81, 0,
83, 72, 68, 82, 128, 1, 0, 5, 5, 0, 15, 160,
0, 0, 64, 0, 0, 0, 230, 174, 37, 61, 145, 131,
96, 0, 0, 0, 89, 0, 158, 61, 174, 71, 97, 61,
0, 4, 70, 142, 32, 0, 111, 167, 114, 63, 81, 0,
0, 0, 0, 0, 4, 0, 0, 5, 6, 0, 15, 160,
0, 0, 90, 0, 0, 3, 154, 153, 25, 64, 0, 0,
0, 96, 16, 0, 0, 0, 128, 63, 0, 0, 0, 0,
0, 0, 88, 24, 0, 4, 0, 0, 0, 0, 31, 0,
0, 112, 16, 0, 0, 0, 0, 2, 0, 0, 0, 128,
0, 0, 85, 85, 0, 0, 0, 0, 3, 176, 31, 0,
88, 24, 0, 4, 0, 112, 0, 2, 0, 0, 0, 128,
16, 0, 1, 0, 0, 0, 1, 0, 15, 176, 31, 0,
85, 85, 0, 0, 98, 16, 0, 2, 0, 0, 0, 144,
0, 3, 50, 16, 16, 0, 0, 8, 15, 160, 31, 0,
1, 0, 0, 0, 98, 16, 0, 2, 0, 0, 0, 144,
0, 3, 242, 16, 16, 0, 1, 8, 15, 160, 66, 0,
2, 0, 0, 0, 101, 0, 0, 3, 0, 0, 15, 128,
0, 3, 242, 32, 16, 0, 0, 0, 228, 176, 0, 8,
0, 0, 0, 0, 104, 0, 228, 160, 66, 0, 0, 3,
0, 2, 2, 0, 0, 0, 1, 0, 15, 128, 0, 0,
69, 0, 0, 9, 242, 0, 228, 176, 1, 8, 228, 160,
16, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0,
70, 16, 16, 0, 1, 0, 2, 128, 1, 0, 85, 128,
0, 0, 70, 126, 16, 0, 1, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 96, 4, 128, 1, 0, 0, 128,
16, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0,
69, 0, 0, 9, 242, 0, 7, 128, 0, 0, 228, 128,
16, 0, 1, 0, 0, 0, 1, 0, 228, 160, 8, 0,
70, 16, 16, 0, 1, 0, 0, 3, 1, 0, 1, 128,
0, 0, 70, 126, 16, 0, 0, 0, 228, 128, 2, 0,
1, 0, 0, 0, 0, 96, 228, 160, 2, 0, 0, 3,
16, 0, 0, 0, 0, 0, 0, 0, 8, 128, 1, 0,
54, 0, 0, 5, 98, 0, 0, 128, 5, 0, 170, 160,
16, 0, 0, 0, 0, 0, 35, 0, 0, 2, 0, 0,
86, 4, 16, 0, 1, 0, 8, 128, 0, 0, 255, 128,
0, 0, 0, 0, 0, 8, 5, 0, 0, 3, 0, 0,
114, 0, 16, 0, 0, 0, 8, 128, 0, 0, 255, 128,
0, 0, 70, 2, 16, 0, 5, 0, 255, 160, 32, 0,
0, 0, 0, 0, 70, 130, 0, 3, 1, 0, 8, 128,
32, 0, 0, 0, 0, 0, 0, 0, 255, 128, 6, 0,
0, 0, 0, 0, 16, 0, 0, 160, 2, 0, 0, 3,
0, 8, 18, 0, 16, 0, 0, 0, 8, 128, 1, 0,
1, 0, 0, 0, 70, 2, 0, 129, 5, 0, 0, 160,
16, 0, 0, 0, 0, 0, 5, 0, 0, 3, 2, 0,
70, 130, 32, 0, 0, 0, 8, 128, 1, 0, 0, 128,
0, 0, 1, 0, 0, 0, 5, 0, 85, 160, 88, 0,
16, 0, 0, 8, 34, 0, 0, 4, 2, 0, 1, 128,
16, 0, 1, 0, 0, 0, 0, 0, 255, 128, 2, 0,
70, 2, 16, 0, 0, 0, 255, 128, 1, 0, 255, 128,
0, 0, 70, 130, 32, 0, 8, 0, 0, 3, 1, 0,
0, 0, 0, 0, 2, 0, 2, 128, 0, 0, 228, 128,
0, 0, 16, 0, 0, 8, 3, 0, 228, 160, 8, 0,
66, 0, 16, 0, 1, 0, 0, 3, 1, 0, 4, 128,
0, 0, 70, 2, 16, 0, 0, 0, 228, 128, 4, 0,
0, 0, 0, 0, 70, 130, 228, 160, 2, 0, 0, 3,
32, 0, 0, 0, 0, 0, 1, 0, 8, 128, 1, 0,
3, 0, 0, 0, 54, 0, 85, 128, 5, 0, 170, 160,
0, 5, 130, 0, 16, 0, 35, 0, 0, 2, 1, 0,
1, 0, 0, 0, 1, 64, 8, 128, 1, 0, 255, 128,
0, 0, 0, 0, 128, 63, 5, 0, 0, 3, 1, 0,
56, 0, 0, 7, 242, 32, 8, 128, 1, 0, 255, 128,
16, 0, 0, 0, 0, 0, 5, 0, 255, 160, 32, 0,
70, 14, 16, 0, 1, 0, 0, 3, 2, 0, 8, 128,
0, 0, 70, 30, 16, 0, 1, 0, 255, 128, 6, 0,
2, 0, 0, 0, 62, 0, 0, 160, 2, 0, 0, 3,
0, 1, 83, 84, 65, 84, 1, 0, 8, 128, 1, 0,
116, 0, 0, 0, 10, 0, 85, 129, 5, 0, 0, 160,
0, 0, 2, 0, 0, 0, 5, 0, 0, 3, 0, 0,
0, 0, 0, 0, 3, 0, 1, 128, 1, 0, 85, 128,
0, 0, 5, 0, 0, 0, 5, 0, 85, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 2, 128,
0, 0, 1, 0, 0, 0, 1, 0, 255, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 128, 2, 0, 255, 128,
0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 8, 128, 1, 0, 170, 128,
0, 0, 0, 0, 0, 0, 5, 0, 170, 160, 35, 0,
2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 8, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 128, 5, 0,
0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 8, 128,
0, 0, 2, 0, 0, 0, 1, 0, 255, 128, 5, 0,
0, 0, 0, 0, 0, 0, 255, 160, 32, 0, 0, 3,
0, 0, 0, 0, 0, 0, 2, 0, 8, 128, 1, 0,
0, 0, 0, 0, 0, 0, 255, 128, 6, 0, 0, 160,
0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 8, 128, 1, 0, 170, 129,
0, 0, 0, 0, 0, 0, 5, 0, 0, 160, 5, 0,
82, 68, 69, 70, 156, 1, 0, 3, 0, 0, 1, 128,
0, 0, 1, 0, 0, 0, 1, 0, 170, 128, 5, 0,
204, 0, 0, 0, 4, 0, 85, 160, 88, 0, 0, 4,
0, 0, 28, 0, 0, 0, 2, 0, 4, 128, 1, 0,
0, 4, 255, 255, 0, 1, 255, 128, 0, 0, 0, 128,
0, 0, 113, 1, 0, 0, 2, 0, 255, 128, 5, 0,
156, 0, 0, 0, 3, 0, 0, 3, 1, 0, 8, 128,
0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0,
0, 0, 0, 0, 0, 0, 0, 160, 88, 0, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 7, 128, 1, 0,
1, 0, 0, 0, 1, 0, 255, 129, 1, 0, 228, 128,
0, 0, 167, 0, 0, 0, 2, 0, 228, 128, 1, 0,
2, 0, 0, 0, 5, 0, 0, 2, 0, 0, 8, 128,
0, 0, 4, 0, 0, 0, 6, 0, 85, 160, 5, 0,
255, 255, 255, 255, 0, 0, 0, 3, 0, 0, 15, 128,
0, 0, 1, 0, 0, 0, 0, 0, 228, 128, 1, 0,
13, 0, 0, 0, 179, 0, 228, 176, 1, 0, 0, 2,
0, 0, 2, 0, 0, 0, 0, 8, 15, 128, 0, 0,
5, 0, 0, 0, 4, 0, 228, 128, 255, 255, 0, 0,
0, 0, 255, 255, 255, 255, 83, 72, 68, 82, 212, 2,
1, 0, 0, 0, 1, 0, 0, 0, 64, 0, 0, 0,
0, 0, 13, 0, 0, 0, 181, 0, 0, 0, 89, 0,
192, 0, 0, 0, 0, 0, 0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 88, 24, 0, 4,
0, 0, 116, 104, 101, 83, 0, 112, 16, 0, 0, 0,
97, 109, 112, 108, 101, 114, 0, 0, 85, 85, 0, 0,
0, 116, 104, 101, 84, 101, 88, 24, 0, 4, 0, 112,
120, 116, 117, 114, 101, 89, 16, 0, 1, 0, 0, 0,
0, 116, 104, 101, 84, 101, 85, 85, 0, 0, 98, 16,
120, 116, 117, 114, 101, 85, 0, 3, 50, 16, 16, 0,
86, 0, 67, 111, 110, 115, 1, 0, 0, 0, 98, 16,
116, 97, 110, 116, 115, 0, 0, 3, 242, 16, 16, 0,
171, 171, 192, 0, 0, 0, 2, 0, 0, 0, 101, 0,
4, 0, 0, 0, 228, 0, 0, 3, 242, 32, 16, 0,
0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0,
0, 0, 68, 1, 0, 0, 69, 0, 0, 9, 242, 0,
0, 0, 0, 0, 16, 0, 16, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 70, 16, 16, 0, 1, 0,
76, 1, 0, 0, 0, 0, 0, 0, 70, 126, 16, 0,
0, 0, 92, 1, 0, 0, 0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 16, 0, 16, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 69, 0, 0, 9, 242, 0,
76, 1, 0, 0, 0, 0, 16, 0, 1, 0, 0, 0,
0, 0, 99, 1, 0, 0, 70, 16, 16, 0, 1, 0,
32, 0, 0, 0, 16, 0, 0, 0, 102, 124, 16, 0,
0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 96,
76, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
0, 0, 106, 1, 0, 0, 54, 0, 0, 5, 18, 0,
48, 0, 0, 0, 16, 0, 16, 0, 1, 0, 0, 0,
0, 0, 2, 0, 0, 0, 10, 0, 16, 0, 0, 0,
76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
0, 0, 89, 111, 102, 102, 114, 0, 16, 0, 0, 0,
115, 101, 116, 0, 1, 0, 0, 0, 70, 2, 16, 0,
3, 0, 1, 0, 4, 0, 1, 0, 0, 0, 70, 130,
0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
0, 0, 82, 99, 111, 101, 1, 0, 0, 0, 16, 0,
102, 102, 0, 71, 99, 111, 0, 8, 18, 0, 16, 0,
101, 102, 102, 0, 66, 99, 1, 0, 0, 0, 70, 2,
111, 101, 102, 102, 0, 77, 16, 0, 0, 0, 0, 0,
105, 99, 114, 111, 115, 111, 70, 130, 32, 0, 0, 0,
102, 116, 32, 40, 82, 41, 0, 0, 2, 0, 0, 0,
32, 72, 76, 83, 76, 32, 16, 0, 0, 8, 34, 0,
83, 104, 97, 100, 101, 114, 16, 0, 1, 0, 0, 0,
32, 67, 111, 109, 112, 105, 70, 2, 16, 0, 0, 0,
108, 101, 114, 32, 49, 48, 0, 0, 70, 130, 32, 0,
46, 49, 0, 171, 171, 171, 0, 0, 0, 0, 3, 0,
73, 83, 71, 78, 108, 0, 0, 0, 16, 0, 0, 8,
0, 0, 3, 0, 0, 0, 66, 0, 16, 0, 1, 0,
8, 0, 0, 0, 80, 0, 0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 130,
1, 0, 0, 0, 3, 0, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 57, 0,
15, 0, 0, 0, 92, 0, 0, 11, 18, 0, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 3, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 10, 128, 32, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 31, 0, 4, 3, 10, 0,
15, 15, 0, 0, 83, 86, 16, 0, 0, 0, 0, 0,
95, 80, 79, 83, 73, 84, 29, 0, 0, 10, 114, 0,
73, 79, 78, 0, 84, 69, 16, 0, 0, 0, 0, 0,
88, 67, 79, 79, 82, 68, 2, 64, 0, 0, 230, 174,
0, 67, 79, 76, 79, 82, 37, 61, 230, 174, 37, 61,
0, 171, 79, 83, 71, 78, 230, 174, 37, 61, 0, 0,
44, 0, 0, 0, 1, 0, 0, 0, 70, 2, 16, 0,
0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 56, 0,
32, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 70, 2,
3, 0, 0, 0, 0, 0, 16, 0, 1, 0, 0, 0,
0, 0, 15, 0, 0, 0, 2, 64, 0, 0, 145, 131,
83, 86, 95, 84, 65, 82, 158, 61, 145, 131, 158, 61,
71, 69, 84, 0, 171, 171 145, 131, 158, 61, 0, 0,
}; 0, 0, 0, 0, 0, 10,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 174, 71, 97, 61,
174, 71, 97, 61, 174, 71,
97, 61, 0, 0, 0, 0,
56, 0, 0, 11, 114, 0,
16, 0, 3, 0, 0, 0,
70, 2, 16, 128, 129, 0,
0, 0, 3, 0, 0, 0,
2, 64, 0, 0, 111, 167,
114, 63, 111, 167, 114, 63,
111, 167, 114, 63, 0, 0,
0, 0, 47, 0, 0, 5,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 56, 0,
0, 10, 114, 0, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
2, 64, 0, 0, 154, 153,
25, 64, 154, 153, 25, 64,
154, 153, 25, 64, 0, 0,
0, 0, 25, 0, 0, 5,
114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 55, 0,
0, 9, 114, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 21, 0,
0, 1, 54, 0, 0, 5,
130, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 56, 0,
0, 7, 242, 32, 16, 0,
0, 0, 0, 0, 70, 14,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 2, 0,
0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0,
0, 0, 21, 0, 0, 0,
4, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
12, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 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, 2, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 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, 68, 2, 0, 0,
1, 0, 0, 0, 204, 0,
0, 0, 4, 0, 0, 0,
28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0,
25, 2, 0, 0, 156, 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,
167, 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, 179, 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, 192, 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,
116, 104, 101, 83, 97, 109,
112, 108, 101, 114, 0, 116,
104, 101, 84, 101, 120, 116,
117, 114, 101, 89, 0, 116,
104, 101, 84, 101, 120, 116,
117, 114, 101, 85, 86, 0,
67, 111, 110, 115, 116, 97,
110, 116, 115, 0, 171, 171,
192, 0, 0, 0, 8, 0,
0, 0, 228, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
164, 1, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 4, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
211, 1, 0, 0, 8, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
226, 1, 0, 0, 12, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 180, 1,
0, 0, 0, 0, 0, 0,
233, 1, 0, 0, 16, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
4, 2, 0, 0, 32, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
11, 2, 0, 0, 48, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
18, 2, 0, 0, 64, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 244, 1,
0, 0, 0, 0, 0, 0,
115, 99, 82, 71, 66, 95,
111, 117, 116, 112, 117, 116,
0, 171, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 83, 68, 82, 95,
119, 104, 105, 116, 101, 108,
101, 118, 101, 108, 0, 72,
68, 82, 95, 119, 104, 105,
116, 101, 108, 101, 118, 101,
108, 0, 109, 97, 120, 67,
76, 76, 0, 89, 111, 102,
102, 115, 101, 116, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0,
82, 99, 111, 101, 102, 102,
0, 71, 99, 111, 101, 102,
102, 0, 66, 99, 111, 101,
102, 102, 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, 49, 48, 46, 49,
0, 171, 171, 171, 73, 83,
71, 78, 108, 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, 3, 3,
0, 0, 101, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 15,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 67,
79, 76, 79, 82, 0, 171,
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, 65, 82, 71, 69,
84, 0, 171, 171
};

View File

@@ -2,21 +2,7 @@ Texture2D theTextureY : register(t0);
Texture2D theTextureUV : register(t1); Texture2D theTextureUV : register(t1);
SamplerState theSampler : register(s0); SamplerState theSampler : register(s0);
struct PixelShaderInput #include "D3D11_PixelShader_Common.incl"
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
cbuffer Constants : register(b0)
{
float4 Yoffset;
float4 Rcoeff;
float4 Gcoeff;
float4 Bcoeff;
};
float4 main(PixelShaderInput input) : SV_TARGET float4 main(PixelShaderInput input) : SV_TARGET
{ {
@@ -26,11 +12,11 @@ float4 main(PixelShaderInput input) : SV_TARGET
yuv.x = theTextureY.Sample(theSampler, input.tex).r; yuv.x = theTextureY.Sample(theSampler, input.tex).r;
yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr; yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
float3 rgb;
yuv += Yoffset.xyz; yuv += Yoffset.xyz;
Output.r = dot(yuv, Rcoeff.xyz); rgb.r = dot(yuv, Rcoeff.xyz);
Output.g = dot(yuv, Gcoeff.xyz); rgb.g = dot(yuv, Gcoeff.xyz);
Output.b = dot(yuv, Bcoeff.xyz); rgb.b = dot(yuv, Bcoeff.xyz);
Output.a = 1.0f;
return Output * input.color; return GetOutputColorFromSRGB(rgb) * input.color;
} }

539
src/render/direct3d11/D3D11_PixelShader_Textures.h Executable file → Normal file
View File

@@ -1,198 +1,341 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// Resource Bindings: // Buffer Definitions:
// //
// Name Type Format Dim HLSL Bind Count // cbuffer Constants
// ------------------------------ ---------- ------- ----------- -------------- ------ // {
// theSampler sampler NA NA s0 1 //
// theTexture texture float4 2d t0 1 // float scRGB_output; // Offset: 0 Size: 4
// // float SDR_whitelevel; // Offset: 4 Size: 4
// // float HDR_whitelevel; // Offset: 8 Size: 4 [unused]
// // float maxCLL; // Offset: 12 Size: 4 [unused]
// Input signature: // float4 Yoffset; // Offset: 16 Size: 16 [unused]
// // float4 Rcoeff; // Offset: 32 Size: 16 [unused]
// Name Index Mask Register SysValue Format Used // float4 Gcoeff; // Offset: 48 Size: 16 [unused]
// -------------------- ----- ------ -------- -------- ------- ------ // float4 Bcoeff; // Offset: 64 Size: 16 [unused]
// SV_POSITION 0 xyzw 0 POS float //
// TEXCOORD 0 xy 1 NONE float xy // }
// COLOR 0 xyzw 2 NONE float xyzw //
// //
// // Resource Bindings:
// Output signature: //
// // Name Type Format Dim HLSL Bind Count
// Name Index Mask Register SysValue Format Used // ------------------------------ ---------- ------- ----------- -------------- ------
// -------------------- ----- ------ -------- -------- ------- ------ // theSampler sampler NA NA s0 1
// SV_TARGET 0 xyzw 0 TARGET float xyzw // theTexture texture float4 2d t0 1
// // Constants cbuffer NA NA cb0 1
// //
// Sampler/Resource to DX9 shader sampler mappings: //
// //
// Target Sampler Source Sampler Source Resource // Input signature:
// -------------- --------------- ---------------- //
// s0 s0 t0 // Name Index Mask Register SysValue Format Used
// // -------------------- ----- ------ -------- -------- ------- ------
// // SV_POSITION 0 xyzw 0 POS float
// Level9 shader bytecode: // TEXCOORD 0 xy 1 NONE float xy
// // COLOR 0 xyzw 2 NONE float xyzw
ps_2_0 //
dcl t0.xy //
dcl t1 // Output signature:
dcl_2d s0 //
texld r0, t0, s0 // Name Index Mask Register SysValue Format Used
mul r0, r0, t1 // -------------------- ----- ------ -------- -------- ------- ------
mov oC0, r0 // SV_TARGET 0 xyzw 0 TARGET float xyzw
//
// approximately 3 instruction slots used (1 texture, 2 arithmetic) //
ps_4_0 // Constant buffer to DX9 shader constant mappings:
dcl_sampler s0, mode_default //
dcl_resource_texture2d (float,float,float,float) t0 // Target Reg Buffer Start Reg # of Regs Data Conversion
dcl_input_ps linear v1.xy // ---------- ------- --------- --------- ----------------------
dcl_input_ps linear v2.xyzw // c0 cb0 0 1 ( FLT, FLT, FLT, FLT)
dcl_output o0.xyzw //
dcl_temps 1 //
sample r0.xyzw, v1.xyxx, t0.xyzw, s0 // Sampler/Resource to DX9 shader sampler mappings:
mul o0.xyzw, r0.xyzw, v2.xyzw //
ret // Target Sampler Source Sampler Source Resource
// Approximately 3 instruction slots used // -------------- --------------- ----------------
#endif // s0 s0 t0
//
const BYTE g_main[] = //
{ // Level9 shader bytecode:
68, 88, 66, 67, 192, 209, //
41, 173, 243, 223, 145, 48, ps_2_0
186, 133, 149, 213, 4, 163, def c1, 0.0125000002, 0, 0, 0
174, 97, 1, 0, 0, 0, dcl t0.xy
36, 3, 0, 0, 6, 0, dcl t1
0, 0, 56, 0, 0, 0, dcl_2d s0
192, 0, 0, 0, 92, 1, texld r0, t0, s0
0, 0, 216, 1, 0, 0, mul r1.w, c0.x, c0.x
124, 2, 0, 0, 240, 2, mul r1.xyz, r0, c0.y
0, 0, 65, 111, 110, 57, mul r1.xyz, r1, c1.x
128, 0, 0, 0, 128, 0, cmp r0.xyz, -r1.w, r0, r1
0, 0, 0, 2, 255, 255, mul r0, r0, t1
88, 0, 0, 0, 40, 0, mov oC0, r0
0, 0, 0, 0, 40, 0,
0, 0, 40, 0, 0, 0, // approximately 7 instruction slots used (1 texture, 6 arithmetic)
40, 0, 1, 0, 36, 0, ps_4_0
0, 0, 40, 0, 0, 0, dcl_constantbuffer CB0[1], immediateIndexed
0, 0, 0, 2, 255, 255, dcl_sampler s0, mode_default
31, 0, 0, 2, 0, 0, dcl_resource_texture2d (float,float,float,float) t0
0, 128, 0, 0, 3, 176, dcl_input_ps linear v1.xy
31, 0, 0, 2, 0, 0, dcl_input_ps linear v2.xyzw
0, 128, 1, 0, 15, 176, dcl_output o0.xyzw
31, 0, 0, 2, 0, 0, dcl_temps 2
0, 144, 0, 8, 15, 160, ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x
66, 0, 0, 3, 0, 0, sample r1.xyzw, v1.xyxx, t0.xyzw, s0
15, 128, 0, 0, 228, 176, mul r0.yzw, r1.xxyz, cb0[0].yyyy
0, 8, 228, 160, 5, 0, mul r0.yzw, r0.yyzw, l(0.000000, 0.012500, 0.012500, 0.012500)
0, 3, 0, 0, 15, 128, movc r1.xyz, r0.xxxx, r0.yzwy, r1.xyzx
0, 0, 228, 128, 1, 0, mul o0.xyzw, r1.xyzw, v2.xyzw
228, 176, 1, 0, 0, 2, ret
0, 8, 15, 128, 0, 0, // Approximately 7 instruction slots used
228, 128, 255, 255, 0, 0, #endif
83, 72, 68, 82, 148, 0,
0, 0, 64, 0, 0, 0, const BYTE g_main[] =
37, 0, 0, 0, 90, 0, {
0, 3, 0, 96, 16, 0, 68, 88, 66, 67, 129, 29,
0, 0, 0, 0, 88, 24, 250, 77, 23, 118, 4, 254,
0, 4, 0, 112, 16, 0, 122, 59, 184, 144, 253, 202,
0, 0, 0, 0, 85, 85, 233, 166, 1, 0, 0, 0,
0, 0, 98, 16, 0, 3, 172, 5, 0, 0, 6, 0,
50, 16, 16, 0, 1, 0, 0, 0, 56, 0, 0, 0,
0, 0, 98, 16, 0, 3, 40, 1, 0, 0, 108, 2,
242, 16, 16, 0, 2, 0, 0, 0, 232, 2, 0, 0,
0, 0, 101, 0, 0, 3, 4, 5, 0, 0, 120, 5,
242, 32, 16, 0, 0, 0, 0, 0, 65, 111, 110, 57,
0, 0, 104, 0, 0, 2, 232, 0, 0, 0, 232, 0,
1, 0, 0, 0, 69, 0, 0, 0, 0, 2, 255, 255,
0, 9, 242, 0, 16, 0, 180, 0, 0, 0, 52, 0,
0, 0, 0, 0, 70, 16, 0, 0, 1, 0, 40, 0,
16, 0, 1, 0, 0, 0, 0, 0, 52, 0, 0, 0,
70, 126, 16, 0, 0, 0, 52, 0, 1, 0, 36, 0,
0, 0, 0, 96, 16, 0, 0, 0, 52, 0, 0, 0,
0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0,
0, 7, 242, 32, 16, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 70, 14, 0, 0, 0, 2, 255, 255,
16, 0, 0, 0, 0, 0, 81, 0, 0, 5, 1, 0,
70, 30, 16, 0, 2, 0, 15, 160, 205, 204, 76, 60,
0, 0, 62, 0, 0, 1, 0, 0, 0, 0, 0, 0,
83, 84, 65, 84, 116, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 31, 0, 0, 2, 0, 0,
1, 0, 0, 0, 0, 0, 0, 128, 0, 0, 3, 176,
0, 0, 3, 0, 0, 0, 31, 0, 0, 2, 0, 0,
1, 0, 0, 0, 0, 0, 0, 128, 1, 0, 15, 176,
0, 0, 0, 0, 0, 0, 31, 0, 0, 2, 0, 0,
1, 0, 0, 0, 0, 0, 0, 144, 0, 8, 15, 160,
0, 0, 0, 0, 0, 0, 66, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 15, 128, 0, 0, 228, 176,
0, 0, 0, 0, 0, 0, 0, 8, 228, 160, 5, 0,
0, 0, 0, 0, 1, 0, 0, 3, 1, 0, 8, 128,
0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0,
0, 0, 0, 0, 0, 0, 0, 160, 5, 0, 0, 3,
0, 0, 0, 0, 0, 0, 1, 0, 7, 128, 0, 0,
0, 0, 0, 0, 0, 0, 228, 128, 0, 0, 85, 160,
0, 0, 0, 0, 0, 0, 5, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 7, 128, 1, 0, 228, 128,
0, 0, 0, 0, 0, 0, 1, 0, 0, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 7, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 129, 0, 0,
0, 0, 0, 0, 82, 68, 228, 128, 1, 0, 228, 128,
69, 70, 156, 0, 0, 0, 5, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 15, 128, 0, 0, 228, 128,
0, 0, 2, 0, 0, 0, 1, 0, 228, 176, 1, 0,
28, 0, 0, 0, 0, 4, 0, 2, 0, 8, 15, 128,
255, 255, 0, 1, 0, 0, 0, 0, 228, 128, 255, 255,
114, 0, 0, 0, 92, 0, 0, 0, 83, 72, 68, 82,
0, 0, 3, 0, 0, 0, 60, 1, 0, 0, 64, 0,
0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0,
0, 0, 0, 0, 0, 0, 89, 0, 0, 4, 70, 142,
0, 0, 0, 0, 1, 0, 32, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 90, 0,
103, 0, 0, 0, 2, 0, 0, 3, 0, 96, 16, 0,
0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 88, 24,
4, 0, 0, 0, 255, 255, 0, 4, 0, 112, 16, 0,
255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 85, 85,
1, 0, 0, 0, 13, 0, 0, 0, 98, 16, 0, 3,
0, 0, 116, 104, 101, 83, 50, 16, 16, 0, 1, 0,
97, 109, 112, 108, 101, 114, 0, 0, 98, 16, 0, 3,
0, 116, 104, 101, 84, 101, 242, 16, 16, 0, 2, 0,
120, 116, 117, 114, 101, 0, 0, 0, 101, 0, 0, 3,
77, 105, 99, 114, 111, 115, 242, 32, 16, 0, 0, 0,
111, 102, 116, 32, 40, 82, 0, 0, 104, 0, 0, 2,
41, 32, 72, 76, 83, 76, 2, 0, 0, 0, 57, 0,
32, 83, 104, 97, 100, 101, 0, 11, 18, 0, 16, 0,
114, 32, 67, 111, 109, 112, 0, 0, 0, 0, 2, 64,
105, 108, 101, 114, 32, 49, 0, 0, 0, 0, 0, 0,
48, 46, 49, 0, 171, 171, 0, 0, 0, 0, 0, 0,
73, 83, 71, 78, 108, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 10, 128, 32, 0, 0, 0,
8, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 0,
1, 0, 0, 0, 3, 0, 16, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0,
15, 0, 0, 0, 92, 0, 0, 0, 70, 126, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
0, 0, 0, 0, 3, 0, 16, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 56, 0, 0, 8, 226, 0,
3, 3, 0, 0, 101, 0, 16, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 6, 9, 16, 0, 1, 0,
0, 0, 0, 0, 3, 0, 0, 0, 86, 133, 32, 0,
0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 83, 86, 0, 0, 56, 0, 0, 10,
95, 80, 79, 83, 73, 84, 226, 0, 16, 0, 0, 0,
73, 79, 78, 0, 84, 69, 0, 0, 86, 14, 16, 0,
88, 67, 79, 79, 82, 68, 0, 0, 0, 0, 2, 64,
0, 67, 79, 76, 79, 82, 0, 0, 0, 0, 0, 0,
0, 171, 79, 83, 71, 78, 205, 204, 76, 60, 205, 204,
44, 0, 0, 0, 1, 0, 76, 60, 205, 204, 76, 60,
0, 0, 8, 0, 0, 0, 55, 0, 0, 9, 114, 0,
32, 0, 0, 0, 0, 0, 16, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 150, 7, 16, 0,
0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 70, 2,
83, 86, 95, 84, 65, 82, 16, 0, 1, 0, 0, 0,
71, 69, 84, 0, 171, 171 56, 0, 0, 7, 242, 32,
}; 16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
2, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 7, 0,
0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 3, 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,
1, 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, 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, 20, 2,
0, 0, 1, 0, 0, 0,
156, 0, 0, 0, 3, 0,
0, 0, 28, 0, 0, 0,
0, 4, 255, 255, 0, 1,
0, 0, 233, 1, 0, 0,
124, 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, 135, 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, 146, 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,
116, 104, 101, 83, 97, 109,
112, 108, 101, 114, 0, 116,
104, 101, 84, 101, 120, 116,
117, 114, 101, 0, 67, 111,
110, 115, 116, 97, 110, 116,
115, 0, 146, 0, 0, 0,
8, 0, 0, 0, 180, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 116, 1, 0, 0,
0, 0, 0, 0, 4, 0,
0, 0, 2, 0, 0, 0,
132, 1, 0, 0, 0, 0,
0, 0, 148, 1, 0, 0,
4, 0, 0, 0, 4, 0,
0, 0, 2, 0, 0, 0,
132, 1, 0, 0, 0, 0,
0, 0, 163, 1, 0, 0,
8, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
132, 1, 0, 0, 0, 0,
0, 0, 178, 1, 0, 0,
12, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
132, 1, 0, 0, 0, 0,
0, 0, 185, 1, 0, 0,
16, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 0, 0,
0, 0, 212, 1, 0, 0,
32, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 0, 0,
0, 0, 219, 1, 0, 0,
48, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 0, 0,
0, 0, 226, 1, 0, 0,
64, 0, 0, 0, 16, 0,
0, 0, 0, 0, 0, 0,
196, 1, 0, 0, 0, 0,
0, 0, 115, 99, 82, 71,
66, 95, 111, 117, 116, 112,
117, 116, 0, 171, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 83, 68,
82, 95, 119, 104, 105, 116,
101, 108, 101, 118, 101, 108,
0, 72, 68, 82, 95, 119,
104, 105, 116, 101, 108, 101,
118, 101, 108, 0, 109, 97,
120, 67, 76, 76, 0, 89,
111, 102, 102, 115, 101, 116,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
0, 0, 0, 0, 0, 0,
0, 0, 82, 99, 111, 101,
102, 102, 0, 71, 99, 111,
101, 102, 102, 0, 66, 99,
111, 101, 102, 102, 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, 49, 48,
46, 49, 0, 171, 171, 171,
73, 83, 71, 78, 108, 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,
3, 3, 0, 0, 101, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 15, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84,
73, 79, 78, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 171, 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, 65, 82,
71, 69, 84, 0, 171, 171
};

View File

@@ -1,14 +1,9 @@
Texture2D theTexture : register(t0); Texture2D theTexture : register(t0);
SamplerState theSampler : register(s0); SamplerState theSampler : register(s0);
struct PixelShaderInput #include "D3D11_PixelShader_Common.incl"
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
float4 main(PixelShaderInput input) : SV_TARGET float4 main(PixelShaderInput input) : SV_TARGET
{ {
return theTexture.Sample(theSampler, input.tex) * input.color; return GetOutputColor(theTexture.Sample(theSampler, input.tex)) * input.color;
} }

954
src/render/direct3d11/D3D11_PixelShader_YUV.h Executable file → Normal file
View File

@@ -1,382 +1,572 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// Buffer Definitions: // Buffer Definitions:
// //
// cbuffer Constants // cbuffer Constants
// { // {
// //
// float4 Yoffset; // Offset: 0 Size: 16 // float scRGB_output; // Offset: 0 Size: 4
// float4 Rcoeff; // Offset: 16 Size: 16 // float SDR_whitelevel; // Offset: 4 Size: 4 [unused]
// float4 Gcoeff; // Offset: 32 Size: 16 // float HDR_whitelevel; // Offset: 8 Size: 4 [unused]
// float4 Bcoeff; // Offset: 48 Size: 16 // float maxCLL; // Offset: 12 Size: 4 [unused]
// // float4 Yoffset; // Offset: 16 Size: 16
// } // float4 Rcoeff; // Offset: 32 Size: 16
// // float4 Gcoeff; // Offset: 48 Size: 16
// // float4 Bcoeff; // Offset: 64 Size: 16
// Resource Bindings: //
// // }
// Name Type Format Dim HLSL Bind Count //
// ------------------------------ ---------- ------- ----------- -------------- ------ //
// theSampler sampler NA NA s0 1 // Resource Bindings:
// theTextureY texture float4 2d t0 1 //
// theTextureU texture float4 2d t1 1 // Name Type Format Dim HLSL Bind Count
// theTextureV texture float4 2d t2 1 // ------------------------------ ---------- ------- ----------- -------------- ------
// Constants cbuffer NA NA cb0 1 // theSampler sampler NA NA s0 1
// // theTextureY texture float4 2d t0 1
// // theTextureU texture float4 2d t1 1
// // theTextureV texture float4 2d t2 1
// Input signature: // Constants cbuffer NA NA cb0 1
// //
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_POSITION 0 xyzw 0 POS float // Input signature:
// TEXCOORD 0 xy 1 NONE float xy //
// COLOR 0 xyzw 2 NONE float xyzw // Name Index Mask Register SysValue Format Used
// // -------------------- ----- ------ -------- -------- ------- ------
// // SV_POSITION 0 xyzw 0 POS float
// Output signature: // TEXCOORD 0 xy 1 NONE float xy
// // COLOR 0 xyzw 2 NONE float xyzw
// Name Index Mask Register SysValue Format Used //
// -------------------- ----- ------ -------- -------- ------- ------ //
// SV_TARGET 0 xyzw 0 TARGET float xyzw // Output signature:
// //
// // Name Index Mask Register SysValue Format Used
// Constant buffer to DX9 shader constant mappings: // -------------------- ----- ------ -------- -------- ------- ------
// // SV_TARGET 0 xyzw 0 TARGET float xyzw
// Target Reg Buffer Start Reg # of Regs Data Conversion //
// ---------- ------- --------- --------- ---------------------- //
// c0 cb0 0 4 ( FLT, FLT, FLT, FLT) // Constant buffer to DX9 shader constant mappings:
// //
// // Target Reg Buffer Start Reg # of Regs Data Conversion
// Sampler/Resource to DX9 shader sampler mappings: // ---------- ------- --------- --------- ----------------------
// // c0 cb0 0 5 ( FLT, FLT, FLT, FLT)
// Target Sampler Source Sampler Source Resource //
// -------------- --------------- ---------------- //
// s0 s0 t0 // Sampler/Resource to DX9 shader sampler mappings:
// s1 s0 t1 //
// s2 s0 t2 // Target Sampler Source Sampler Source Resource
// // -------------- --------------- ----------------
// // s0 s0 t0
// Level9 shader bytecode: // s1 s0 t1
// // s2 s0 t2
ps_2_0 //
def c4, 1, 0, 0, 0 //
dcl t0.xy // Level9 shader bytecode:
dcl t1 //
dcl_2d s0 ps_2_0
dcl_2d s1 def c5, 0.0404499993, 0.0773993805, 0.0549999997, 0.947867334
dcl_2d s2 def c6, 2.4000001, 1, 0, 0
texld r0, t0, s0 dcl t0.xy
texld r1, t0, s1 dcl t1
texld r2, t0, s2 dcl_2d s0
mov r0.y, r1.x dcl_2d s1
mov r0.z, r2.x dcl_2d s2
add r0.xyz, r0, c0 texld r0, t0, s0
dp3 r1.x, r0, c1 texld r1, t0, s1
dp3 r1.y, r0, c2 texld r2, t0, s2
dp3 r1.z, r0, c3 mov r0.y, r1.x
mov r1.w, c4.x mov r0.z, r2.x
mul r0, r1, t1 add r0.xyz, r0, c1
mov oC0, r0 dp3 r1.x, r0, c2
add r0.w, r1.x, c5.z
// approximately 12 instruction slots used (3 texture, 9 arithmetic) abs r0.w, r0.w
ps_4_0 mul r0.w, r0.w, c5.w
dcl_constantbuffer CB0[4], immediateIndexed pow r1.w, r0.w, c6.x
dcl_sampler s0, mode_default add r0.w, -r1.x, c5.x
dcl_resource_texture2d (float,float,float,float) t0 mul r2.x, r1.x, c5.y
dcl_resource_texture2d (float,float,float,float) t1 cmp r2.x, r0.w, r2.x, r1.w
dcl_resource_texture2d (float,float,float,float) t2 dp3 r1.y, r0, c3
dcl_input_ps linear v1.xy dp3 r1.z, r0, c4
dcl_input_ps linear v2.xyzw add r1.w, r1.y, c5.z
dcl_output o0.xyzw abs r1.w, r1.w
dcl_temps 2 mul r1.w, r1.w, c5.w
sample r0.xyzw, v1.xyxx, t0.xyzw, s0 pow r2.w, r1.w, c6.x
sample r1.xyzw, v1.xyxx, t1.xyzw, s0 add r1.w, -r1.y, c5.x
mov r0.y, r1.x mul r0.x, r1.y, c5.y
sample r1.xyzw, v1.xyxx, t2.xyzw, s0 cmp r2.y, r1.w, r0.x, r2.w
mov r0.z, r1.x add r1.w, r1.z, c5.z
add r0.xyz, r0.xyzx, cb0[0].xyzx abs r1.w, r1.w
dp3 r1.x, r0.xyzx, cb0[1].xyzx mul r1.w, r1.w, c5.w
dp3 r1.y, r0.xyzx, cb0[2].xyzx pow r2.w, r1.w, c6.x
dp3 r1.z, r0.xyzx, cb0[3].xyzx add r1.w, -r1.z, c5.x
mov r1.w, l(1.000000) mul r0.x, r1.z, c5.y
mul o0.xyzw, r1.xyzw, v2.xyzw cmp r2.z, r1.w, r0.x, r2.w
ret mul r1.w, c0.x, c0.x
// Approximately 12 instruction slots used cmp r0.xyz, -r1.w, r1, r2
#endif mov r0.w, c6.y
mul r0, r0, t1
const BYTE g_main[] = mov oC0, r0
{
68, 88, 66, 67, 17, 27, // approximately 41 instruction slots used (3 texture, 38 arithmetic)
202, 87, 93, 193, 186, 139, ps_4_0
251, 175, 168, 151, 229, 182, dcl_constantbuffer CB0[5], immediateIndexed
100, 211, 1, 0, 0, 0, dcl_sampler s0, mode_default
76, 6, 0, 0, 6, 0, dcl_resource_texture2d (float,float,float,float) t0
0, 0, 56, 0, 0, 0, dcl_resource_texture2d (float,float,float,float) t1
136, 1, 0, 0, 88, 3, dcl_resource_texture2d (float,float,float,float) t2
0, 0, 212, 3, 0, 0, dcl_input_ps linear v1.xy
164, 5, 0, 0, 24, 6, dcl_input_ps linear v2.xyzw
0, 0, 65, 111, 110, 57, dcl_output o0.xyzw
72, 1, 0, 0, 72, 1, dcl_temps 4
0, 0, 0, 2, 255, 255, sample r0.xyzw, v1.xyxx, t0.xyzw, s0
12, 1, 0, 0, 60, 0, sample r1.xyzw, v1.xyxx, t1.xyzw, s0
0, 0, 1, 0, 48, 0, sample r2.xyzw, v1.xyxx, t2.yzxw, s0
0, 0, 60, 0, 0, 0, mov r2.x, r0.x
60, 0, 3, 0, 36, 0, mov r2.y, r1.x
0, 0, 60, 0, 0, 0, add r0.xyz, r2.xyzx, cb0[1].xyzx
0, 0, 1, 0, 1, 0, dp3 r1.x, r0.xyzx, cb0[2].xyzx
2, 0, 2, 0, 0, 0, dp3 r1.y, r0.xyzx, cb0[3].xyzx
0, 0, 4, 0, 0, 0, dp3 r1.z, r0.xyzx, cb0[4].xyzx
0, 0, 0, 0, 0, 2, ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x
255, 255, 81, 0, 0, 5, if_nz r0.x
4, 0, 15, 160, 0, 0, ge r0.xyz, l(0.040450, 0.040450, 0.040450, 0.000000), r1.xyzx
128, 63, 0, 0, 0, 0, mul r2.xyz, r1.xyzx, l(0.077399, 0.077399, 0.077399, 0.000000)
0, 0, 0, 0, 0, 0, add r3.xyz, r1.xyzx, l(0.055000, 0.055000, 0.055000, 0.000000)
0, 0, 31, 0, 0, 2, mul r3.xyz, |r3.xyzx|, l(0.947867, 0.947867, 0.947867, 0.000000)
0, 0, 0, 128, 0, 0, log r3.xyz, r3.xyzx
3, 176, 31, 0, 0, 2, mul r3.xyz, r3.xyzx, l(2.400000, 2.400000, 2.400000, 0.000000)
0, 0, 0, 128, 1, 0, exp r3.xyz, r3.xyzx
15, 176, 31, 0, 0, 2, movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx
0, 0, 0, 144, 0, 8, endif
15, 160, 31, 0, 0, 2, mov r1.w, l(1.000000)
0, 0, 0, 144, 1, 8, mul o0.xyzw, r1.xyzw, v2.xyzw
15, 160, 31, 0, 0, 2, ret
0, 0, 0, 144, 2, 8, // Approximately 23 instruction slots used
15, 160, 66, 0, 0, 3, #endif
0, 0, 15, 128, 0, 0,
228, 176, 0, 8, 228, 160, const BYTE g_main[] =
66, 0, 0, 3, 1, 0, {
15, 128, 0, 0, 228, 176, 68, 88, 66, 67, 9, 92,
1, 8, 228, 160, 66, 0, 101, 235, 212, 83, 42, 215,
0, 3, 2, 0, 15, 128, 158, 193, 215, 73, 102, 13,
0, 0, 228, 176, 2, 8, 226, 183, 1, 0, 0, 0,
228, 160, 1, 0, 0, 2, 212, 9, 0, 0, 6, 0,
0, 0, 2, 128, 1, 0, 0, 0, 56, 0, 0, 0,
0, 128, 1, 0, 0, 2, 20, 3, 0, 0, 56, 6,
0, 0, 4, 128, 2, 0, 0, 0, 180, 6, 0, 0,
0, 128, 2, 0, 0, 3, 44, 9, 0, 0, 160, 9,
0, 0, 7, 128, 0, 0, 0, 0, 65, 111, 110, 57,
228, 128, 0, 0, 228, 160, 212, 2, 0, 0, 212, 2,
8, 0, 0, 3, 1, 0, 0, 0, 0, 2, 255, 255,
1, 128, 0, 0, 228, 128, 152, 2, 0, 0, 60, 0,
1, 0, 228, 160, 8, 0, 0, 0, 1, 0, 48, 0,
0, 3, 1, 0, 2, 128, 0, 0, 60, 0, 0, 0,
0, 0, 228, 128, 2, 0, 60, 0, 3, 0, 36, 0,
228, 160, 8, 0, 0, 3, 0, 0, 60, 0, 0, 0,
1, 0, 4, 128, 0, 0, 0, 0, 1, 0, 1, 0,
228, 128, 3, 0, 228, 160, 2, 0, 2, 0, 0, 0,
1, 0, 0, 2, 1, 0, 0, 0, 5, 0, 0, 0,
8, 128, 4, 0, 0, 160, 0, 0, 0, 0, 0, 2,
5, 0, 0, 3, 0, 0, 255, 255, 81, 0, 0, 5,
15, 128, 1, 0, 228, 128, 5, 0, 15, 160, 230, 174,
1, 0, 228, 176, 1, 0, 37, 61, 145, 131, 158, 61,
0, 2, 0, 8, 15, 128, 174, 71, 97, 61, 111, 167,
0, 0, 228, 128, 255, 255, 114, 63, 81, 0, 0, 5,
0, 0, 83, 72, 68, 82, 6, 0, 15, 160, 154, 153,
200, 1, 0, 0, 64, 0, 25, 64, 0, 0, 128, 63,
0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89, 0, 0, 4, 70, 142, 0, 0, 31, 0, 0, 2,
32, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0,
4, 0, 0, 0, 90, 0, 3, 176, 31, 0, 0, 2,
0, 3, 0, 96, 16, 0, 0, 0, 0, 128, 1, 0,
0, 0, 0, 0, 88, 24, 15, 176, 31, 0, 0, 2,
0, 4, 0, 112, 16, 0, 0, 0, 0, 144, 0, 8,
0, 0, 0, 0, 85, 85, 15, 160, 31, 0, 0, 2,
0, 0, 88, 24, 0, 4, 0, 0, 0, 144, 1, 8,
0, 112, 16, 0, 1, 0, 15, 160, 31, 0, 0, 2,
0, 0, 85, 85, 0, 0, 0, 0, 0, 144, 2, 8,
88, 24, 0, 4, 0, 112, 15, 160, 66, 0, 0, 3,
16, 0, 2, 0, 0, 0, 0, 0, 15, 128, 0, 0,
85, 85, 0, 0, 98, 16, 228, 176, 0, 8, 228, 160,
0, 3, 50, 16, 16, 0, 66, 0, 0, 3, 1, 0,
1, 0, 0, 0, 98, 16, 15, 128, 0, 0, 228, 176,
0, 3, 242, 16, 16, 0, 1, 8, 228, 160, 66, 0,
2, 0, 0, 0, 101, 0, 0, 3, 2, 0, 15, 128,
0, 3, 242, 32, 16, 0, 0, 0, 228, 176, 2, 8,
0, 0, 0, 0, 104, 0, 228, 160, 1, 0, 0, 2,
0, 2, 2, 0, 0, 0, 0, 0, 2, 128, 1, 0,
69, 0, 0, 9, 242, 0, 0, 128, 1, 0, 0, 2,
16, 0, 0, 0, 0, 0, 0, 0, 4, 128, 2, 0,
70, 16, 16, 0, 1, 0, 0, 128, 2, 0, 0, 3,
0, 0, 70, 126, 16, 0, 0, 0, 7, 128, 0, 0,
0, 0, 0, 0, 0, 96, 228, 128, 1, 0, 228, 160,
16, 0, 0, 0, 0, 0, 8, 0, 0, 3, 1, 0,
69, 0, 0, 9, 242, 0, 1, 128, 0, 0, 228, 128,
16, 0, 1, 0, 0, 0, 2, 0, 228, 160, 2, 0,
70, 16, 16, 0, 1, 0, 0, 3, 0, 0, 8, 128,
0, 0, 70, 126, 16, 0, 1, 0, 0, 128, 5, 0,
1, 0, 0, 0, 0, 96, 170, 160, 35, 0, 0, 2,
16, 0, 0, 0, 0, 0, 0, 0, 8, 128, 0, 0,
54, 0, 0, 5, 34, 0, 255, 128, 5, 0, 0, 3,
16, 0, 0, 0, 0, 0, 0, 0, 8, 128, 0, 0,
10, 0, 16, 0, 1, 0, 255, 128, 5, 0, 255, 160,
0, 0, 69, 0, 0, 9, 32, 0, 0, 3, 1, 0,
242, 0, 16, 0, 1, 0, 8, 128, 0, 0, 255, 128,
0, 0, 70, 16, 16, 0, 6, 0, 0, 160, 2, 0,
1, 0, 0, 0, 70, 126, 0, 3, 0, 0, 8, 128,
16, 0, 2, 0, 0, 0, 1, 0, 0, 129, 5, 0,
0, 96, 16, 0, 0, 0, 0, 160, 5, 0, 0, 3,
0, 0, 54, 0, 0, 5, 2, 0, 1, 128, 1, 0,
66, 0, 16, 0, 0, 0, 0, 128, 5, 0, 85, 160,
0, 0, 10, 0, 16, 0, 88, 0, 0, 4, 2, 0,
1, 0, 0, 0, 0, 0, 1, 128, 0, 0, 255, 128,
0, 8, 114, 0, 16, 0, 2, 0, 0, 128, 1, 0,
0, 0, 0, 0, 70, 2, 255, 128, 8, 0, 0, 3,
16, 0, 0, 0, 0, 0, 1, 0, 2, 128, 0, 0,
70, 130, 32, 0, 0, 0, 228, 128, 3, 0, 228, 160,
0, 0, 0, 0, 0, 0, 8, 0, 0, 3, 1, 0,
16, 0, 0, 8, 18, 0, 4, 128, 0, 0, 228, 128,
16, 0, 1, 0, 0, 0, 4, 0, 228, 160, 2, 0,
70, 2, 16, 0, 0, 0, 0, 3, 1, 0, 8, 128,
0, 0, 70, 130, 32, 0, 1, 0, 85, 128, 5, 0,
0, 0, 0, 0, 1, 0, 170, 160, 35, 0, 0, 2,
0, 0, 16, 0, 0, 8, 1, 0, 8, 128, 1, 0,
34, 0, 16, 0, 1, 0, 255, 128, 5, 0, 0, 3,
0, 0, 70, 2, 16, 0, 1, 0, 8, 128, 1, 0,
0, 0, 0, 0, 70, 130, 255, 128, 5, 0, 255, 160,
32, 0, 0, 0, 0, 0, 32, 0, 0, 3, 2, 0,
2, 0, 0, 0, 16, 0, 8, 128, 1, 0, 255, 128,
0, 8, 66, 0, 16, 0, 6, 0, 0, 160, 2, 0,
1, 0, 0, 0, 70, 2, 0, 3, 1, 0, 8, 128,
16, 0, 0, 0, 0, 0, 1, 0, 85, 129, 5, 0,
70, 130, 32, 0, 0, 0, 0, 160, 5, 0, 0, 3,
0, 0, 3, 0, 0, 0, 0, 0, 1, 128, 1, 0,
54, 0, 0, 5, 130, 0, 85, 128, 5, 0, 85, 160,
16, 0, 1, 0, 0, 0, 88, 0, 0, 4, 2, 0,
1, 64, 0, 0, 0, 0, 2, 128, 1, 0, 255, 128,
128, 63, 56, 0, 0, 7, 0, 0, 0, 128, 2, 0,
242, 32, 16, 0, 0, 0, 255, 128, 2, 0, 0, 3,
0, 0, 70, 14, 16, 0, 1, 0, 8, 128, 1, 0,
1, 0, 0, 0, 70, 30, 170, 128, 5, 0, 170, 160,
16, 0, 2, 0, 0, 0, 35, 0, 0, 2, 1, 0,
62, 0, 0, 1, 83, 84, 8, 128, 1, 0, 255, 128,
65, 84, 116, 0, 0, 0, 5, 0, 0, 3, 1, 0,
12, 0, 0, 0, 2, 0, 8, 128, 1, 0, 255, 128,
0, 0, 0, 0, 0, 0, 5, 0, 255, 160, 32, 0,
3, 0, 0, 0, 5, 0, 0, 3, 2, 0, 8, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 128, 6, 0,
0, 0, 0, 0, 1, 0, 0, 160, 2, 0, 0, 3,
0, 0, 0, 0, 0, 0, 1, 0, 8, 128, 1, 0,
0, 0, 0, 0, 0, 0, 170, 129, 5, 0, 0, 160,
0, 0, 0, 0, 0, 0, 5, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 1, 128, 1, 0, 170, 128,
0, 0, 3, 0, 0, 0, 5, 0, 85, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 4, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 128, 0, 0,
0, 0, 0, 0, 3, 0, 0, 128, 2, 0, 255, 128,
0, 0, 0, 0, 0, 0, 5, 0, 0, 3, 1, 0,
0, 0, 0, 0, 0, 0, 8, 128, 0, 0, 0, 160,
0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 88, 0,
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 7, 128,
0, 0, 0, 0, 0, 0, 1, 0, 255, 129, 1, 0,
0, 0, 0, 0, 0, 0, 228, 128, 2, 0, 228, 128,
0, 0, 82, 68, 69, 70, 1, 0, 0, 2, 0, 0,
200, 1, 0, 0, 1, 0, 8, 128, 6, 0, 85, 160,
0, 0, 248, 0, 0, 0, 5, 0, 0, 3, 0, 0,
5, 0, 0, 0, 28, 0, 15, 128, 0, 0, 228, 128,
0, 0, 0, 4, 255, 255, 1, 0, 228, 176, 1, 0,
0, 1, 0, 0, 157, 1, 0, 2, 0, 8, 15, 128,
0, 0, 188, 0, 0, 0, 0, 0, 228, 128, 255, 255,
3, 0, 0, 0, 0, 0, 0, 0, 83, 72, 68, 82,
0, 0, 0, 0, 0, 0, 28, 3, 0, 0, 64, 0,
0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0,
0, 0, 1, 0, 0, 0, 89, 0, 0, 4, 70, 142,
1, 0, 0, 0, 199, 0, 32, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 90, 0,
5, 0, 0, 0, 4, 0, 0, 3, 0, 96, 16, 0,
0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 88, 24,
0, 0, 0, 0, 1, 0, 0, 4, 0, 112, 16, 0,
0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 85, 85,
211, 0, 0, 0, 2, 0, 0, 0, 88, 24, 0, 4,
0, 0, 5, 0, 0, 0, 0, 112, 16, 0, 1, 0,
4, 0, 0, 0, 255, 255, 0, 0, 85, 85, 0, 0,
255, 255, 1, 0, 0, 0, 88, 24, 0, 4, 0, 112,
1, 0, 0, 0, 13, 0, 16, 0, 2, 0, 0, 0,
0, 0, 223, 0, 0, 0, 85, 85, 0, 0, 98, 16,
2, 0, 0, 0, 5, 0, 0, 3, 50, 16, 16, 0,
0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 98, 16,
255, 255, 255, 255, 2, 0, 0, 3, 242, 16, 16, 0,
0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 101, 0,
13, 0, 0, 0, 235, 0, 0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 0,
0, 0, 0, 0, 1, 0, 16, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 70, 16, 16, 0, 1, 0,
116, 104, 101, 83, 97, 109, 0, 0, 70, 126, 16, 0,
112, 108, 101, 114, 0, 116, 0, 0, 0, 0, 0, 96,
104, 101, 84, 101, 120, 116, 16, 0, 0, 0, 0, 0,
117, 114, 101, 89, 0, 116, 69, 0, 0, 9, 242, 0,
104, 101, 84, 101, 120, 116, 16, 0, 1, 0, 0, 0,
117, 114, 101, 85, 0, 116, 70, 16, 16, 0, 1, 0,
104, 101, 84, 101, 120, 116, 0, 0, 70, 126, 16, 0,
117, 114, 101, 86, 0, 67, 1, 0, 0, 0, 0, 96,
111, 110, 115, 116, 97, 110, 16, 0, 0, 0, 0, 0,
116, 115, 0, 171, 171, 171, 69, 0, 0, 9, 242, 0,
235, 0, 0, 0, 4, 0, 16, 0, 2, 0, 0, 0,
0, 0, 16, 1, 0, 0, 70, 16, 16, 0, 1, 0,
64, 0, 0, 0, 0, 0, 0, 0, 150, 124, 16, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 96,
112, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
0, 0, 16, 0, 0, 0, 54, 0, 0, 5, 18, 0,
2, 0, 0, 0, 120, 1, 16, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0,
136, 1, 0, 0, 16, 0, 0, 0, 54, 0, 0, 5,
0, 0, 16, 0, 0, 0, 34, 0, 16, 0, 2, 0,
2, 0, 0, 0, 120, 1, 0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
143, 1, 0, 0, 32, 0, 0, 8, 114, 0, 16, 0,
0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 70, 2,
2, 0, 0, 0, 120, 1, 16, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0,
150, 1, 0, 0, 48, 0, 0, 0, 1, 0, 0, 0,
0, 0, 16, 0, 0, 0, 16, 0, 0, 8, 18, 0,
2, 0, 0, 0, 120, 1, 16, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0,
89, 111, 102, 102, 115, 101, 0, 0, 70, 130, 32, 0,
116, 0, 1, 0, 3, 0, 0, 0, 0, 0, 2, 0,
1, 0, 4, 0, 0, 0, 0, 0, 16, 0, 0, 8,
0, 0, 0, 0, 0, 0, 34, 0, 16, 0, 1, 0,
82, 99, 111, 101, 102, 102, 0, 0, 70, 2, 16, 0,
0, 71, 99, 111, 101, 102, 0, 0, 0, 0, 70, 130,
102, 0, 66, 99, 111, 101, 32, 0, 0, 0, 0, 0,
102, 102, 0, 77, 105, 99, 3, 0, 0, 0, 16, 0,
114, 111, 115, 111, 102, 116, 0, 8, 66, 0, 16, 0,
32, 40, 82, 41, 32, 72, 1, 0, 0, 0, 70, 2,
76, 83, 76, 32, 83, 104, 16, 0, 0, 0, 0, 0,
97, 100, 101, 114, 32, 67, 70, 130, 32, 0, 0, 0,
111, 109, 112, 105, 108, 101, 0, 0, 4, 0, 0, 0,
114, 32, 49, 48, 46, 49, 57, 0, 0, 11, 18, 0,
0, 171, 171, 171, 73, 83, 16, 0, 0, 0, 0, 0,
71, 78, 108, 0, 0, 0, 2, 64, 0, 0, 0, 0,
3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 10, 128, 32, 0,
0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 15, 0, 0, 0, 31, 0, 4, 3,
0, 0, 92, 0, 0, 0, 10, 0, 16, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 10,
0, 0, 3, 0, 0, 0, 114, 0, 16, 0, 0, 0,
1, 0, 0, 0, 3, 3, 0, 0, 2, 64, 0, 0,
0, 0, 101, 0, 0, 0, 230, 174, 37, 61, 230, 174,
0, 0, 0, 0, 0, 0, 37, 61, 230, 174, 37, 61,
0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 70, 2,
2, 0, 0, 0, 15, 15, 16, 0, 1, 0, 0, 0,
0, 0, 83, 86, 95, 80, 56, 0, 0, 10, 114, 0,
79, 83, 73, 84, 73, 79, 16, 0, 2, 0, 0, 0,
78, 0, 84, 69, 88, 67, 70, 2, 16, 0, 1, 0,
79, 79, 82, 68, 0, 67, 0, 0, 2, 64, 0, 0,
79, 76, 79, 82, 0, 171, 145, 131, 158, 61, 145, 131,
79, 83, 71, 78, 44, 0, 158, 61, 145, 131, 158, 61,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 32, 0, 0, 10, 114, 0, 16, 0,
0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 70, 2,
0, 0, 0, 0, 3, 0, 16, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 64, 0, 0, 174, 71,
15, 0, 0, 0, 83, 86, 97, 61, 174, 71, 97, 61,
95, 84, 65, 82, 71, 69, 174, 71, 97, 61, 0, 0,
84, 0, 171, 171 0, 0, 56, 0, 0, 11,
}; 114, 0, 16, 0, 3, 0,
0, 0, 70, 2, 16, 128,
129, 0, 0, 0, 3, 0,
0, 0, 2, 64, 0, 0,
111, 167, 114, 63, 111, 167,
114, 63, 111, 167, 114, 63,
0, 0, 0, 0, 47, 0,
0, 5, 114, 0, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
56, 0, 0, 10, 114, 0,
16, 0, 3, 0, 0, 0,
70, 2, 16, 0, 3, 0,
0, 0, 2, 64, 0, 0,
154, 153, 25, 64, 154, 153,
25, 64, 154, 153, 25, 64,
0, 0, 0, 0, 25, 0,
0, 5, 114, 0, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
55, 0, 0, 9, 114, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
2, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
21, 0, 0, 1, 54, 0,
0, 5, 130, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
56, 0, 0, 7, 242, 32,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
2, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 23, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 1, 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,
3, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 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, 112, 2,
0, 0, 1, 0, 0, 0,
248, 0, 0, 0, 5, 0,
0, 0, 28, 0, 0, 0,
0, 4, 255, 255, 0, 1,
0, 0, 69, 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, 199, 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, 211, 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,
223, 0, 0, 0, 2, 0,
0, 0, 5, 0, 0, 0,
4, 0, 0, 0, 255, 255,
255, 255, 2, 0, 0, 0,
1, 0, 0, 0, 13, 0,
0, 0, 235, 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, 116, 104,
101, 83, 97, 109, 112, 108,
101, 114, 0, 116, 104, 101,
84, 101, 120, 116, 117, 114,
101, 89, 0, 116, 104, 101,
84, 101, 120, 116, 117, 114,
101, 85, 0, 116, 104, 101,
84, 101, 120, 116, 117, 114,
101, 86, 0, 67, 111, 110,
115, 116, 97, 110, 116, 115,
0, 171, 171, 171, 235, 0,
0, 0, 8, 0, 0, 0,
16, 1, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 208, 1,
0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 2, 0,
0, 0, 224, 1, 0, 0,
0, 0, 0, 0, 240, 1,
0, 0, 4, 0, 0, 0,
4, 0, 0, 0, 0, 0,
0, 0, 224, 1, 0, 0,
0, 0, 0, 0, 255, 1,
0, 0, 8, 0, 0, 0,
4, 0, 0, 0, 0, 0,
0, 0, 224, 1, 0, 0,
0, 0, 0, 0, 14, 2,
0, 0, 12, 0, 0, 0,
4, 0, 0, 0, 0, 0,
0, 0, 224, 1, 0, 0,
0, 0, 0, 0, 21, 2,
0, 0, 16, 0, 0, 0,
16, 0, 0, 0, 2, 0,
0, 0, 32, 2, 0, 0,
0, 0, 0, 0, 48, 2,
0, 0, 32, 0, 0, 0,
16, 0, 0, 0, 2, 0,
0, 0, 32, 2, 0, 0,
0, 0, 0, 0, 55, 2,
0, 0, 48, 0, 0, 0,
16, 0, 0, 0, 2, 0,
0, 0, 32, 2, 0, 0,
0, 0, 0, 0, 62, 2,
0, 0, 64, 0, 0, 0,
16, 0, 0, 0, 2, 0,
0, 0, 32, 2, 0, 0,
0, 0, 0, 0, 115, 99,
82, 71, 66, 95, 111, 117,
116, 112, 117, 116, 0, 171,
171, 171, 0, 0, 3, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0,
83, 68, 82, 95, 119, 104,
105, 116, 101, 108, 101, 118,
101, 108, 0, 72, 68, 82,
95, 119, 104, 105, 116, 101,
108, 101, 118, 101, 108, 0,
109, 97, 120, 67, 76, 76,
0, 89, 111, 102, 102, 115,
101, 116, 0, 171, 171, 171,
1, 0, 3, 0, 1, 0,
4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 82, 99,
111, 101, 102, 102, 0, 71,
99, 111, 101, 102, 102, 0,
66, 99, 111, 101, 102, 102,
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,
49, 48, 46, 49, 0, 171,
171, 171, 73, 83, 71, 78,
108, 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, 3, 3, 0, 0,
101, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 67, 79, 76,
79, 82, 0, 171, 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,
65, 82, 71, 69, 84, 0,
171, 171
};

View File

@@ -3,21 +3,7 @@ Texture2D theTextureU : register(t1);
Texture2D theTextureV : register(t2); Texture2D theTextureV : register(t2);
SamplerState theSampler : register(s0); SamplerState theSampler : register(s0);
struct PixelShaderInput #include "D3D11_PixelShader_Common.incl"
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
cbuffer Constants : register(b0)
{
float4 Yoffset;
float4 Rcoeff;
float4 Gcoeff;
float4 Bcoeff;
};
float4 main(PixelShaderInput input) : SV_TARGET float4 main(PixelShaderInput input) : SV_TARGET
{ {
@@ -28,11 +14,11 @@ float4 main(PixelShaderInput input) : SV_TARGET
yuv.y = theTextureU.Sample(theSampler, input.tex).r; yuv.y = theTextureU.Sample(theSampler, input.tex).r;
yuv.z = theTextureV.Sample(theSampler, input.tex).r; yuv.z = theTextureV.Sample(theSampler, input.tex).r;
float3 rgb;
yuv += Yoffset.xyz; yuv += Yoffset.xyz;
Output.r = dot(yuv, Rcoeff.xyz); rgb.r = dot(yuv, Rcoeff.xyz);
Output.g = dot(yuv, Gcoeff.xyz); rgb.g = dot(yuv, Gcoeff.xyz);
Output.b = dot(yuv, Bcoeff.xyz); rgb.b = dot(yuv, Bcoeff.xyz);
Output.a = 1.0f;
return Output * input.color; return GetOutputColorFromSRGB(rgb) * input.color;
} }

678
src/render/direct3d11/D3D11_VertexShader.h Executable file → Normal file
View File

@@ -1,339 +1,339 @@
#if 0 #if 0
// //
// Generated by Microsoft (R) HLSL Shader Compiler 10.1 // Generated by Microsoft (R) HLSL Shader Compiler 10.1
// //
// //
// Buffer Definitions: // Buffer Definitions:
// //
// cbuffer VertexShaderConstants // cbuffer VertexShaderConstants
// { // {
// //
// row_major float4x4 model; // Offset: 0 Size: 64 // row_major float4x4 model; // Offset: 0 Size: 64
// row_major float4x4 projectionAndView;// Offset: 64 Size: 64 // row_major float4x4 projectionAndView;// Offset: 64 Size: 64
// //
// } // }
// //
// //
// Resource Bindings: // Resource Bindings:
// //
// Name Type Format Dim HLSL Bind Count // Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------ // ------------------------------ ---------- ------- ----------- -------------- ------
// VertexShaderConstants cbuffer NA NA cb0 1 // VertexShaderConstants cbuffer NA NA cb0 1
// //
// //
// //
// Input signature: // Input signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyz 0 NONE float xyz // POSITION 0 xyz 0 NONE float xyz
// TEXCOORD 0 xy 1 NONE float xy // TEXCOORD 0 xy 1 NONE float xy
// COLOR 0 xyzw 2 NONE float xyzw // COLOR 0 xyzw 2 NONE float xyzw
// //
// //
// Output signature: // Output signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xyzw // SV_POSITION 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xy 1 NONE float xy // TEXCOORD 0 xy 1 NONE float xy
// COLOR 0 xyzw 2 NONE float xyzw // COLOR 0 xyzw 2 NONE float xyzw
// //
// //
// Constant buffer to DX9 shader constant mappings: // Constant buffer to DX9 shader constant mappings:
// //
// Target Reg Buffer Start Reg # of Regs Data Conversion // Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ---------------------- // ---------- ------- --------- --------- ----------------------
// c1 cb0 0 8 ( FLT, FLT, FLT, FLT) // c1 cb0 0 8 ( FLT, FLT, FLT, FLT)
// //
// //
// Runtime generated constant mappings: // Runtime generated constant mappings:
// //
// Target Reg Constant Description // Target Reg Constant Description
// ---------- -------------------------------------------------- // ---------- --------------------------------------------------
// c0 Vertex Shader position offset // c0 Vertex Shader position offset
// //
// //
// Level9 shader bytecode: // Level9 shader bytecode:
// //
vs_2_0 vs_2_0
dcl_texcoord v0 dcl_texcoord v0
dcl_texcoord1 v1 dcl_texcoord1 v1
dcl_texcoord2 v2 dcl_texcoord2 v2
mul r0, v0.y, c2 mul r0, v0.y, c2
mad r0, v0.x, c1, r0 mad r0, v0.x, c1, r0
mad r0, v0.z, c3, r0 mad r0, v0.z, c3, r0
add r0, r0, c4 add r0, r0, c4
mul r1, r0.y, c6 mul r1, r0.y, c6
mad r1, r0.x, c5, r1 mad r1, r0.x, c5, r1
mad r1, r0.z, c7, r1 mad r1, r0.z, c7, r1
mad r0, r0.w, c8, r1 mad r0, r0.w, c8, r1
mad oPos.xy, r0.w, c0, r0 mad oPos.xy, r0.w, c0, r0
mov oPos.zw, r0 mov oPos.zw, r0
mov oT0.xy, v1 mov oT0.xy, v1
mov oT1, v2 mov oT1, v2
// approximately 12 instruction slots used // approximately 12 instruction slots used
vs_4_0 vs_4_0
dcl_constantbuffer CB0[8], immediateIndexed dcl_constantbuffer CB0[8], immediateIndexed
dcl_input v0.xyz dcl_input v0.xyz
dcl_input v1.xy dcl_input v1.xy
dcl_input v2.xyzw dcl_input v2.xyzw
dcl_output_siv o0.xyzw, position dcl_output_siv o0.xyzw, position
dcl_output o1.xy dcl_output o1.xy
dcl_output o2.xyzw dcl_output o2.xyzw
dcl_temps 2 dcl_temps 2
mul r0.xyzw, v0.yyyy, cb0[1].xyzw mul r0.xyzw, v0.yyyy, cb0[1].xyzw
mad r0.xyzw, v0.xxxx, cb0[0].xyzw, r0.xyzw mad r0.xyzw, v0.xxxx, cb0[0].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, cb0[2].xyzw, r0.xyzw mad r0.xyzw, v0.zzzz, cb0[2].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[3].xyzw add r0.xyzw, r0.xyzw, cb0[3].xyzw
mul r1.xyzw, r0.yyyy, cb0[5].xyzw mul r1.xyzw, r0.yyyy, cb0[5].xyzw
mad r1.xyzw, r0.xxxx, cb0[4].xyzw, r1.xyzw mad r1.xyzw, r0.xxxx, cb0[4].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb0[6].xyzw, r1.xyzw mad r1.xyzw, r0.zzzz, cb0[6].xyzw, r1.xyzw
mad o0.xyzw, r0.wwww, cb0[7].xyzw, r1.xyzw mad o0.xyzw, r0.wwww, cb0[7].xyzw, r1.xyzw
mov o1.xy, v1.xyxx mov o1.xy, v1.xyxx
mov o2.xyzw, v2.xyzw mov o2.xyzw, v2.xyzw
ret ret
// Approximately 11 instruction slots used // Approximately 11 instruction slots used
#endif #endif
const BYTE g_main[] = const BYTE g_main[] =
{ {
68, 88, 66, 67, 152, 172, 68, 88, 66, 67, 152, 172,
81, 45, 198, 200, 12, 38, 81, 45, 198, 200, 12, 38,
143, 4, 178, 228, 158, 175, 143, 4, 178, 228, 158, 175,
169, 64, 1, 0, 0, 0, 169, 64, 1, 0, 0, 0,
140, 5, 0, 0, 6, 0, 140, 5, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0, 0, 0, 56, 0, 0, 0,
108, 1, 0, 0, 52, 3, 108, 1, 0, 0, 52, 3,
0, 0, 176, 3, 0, 0, 0, 0, 176, 3, 0, 0,
168, 4, 0, 0, 24, 5, 168, 4, 0, 0, 24, 5,
0, 0, 65, 111, 110, 57, 0, 0, 65, 111, 110, 57,
44, 1, 0, 0, 44, 1, 44, 1, 0, 0, 44, 1,
0, 0, 0, 2, 254, 255, 0, 0, 0, 2, 254, 255,
248, 0, 0, 0, 52, 0, 248, 0, 0, 0, 52, 0,
0, 0, 1, 0, 36, 0, 0, 0, 1, 0, 36, 0,
0, 0, 48, 0, 0, 0, 0, 0, 48, 0, 0, 0,
48, 0, 0, 0, 36, 0, 48, 0, 0, 0, 36, 0,
1, 0, 48, 0, 0, 0, 1, 0, 48, 0, 0, 0,
0, 0, 8, 0, 1, 0, 0, 0, 8, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 254, 255, 0, 0, 0, 2, 254, 255,
31, 0, 0, 2, 5, 0, 31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144, 0, 128, 0, 0, 15, 144,
31, 0, 0, 2, 5, 0, 31, 0, 0, 2, 5, 0,
1, 128, 1, 0, 15, 144, 1, 128, 1, 0, 15, 144,
31, 0, 0, 2, 5, 0, 31, 0, 0, 2, 5, 0,
2, 128, 2, 0, 15, 144, 2, 128, 2, 0, 15, 144,
5, 0, 0, 3, 0, 0, 5, 0, 0, 3, 0, 0,
15, 128, 0, 0, 85, 144, 15, 128, 0, 0, 85, 144,
2, 0, 228, 160, 4, 0, 2, 0, 228, 160, 4, 0,
0, 4, 0, 0, 15, 128, 0, 4, 0, 0, 15, 128,
0, 0, 0, 144, 1, 0, 0, 0, 0, 144, 1, 0,
228, 160, 0, 0, 228, 128, 228, 160, 0, 0, 228, 128,
4, 0, 0, 4, 0, 0, 4, 0, 0, 4, 0, 0,
15, 128, 0, 0, 170, 144, 15, 128, 0, 0, 170, 144,
3, 0, 228, 160, 0, 0, 3, 0, 228, 160, 0, 0,
228, 128, 2, 0, 0, 3, 228, 128, 2, 0, 0, 3,
0, 0, 15, 128, 0, 0, 0, 0, 15, 128, 0, 0,
228, 128, 4, 0, 228, 160, 228, 128, 4, 0, 228, 160,
5, 0, 0, 3, 1, 0, 5, 0, 0, 3, 1, 0,
15, 128, 0, 0, 85, 128, 15, 128, 0, 0, 85, 128,
6, 0, 228, 160, 4, 0, 6, 0, 228, 160, 4, 0,
0, 4, 1, 0, 15, 128, 0, 4, 1, 0, 15, 128,
0, 0, 0, 128, 5, 0, 0, 0, 0, 128, 5, 0,
228, 160, 1, 0, 228, 128, 228, 160, 1, 0, 228, 128,
4, 0, 0, 4, 1, 0, 4, 0, 0, 4, 1, 0,
15, 128, 0, 0, 170, 128, 15, 128, 0, 0, 170, 128,
7, 0, 228, 160, 1, 0, 7, 0, 228, 160, 1, 0,
228, 128, 4, 0, 0, 4, 228, 128, 4, 0, 0, 4,
0, 0, 15, 128, 0, 0, 0, 0, 15, 128, 0, 0,
255, 128, 8, 0, 228, 160, 255, 128, 8, 0, 228, 160,
1, 0, 228, 128, 4, 0, 1, 0, 228, 128, 4, 0,
0, 4, 0, 0, 3, 192, 0, 4, 0, 0, 3, 192,
0, 0, 255, 128, 0, 0, 0, 0, 255, 128, 0, 0,
228, 160, 0, 0, 228, 128, 228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0,
12, 192, 0, 0, 228, 128, 12, 192, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0,
3, 224, 1, 0, 228, 144, 3, 224, 1, 0, 228, 144,
1, 0, 0, 2, 1, 0, 1, 0, 0, 2, 1, 0,
15, 224, 2, 0, 228, 144, 15, 224, 2, 0, 228, 144,
255, 255, 0, 0, 83, 72, 255, 255, 0, 0, 83, 72,
68, 82, 192, 1, 0, 0, 68, 82, 192, 1, 0, 0,
64, 0, 1, 0, 112, 0, 64, 0, 1, 0, 112, 0,
0, 0, 89, 0, 0, 4, 0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0, 70, 142, 32, 0, 0, 0,
0, 0, 8, 0, 0, 0, 0, 0, 8, 0, 0, 0,
95, 0, 0, 3, 114, 16, 95, 0, 0, 3, 114, 16,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 50, 16, 95, 0, 0, 3, 50, 16,
16, 0, 1, 0, 0, 0, 16, 0, 1, 0, 0, 0,
95, 0, 0, 3, 242, 16, 95, 0, 0, 3, 242, 16,
16, 0, 2, 0, 0, 0, 16, 0, 2, 0, 0, 0,
103, 0, 0, 4, 242, 32, 103, 0, 0, 4, 242, 32,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
1, 0, 0, 0, 101, 0, 1, 0, 0, 0, 101, 0,
0, 3, 50, 32, 16, 0, 0, 3, 50, 32, 16, 0,
1, 0, 0, 0, 101, 0, 1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
2, 0, 0, 0, 104, 0, 2, 0, 0, 0, 104, 0,
0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 0, 0,
56, 0, 0, 8, 242, 0, 56, 0, 0, 8, 242, 0,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
86, 21, 16, 0, 0, 0, 86, 21, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0, 0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
0, 0, 50, 0, 0, 10, 0, 0, 50, 0, 0, 10,
242, 0, 16, 0, 0, 0, 242, 0, 16, 0, 0, 0,
0, 0, 6, 16, 16, 0, 0, 0, 6, 16, 16, 0,
0, 0, 0, 0, 70, 142, 0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 70, 14, 0, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
50, 0, 0, 10, 242, 0, 50, 0, 0, 10, 242, 0,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
166, 26, 16, 0, 0, 0, 166, 26, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0, 0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0,
0, 0, 70, 14, 16, 0, 0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 8, 242, 0, 16, 0, 0, 8, 242, 0, 16, 0,
0, 0, 0, 0, 70, 14, 0, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0, 70, 142, 32, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0,
56, 0, 0, 8, 242, 0, 56, 0, 0, 8, 242, 0,
16, 0, 1, 0, 0, 0, 16, 0, 1, 0, 0, 0,
86, 5, 16, 0, 0, 0, 86, 5, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0, 0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 0,
0, 0, 50, 0, 0, 10, 0, 0, 50, 0, 0, 10,
242, 0, 16, 0, 1, 0, 242, 0, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0, 0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 142, 0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
4, 0, 0, 0, 70, 14, 4, 0, 0, 0, 70, 14,
16, 0, 1, 0, 0, 0, 16, 0, 1, 0, 0, 0,
50, 0, 0, 10, 242, 0, 50, 0, 0, 10, 242, 0,
16, 0, 1, 0, 0, 0, 16, 0, 1, 0, 0, 0,
166, 10, 16, 0, 0, 0, 166, 10, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0, 0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
0, 0, 70, 14, 16, 0, 0, 0, 70, 14, 16, 0,
1, 0, 0, 0, 50, 0, 1, 0, 0, 0, 50, 0,
0, 10, 242, 32, 16, 0, 0, 10, 242, 32, 16, 0,
0, 0, 0, 0, 246, 15, 0, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0, 70, 142, 32, 0, 0, 0,
0, 0, 7, 0, 0, 0, 0, 0, 7, 0, 0, 0,
70, 14, 16, 0, 1, 0, 70, 14, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5, 0, 0, 54, 0, 0, 5,
50, 32, 16, 0, 1, 0, 50, 32, 16, 0, 1, 0,
0, 0, 70, 16, 16, 0, 0, 0, 70, 16, 16, 0,
1, 0, 0, 0, 54, 0, 1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0, 0, 5, 242, 32, 16, 0,
2, 0, 0, 0, 70, 30, 2, 0, 0, 0, 70, 30,
16, 0, 2, 0, 0, 0, 16, 0, 2, 0, 0, 0,
62, 0, 0, 1, 83, 84, 62, 0, 0, 1, 83, 84,
65, 84, 116, 0, 0, 0, 65, 84, 116, 0, 0, 0,
11, 0, 0, 0, 2, 0, 11, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 8, 0, 6, 0, 0, 0, 8, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 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, 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, 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, 2, 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, 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, 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, 0, 0, 82, 68, 69, 70,
240, 0, 0, 0, 1, 0, 240, 0, 0, 0, 1, 0,
0, 0, 84, 0, 0, 0, 0, 0, 84, 0, 0, 0,
1, 0, 0, 0, 28, 0, 1, 0, 0, 0, 28, 0,
0, 0, 0, 4, 254, 255, 0, 0, 0, 4, 254, 255,
0, 1, 0, 0, 198, 0, 0, 1, 0, 0, 198, 0,
0, 0, 60, 0, 0, 0, 0, 0, 60, 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, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 86, 101, 1, 0, 0, 0, 86, 101,
114, 116, 101, 120, 83, 104, 114, 116, 101, 120, 83, 104,
97, 100, 101, 114, 67, 111, 97, 100, 101, 114, 67, 111,
110, 115, 116, 97, 110, 116, 110, 115, 116, 97, 110, 116,
115, 0, 171, 171, 60, 0, 115, 0, 171, 171, 60, 0,
0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
108, 0, 0, 0, 128, 0, 108, 0, 0, 0, 128, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 156, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
64, 0, 0, 0, 2, 0, 64, 0, 0, 0, 2, 0,
0, 0, 164, 0, 0, 0, 0, 0, 164, 0, 0, 0,
0, 0, 0, 0, 180, 0, 0, 0, 0, 0, 180, 0,
0, 0, 64, 0, 0, 0, 0, 0, 64, 0, 0, 0,
64, 0, 0, 0, 2, 0, 64, 0, 0, 0, 2, 0,
0, 0, 164, 0, 0, 0, 0, 0, 164, 0, 0, 0,
0, 0, 0, 0, 109, 111, 0, 0, 0, 0, 109, 111,
100, 101, 108, 0, 171, 171, 100, 101, 108, 0, 171, 171,
2, 0, 3, 0, 4, 0, 2, 0, 3, 0, 4, 0,
4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 112, 114, 0, 0, 0, 0, 112, 114,
111, 106, 101, 99, 116, 105, 111, 106, 101, 99, 116, 105,
111, 110, 65, 110, 100, 86, 111, 110, 65, 110, 100, 86,
105, 101, 119, 0, 77, 105, 105, 101, 119, 0, 77, 105,
99, 114, 111, 115, 111, 102, 99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32, 116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83, 72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32, 104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108, 67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46, 101, 114, 32, 49, 48, 46,
49, 0, 171, 171, 73, 83, 49, 0, 171, 171, 73, 83,
71, 78, 104, 0, 0, 0, 71, 78, 104, 0, 0, 0,
3, 0, 0, 0, 8, 0, 3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0, 0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 7, 7,
0, 0, 89, 0, 0, 0, 0, 0, 89, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 3, 3, 1, 0, 0, 0, 3, 3,
0, 0, 98, 0, 0, 0, 0, 0, 98, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 15, 2, 0, 0, 0, 15, 15,
0, 0, 80, 79, 83, 73, 0, 0, 80, 79, 83, 73,
84, 73, 79, 78, 0, 84, 84, 73, 79, 78, 0, 84,
69, 88, 67, 79, 79, 82, 69, 88, 67, 79, 79, 82,
68, 0, 67, 79, 76, 79, 68, 0, 67, 79, 76, 79,
82, 0, 79, 83, 71, 78, 82, 0, 79, 83, 71, 78,
108, 0, 0, 0, 3, 0, 108, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0, 0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 0, 0, 15, 0, 0, 0,
92, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0,
0, 0, 3, 12, 0, 0, 0, 0, 3, 12, 0, 0,
101, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0, 3, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 0, 0, 0, 15, 0, 0, 0,
83, 86, 95, 80, 79, 83, 83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0, 73, 84, 73, 79, 78, 0,
84, 69, 88, 67, 79, 79, 84, 69, 88, 67, 79, 79,
82, 68, 0, 67, 79, 76, 82, 68, 0, 67, 79, 76,
79, 82, 0, 171 79, 82, 0, 171
}; };

View File

@@ -76,11 +76,11 @@ typedef struct
typedef struct typedef struct
{ {
float YCbCr_matrix[16];
float scRGB_output; float scRGB_output;
float SDR_whitelevel; float SDR_whitelevel;
float HDR_whitelevel; float HDR_whitelevel;
float maxCLL; float maxCLL;
float YCbCr_matrix[16];
} PixelShaderConstants; } PixelShaderConstants;
/* Per-vertex data */ /* Per-vertex data */
@@ -155,6 +155,11 @@ typedef struct
D3D_FEATURE_LEVEL featureLevel; D3D_FEATURE_LEVEL featureLevel;
SDL_bool pixelSizeChanged; SDL_bool pixelSizeChanged;
/* HDR state */
SDL_bool HDR_enabled;
int SDR_whitelevel;
int HDR_whitelevel;
/* Rasterizers */ /* Rasterizers */
ID3D11RasterizerState *mainRasterizer; ID3D11RasterizerState *mainRasterizer;
ID3D11RasterizerState *clippedRasterizer; ID3D11RasterizerState *clippedRasterizer;
@@ -465,6 +470,21 @@ static ID3D11BlendState *D3D11_CreateBlendState(SDL_Renderer *renderer, SDL_Blen
return blendState; return blendState;
} }
static void D3D11_UpdateHDRState(SDL_Renderer *renderer)
{
D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata;
/* Using some placeholder values here... */
data->HDR_enabled = SDL_TRUE;
if (renderer->output_colorspace == SDL_COLORSPACE_SCRGB && data->HDR_enabled) {
data->SDR_whitelevel = 200.0f;
data->HDR_whitelevel = 400.0f;
} else {
data->SDR_whitelevel = 80.0f;
data->HDR_whitelevel = 80.0f;
}
}
/* Create resources that depend on the device. */ /* Create resources that depend on the device. */
static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer)
{ {
@@ -716,6 +736,8 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer)
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice);
D3D11_UpdateHDRState(renderer);
done: done:
SAFE_RELEASE(d3dDevice); SAFE_RELEASE(d3dDevice);
SAFE_RELEASE(d3dContext); SAFE_RELEASE(d3dContext);
@@ -2177,46 +2199,42 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c
rendererData->currentBlendState = blendState; rendererData->currentBlendState = blendState;
} }
if (shader_params != rendererData->currentShaderParams[shader]) { if (!rendererData->pixelShaderConstants[shader] ||
shader_params != rendererData->currentShaderParams[shader]) {
SAFE_RELEASE(rendererData->pixelShaderConstants[shader]);
PixelShaderConstants constants;
if (renderer->output_colorspace == SDL_COLORSPACE_SCRGB) {
constants.scRGB_output = 1.0f;
} else {
constants.scRGB_output = 0.0f;
}
constants.SDR_whitelevel = (float)rendererData->SDR_whitelevel;
constants.HDR_whitelevel = (float)rendererData->HDR_whitelevel;
constants.maxCLL = 400.0f;
if (shader_params) { if (shader_params) {
SAFE_RELEASE(rendererData->pixelShaderConstants[shader]);
PixelShaderConstants constants;
SDL_memcpy(constants.YCbCr_matrix, shader_params, sizeof(constants.YCbCr_matrix)); SDL_memcpy(constants.YCbCr_matrix, shader_params, sizeof(constants.YCbCr_matrix));
if (renderer->output_colorspace == SDL_COLORSPACE_SCRGB) { }
constants.scRGB_output = 1.0f;
} else {
constants.scRGB_output = 0.0f;
}
/* Using some placeholder values here... */ D3D11_BUFFER_DESC desc;
const SDL_bool HDR = SDL_TRUE; SDL_zero(desc);
if (renderer->output_colorspace == SDL_COLORSPACE_SCRGB && HDR) { desc.Usage = D3D11_USAGE_DEFAULT;
constants.SDR_whitelevel = 200.0f; desc.ByteWidth = sizeof(constants);
constants.HDR_whitelevel = 400.0f; desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
} else {
constants.SDR_whitelevel = 80.0f;
constants.HDR_whitelevel = 80.0f;
}
constants.maxCLL = 400.0f;
D3D11_BUFFER_DESC desc; D3D11_SUBRESOURCE_DATA data;
SDL_zero(desc); SDL_zero(data);
desc.Usage = D3D11_USAGE_DEFAULT; data.pSysMem = &constants;
desc.ByteWidth = sizeof(constants);
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
D3D11_SUBRESOURCE_DATA data; HRESULT result = ID3D11Device_CreateBuffer(rendererData->d3dDevice, &desc, &data, &rendererData->pixelShaderConstants[shader]);
SDL_zero(data); if (FAILED(result)) {
data.pSysMem = &constants; WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device::CreateBuffer [create shader constants]"), result);
return -1;
HRESULT result = ID3D11Device_CreateBuffer(rendererData->d3dDevice, &desc, &data, &rendererData->pixelShaderConstants[shader]);
if (FAILED(result)) {
WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device::CreateBuffer [create shader constants]"), result);
return -1;
}
} }
rendererData->currentShaderParams[shader] = shader_params; rendererData->currentShaderParams[shader] = shader_params;
rendererData->currentShader = SHADER_NONE;
} }
if (shader != rendererData->currentShader) { if (shader != rendererData->currentShader) {
if (!rendererData->pixelShaders[shader]) { if (!rendererData->pixelShaders[shader]) {
@@ -2371,7 +2389,13 @@ static int D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
SDL_bool convert_color = SDL_RenderingLinearSpace(renderer); SDL_bool convert_color = SDL_RenderingLinearSpace(renderer);
SDL_FColor color = cmd->data.color.color; SDL_FColor color = cmd->data.color.color;
if (convert_color) { if (convert_color) {
float light_scale = (float)rendererData->SDR_whitelevel / 80.0f;
SDL_ConvertToLinear(&color); SDL_ConvertToLinear(&color);
color.r *= light_scale;
color.g *= light_scale;
color.b *= light_scale;
} }
ID3D11DeviceContext_ClearRenderTargetView(rendererData->d3dContext, D3D11_GetCurrentRenderTargetView(renderer), &color.r); ID3D11DeviceContext_ClearRenderTargetView(rendererData->d3dContext, D3D11_GetCurrentRenderTargetView(renderer), &color.r);
break; break;