[GPU] DC_LUT_RW_INDEX/WRITE_EN_MASK + gamma ramp and registers in traces

This commit is contained in:
Triang3l
2022-05-05 13:10:29 +03:00
parent 2d90d5940f
commit c794d0d538
19 changed files with 743 additions and 242 deletions

View File

@@ -32,10 +32,9 @@ void main(uint3 xe_thread_id : SV_DispatchThreadID) {
}
// UNORM conversion according to the Direct3D 10+ rules.
uint3 input = uint3(xe_apply_gamma_source[xe_thread_id.xy] * 1023.0f + 0.5f);
// The ramp is BGR, not RGB.
float3 output = float3(XeApplyPWLGamma(input.r, 2u),
float3 output = float3(XeApplyPWLGamma(input.r, 0u),
XeApplyPWLGamma(input.g, 1u),
XeApplyPWLGamma(input.b, 0u));
XeApplyPWLGamma(input.b, 2u));
xe_apply_gamma_dest[xe_thread_id.xy] =
float4(output, XeApplyGammaGetAlpha(output));
}

View File

@@ -14,7 +14,8 @@ void main(uint3 xe_thread_id : SV_DispatchThreadID) {
}
// UNORM conversion according to the Direct3D 10+ rules.
uint3 input = uint3(xe_apply_gamma_source[xe_thread_id.xy] * 255.0f + 0.5f);
// The ramp is BGR, not RGB.
// The ramp has blue in bits 0:9, green in 10:19, red in 20:29 - BGR passed as
// an R10G10B10A2 buffer.
float3 output = float3(xe_apply_gamma_ramp[input.r].b,
xe_apply_gamma_ramp[input.g].g,
xe_apply_gamma_ramp[input.b].r);

View File

@@ -55,17 +55,17 @@ ld r0.xyz, r0.xyzw, T0[0].xyzw
mad r0.xyz, r0.xyzx, l(1023.000000, 1023.000000, 1023.000000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
ftou r0.xyz, r0.xyzx
ushr r1.xyz, r0.xyzx, l(3, 3, 3, 0)
imul null, r0.w, r1.z, l(3)
imad r1.xy, r1.xyxx, l(3, 3, 0, 0), l(2, 1, 0, 0)
ld r1.xz, r1.xxxx, T1[1].xzyw
utof r1.x, r1.x
imul null, r0.w, r1.x, l(3)
ld r1.xw, r0.wwww, T1[1].xzwy
utof r0.w, r1.x
and r0.xyz, r0.xyzx, l(7, 7, 7, 0)
imul null, r0.x, r1.z, r0.x
imul null, r0.x, r1.w, r0.x
utof r0.x, r0.x
mad r0.x, r0.x, l(0.125000), r1.x
mad r0.x, r0.x, l(0.125000), r0.w
mul r0.x, r0.x, l(0.000015)
min r2.x, r0.x, l(1.000000)
ld r1.xy, r1.yyyy, T1[1].xyzw
imad r0.xw, r1.yyyz, l(3, 0, 0, 3), l(1, 0, 0, 2)
ld r1.xy, r0.xxxx, T1[1].xyzw
utof r0.x, r1.x
imul null, r0.y, r0.y, r1.y
utof r0.y, r0.y
@@ -86,10 +86,10 @@ ret
const BYTE apply_gamma_pwl_cs[] =
{
68, 88, 66, 67, 180, 180,
222, 28, 4, 138, 188, 113,
52, 97, 214, 88, 116, 106,
105, 240, 1, 0, 0, 0,
68, 88, 66, 67, 134, 193,
189, 188, 150, 246, 151, 78,
29, 10, 33, 117, 212, 145,
204, 130, 1, 0, 0, 0,
128, 7, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
24, 2, 0, 0, 40, 2,
@@ -257,26 +257,16 @@ const BYTE apply_gamma_pwl_cs[] =
0, 0, 0, 0, 38, 0,
0, 8, 0, 208, 0, 0,
130, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 3, 0, 0, 0,
35, 0, 0, 15, 50, 0,
45, 0, 0, 8, 146, 0,
16, 0, 1, 0, 0, 0,
70, 0, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 64,
0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
45, 0, 0, 8, 82, 0,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 1, 0,
0, 0, 134, 125, 32, 0,
246, 15, 16, 0, 0, 0,
0, 0, 134, 119, 32, 0,
1, 0, 0, 0, 1, 0,
0, 0, 86, 0, 0, 5,
18, 0, 16, 0, 1, 0,
130, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 0,
0, 10, 114, 0, 16, 0,
@@ -288,7 +278,7 @@ const BYTE apply_gamma_pwl_cs[] =
0, 0, 38, 0, 0, 8,
0, 208, 0, 0, 18, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 1, 0,
58, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 86, 0,
0, 5, 18, 0, 16, 0,
@@ -298,8 +288,8 @@ const BYTE apply_gamma_pwl_cs[] =
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 62, 10, 0,
16, 0, 1, 0, 0, 0,
0, 0, 0, 62, 58, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
@@ -309,10 +299,20 @@ const BYTE apply_gamma_pwl_cs[] =
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 45, 0, 0, 8,
128, 63, 35, 0, 0, 15,
146, 0, 16, 0, 0, 0,
0, 0, 86, 9, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 64, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 45, 0, 0, 8,
50, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
1, 0, 0, 0, 70, 126,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 126,
32, 0, 1, 0, 0, 0,
1, 0, 0, 0, 86, 0,
0, 5, 18, 0, 16, 0,

View File

@@ -55,17 +55,17 @@ ld r0.xyz, r0.xyzw, T0[0].xyzw
mad r0.xyz, r0.xyzx, l(1023.000000, 1023.000000, 1023.000000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
ftou r0.xyz, r0.xyzx
ushr r1.xyz, r0.xyzx, l(3, 3, 3, 0)
imul null, r0.w, r1.z, l(3)
imad r1.xy, r1.xyxx, l(3, 3, 0, 0), l(2, 1, 0, 0)
ld r1.xz, r1.xxxx, T1[1].xzyw
utof r1.x, r1.x
imul null, r0.w, r1.x, l(3)
ld r1.xw, r0.wwww, T1[1].xzwy
utof r0.w, r1.x
and r0.xyz, r0.xyzx, l(7, 7, 7, 0)
imul null, r0.x, r1.z, r0.x
imul null, r0.x, r1.w, r0.x
utof r0.x, r0.x
mad r0.x, r0.x, l(0.125000), r1.x
mad r0.x, r0.x, l(0.125000), r0.w
mul r0.x, r0.x, l(0.000015)
min r2.x, r0.x, l(1.000000)
ld r1.xy, r1.yyyy, T1[1].xyzw
imad r0.xw, r1.yyyz, l(3, 0, 0, 3), l(1, 0, 0, 2)
ld r1.xy, r0.xxxx, T1[1].xyzw
utof r0.x, r1.x
imul null, r0.y, r0.y, r1.y
utof r0.y, r0.y
@@ -86,10 +86,10 @@ ret
const BYTE apply_gamma_pwl_fxaa_luma_cs[] =
{
68, 88, 66, 67, 165, 122,
242, 36, 160, 218, 193, 67,
37, 43, 138, 45, 109, 219,
226, 109, 1, 0, 0, 0,
68, 88, 66, 67, 115, 68,
69, 234, 116, 212, 118, 193,
71, 10, 44, 165, 244, 209,
63, 198, 1, 0, 0, 0,
148, 7, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
24, 2, 0, 0, 40, 2,
@@ -257,26 +257,16 @@ const BYTE apply_gamma_pwl_fxaa_luma_cs[] =
0, 0, 0, 0, 38, 0,
0, 8, 0, 208, 0, 0,
130, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 3, 0, 0, 0,
35, 0, 0, 15, 50, 0,
45, 0, 0, 8, 146, 0,
16, 0, 1, 0, 0, 0,
70, 0, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 64,
0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
45, 0, 0, 8, 82, 0,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 1, 0,
0, 0, 134, 125, 32, 0,
246, 15, 16, 0, 0, 0,
0, 0, 134, 119, 32, 0,
1, 0, 0, 0, 1, 0,
0, 0, 86, 0, 0, 5,
18, 0, 16, 0, 1, 0,
130, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 0,
0, 10, 114, 0, 16, 0,
@@ -288,7 +278,7 @@ const BYTE apply_gamma_pwl_fxaa_luma_cs[] =
0, 0, 38, 0, 0, 8,
0, 208, 0, 0, 18, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 1, 0,
58, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 86, 0,
0, 5, 18, 0, 16, 0,
@@ -298,8 +288,8 @@ const BYTE apply_gamma_pwl_fxaa_luma_cs[] =
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 62, 10, 0,
16, 0, 1, 0, 0, 0,
0, 0, 0, 62, 58, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
@@ -309,10 +299,20 @@ const BYTE apply_gamma_pwl_fxaa_luma_cs[] =
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 45, 0, 0, 8,
128, 63, 35, 0, 0, 15,
146, 0, 16, 0, 0, 0,
0, 0, 86, 9, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 64, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 45, 0, 0, 8,
50, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
1, 0, 0, 0, 70, 126,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 126,
32, 0, 1, 0, 0, 0,
1, 0, 0, 0, 86, 0,
0, 5, 18, 0, 16, 0,