From d4caef5b89266c4244c83c1de7132e319e1c774c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 5 Feb 2024 23:20:43 -0800 Subject: [PATCH] Generalize SDR white level handling into a color scale This gives applications better control over how and when light levels are adjusted when working with HDR content and display. --- include/SDL3/SDL_render.h | 32 + src/dynapi/SDL_dynapi.sym | 2 + src/dynapi/SDL_dynapi_overrides.h | 2 + src/dynapi/SDL_dynapi_procs.h | 2 + src/render/SDL_render.c | 55 +- src/render/SDL_sysrender.h | 3 + src/render/direct3d/SDL_render_d3d.c | 14 +- .../direct3d11/D3D11_PixelShader_Colors.h | 368 ++++--- .../direct3d11/D3D11_PixelShader_Common.incl | 43 +- .../direct3d11/D3D11_PixelShader_HDR10.h | 550 +++++------ .../direct3d11/D3D11_PixelShader_HDR10.hlsl | 15 +- .../direct3d11/D3D11_PixelShader_NV12.h | 312 +++--- .../direct3d11/D3D11_PixelShader_NV21.h | 312 +++--- .../direct3d11/D3D11_PixelShader_Textures.h | 381 ++++---- src/render/direct3d11/D3D11_PixelShader_YUV.h | 326 ++++--- src/render/direct3d11/SDL_render_d3d11.c | 91 +- .../direct3d12/D3D12_PixelShader_Colors.h | 419 ++++---- .../direct3d12/D3D12_PixelShader_Common.incl | 43 +- .../direct3d12/D3D12_PixelShader_HDR10.h | 922 +++++++++--------- .../direct3d12/D3D12_PixelShader_HDR10.hlsl | 15 +- .../direct3d12/D3D12_PixelShader_NV12.h | 579 +++++------ .../direct3d12/D3D12_PixelShader_NV21.h | 579 +++++------ .../direct3d12/D3D12_PixelShader_Textures.h | 560 +++++------ src/render/direct3d12/D3D12_PixelShader_YUV.h | 591 +++++------ src/render/direct3d12/SDL_render_d3d12.c | 60 +- src/render/metal/SDL_render_metal.m | 43 +- src/render/opengl/SDL_render_gl.c | 29 +- src/render/opengles2/SDL_render_gles2.c | 30 +- src/render/ps2/SDL_render_ps2.c | 27 +- src/render/psp/SDL_render_psp.c | 25 +- src/render/software/SDL_render_sw.c | 25 +- src/render/vitagxm/SDL_render_vita_gxm.c | 21 +- test/testcolorspace.c | 17 + test/testffmpeg.c | 20 + 34 files changed, 3279 insertions(+), 3234 deletions(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 4e5157e5c..7a0862dcb 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1459,6 +1459,38 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 */ extern DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +/** + * Set the color scale used for render operations. + * + * The color scale is an additional scale multiplied into the pixel color value while rendering. This can be used to adjust the brightness of colors during HDR rendering, or changing HDR video brightness when playing on an SDR display. + * + * The color scale does not affect the alpha channel, only the color brightness. + * + * \param renderer the rendering context + * \param scale the color scale value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetRenderColorScale + */ +extern DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); + +/** + * Get the color scale used for render operations. + * + * \param renderer the rendering context + * \param scale a pointer filled in with the current color scale value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetRenderColorScale + */ +extern DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); + /** * Set the blend mode used for drawing operations (Fill and Line). * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 07f36e853..c196aee41 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -967,6 +967,8 @@ SDL3_0.0.0 { SDL_GetSurfaceColorspace; SDL_ConvertSurfaceFormatAndColorspace; SDL_CopyProperties; + SDL_SetRenderColorScale; + SDL_GetRenderColorScale; # extra symbols go here (don't modify this line) local: *; }; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 208eb1238..2aa25f12b 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -992,3 +992,5 @@ #define SDL_GetSurfaceColorspace SDL_GetSurfaceColorspace_REAL #define SDL_ConvertSurfaceFormatAndColorspace SDL_ConvertSurfaceFormatAndColorspace_REAL #define SDL_CopyProperties SDL_CopyProperties_REAL +#define SDL_SetRenderColorScale SDL_SetRenderColorScale_REAL +#define SDL_GetRenderColorScale SDL_GetRenderColorScale_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index d870d42c3..6f93f2ff1 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -1017,3 +1017,5 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b), SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceFormatAndColorspace,(SDL_Surface *a, Uint32 b, SDL_Colorspace c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_CopyProperties,(SDL_PropertiesID a, SDL_PropertiesID b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_GetRenderColorScale,(SDL_Renderer *a, float *b),(a,b),return) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 58d6ece86..2623fe5ef 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -196,72 +196,72 @@ static SDL_INLINE void DebugLogRenderCommands(const SDL_RenderCommand *cmd) break; case SDL_RENDERCMD_SETDRAWCOLOR: - SDL_Log(" %u. set draw color (first=%u, r=%d, g=%d, b=%d, a=%d)", i++, + SDL_Log(" %u. set draw color (first=%u, r=%d, g=%d, b=%d, a=%d, color_scale=%g)", i++, (unsigned int) cmd->data.color.first, (int) cmd->data.color.r, (int) cmd->data.color.g, - (int) cmd->data.color.b, (int) cmd->data.color.a); + (int) cmd->data.color.b, (int) cmd->data.color.a, cmd->data.color.color_scale); break; case SDL_RENDERCMD_CLEAR: - SDL_Log(" %u. clear (first=%u, r=%d, g=%d, b=%d, a=%d)", i++, + SDL_Log(" %u. clear (first=%u, r=%d, g=%d, b=%d, a=%d, color_scale=%g)", i++, (unsigned int) cmd->data.color.first, (int) cmd->data.color.r, (int) cmd->data.color.g, - (int) cmd->data.color.b, (int) cmd->data.color.a); + (int) cmd->data.color.b, (int) cmd->data.color.a, cmd->data.color.color_scale); break; case SDL_RENDERCMD_DRAW_POINTS: - SDL_Log(" %u. draw points (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++, + SDL_Log(" %u. draw points (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale); break; case SDL_RENDERCMD_DRAW_LINES: - SDL_Log(" %u. draw lines (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++, + SDL_Log(" %u. draw lines (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale); break; case SDL_RENDERCMD_FILL_RECTS: - SDL_Log(" %u. fill rects (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++, + SDL_Log(" %u. fill rects (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale); break; case SDL_RENDERCMD_COPY: - SDL_Log(" %u. copy (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, tex=%p)", i++, + SDL_Log(" %u. copy (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g, tex=%p)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend, cmd->data.draw.texture); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale, cmd->data.draw.texture); break; case SDL_RENDERCMD_COPY_EX: - SDL_Log(" %u. copyex (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, tex=%p)", i++, + SDL_Log(" %u. copyex (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g, tex=%p)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend, cmd->data.draw.texture); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale, cmd->data.draw.texture); break; case SDL_RENDERCMD_GEOMETRY: - SDL_Log(" %u. geometry (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, tex=%p)", i++, + SDL_Log(" %u. geometry (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, color_scale=%g, tex=%p)", i++, (unsigned int) cmd->data.draw.first, (unsigned int) cmd->data.draw.count, (int) cmd->data.draw.r, (int) cmd->data.draw.g, (int) cmd->data.draw.b, (int) cmd->data.draw.a, - (int) cmd->data.draw.blend, cmd->data.draw.texture); + (int) cmd->data.draw.blend, cmd->data.draw.color_scale, cmd->data.draw.texture); break; } @@ -467,6 +467,7 @@ static int QueueCmdSetDrawColor(SDL_Renderer *renderer, SDL_FColor *color) if (cmd) { cmd->command = SDL_RENDERCMD_SETDRAWCOLOR; cmd->data.color.first = 0; /* render backend will fill this in. */ + cmd->data.color.color_scale = renderer->color_scale; cmd->data.color.color = *color; retval = renderer->QueueSetDrawColor(renderer, cmd); if (retval < 0) { @@ -489,6 +490,7 @@ static int QueueCmdClear(SDL_Renderer *renderer) cmd->command = SDL_RENDERCMD_CLEAR; cmd->data.color.first = 0; + cmd->data.color.color_scale = renderer->color_scale; cmd->data.color.color = renderer->color; return 0; } @@ -527,6 +529,7 @@ static SDL_RenderCommand *PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_Ren cmd->command = cmdtype; cmd->data.draw.first = 0; /* render backend will fill this in. */ cmd->data.draw.count = 0; /* render backend will fill this in. */ + cmd->data.draw.color_scale = renderer->color_scale; cmd->data.draw.color = *color; cmd->data.draw.blend = blendMode; cmd->data.draw.texture = texture; @@ -953,6 +956,8 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) renderer->line_method = SDL_GetRenderLineMethod(); + renderer->color_scale = 1.0f; + if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) { renderer->hidden = SDL_TRUE; } else { @@ -2835,6 +2840,24 @@ int SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, floa return 0; } +int SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->color_scale = scale; + return 0; +} + +int SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (scale) { + *scale = renderer->color_scale; + } + return 0; +} + int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { CHECK_RENDERER_MAGIC(renderer, -1); diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index 627fd890e..a953be5ce 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -127,6 +127,7 @@ typedef struct SDL_RenderCommand { size_t first; size_t count; + float color_scale; SDL_FColor color; SDL_BlendMode blend; SDL_Texture *texture; @@ -134,6 +135,7 @@ typedef struct SDL_RenderCommand struct { size_t first; + float color_scale; SDL_FColor color; } color; } data; @@ -251,6 +253,7 @@ struct SDL_Renderer SDL_Colorspace output_colorspace; + float color_scale; SDL_FColor color; /**< Color for drawing operations values */ SDL_BlendMode blendMode; /**< The drawing blend mode */ diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index d0381b9ba..588a34912 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -815,9 +815,9 @@ static int D3D_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) static int D3D_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - const DWORD color = D3DCOLOR_COLORVALUE(cmd->data.draw.color.r, - cmd->data.draw.color.g, - cmd->data.draw.color.b, + const DWORD color = D3DCOLOR_COLORVALUE(cmd->data.draw.color.r * cmd->data.draw.color_scale, + cmd->data.draw.color.g * cmd->data.draw.color_scale, + cmd->data.draw.color.b * cmd->data.draw.color_scale, cmd->data.draw.color.a); const size_t vertslen = count * sizeof(Vertex); Vertex *verts = (Vertex *)SDL_AllocateRenderVertices(renderer, vertslen, 0, &cmd->data.draw.first); @@ -847,6 +847,7 @@ static int D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL int i; int count = indices ? num_indices : num_vertices; Vertex *verts = (Vertex *)SDL_AllocateRenderVertices(renderer, count * sizeof(Vertex), 0, &cmd->data.draw.first); + const float color_scale = cmd->data.draw.color_scale; if (!verts) { return -1; @@ -875,7 +876,7 @@ static int D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL verts->x = xy_[0] * scale_x - 0.5f; verts->y = xy_[1] * scale_y - 0.5f; verts->z = 0.0f; - verts->color = D3DCOLOR_COLORVALUE(col_->r, col_->g, col_->b, col_->a); + verts->color = D3DCOLOR_COLORVALUE(col_->r * color_scale, col_->g * color_scale, col_->b * color_scale, col_->a); if (texture) { float *uv_ = (float *)((char *)uv + j * uv_stride); @@ -1205,7 +1206,10 @@ static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v case SDL_RENDERCMD_CLEAR: { - const DWORD color = D3DCOLOR_COLORVALUE(cmd->data.color.color.r, cmd->data.color.color.g, cmd->data.color.color.b, cmd->data.color.color.a); + const DWORD color = D3DCOLOR_COLORVALUE(cmd->data.color.color.r * cmd->data.color.color_scale, + cmd->data.color.color.g * cmd->data.color.color_scale, + cmd->data.color.color.b * cmd->data.color.color_scale, + cmd->data.color.color.a); const SDL_Rect *viewport = &data->drawstate.viewport; const int backw = istarget ? renderer->target->w : data->pparams.BackBufferWidth; const int backh = istarget ? renderer->target->h : data->pparams.BackBufferHeight; diff --git a/src/render/direct3d11/D3D11_PixelShader_Colors.h b/src/render/direct3d11/D3D11_PixelShader_Colors.h index 955c2532d..ad68f93bb 100644 --- a/src/render/direct3d11/D3D11_PixelShader_Colors.h +++ b/src/render/direct3d11/D3D11_PixelShader_Colors.h @@ -8,10 +8,10 @@ // cbuffer Constants // { // -// 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] +// float scRGB_output; // Offset: 0 Size: 4 [unused] +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 [unused] // float4 Rcoeff; // Offset: 32 Size: 16 [unused] // float4 Gcoeff; // Offset: 48 Size: 16 [unused] @@ -54,239 +54,199 @@ // Level9 shader bytecode: // ps_2_0 - def c1, 0.0125000002, 1, 0, 0 dcl t1 - mul r0.w, c0.x, c0.x - mov r0.x, c1.x - mul r0.x, r0.x, c0.y - cmp r0.xyz, -r0.w, c1.y, r0.x - mov r0.w, c1.y - mul r0, r0, t1 + mul r0.xyz, t1, c0.y + mov r0.w, t1.w mov oC0, r0 -// approximately 7 instruction slots used +// approximately 3 instruction slots used ps_4_0 dcl_constantbuffer CB0[1], immediateIndexed dcl_input_ps linear v2.xyzw dcl_output o0.xyzw dcl_temps 1 -ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x -mul r0.y, cb0[0].y, l(0.012500) -movc r0.xyz, r0.xxxx, r0.yyyy, l(1.000000,1.000000,1.000000,0) +mov r0.x, cb0[0].y mov r0.w, l(1.000000) -mul o0.xyzw, r0.xyzw, v2.xyzw +mul o0.xyzw, r0.xxxw, v2.xyzw ret -// Approximately 6 instruction slots used +// Approximately 4 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 132, 13, - 165, 35, 17, 157, 163, 217, - 158, 71, 117, 171, 46, 252, - 9, 215, 1, 0, 0, 0, - 224, 4, 0, 0, 6, 0, + 68, 88, 66, 67, 76, 154, + 233, 103, 201, 50, 167, 173, + 112, 159, 134, 20, 133, 254, + 166, 35, 1, 0, 0, 0, + 24, 4, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, - 4, 1, 0, 0, 244, 1, - 0, 0, 112, 2, 0, 0, - 56, 4, 0, 0, 172, 4, + 172, 0, 0, 0, 56, 1, + 0, 0, 180, 1, 0, 0, + 112, 3, 0, 0, 228, 3, 0, 0, 65, 111, 110, 57, - 196, 0, 0, 0, 196, 0, + 108, 0, 0, 0, 108, 0, 0, 0, 0, 2, 255, 255, - 148, 0, 0, 0, 48, 0, + 60, 0, 0, 0, 48, 0, 0, 0, 1, 0, 36, 0, 0, 0, 48, 0, 0, 0, 48, 0, 0, 0, 36, 0, 0, 0, 48, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 255, 255, 81, 0, 0, 5, - 1, 0, 15, 160, 205, 204, - 76, 60, 0, 0, 128, 63, - 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, + 255, 255, 31, 0, 0, 2, 0, 0, 0, 128, 1, 0, 15, 176, 5, 0, 0, 3, - 0, 0, 8, 128, 0, 0, - 0, 160, 0, 0, 0, 160, + 0, 0, 7, 128, 1, 0, + 228, 176, 0, 0, 85, 160, 1, 0, 0, 2, 0, 0, - 1, 128, 1, 0, 0, 160, - 5, 0, 0, 3, 0, 0, - 1, 128, 0, 0, 0, 128, - 0, 0, 85, 160, 88, 0, - 0, 4, 0, 0, 7, 128, - 0, 0, 255, 129, 1, 0, - 85, 160, 0, 0, 0, 128, - 1, 0, 0, 2, 0, 0, - 8, 128, 1, 0, 85, 160, - 5, 0, 0, 3, 0, 0, + 8, 128, 1, 0, 255, 176, + 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, - 1, 0, 228, 176, 1, 0, - 0, 2, 0, 8, 15, 128, - 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, - 232, 0, 0, 0, 64, 0, - 0, 0, 58, 0, 0, 0, - 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 98, 16, - 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, + 255, 255, 0, 0, 83, 72, + 68, 82, 132, 0, 0, 0, + 64, 0, 0, 0, 33, 0, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 98, 16, 0, 3, 242, 16, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, 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, + 104, 0, 0, 2, 1, 0, + 0, 0, 54, 0, 0, 6, + 18, 0, 16, 0, 0, 0, 0, 0, 26, 128, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 130, 0, 16, 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, + 0, 0, 128, 63, 56, 0, + 0, 7, 242, 32, 16, 0, + 0, 0, 0, 0, 6, 12, 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, + 70, 30, 16, 0, 2, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 116, 0, + 0, 0, 4, 0, 0, 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, + 1, 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 + 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, + 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, 82, 68, + 69, 70, 180, 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, + 137, 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, + 0, 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, + 76, 1, 0, 0, 8, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 48, 1, + 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 12, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 48, 1, + 0, 0, 0, 0, 0, 0, + 92, 1, 0, 0, 16, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 100, 1, + 0, 0, 0, 0, 0, 0, + 116, 1, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 100, 1, + 0, 0, 0, 0, 0, 0, + 123, 1, 0, 0, 48, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 100, 1, + 0, 0, 0, 0, 0, 0, + 130, 1, 0, 0, 64, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 100, 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, 99, 111, 108, 111, + 114, 95, 115, 99, 97, 108, + 101, 0, 117, 110, 117, 115, + 101, 100, 49, 0, 117, 110, + 117, 115, 101, 100, 50, 0, + 89, 111, 102, 102, 115, 101, + 116, 0, 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 }; diff --git a/src/render/direct3d11/D3D11_PixelShader_Common.incl b/src/render/direct3d11/D3D11_PixelShader_Common.incl index 2b547c7b5..b1f690ade 100644 --- a/src/render/direct3d11/D3D11_PixelShader_Common.incl +++ b/src/render/direct3d11/D3D11_PixelShader_Common.incl @@ -8,9 +8,9 @@ struct PixelShaderInput cbuffer Constants : register(b0) { float scRGB_output; - float SDR_whitelevel; - float HDR_whitelevel; - float maxCLL; + float color_scale; + float unused1; + float unused2; float4 Yoffset; float4 Rcoeff; @@ -50,11 +50,12 @@ float sRGBfromLinear(float v) float4 GetOutputColor(float4 rgba) { - if (scRGB_output) { - rgba.rgb = scRGBfromNits(rgba.rgb * SDR_whitelevel); - } + float4 output; - return rgba; + output.rgb = rgba.rgb * color_scale; + output.a = rgba.a; + + return output; } float4 GetOutputColorFromSRGB(float3 rgb) @@ -62,14 +63,30 @@ 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; + rgb.r = sRGBtoLinear(rgb.r); + rgb.g = sRGBtoLinear(rgb.g); + rgb.b = sRGBtoLinear(rgb.b); } + + output.rgb = rgb * color_scale; output.a = 1.0; return output; } + +float4 GetOutputColorFromSCRGB(float3 rgb) +{ + float4 output; + + output.rgb = rgb * color_scale; + output.a = 1.0; + + if (!scRGB_output) { + output.r = sRGBfromLinear(output.r); + output.g = sRGBfromLinear(output.g); + output.b = sRGBfromLinear(output.b); + output.rgb = clamp(output.rgb, 0.0, 1.0); + } + + return output; +} diff --git a/src/render/direct3d11/D3D11_PixelShader_HDR10.h b/src/render/direct3d11/D3D11_PixelShader_HDR10.h index c71c13a0a..d8e17c33f 100644 --- a/src/render/direct3d11/D3D11_PixelShader_HDR10.h +++ b/src/render/direct3d11/D3D11_PixelShader_HDR10.h @@ -9,9 +9,9 @@ // { // // float scRGB_output; // Offset: 0 Size: 4 -// float SDR_whitelevel; // Offset: 4 Size: 4 [unused] -// float HDR_whitelevel; // Offset: 8 Size: 4 -// float maxCLL; // Offset: 12 Size: 4 +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 // float4 Rcoeff; // Offset: 32 Size: 16 // float4 Gcoeff; // Offset: 48 Size: 16 @@ -76,8 +76,7 @@ mul r0.xyz, r0.xyzx, l(10000.000000, 10000.000000, 10000.000000, 0.000000) dp3 r1.x, l(1.660496, -0.587656, -0.072840, 0.000000), r0.xyzx dp3 r1.y, l(-0.124547, 1.132895, -0.008348, 0.000000), r0.xyzx dp3 r1.z, l(-0.018154, -0.100597, 1.118751, 0.000000), r0.xyzx -div r0.xyz, r1.xyzx, cb0[0].wwww -mul r0.xyz, r0.xyzx, cb0[0].zzzz +mul r0.xyz, r1.xyzx, cb0[0].yyyy mul r1.xyz, r0.xyzx, l(0.012500, 0.012500, 0.012500, 0.000000) ne r0.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x if_z r0.w @@ -92,26 +91,26 @@ endif mov r1.w, l(1.000000) mul o0.xyzw, r1.xyzw, v2.xyzw ret -// Approximately 36 instruction slots used +// Approximately 35 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 39, 74, - 221, 114, 82, 86, 93, 130, - 9, 184, 52, 173, 245, 104, - 96, 202, 1, 0, 0, 0, - 184, 9, 0, 0, 5, 0, + 68, 88, 66, 67, 95, 217, + 108, 181, 38, 184, 86, 20, + 51, 33, 123, 248, 135, 60, + 0, 250, 1, 0, 0, 0, + 144, 9, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, - 80, 3, 0, 0, 196, 3, - 0, 0, 248, 3, 0, 0, - 28, 9, 0, 0, 82, 68, - 69, 70, 20, 3, 0, 0, + 72, 3, 0, 0, 188, 3, + 0, 0, 240, 3, 0, 0, + 244, 8, 0, 0, 82, 68, + 69, 70, 12, 3, 0, 0, 1, 0, 0, 0, 236, 0, 0, 0, 4, 0, 0, 0, 60, 0, 0, 0, 0, 5, 255, 255, 0, 1, 0, 0, - 233, 2, 0, 0, 82, 68, + 225, 2, 0, 0, 82, 68, 49, 49, 60, 0, 0, 0, 24, 0, 0, 0, 32, 0, 0, 0, 40, 0, 0, 0, @@ -159,47 +158,47 @@ const BYTE g_main[] = 255, 255, 0, 0, 0, 0, 124, 2, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 88, 2, + 2, 0, 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 139, 2, + 0, 0, 0, 0, 136, 2, 0, 0, 8, 0, 0, 0, - 4, 0, 0, 0, 2, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 154, 2, 0, 0, + 0, 0, 144, 2, 0, 0, 12, 0, 0, 0, 4, 0, - 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, - 161, 2, 0, 0, 16, 0, + 152, 2, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 176, 2, + 2, 0, 0, 0, 168, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 212, 2, + 0, 0, 0, 0, 204, 2, 0, 0, 32, 0, 0, 0, 16, 0, 0, 0, 2, 0, - 0, 0, 176, 2, 0, 0, + 0, 0, 168, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 219, 2, 0, 0, + 0, 0, 211, 2, 0, 0, 48, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 176, 2, 0, 0, 0, 0, + 168, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, - 226, 2, 0, 0, 64, 0, + 218, 2, 0, 0, 64, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 176, 2, + 2, 0, 0, 0, 168, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, @@ -213,303 +212,296 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 2, 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, 102, 108, 111, - 97, 116, 52, 0, 1, 0, - 3, 0, 1, 0, 4, 0, + 99, 111, 108, 111, 114, 95, + 115, 99, 97, 108, 101, 0, + 117, 110, 117, 115, 101, 100, + 49, 0, 117, 110, 117, 115, + 101, 100, 50, 0, 89, 111, + 102, 102, 115, 101, 116, 0, + 102, 108, 111, 97, 116, 52, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 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, 160, 2, + 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, - 169, 2, 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, + 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, - 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, 83, 72, 69, 88, - 28, 5, 0, 0, 80, 0, - 0, 0, 71, 1, 0, 0, - 106, 8, 0, 1, 89, 0, - 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 5, 0, - 0, 0, 90, 0, 0, 3, - 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, + 83, 86, 95, 84, 65, 82, + 71, 69, 84, 0, 171, 171, + 83, 72, 69, 88, 252, 4, + 0, 0, 80, 0, 0, 0, + 63, 1, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 1, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, - 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 104, 0, - 0, 2, 4, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, + 0, 0, 104, 0, 0, 2, + 4, 0, 0, 0, 69, 0, + 0, 139, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, 69, 0, 0, 139, 194, 0, 0, 128, 67, 85, 21, 0, - 18, 0, 16, 0, 0, 0, + 98, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, - 1, 0, 0, 0, 70, 126, - 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 38, 125, + 16, 0, 1, 0, 0, 0, 0, 96, 16, 0, 0, 0, - 0, 0, 69, 0, 0, 139, - 194, 0, 0, 128, 67, 85, - 21, 0, 98, 0, 16, 0, - 0, 0, 0, 0, 70, 16, - 16, 0, 1, 0, 0, 0, - 38, 125, 16, 0, 1, 0, - 0, 0, 0, 96, 16, 0, - 0, 0, 0, 0, 0, 0, - 0, 8, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 70, 130, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 16, 0, 0, 8, 18, 0, - 16, 0, 1, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 70, 130, 32, 0, - 0, 0, 0, 0, 2, 0, - 0, 0, 16, 0, 0, 8, - 34, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 16, 0, - 0, 8, 66, 0, 16, 0, + 1, 0, 0, 0, 16, 0, + 0, 8, 18, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, - 0, 0, 4, 0, 0, 0, - 47, 0, 0, 6, 114, 0, - 16, 0, 0, 0, 0, 0, - 70, 2, 16, 128, 129, 0, - 0, 0, 1, 0, 0, 0, - 56, 0, 0, 10, 114, 0, - 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 2, 64, 0, 0, - 172, 205, 79, 60, 172, 205, - 79, 60, 172, 205, 79, 60, - 0, 0, 0, 0, 25, 0, - 0, 5, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 114, 0, + 0, 0, 2, 0, 0, 0, + 16, 0, 0, 8, 34, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, - 0, 0, 2, 64, 0, 0, - 0, 0, 86, 191, 0, 0, - 86, 191, 0, 0, 86, 191, - 0, 0, 0, 0, 52, 0, - 0, 10, 114, 0, 16, 0, - 1, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, - 2, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 50, 0, 0, 16, - 114, 0, 16, 0, 0, 0, - 0, 0, 70, 2, 16, 128, - 65, 0, 0, 0, 0, 0, - 0, 0, 2, 64, 0, 0, - 0, 128, 149, 65, 0, 128, - 149, 65, 0, 128, 149, 65, - 0, 0, 0, 0, 2, 64, - 0, 0, 0, 208, 150, 65, - 0, 208, 150, 65, 0, 208, - 150, 65, 0, 0, 0, 0, - 14, 0, 0, 7, 114, 0, - 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 1, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 16, 0, 0, 8, + 66, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 47, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 47, 0, 0, 6, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 128, 129, 0, 0, 0, - 0, 0, 0, 0, 56, 0, + 1, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 107, 224, - 200, 64, 107, 224, 200, 64, - 107, 224, 200, 64, 0, 0, + 2, 64, 0, 0, 172, 205, + 79, 60, 172, 205, 79, 60, + 172, 205, 79, 60, 0, 0, 0, 0, 25, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, + 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 0, 64, - 28, 70, 0, 64, 28, 70, - 0, 64, 28, 70, 0, 0, - 0, 0, 16, 0, 0, 10, - 18, 0, 16, 0, 1, 0, - 0, 0, 2, 64, 0, 0, - 34, 139, 212, 63, 160, 112, - 22, 191, 35, 45, 149, 189, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 16, 0, 0, 10, 34, 0, - 16, 0, 1, 0, 0, 0, - 2, 64, 0, 0, 127, 18, - 255, 189, 180, 2, 145, 63, - 13, 198, 8, 188, 0, 0, - 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 16, 0, - 0, 10, 66, 0, 16, 0, - 1, 0, 0, 0, 2, 64, - 0, 0, 179, 183, 148, 188, - 205, 5, 206, 189, 60, 51, - 143, 63, 0, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 14, 0, 0, 8, - 114, 0, 16, 0, 0, 0, - 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 246, 143, - 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 0, - 0, 8, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 166, 138, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 56, 0, 0, 10, 114, 0, - 16, 0, 1, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 2, 64, 0, 0, - 205, 204, 76, 60, 205, 204, - 76, 60, 205, 204, 76, 60, - 0, 0, 0, 0, 57, 0, - 0, 11, 130, 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, - 31, 0, 0, 3, 58, 0, - 16, 0, 0, 0, 0, 0, - 29, 0, 0, 10, 114, 0, - 16, 0, 2, 0, 0, 0, - 2, 64, 0, 0, 209, 60, - 128, 62, 209, 60, 128, 62, - 209, 60, 128, 62, 0, 0, - 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 56, 0, - 0, 10, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 66, 96, - 37, 62, 66, 96, 37, 62, - 66, 96, 37, 62, 0, 0, - 0, 0, 47, 0, 0, 6, - 114, 0, 16, 0, 3, 0, - 0, 0, 70, 2, 16, 128, - 129, 0, 0, 0, 1, 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, 85, 85, 213, 62, - 85, 85, 213, 62, 85, 85, - 213, 62, 0, 0, 0, 0, - 25, 0, 0, 5, 114, 0, - 16, 0, 3, 0, 0, 0, - 70, 2, 16, 0, 3, 0, - 0, 0, 50, 0, 0, 15, - 114, 0, 16, 0, 3, 0, - 0, 0, 70, 2, 16, 0, - 3, 0, 0, 0, 2, 64, - 0, 0, 61, 10, 135, 63, - 61, 10, 135, 63, 61, 10, - 135, 63, 0, 0, 0, 0, - 2, 64, 0, 0, 174, 71, - 97, 189, 174, 71, 97, 189, - 174, 71, 97, 189, 0, 0, - 0, 0, 55, 32, 0, 9, + 2, 64, 0, 0, 0, 0, + 86, 191, 0, 0, 86, 191, + 0, 0, 86, 191, 0, 0, + 0, 0, 52, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, - 2, 0, 0, 0, 70, 2, + 1, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 50, 0, 0, 16, 114, 0, 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 3, 0, - 0, 0, 21, 0, 0, 1, - 54, 0, 0, 5, 130, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 128, + 149, 65, 0, 128, 149, 65, + 0, 128, 149, 65, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 208, 150, 65, 0, 208, + 150, 65, 0, 208, 150, 65, + 0, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, 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, + 70, 2, 16, 0, 0, 0, + 0, 0, 47, 0, 0, 6, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 128, + 129, 0, 0, 0, 0, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 107, 224, 200, 64, + 107, 224, 200, 64, 107, 224, + 200, 64, 0, 0, 0, 0, + 25, 0, 0, 5, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 64, 28, 70, + 0, 64, 28, 70, 0, 64, + 28, 70, 0, 0, 0, 0, + 16, 0, 0, 10, 18, 0, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 34, 139, + 212, 63, 160, 112, 22, 191, + 35, 45, 149, 189, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 16, 0, + 0, 10, 34, 0, 16, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 127, 18, 255, 189, + 180, 2, 145, 63, 13, 198, + 8, 188, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 16, 0, 0, 10, + 66, 0, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 179, 183, 148, 188, 205, 5, + 206, 189, 60, 51, 143, 63, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 86, 133, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 205, 204, 76, 60, + 205, 204, 76, 60, 205, 204, + 76, 60, 0, 0, 0, 0, + 57, 0, 0, 11, 130, 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, 31, 0, 0, 3, + 58, 0, 16, 0, 0, 0, + 0, 0, 29, 0, 0, 10, + 114, 0, 16, 0, 2, 0, + 0, 0, 2, 64, 0, 0, + 209, 60, 128, 62, 209, 60, + 128, 62, 209, 60, 128, 62, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 66, 96, 37, 62, 66, 96, + 37, 62, 66, 96, 37, 62, + 0, 0, 0, 0, 47, 0, + 0, 6, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 128, 129, 0, 0, 0, + 1, 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, 85, 85, + 213, 62, 85, 85, 213, 62, + 85, 85, 213, 62, 0, 0, + 0, 0, 25, 0, 0, 5, + 114, 0, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 15, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 61, 10, + 135, 63, 61, 10, 135, 63, + 61, 10, 135, 63, 0, 0, + 0, 0, 2, 64, 0, 0, + 174, 71, 97, 189, 174, 71, + 97, 189, 174, 71, 97, 189, + 0, 0, 0, 0, 55, 32, + 0, 9, 114, 0, 16, 0, + 1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, 0, - 62, 0, 0, 1, 83, 84, - 65, 84, 148, 0, 0, 0, - 36, 0, 0, 0, 4, 0, + 70, 2, 16, 0, 0, 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, 148, 0, + 0, 0, 35, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 28, 0, + 1, 0, 0, 0, 1, 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, 2, 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, 2, 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, 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 }; diff --git a/src/render/direct3d11/D3D11_PixelShader_HDR10.hlsl b/src/render/direct3d11/D3D11_PixelShader_HDR10.hlsl index 493c0349a..d7878e91c 100644 --- a/src/render/direct3d11/D3D11_PixelShader_HDR10.hlsl +++ b/src/render/direct3d11/D3D11_PixelShader_HDR10.hlsl @@ -24,7 +24,6 @@ float4 main(PixelShaderInput input) : SV_TARGET -0.124547, 1.132895, -0.008348, -0.018154, -0.100597, 1.118751 }; - float4 Output; float3 yuv; yuv.x = theTextureY.Sample(theSampler, input.tex).r; @@ -40,19 +39,7 @@ float4 main(PixelShaderInput input) : SV_TARGET rgb = mul(mat2020to709, rgb); - rgb = (rgb / maxCLL) * HDR_whitelevel; - rgb = scRGBfromNits(rgb); - if (!scRGB_output) { - rgb.r = sRGBfromLinear(rgb.r); - rgb.g = sRGBfromLinear(rgb.g); - rgb.b = sRGBfromLinear(rgb.b); - rgb.rgb = clamp(rgb.rgb, 0.0, 1.0); - } - - Output.rgb = rgb.rgb; - Output.a = 1.0; - - return Output * input.color; + return GetOutputColorFromSCRGB(rgb) * input.color; } diff --git a/src/render/direct3d11/D3D11_PixelShader_NV12.h b/src/render/direct3d11/D3D11_PixelShader_NV12.h index d6e3445ef..2a76fbaed 100644 --- a/src/render/direct3d11/D3D11_PixelShader_NV12.h +++ b/src/render/direct3d11/D3D11_PixelShader_NV12.h @@ -9,9 +9,9 @@ // { // // float scRGB_output; // Offset: 0 Size: 4 -// float SDR_whitelevel; // Offset: 4 Size: 4 [unused] -// float HDR_whitelevel; // Offset: 8 Size: 4 [unused] -// float maxCLL; // Offset: 12 Size: 4 [unused] +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 // float4 Rcoeff; // Offset: 32 Size: 16 // float4 Gcoeff; // Offset: 48 Size: 16 @@ -101,11 +101,12 @@ cmp r2.z, r1.w, r0.x, r2.w mul r1.w, c0.x, c0.x cmp r0.xyz, -r1.w, r1, r2 + mul r0.xyz, r0, c0.y mov r0.w, c6.y mul r0, r0, t1 mov oC0, r0 -// approximately 39 instruction slots used (2 texture, 37 arithmetic) +// approximately 40 instruction slots used (2 texture, 38 arithmetic) ps_4_0 dcl_constantbuffer CB0[5], immediateIndexed dcl_sampler s0, mode_default @@ -133,27 +134,28 @@ if_nz r0.x exp r3.xyz, r3.xyzx movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx endif -mov r1.w, l(1.000000) -mul o0.xyzw, r1.xyzw, v2.xyzw +mul r0.xyz, r1.xyzx, cb0[0].yyyy +mov r0.w, l(1.000000) +mul o0.xyzw, r0.xyzw, v2.xyzw ret -// Approximately 21 instruction slots used +// Approximately 22 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 57, 206, - 5, 226, 160, 185, 110, 25, - 70, 167, 109, 22, 187, 226, - 244, 122, 1, 0, 0, 0, - 52, 9, 0, 0, 6, 0, + 68, 88, 66, 67, 58, 20, + 110, 34, 151, 86, 32, 17, + 118, 15, 98, 32, 139, 247, + 137, 113, 1, 0, 0, 0, + 88, 9, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, - 232, 2, 0, 0, 196, 5, - 0, 0, 64, 6, 0, 0, - 140, 8, 0, 0, 0, 9, + 248, 2, 0, 0, 244, 5, + 0, 0, 112, 6, 0, 0, + 176, 8, 0, 0, 36, 9, 0, 0, 65, 111, 110, 57, - 168, 2, 0, 0, 168, 2, + 184, 2, 0, 0, 184, 2, 0, 0, 0, 2, 255, 255, - 112, 2, 0, 0, 56, 0, + 128, 2, 0, 0, 56, 0, 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, 56, 0, 2, 0, 36, 0, @@ -257,141 +259,149 @@ const BYTE g_main[] = 0, 160, 88, 0, 0, 4, 0, 0, 7, 128, 1, 0, 255, 129, 1, 0, 228, 128, - 2, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 128, - 6, 0, 85, 160, 5, 0, - 0, 3, 0, 0, 15, 128, - 0, 0, 228, 128, 1, 0, - 228, 176, 1, 0, 0, 2, - 0, 8, 15, 128, 0, 0, - 228, 128, 255, 255, 0, 0, - 83, 72, 68, 82, 212, 2, - 0, 0, 64, 0, 0, 0, - 181, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 5, 0, - 0, 0, 90, 0, 0, 3, - 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, + 2, 0, 228, 128, 5, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 228, 128, 0, 0, + 85, 160, 1, 0, 0, 2, + 0, 0, 8, 128, 6, 0, + 85, 160, 5, 0, 0, 3, + 0, 0, 15, 128, 0, 0, + 228, 128, 1, 0, 228, 176, + 1, 0, 0, 2, 0, 8, + 15, 128, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, + 68, 82, 244, 2, 0, 0, + 64, 0, 0, 0, 189, 0, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 1, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, - 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 104, 0, - 0, 2, 4, 0, 0, 0, - 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 69, 0, 0, 9, 242, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, + 0, 0, 104, 0, 0, 2, + 4, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 38, 125, 16, 0, - 1, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 18, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 10, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 8, - 114, 0, 16, 0, 0, 0, - 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 70, 130, - 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 16, 0, - 0, 8, 18, 0, 16, 0, - 1, 0, 0, 0, 70, 2, + 38, 125, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, - 70, 130, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 16, 0, 0, 8, 34, 0, - 16, 0, 1, 0, 0, 0, - 70, 2, 16, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, 0, 0, 70, 130, 32, 0, - 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 8, - 66, 0, 16, 0, 1, 0, + 18, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, 0, 0, - 4, 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, - 31, 0, 4, 3, 10, 0, - 16, 0, 0, 0, 0, 0, - 29, 0, 0, 10, 114, 0, - 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 230, 174, - 37, 61, 230, 174, 37, 61, - 230, 174, 37, 61, 0, 0, - 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 56, 0, - 0, 10, 114, 0, 16, 0, - 2, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, - 2, 64, 0, 0, 145, 131, - 158, 61, 145, 131, 158, 61, - 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, + 2, 0, 0, 0, 16, 0, + 0, 8, 34, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 2, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 16, 0, 0, 8, 66, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 4, 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, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 29, 0, + 0, 10, 114, 0, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 230, 174, 37, 61, + 230, 174, 37, 61, 230, 174, + 37, 61, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 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, + 1, 0, 0, 0, 2, 64, + 0, 0, 145, 131, 158, 61, + 145, 131, 158, 61, 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, + 56, 0, 0, 8, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 86, 133, 32, 0, + 0, 0, 0, 0, 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, 1, 0, 0, 0, + 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, 21, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 12, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, @@ -408,12 +418,12 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 68, 2, 0, 0, + 69, 70, 56, 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, + 13, 2, 0, 0, 156, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -453,46 +463,44 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 196, 1, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 180, 1, + 2, 0, 0, 0, 180, 1, 0, 0, 0, 0, 0, 0, - 211, 1, 0, 0, 8, 0, + 208, 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, + 216, 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, + 224, 1, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 4, 2, 0, 0, 32, 0, + 248, 1, 0, 0, 32, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 11, 2, 0, 0, 48, 0, + 255, 1, 0, 0, 48, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 18, 2, 0, 0, 64, 0, + 6, 2, 0, 0, 64, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 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, + 0, 0, 99, 111, 108, 111, + 114, 95, 115, 99, 97, 108, + 101, 0, 117, 110, 117, 115, + 101, 100, 49, 0, 117, 110, + 117, 115, 101, 100, 50, 0, + 89, 111, 102, 102, 115, 101, + 116, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 99, 111, 101, 102, 102, diff --git a/src/render/direct3d11/D3D11_PixelShader_NV21.h b/src/render/direct3d11/D3D11_PixelShader_NV21.h index 74be46d18..3db1d52c2 100644 --- a/src/render/direct3d11/D3D11_PixelShader_NV21.h +++ b/src/render/direct3d11/D3D11_PixelShader_NV21.h @@ -9,9 +9,9 @@ // { // // float scRGB_output; // Offset: 0 Size: 4 -// float SDR_whitelevel; // Offset: 4 Size: 4 [unused] -// float HDR_whitelevel; // Offset: 8 Size: 4 [unused] -// float maxCLL; // Offset: 12 Size: 4 [unused] +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 // float4 Rcoeff; // Offset: 32 Size: 16 // float4 Gcoeff; // Offset: 48 Size: 16 @@ -102,11 +102,12 @@ cmp r2.z, r1.w, r0.x, r2.w mul r1.w, c0.x, c0.x cmp r0.xyz, -r1.w, r1, r2 + mul r0.xyz, r0, c0.y mov r0.w, c6.y mul r0, r0, t1 mov oC0, r0 -// approximately 40 instruction slots used (2 texture, 38 arithmetic) +// approximately 41 instruction slots used (2 texture, 39 arithmetic) ps_4_0 dcl_constantbuffer CB0[5], immediateIndexed dcl_sampler s0, mode_default @@ -134,27 +135,28 @@ if_nz r0.x exp r3.xyz, r3.xyzx movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx endif -mov r1.w, l(1.000000) -mul o0.xyzw, r1.xyzw, v2.xyzw +mul r0.xyz, r1.xyzx, cb0[0].yyyy +mov r0.w, l(1.000000) +mul o0.xyzw, r0.xyzw, v2.xyzw ret -// Approximately 21 instruction slots used +// Approximately 22 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 103, 251, - 56, 113, 174, 118, 96, 85, - 191, 91, 87, 213, 153, 143, - 217, 253, 1, 0, 0, 0, - 64, 9, 0, 0, 6, 0, + 68, 88, 66, 67, 150, 187, + 194, 202, 50, 132, 111, 243, + 88, 169, 196, 166, 186, 146, + 56, 89, 1, 0, 0, 0, + 100, 9, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, - 244, 2, 0, 0, 208, 5, - 0, 0, 76, 6, 0, 0, - 152, 8, 0, 0, 12, 9, + 4, 3, 0, 0, 0, 6, + 0, 0, 124, 6, 0, 0, + 188, 8, 0, 0, 48, 9, 0, 0, 65, 111, 110, 57, - 180, 2, 0, 0, 180, 2, + 196, 2, 0, 0, 196, 2, 0, 0, 0, 2, 255, 255, - 124, 2, 0, 0, 56, 0, + 140, 2, 0, 0, 56, 0, 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, 56, 0, 2, 0, 36, 0, @@ -260,141 +262,149 @@ const BYTE g_main[] = 0, 160, 88, 0, 0, 4, 0, 0, 7, 128, 1, 0, 255, 129, 1, 0, 228, 128, - 2, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 128, - 6, 0, 85, 160, 5, 0, - 0, 3, 0, 0, 15, 128, - 0, 0, 228, 128, 1, 0, - 228, 176, 1, 0, 0, 2, - 0, 8, 15, 128, 0, 0, - 228, 128, 255, 255, 0, 0, - 83, 72, 68, 82, 212, 2, - 0, 0, 64, 0, 0, 0, - 181, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 5, 0, - 0, 0, 90, 0, 0, 3, - 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, + 2, 0, 228, 128, 5, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 228, 128, 0, 0, + 85, 160, 1, 0, 0, 2, + 0, 0, 8, 128, 6, 0, + 85, 160, 5, 0, 0, 3, + 0, 0, 15, 128, 0, 0, + 228, 128, 1, 0, 228, 176, + 1, 0, 0, 2, 0, 8, + 15, 128, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, + 68, 82, 244, 2, 0, 0, + 64, 0, 0, 0, 189, 0, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 1, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, - 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 104, 0, - 0, 2, 4, 0, 0, 0, - 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 69, 0, 0, 9, 242, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, + 0, 0, 104, 0, 0, 2, + 4, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 102, 124, 16, 0, - 1, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 18, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 10, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 8, - 114, 0, 16, 0, 0, 0, - 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 70, 130, - 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 16, 0, - 0, 8, 18, 0, 16, 0, - 1, 0, 0, 0, 70, 2, + 102, 124, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, - 70, 130, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 16, 0, 0, 8, 34, 0, - 16, 0, 1, 0, 0, 0, - 70, 2, 16, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, 0, 0, 70, 130, 32, 0, - 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 8, - 66, 0, 16, 0, 1, 0, + 18, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, 0, 0, - 4, 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, - 31, 0, 4, 3, 10, 0, - 16, 0, 0, 0, 0, 0, - 29, 0, 0, 10, 114, 0, - 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 230, 174, - 37, 61, 230, 174, 37, 61, - 230, 174, 37, 61, 0, 0, - 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 56, 0, - 0, 10, 114, 0, 16, 0, - 2, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, - 2, 64, 0, 0, 145, 131, - 158, 61, 145, 131, 158, 61, - 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, + 2, 0, 0, 0, 16, 0, + 0, 8, 34, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 2, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 16, 0, 0, 8, 66, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 4, 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, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 29, 0, + 0, 10, 114, 0, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 230, 174, 37, 61, + 230, 174, 37, 61, 230, 174, + 37, 61, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 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, + 1, 0, 0, 0, 2, 64, + 0, 0, 145, 131, 158, 61, + 145, 131, 158, 61, 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, + 56, 0, 0, 8, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 86, 133, 32, 0, + 0, 0, 0, 0, 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, 1, 0, 0, 0, + 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, 21, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 12, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, @@ -411,12 +421,12 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 68, 2, 0, 0, + 69, 70, 56, 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, + 13, 2, 0, 0, 156, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -456,46 +466,44 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 196, 1, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 180, 1, + 2, 0, 0, 0, 180, 1, 0, 0, 0, 0, 0, 0, - 211, 1, 0, 0, 8, 0, + 208, 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, + 216, 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, + 224, 1, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 4, 2, 0, 0, 32, 0, + 248, 1, 0, 0, 32, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 11, 2, 0, 0, 48, 0, + 255, 1, 0, 0, 48, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 1, 0, 0, 0, 0, 0, 0, - 18, 2, 0, 0, 64, 0, + 6, 2, 0, 0, 64, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 244, 1, + 2, 0, 0, 0, 232, 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, + 0, 0, 99, 111, 108, 111, + 114, 95, 115, 99, 97, 108, + 101, 0, 117, 110, 117, 115, + 101, 100, 49, 0, 117, 110, + 117, 115, 101, 100, 50, 0, + 89, 111, 102, 102, 115, 101, + 116, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 99, 111, 101, 102, 102, diff --git a/src/render/direct3d11/D3D11_PixelShader_Textures.h b/src/render/direct3d11/D3D11_PixelShader_Textures.h index 390c4353f..8103dbdb8 100644 --- a/src/render/direct3d11/D3D11_PixelShader_Textures.h +++ b/src/render/direct3d11/D3D11_PixelShader_Textures.h @@ -8,10 +8,10 @@ // cbuffer Constants // { // -// 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] +// float scRGB_output; // Offset: 0 Size: 4 [unused] +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 [unused] // float4 Rcoeff; // Offset: 32 Size: 16 [unused] // float4 Gcoeff; // Offset: 48 Size: 16 [unused] @@ -63,19 +63,15 @@ // Level9 shader bytecode: // ps_2_0 - def c1, 0.0125000002, 0, 0, 0 dcl t0.xy dcl t1 dcl_2d s0 texld r0, t0, s0 - mul r1.w, c0.x, c0.x - mul r1.xyz, r0, c0.y - mul r1.xyz, r1, c1.x - cmp r0.xyz, -r1.w, r0, r1 + mul r0.xyz, r0, c0.y mul r0, r0, t1 mov oC0, r0 -// approximately 7 instruction slots used (1 texture, 6 arithmetic) +// approximately 4 instruction slots used (1 texture, 3 arithmetic) ps_4_0 dcl_constantbuffer CB0[1], immediateIndexed dcl_sampler s0, mode_default @@ -83,32 +79,29 @@ dcl_resource_texture2d (float,float,float,float) t0 dcl_input_ps linear v1.xy dcl_input_ps linear v2.xyzw dcl_output o0.xyzw -dcl_temps 2 -ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].x -sample r1.xyzw, v1.xyxx, t0.xyzw, s0 -mul r0.yzw, r1.xxyz, cb0[0].yyyy -mul r0.yzw, r0.yyzw, l(0.000000, 0.012500, 0.012500, 0.012500) -movc r1.xyz, r0.xxxx, r0.yzwy, r1.xyzx -mul o0.xyzw, r1.xyzw, v2.xyzw +dcl_temps 1 +sample r0.xyzw, v1.xyxx, t0.xyzw, s0 +mul r0.xyz, r0.xyzx, cb0[0].yyyy +mul o0.xyzw, r0.xyzw, v2.xyzw ret -// Approximately 7 instruction slots used +// Approximately 4 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 129, 29, - 250, 77, 23, 118, 4, 254, - 122, 59, 184, 144, 253, 202, - 233, 166, 1, 0, 0, 0, - 172, 5, 0, 0, 6, 0, + 68, 88, 66, 67, 159, 171, + 49, 134, 139, 171, 105, 34, + 166, 1, 101, 132, 110, 4, + 121, 76, 1, 0, 0, 0, + 220, 4, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, - 40, 1, 0, 0, 108, 2, - 0, 0, 232, 2, 0, 0, - 4, 5, 0, 0, 120, 5, + 220, 0, 0, 0, 168, 1, + 0, 0, 36, 2, 0, 0, + 52, 4, 0, 0, 168, 4, 0, 0, 65, 111, 110, 57, - 232, 0, 0, 0, 232, 0, + 156, 0, 0, 0, 156, 0, 0, 0, 0, 2, 255, 255, - 180, 0, 0, 0, 52, 0, + 104, 0, 0, 0, 52, 0, 0, 0, 1, 0, 40, 0, 0, 0, 52, 0, 0, 0, 52, 0, 1, 0, 36, 0, @@ -116,10 +109,6 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 255, 255, - 81, 0, 0, 5, 1, 0, - 15, 160, 205, 204, 76, 60, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, 0, 2, 0, 0, 0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, @@ -129,213 +118,183 @@ const BYTE g_main[] = 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 5, 0, - 0, 3, 1, 0, 8, 128, - 0, 0, 0, 160, 0, 0, - 0, 160, 5, 0, 0, 3, - 1, 0, 7, 128, 0, 0, - 228, 128, 0, 0, 85, 160, - 5, 0, 0, 3, 1, 0, - 7, 128, 1, 0, 228, 128, - 1, 0, 0, 160, 88, 0, - 0, 4, 0, 0, 7, 128, - 1, 0, 255, 129, 0, 0, - 228, 128, 1, 0, 228, 128, - 5, 0, 0, 3, 0, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 228, 128, 0, 0, + 85, 160, 5, 0, 0, 3, + 0, 0, 15, 128, 0, 0, + 228, 128, 1, 0, 228, 176, + 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, - 1, 0, 228, 176, 1, 0, - 0, 2, 0, 8, 15, 128, - 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, - 60, 1, 0, 0, 64, 0, - 0, 0, 79, 0, 0, 0, - 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, - 0, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, - 0, 0, 98, 16, 0, 3, - 50, 16, 16, 0, 1, 0, - 0, 0, 98, 16, 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, - 2, 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, + 255, 255, 0, 0, 83, 72, + 68, 82, 196, 0, 0, 0, + 64, 0, 0, 0, 49, 0, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 1, 0, 0, 0, 98, 16, + 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, 69, 0, 0, 9, 242, 0, - 16, 0, 1, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 8, 226, 0, + 56, 0, 0, 8, 114, 0, 16, 0, 0, 0, 0, 0, - 6, 9, 16, 0, 1, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 86, 133, 32, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 56, 0, 0, 10, - 226, 0, 16, 0, 0, 0, - 0, 0, 86, 14, 16, 0, - 0, 0, 0, 0, 2, 64, - 0, 0, 0, 0, 0, 0, - 205, 204, 76, 60, 205, 204, - 76, 60, 205, 204, 76, 60, - 55, 0, 0, 9, 114, 0, - 16, 0, 1, 0, 0, 0, - 6, 0, 16, 0, 0, 0, - 0, 0, 150, 7, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, - 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, 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, + 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 3, 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, 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, 82, 68, 69, 70, + 8, 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, 221, 1, + 0, 0, 124, 0, 0, 0, + 3, 0, 0, 0, 0, 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, + 1, 0, 0, 0, 135, 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, + 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, - 32, 0, 0, 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, 0, 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, 160, 1, + 0, 0, 8, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 132, 1, 0, 0, + 0, 0, 0, 0, 168, 1, + 0, 0, 12, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 132, 1, 0, 0, + 0, 0, 0, 0, 176, 1, + 0, 0, 16, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 184, 1, 0, 0, + 0, 0, 0, 0, 200, 1, + 0, 0, 32, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 184, 1, 0, 0, + 0, 0, 0, 0, 207, 1, + 0, 0, 48, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 184, 1, 0, 0, + 0, 0, 0, 0, 214, 1, + 0, 0, 64, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 184, 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, + 99, 111, 108, 111, 114, 95, + 115, 99, 97, 108, 101, 0, + 117, 110, 117, 115, 101, 100, + 49, 0, 117, 110, 117, 115, + 101, 100, 50, 0, 89, 111, + 102, 102, 115, 101, 116, 0, + 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, - 83, 86, 95, 84, 65, 82, - 71, 69, 84, 0, 171, 171 + 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 }; diff --git a/src/render/direct3d11/D3D11_PixelShader_YUV.h b/src/render/direct3d11/D3D11_PixelShader_YUV.h index d99c686c7..158763bf7 100644 --- a/src/render/direct3d11/D3D11_PixelShader_YUV.h +++ b/src/render/direct3d11/D3D11_PixelShader_YUV.h @@ -9,9 +9,9 @@ // { // // float scRGB_output; // Offset: 0 Size: 4 -// float SDR_whitelevel; // Offset: 4 Size: 4 [unused] -// float HDR_whitelevel; // Offset: 8 Size: 4 [unused] -// float maxCLL; // Offset: 12 Size: 4 [unused] +// float color_scale; // Offset: 4 Size: 4 +// float unused1; // Offset: 8 Size: 4 [unused] +// float unused2; // Offset: 12 Size: 4 [unused] // float4 Yoffset; // Offset: 16 Size: 16 // float4 Rcoeff; // Offset: 32 Size: 16 // float4 Gcoeff; // Offset: 48 Size: 16 @@ -106,11 +106,12 @@ cmp r2.z, r1.w, r0.x, r2.w mul r1.w, c0.x, c0.x cmp r0.xyz, -r1.w, r1, r2 + mul r0.xyz, r0, c0.y mov r0.w, c6.y mul r0, r0, t1 mov oC0, r0 -// approximately 41 instruction slots used (3 texture, 38 arithmetic) +// approximately 42 instruction slots used (3 texture, 39 arithmetic) ps_4_0 dcl_constantbuffer CB0[5], immediateIndexed dcl_sampler s0, mode_default @@ -141,27 +142,28 @@ if_nz r0.x exp r3.xyz, r3.xyzx movc r1.xyz, r0.xyzx, r2.xyzx, r3.xyzx endif -mov r1.w, l(1.000000) -mul o0.xyzw, r1.xyzw, v2.xyzw +mul r0.xyz, r1.xyzx, cb0[0].yyyy +mov r0.w, l(1.000000) +mul o0.xyzw, r0.xyzw, v2.xyzw ret -// Approximately 23 instruction slots used +// Approximately 24 instruction slots used #endif const BYTE g_main[] = { - 68, 88, 66, 67, 9, 92, - 101, 235, 212, 83, 42, 215, - 158, 193, 215, 73, 102, 13, - 226, 183, 1, 0, 0, 0, - 212, 9, 0, 0, 6, 0, + 68, 88, 66, 67, 84, 14, + 232, 134, 42, 204, 66, 203, + 56, 83, 173, 74, 161, 2, + 47, 168, 1, 0, 0, 0, + 248, 9, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, - 20, 3, 0, 0, 56, 6, - 0, 0, 180, 6, 0, 0, - 44, 9, 0, 0, 160, 9, + 36, 3, 0, 0, 104, 6, + 0, 0, 228, 6, 0, 0, + 80, 9, 0, 0, 196, 9, 0, 0, 65, 111, 110, 57, - 212, 2, 0, 0, 212, 2, + 228, 2, 0, 0, 228, 2, 0, 0, 0, 2, 255, 255, - 152, 2, 0, 0, 60, 0, + 168, 2, 0, 0, 60, 0, 0, 0, 1, 0, 48, 0, 0, 0, 60, 0, 0, 0, 60, 0, 3, 0, 36, 0, @@ -273,152 +275,160 @@ const BYTE g_main[] = 0, 4, 0, 0, 7, 128, 1, 0, 255, 129, 1, 0, 228, 128, 2, 0, 228, 128, - 1, 0, 0, 2, 0, 0, - 8, 128, 6, 0, 85, 160, 5, 0, 0, 3, 0, 0, - 15, 128, 0, 0, 228, 128, - 1, 0, 228, 176, 1, 0, - 0, 2, 0, 8, 15, 128, - 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, - 28, 3, 0, 0, 64, 0, - 0, 0, 199, 0, 0, 0, - 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, - 0, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, + 7, 128, 0, 0, 228, 128, + 0, 0, 85, 160, 1, 0, + 0, 2, 0, 0, 8, 128, + 6, 0, 85, 160, 5, 0, + 0, 3, 0, 0, 15, 128, + 0, 0, 228, 128, 1, 0, + 228, 176, 1, 0, 0, 2, + 0, 8, 15, 128, 0, 0, + 228, 128, 255, 255, 0, 0, + 83, 72, 68, 82, 60, 3, + 0, 0, 64, 0, 0, 0, + 207, 0, 0, 0, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 90, 0, 0, 3, + 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 1, 0, + 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 2, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 98, 16, - 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, 4, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 1, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 2, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 150, 124, 16, 0, - 2, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 18, 0, - 16, 0, 2, 0, 0, 0, - 10, 0, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, - 34, 0, 16, 0, 2, 0, - 0, 0, 10, 0, 16, 0, - 1, 0, 0, 0, 0, 0, - 0, 8, 114, 0, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 2, 0, 0, 0, - 70, 130, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 16, 0, 0, 8, 18, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 2, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 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, + 4, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 70, 130, 32, 0, - 0, 0, 0, 0, 2, 0, - 0, 0, 16, 0, 0, 8, - 34, 0, 16, 0, 1, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 70, 126, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 2, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 150, 124, 16, 0, 2, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 2, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 70, 130, + 2, 0, 0, 0, 70, 130, 32, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 16, 0, - 0, 8, 66, 0, 16, 0, + 1, 0, 0, 0, 16, 0, + 0, 8, 18, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 70, 130, 32, 0, 0, 0, - 0, 0, 4, 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, 31, 0, 4, 3, - 10, 0, 16, 0, 0, 0, - 0, 0, 29, 0, 0, 10, - 114, 0, 16, 0, 0, 0, - 0, 0, 2, 64, 0, 0, - 230, 174, 37, 61, 230, 174, - 37, 61, 230, 174, 37, 61, - 0, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, - 56, 0, 0, 10, 114, 0, - 16, 0, 2, 0, 0, 0, - 70, 2, 16, 0, 1, 0, - 0, 0, 2, 64, 0, 0, - 145, 131, 158, 61, 145, 131, - 158, 61, 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, + 0, 0, 2, 0, 0, 0, + 16, 0, 0, 8, 34, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 16, 0, 0, 8, + 66, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 4, 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, + 31, 0, 4, 3, 10, 0, + 16, 0, 0, 0, 0, 0, + 29, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 230, 174, + 37, 61, 230, 174, 37, 61, + 230, 174, 37, 61, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, 2, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 145, 131, + 158, 61, 145, 131, 158, 61, + 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, - 21, 0, 0, 1, 54, 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, 56, 0, 0, 8, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 86, 133, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 54, 0, 0, 5, 130, 0, 16, 0, - 1, 0, 0, 0, 1, 64, + 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, 1, 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, 23, 0, + 116, 0, 0, 0, 24, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 12, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, @@ -435,12 +445,12 @@ const BYTE g_main[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 112, 2, + 82, 68, 69, 70, 100, 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, + 0, 0, 57, 2, 0, 0, 188, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -487,46 +497,44 @@ const BYTE g_main[] = 0, 0, 224, 1, 0, 0, 0, 0, 0, 0, 240, 1, 0, 0, 4, 0, 0, 0, - 4, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 2, 0, 0, 0, 224, 1, 0, 0, - 0, 0, 0, 0, 255, 1, + 0, 0, 0, 0, 252, 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, 0, 0, 4, 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, 0, 0, 12, 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, 20, 2, 0, 0, + 0, 0, 0, 0, 36, 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, 20, 2, 0, 0, + 0, 0, 0, 0, 43, 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, 20, 2, 0, 0, + 0, 0, 0, 0, 50, 2, 0, 0, 64, 0, 0, 0, 16, 0, 0, 0, 2, 0, - 0, 0, 32, 2, 0, 0, + 0, 0, 20, 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, + 99, 111, 108, 111, 114, 95, + 115, 99, 97, 108, 101, 0, + 117, 110, 117, 115, 101, 100, + 49, 0, 117, 110, 117, 115, + 101, 100, 50, 0, 89, 111, + 102, 102, 115, 101, 116, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 99, diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 516aae681..2b7ce5896 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -77,12 +77,20 @@ typedef struct typedef struct { float scRGB_output; - float SDR_whitelevel; - float HDR_whitelevel; - float maxCLL; + float color_scale; + float unused1; + float unused2; float YCbCr_matrix[16]; } PixelShaderConstants; +typedef struct +{ + ID3D11Buffer *constants; + SDL_bool scRGB_output; + float color_scale; + const float *shader_params; +} PixelShaderState; + /* Per-vertex data */ typedef struct { @@ -147,7 +155,6 @@ typedef struct size_t vertexBufferSizes[8]; ID3D11VertexShader *vertexShader; ID3D11PixelShader *pixelShaders[NUM_SHADERS]; - ID3D11Buffer *pixelShaderConstants[NUM_SHADERS]; int blendModesCount; D3D11_BlendMode *blendModes; ID3D11SamplerState *nearestPixelSampler; @@ -155,11 +162,6 @@ typedef struct D3D_FEATURE_LEVEL featureLevel; SDL_bool pixelSizeChanged; - /* HDR state */ - SDL_bool HDR_enabled; - int SDR_whitelevel; - int HDR_whitelevel; - /* Rasterizers */ ID3D11RasterizerState *mainRasterizer; ID3D11RasterizerState *clippedRasterizer; @@ -174,7 +176,7 @@ typedef struct ID3D11RasterizerState *currentRasterizerState; ID3D11BlendState *currentBlendState; D3D11_Shader currentShader; - const float *currentShaderParams[NUM_SHADERS]; + PixelShaderState currentShaderState[NUM_SHADERS]; ID3D11ShaderResourceView *currentShaderResource; ID3D11SamplerState *currentSampler; SDL_bool cliprectDirty; @@ -325,8 +327,8 @@ static void D3D11_ReleaseAll(SDL_Renderer *renderer) for (i = 0; i < SDL_arraysize(data->pixelShaders); ++i) { SAFE_RELEASE(data->pixelShaders[i]); } - for (i = 0; i < SDL_arraysize(data->pixelShaderConstants); ++i) { - SAFE_RELEASE(data->pixelShaderConstants[i]); + for (i = 0; i < SDL_arraysize(data->currentShaderState); ++i) { + SAFE_RELEASE(data->currentShaderState[i].constants); } SAFE_RELEASE(data->vertexShader); for (i = 0; i < SDL_arraysize(data->vertexBuffers); ++i) { @@ -352,7 +354,7 @@ static void D3D11_ReleaseAll(SDL_Renderer *renderer) data->currentRasterizerState = NULL; data->currentBlendState = NULL; data->currentShader = SHADER_NONE; - SDL_zero(data->currentShaderParams); + SDL_zero(data->currentShaderState); data->currentShaderResource = NULL; data->currentSampler = NULL; @@ -380,21 +382,6 @@ static void D3D11_DestroyRenderer(SDL_Renderer *renderer) SDL_free(renderer); } -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; - } -} - static D3D11_BLEND GetBlendFunc(SDL_BlendFactor factor) { switch (factor) { @@ -736,8 +723,6 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); - D3D11_UpdateHDRState(renderer); - done: SAFE_RELEASE(d3dDevice); SAFE_RELEASE(d3dContext); @@ -2139,6 +2124,9 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c const SDL_BlendMode blendMode = cmd->data.draw.blend; ID3D11BlendState *blendState = NULL; SDL_bool updateSubresource = SDL_FALSE; + SDL_bool scRGB_output = SDL_RenderingLinearSpace(renderer); + float color_scale = cmd->data.draw.color_scale; + PixelShaderState *shader_state = &rendererData->currentShaderState[shader]; if (numShaderResources > 0) { shaderResource = shaderResources[0]; @@ -2212,20 +2200,15 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c rendererData->currentBlendState = blendState; } - if (!rendererData->pixelShaderConstants[shader] || - shader_params != rendererData->currentShaderParams[shader]) { - SAFE_RELEASE(rendererData->pixelShaderConstants[shader]); + if (!shader_state->constants || + scRGB_output != shader_state->scRGB_output || + color_scale != shader_state->color_scale || + shader_params != shader_state->shader_params) { + SAFE_RELEASE(shader_state->constants); 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; - + constants.scRGB_output = (float)scRGB_output; + constants.color_scale = color_scale; if (shader_params) { SDL_memcpy(constants.YCbCr_matrix, shader_params, sizeof(constants.YCbCr_matrix)); } @@ -2240,12 +2223,16 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c SDL_zero(data); data.pSysMem = &constants; - HRESULT result = ID3D11Device_CreateBuffer(rendererData->d3dDevice, &desc, &data, &rendererData->pixelShaderConstants[shader]); + HRESULT result = ID3D11Device_CreateBuffer(rendererData->d3dDevice, &desc, &data, &shader_state->constants); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device::CreateBuffer [create shader constants]"), result); return -1; } - rendererData->currentShaderParams[shader] = shader_params; + shader_state->scRGB_output = scRGB_output; + shader_state->color_scale = color_scale; + shader_state->shader_params = shader_params; + + /* Force the shader parameters to be re-set */ rendererData->currentShader = SHADER_NONE; } if (shader != rendererData->currentShader) { @@ -2255,8 +2242,8 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c } } ID3D11DeviceContext_PSSetShader(rendererData->d3dContext, rendererData->pixelShaders[shader], NULL, 0); - if (rendererData->pixelShaderConstants[shader]) { - ID3D11DeviceContext_PSSetConstantBuffers(rendererData->d3dContext, 0, 1, &rendererData->pixelShaderConstants[shader]); + if (rendererData->currentShaderState[shader].constants) { + ID3D11DeviceContext_PSSetConstantBuffers(rendererData->d3dContext, 0, 1, &rendererData->currentShaderState[shader].constants); } rendererData->currentShader = shader; } @@ -2338,8 +2325,7 @@ static void D3D11_InvalidateCachedState(SDL_Renderer *renderer) data->currentRenderTargetView = NULL; data->currentRasterizerState = NULL; data->currentBlendState = NULL; - data->currentShader = NUM_SHADERS; - SDL_zero(data->currentShaderParams); + data->currentShader = SHADER_NONE; data->currentShaderResource = NULL; data->currentSampler = NULL; data->cliprectDirty = SDL_TRUE; @@ -2401,14 +2387,11 @@ static int D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_bool convert_color = SDL_RenderingLinearSpace(renderer); SDL_FColor color = cmd->data.color.color; if (convert_color) { - float light_scale = (float)rendererData->SDR_whitelevel / 80.0f; - SDL_ConvertToLinear(&color); - - color.r *= light_scale; - color.g *= light_scale; - color.b *= light_scale; } + color.r *= cmd->data.color.color_scale; + color.g *= cmd->data.color.color_scale; + color.b *= cmd->data.color.color_scale; ID3D11DeviceContext_ClearRenderTargetView(rendererData->d3dContext, D3D11_GetCurrentRenderTargetView(renderer), &color.r); break; } diff --git a/src/render/direct3d12/D3D12_PixelShader_Colors.h b/src/render/direct3d12/D3D12_PixelShader_Colors.h index 5a2ce5674..40ce0213e 100644 --- a/src/render/direct3d12/D3D12_PixelShader_Colors.h +++ b/src/render/direct3d12/D3D12_PixelShader_Colors.h @@ -15,7 +15,7 @@ ; -------------------- ----- ------ -------- -------- ------- ------ ; SV_Target 0 xyzw 0 TARGET float xyzw ; -; shader hash: 0f0685d8a85217756714f0196741b112 +; shader hash: d512f5b2e04a35d44c7a732df68d8917 ; ; Pipeline Runtime Information: ; @@ -47,9 +47,9 @@ ; { ; ; float scRGB_output; ; Offset: 0 -; float SDR_whitelevel; ; Offset: 4 -; float HDR_whitelevel; ; Offset: 8 -; float maxCLL; ; Offset: 12 +; float color_scale; ; Offset: 4 +; float unused1; ; Offset: 8 +; float unused2; ; Offset: 12 ; float4 Yoffset; ; Offset: 16 ; float4 Rcoeff; ; Offset: 32 ; float4 Gcoeff; ; Offset: 48 @@ -91,17 +91,13 @@ define void @main() { %4 = call float @dx.op.loadInput.f32(i32 4, i32 2, i32 0, i8 2, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) %5 = call float @dx.op.loadInput.f32(i32 4, i32 2, i32 0, i8 3, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) %6 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 0) ; CBufferLoadLegacy(handle,regIndex) - %7 = extractvalue %dx.types.CBufRet.f32 %6, 0 - %8 = fcmp fast une float %7, 0.000000e+00 - %9 = extractvalue %dx.types.CBufRet.f32 %6, 1 - %10 = fmul fast float %9, 0x3F899999A0000000 - %11 = select i1 %8, float %10, float 1.000000e+00 - %12 = fmul fast float %11, %2 - %13 = fmul fast float %11, %3 - %14 = fmul fast float %11, %4 - call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %12) ; StoreOutput(outputSigId,rowIndex,colIndex,value) - call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float %13) ; StoreOutput(outputSigId,rowIndex,colIndex,value) - call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float %14) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + %7 = extractvalue %dx.types.CBufRet.f32 %6, 1 + %8 = fmul fast float %7, %2 + %9 = fmul fast float %7, %3 + %10 = fmul fast float %7, %4 + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %8) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float %9) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float %10) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %5) ; StoreOutput(outputSigId,rowIndex,colIndex,value) ret void } @@ -152,12 +148,12 @@ attributes #2 = { nounwind readonly } #endif const unsigned char g_main[] = { - 0x44, 0x58, 0x42, 0x43, 0x43, 0x2e, 0xac, 0x2f, 0x03, 0x47, 0x70, 0x30, - 0x31, 0x59, 0x46, 0x88, 0x63, 0x21, 0xb6, 0x28, 0x01, 0x00, 0x00, 0x00, - 0x55, 0x0f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x44, 0x58, 0x42, 0x43, 0xe5, 0x40, 0xb7, 0x7a, 0xe3, 0x4e, 0xbb, 0x7b, + 0x59, 0x24, 0xcb, 0xd3, 0x7c, 0x44, 0x29, 0xbc, 0x01, 0x00, 0x00, 0x00, + 0x19, 0x0f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, - 0x01, 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, - 0x1d, 0x09, 0x00, 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x00, 0x00, 0x39, 0x02, 0x00, 0x00, 0xed, 0x08, 0x00, 0x00, + 0x09, 0x09, 0x00, 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x83, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -199,10 +195,10 @@ const unsigned char g_main[] = { 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0xc0, 0x06, 0x00, - 0x00, 0x60, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, - 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, - 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xa7, 0x01, 0x00, + 0x00, 0x14, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0xac, 0x06, 0x00, + 0x00, 0x60, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, + 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x94, 0x06, 0x00, + 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xa2, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, @@ -245,189 +241,70 @@ const unsigned char g_main[] = { 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, - 0x18, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, + 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x05, 0x1a, 0x50, 0x06, 0xe5, 0x50, 0x12, 0x85, 0x50, 0x10, 0x85, 0x51, 0x20, 0x05, 0x54, 0x60, 0x05, 0x18, - 0x50, 0x04, 0xe5, 0x51, 0x0a, 0x65, 0x42, 0xa5, 0x24, 0xca, 0xa0, 0x10, - 0x46, 0x00, 0x8a, 0xa0, 0x40, 0xe8, 0xd5, 0x00, 0xd1, 0x19, 0x00, 0xaa, - 0x33, 0x00, 0x64, 0xc7, 0x72, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x00, 0x79, 0x18, 0x00, 0x00, 0xaf, 0x00, 0x00, + 0x50, 0x04, 0xe5, 0x41, 0xa5, 0x24, 0xca, 0xa0, 0x10, 0x46, 0x00, 0x8a, + 0xa0, 0x40, 0xe8, 0xd5, 0x00, 0xd1, 0x19, 0x00, 0xaa, 0x33, 0x00, 0x64, + 0xc7, 0x72, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0x44, 0x35, 0x18, 0x63, 0x0b, 0x73, 0x3b, 0x03, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73, 0x03, 0x99, 0x71, 0xb9, 0x01, 0x41, 0xa1, 0x0b, 0x3b, 0x9b, 0x7b, 0x91, 0x2a, 0x62, 0x2a, 0x0a, 0x9a, 0x2a, 0xfa, 0x9a, 0xb9, 0x81, 0x79, 0x31, 0x4b, 0x73, 0x0b, 0x63, 0x4b, 0xd9, 0x10, 0x04, 0x13, 0x04, 0xa2, 0x98, 0x20, 0x10, 0xc6, 0x06, 0x61, 0x20, 0x36, 0x08, 0x04, 0x41, 0x01, 0x6e, 0x6e, - 0x82, 0x40, 0x1c, 0x1b, 0x86, 0x03, 0x21, 0x26, 0x08, 0xd5, 0xc7, 0x64, + 0x82, 0x40, 0x1c, 0x1b, 0x86, 0x03, 0x21, 0x26, 0x08, 0x55, 0xc7, 0x64, 0xe8, 0xcd, 0x6d, 0x8e, 0x2e, 0xcc, 0x8d, 0x6e, 0x6e, 0x82, 0x40, 0x20, 0x1b, 0x10, 0x42, 0x59, 0x88, 0x61, 0x60, 0x80, 0x0d, 0x41, 0xb3, 0x81, - 0x00, 0x00, 0x07, 0x98, 0x20, 0x50, 0x1e, 0x99, 0xb9, 0x31, 0xa9, 0x23, + 0x00, 0x00, 0x07, 0x98, 0x20, 0x50, 0x1c, 0x99, 0xb9, 0x31, 0xa9, 0x23, 0xa1, 0xaf, 0xb7, 0x3a, 0x3a, 0xb8, 0x3a, 0xba, 0x09, 0x02, 0x91, 0x4c, - 0x10, 0x08, 0x65, 0x82, 0x40, 0x2c, 0x13, 0x84, 0xa7, 0xdb, 0x80, 0x20, - 0x91, 0x44, 0x4c, 0x14, 0x55, 0xd1, 0x99, 0x22, 0x92, 0xfa, 0xba, 0x43, - 0x4b, 0xa3, 0x2b, 0x63, 0x2b, 0xb3, 0x2b, 0x63, 0x9b, 0x20, 0x10, 0xcc, - 0x06, 0x04, 0xb9, 0x24, 0x6c, 0xa2, 0xa8, 0x8a, 0x0e, 0x12, 0x91, 0xd4, - 0xd7, 0x1d, 0x5a, 0x1a, 0x5d, 0x19, 0x5b, 0x99, 0x5d, 0x19, 0xdb, 0x04, - 0x81, 0x68, 0x36, 0x18, 0x88, 0x26, 0x6d, 0x13, 0x45, 0xa3, 0x2d, 0x0c, - 0x6f, 0x88, 0x89, 0x69, 0x82, 0x40, 0x38, 0x1b, 0x0c, 0xa4, 0x93, 0xbc, - 0x89, 0xe2, 0x91, 0xf5, 0x66, 0x66, 0x36, 0x57, 0x46, 0x37, 0x41, 0x20, - 0x9e, 0x0d, 0x06, 0x02, 0x06, 0x52, 0x18, 0x4c, 0x14, 0x0d, 0xa9, 0xb1, - 0xb7, 0x32, 0x33, 0xb3, 0x09, 0x02, 0x01, 0x6d, 0x30, 0x90, 0x31, 0x90, - 0xc8, 0x60, 0xa2, 0x68, 0x1c, 0x8d, 0xbd, 0x95, 0x99, 0x99, 0x4d, 0x10, - 0x88, 0x68, 0x83, 0x81, 0x98, 0x81, 0x74, 0x06, 0x13, 0x45, 0x43, 0x68, - 0xec, 0xad, 0xcc, 0xcc, 0x6c, 0x82, 0x40, 0x48, 0x1b, 0x0c, 0x24, 0x0d, - 0x24, 0x35, 0x98, 0xa8, 0x0d, 0x09, 0x63, 0x65, 0xdc, 0x27, 0x06, 0x65, - 0x80, 0x06, 0x6b, 0xb0, 0x61, 0x20, 0x20, 0x36, 0x98, 0x20, 0x08, 0xc0, - 0x06, 0x60, 0xc3, 0x40, 0xbc, 0xc1, 0x1b, 0x6c, 0x08, 0xe0, 0x60, 0xc3, - 0x30, 0xb8, 0x41, 0x1c, 0x4c, 0x10, 0x2c, 0x30, 0xd8, 0x10, 0xcc, 0x01, - 0x89, 0xb6, 0xb0, 0x34, 0x37, 0x2e, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x13, 0x84, 0xe2, 0x9a, 0x20, 0x14, 0xd8, - 0x86, 0x80, 0x98, 0x20, 0x14, 0xd9, 0x04, 0xa1, 0xd0, 0x36, 0x2c, 0x84, - 0x1d, 0xdc, 0x01, 0x1e, 0xe4, 0x81, 0x1e, 0x0c, 0x7a, 0x40, 0xec, 0x01, - 0x40, 0x84, 0xaa, 0x08, 0x6b, 0xe8, 0xe9, 0x49, 0x8a, 0x68, 0x82, 0x50, - 0x6c, 0x1b, 0x96, 0xa1, 0x0f, 0xee, 0x60, 0x0f, 0xf2, 0xc0, 0x0f, 0x06, - 0x3f, 0x18, 0xf6, 0x00, 0x98, 0x20, 0x10, 0x13, 0x8b, 0xa1, 0x27, 0xa6, - 0x27, 0xa9, 0x09, 0x02, 0x41, 0x6d, 0x10, 0x24, 0x51, 0xd8, 0xb0, 0x80, - 0x42, 0x28, 0xdc, 0xc1, 0x1e, 0xe4, 0x81, 0x1f, 0x0c, 0x7a, 0x00, 0x0a, - 0x7b, 0x30, 0x0a, 0x1b, 0x06, 0x3e, 0xf8, 0x03, 0x52, 0x60, 0x32, 0x65, - 0xf5, 0x45, 0x15, 0x26, 0x77, 0x56, 0x46, 0x37, 0x41, 0x28, 0xb8, 0x0d, - 0x0b, 0x61, 0x0a, 0x77, 0x70, 0x0a, 0x79, 0xb0, 0x07, 0x83, 0x1e, 0x10, - 0x7b, 0x30, 0x0a, 0x1b, 0x02, 0x54, 0xd8, 0x30, 0x94, 0x42, 0x2a, 0x00, - 0x1b, 0x0a, 0x37, 0xa8, 0x03, 0x55, 0x78, 0x00, 0x1a, 0x66, 0x6c, 0x6f, - 0x61, 0x74, 0x73, 0x13, 0x04, 0xa2, 0x62, 0x91, 0xe6, 0x36, 0x47, 0x37, - 0x37, 0x41, 0x20, 0x2c, 0x1a, 0x73, 0x69, 0x67, 0x5f, 0x6c, 0x64, 0x34, - 0xe6, 0xd2, 0xce, 0xbe, 0xe6, 0xe8, 0x36, 0x20, 0xac, 0xd0, 0x0a, 0xae, - 0xf0, 0x0a, 0xb0, 0x80, 0xc5, 0x02, 0x56, 0x85, 0x8d, 0xcd, 0xae, 0xcd, - 0x25, 0x8d, 0xac, 0xcc, 0x8d, 0x6e, 0x4a, 0x10, 0x54, 0x21, 0xc3, 0x73, - 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73, 0x9b, 0x12, 0x10, 0x4d, 0xc8, - 0xf0, 0x5c, 0xec, 0xc2, 0xd8, 0xec, 0xca, 0xe4, 0xa6, 0x04, 0x45, 0x1d, - 0x32, 0x3c, 0x97, 0x39, 0xb4, 0x30, 0xb2, 0x32, 0xb9, 0xa6, 0x37, 0xb2, - 0x32, 0xb6, 0x29, 0x01, 0x52, 0x86, 0x0c, 0xcf, 0x45, 0xae, 0x6c, 0xee, - 0xad, 0x4e, 0x6e, 0xac, 0x6c, 0x6e, 0x4a, 0xe0, 0x54, 0x22, 0xc3, 0x73, - 0xa1, 0xcb, 0x83, 0x2b, 0x0b, 0x72, 0x73, 0x7b, 0xa3, 0x0b, 0xa3, 0x4b, - 0x7b, 0x73, 0x9b, 0x9b, 0x22, 0xb0, 0x41, 0x1c, 0xd4, 0x21, 0xc3, 0x73, - 0xb1, 0x4b, 0x2b, 0xbb, 0x4b, 0x22, 0x9b, 0xa2, 0x0b, 0xa3, 0x2b, 0x9b, - 0x12, 0xcc, 0x41, 0x1d, 0x32, 0x3c, 0x97, 0x32, 0x37, 0x3a, 0xb9, 0x3c, - 0xa8, 0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0x81, 0x2a, 0x74, 0x21, 0xc3, - 0x73, 0x19, 0x7b, 0xab, 0x73, 0xa3, 0x2b, 0x93, 0x9b, 0x9b, 0x12, 0xc4, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, - 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, - 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, - 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, - 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, - 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, - 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, - 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, - 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, - 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, - 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, - 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, - 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, - 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, - 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, - 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, - 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, - 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, - 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, - 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, - 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, - 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, - 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, - 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, - 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, - 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, - 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x36, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x50, 0x45, 0x41, - 0x44, 0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, 0x17, 0xb7, 0x6d, - 0x04, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08, - 0x34, 0xc3, 0x42, 0x58, 0xc0, 0x34, 0x5c, 0xbe, 0xf3, 0xf8, 0x8b, 0x03, - 0x0c, 0x62, 0xf3, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x09, 0x54, 0xc3, 0xe5, - 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xa0, 0xd4, 0xf4, 0x50, 0x93, 0x5f, - 0xdc, 0xb6, 0x01, 0x10, 0x0c, 0x80, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x06, 0x85, 0xd8, 0xa8, 0x52, 0x17, 0x75, 0x67, 0x14, 0xf0, - 0x19, 0x67, 0x41, 0xb1, 0x12, 0x44, 0x58, 0x49, 0x4c, 0x30, 0x06, 0x00, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, - 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x18, 0x06, 0x00, - 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x83, 0x01, 0x00, - 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, - 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, - 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, - 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, - 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, - 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, - 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, - 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, - 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, - 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, - 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x21, 0x00, 0x00, - 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, - 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, - 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x5c, 0x23, 0x00, 0x25, 0x00, 0x14, - 0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x20, 0x84, - 0x14, 0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, 0xa1, 0xa3, 0x86, 0xcb, - 0x9f, 0xb0, 0x87, 0x90, 0x7c, 0x6e, 0xa3, 0x8a, 0x95, 0x98, 0xfc, 0xe2, - 0xb6, 0x11, 0x31, 0xc6, 0x18, 0x54, 0xee, 0x19, 0x2e, 0x7f, 0xc2, 0x1e, - 0x42, 0xf2, 0x43, 0xa0, 0x19, 0x16, 0x02, 0x05, 0xab, 0x10, 0x8a, 0x30, - 0x42, 0x6d, 0x8e, 0x20, 0x28, 0x06, 0x23, 0x85, 0x90, 0x47, 0x70, 0x20, - 0x60, 0x18, 0x81, 0x18, 0x2e, 0xe1, 0x9c, 0x46, 0x9a, 0x80, 0x66, 0x92, - 0x10, 0x32, 0xc6, 0x18, 0x73, 0xce, 0x49, 0x34, 0x1d, 0x08, 0x00, 0x00, - 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, - 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, - 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, - 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, - 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, - 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, - 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, - 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, - 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, - 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, - 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, - 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, - 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, - 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, - 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x0b, 0x04, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, - 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, - 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x05, 0x1a, 0x50, 0x04, 0x65, 0x50, - 0x1e, 0x54, 0x4a, 0xa2, 0x0c, 0x0a, 0x61, 0x04, 0xa0, 0x08, 0x0a, 0x84, - 0xea, 0x0c, 0x00, 0xd9, 0xb1, 0x1c, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x04, 0x02, 0x01, 0x79, 0x18, 0x00, 0x00, 0x5c, 0x00, 0x00, - 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0x44, 0x35, 0x18, 0x63, - 0x0b, 0x73, 0x3b, 0x03, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73, 0x03, - 0x99, 0x71, 0xb9, 0x01, 0x41, 0xa1, 0x0b, 0x3b, 0x9b, 0x7b, 0x91, 0x2a, - 0x62, 0x2a, 0x0a, 0x9a, 0x2a, 0xfa, 0x9a, 0xb9, 0x81, 0x79, 0x31, 0x4b, - 0x73, 0x0b, 0x63, 0x4b, 0xd9, 0x10, 0x04, 0x13, 0x04, 0xa2, 0x98, 0x20, - 0x10, 0xc6, 0x06, 0x61, 0x20, 0x26, 0x08, 0xc4, 0xb1, 0x41, 0x18, 0x0c, - 0x0a, 0x70, 0x73, 0x1b, 0x06, 0xc4, 0x20, 0x26, 0x08, 0x95, 0x44, 0x60, - 0x82, 0x40, 0x20, 0x1b, 0x10, 0x42, 0x59, 0x88, 0x61, 0x60, 0x80, 0x0d, - 0x41, 0xb3, 0x81, 0x00, 0x00, 0x07, 0x98, 0x20, 0x58, 0xd3, 0x86, 0x00, - 0x9a, 0x20, 0x08, 0x00, 0x89, 0xb6, 0xb0, 0x34, 0x37, 0x2e, 0x53, 0x56, - 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x13, 0x84, 0x82, - 0x99, 0x20, 0x14, 0xcd, 0x86, 0x80, 0x98, 0x20, 0x14, 0xce, 0x04, 0xa1, - 0x78, 0x36, 0x2c, 0x04, 0x55, 0x59, 0x17, 0x36, 0x60, 0x44, 0x06, 0x10, - 0xa1, 0x2a, 0xc2, 0x1a, 0x7a, 0x7a, 0x92, 0x22, 0x9a, 0x20, 0x14, 0xd0, - 0x86, 0x65, 0xd8, 0xaa, 0xec, 0xe2, 0x06, 0x6e, 0xc8, 0x80, 0x09, 0x02, - 0x91, 0xb0, 0x18, 0x7a, 0x62, 0x7a, 0x92, 0x9a, 0x20, 0x10, 0xca, 0x04, - 0x81, 0x58, 0x36, 0x08, 0x60, 0x10, 0x06, 0x1b, 0x16, 0xef, 0xab, 0xb2, - 0x8b, 0x1b, 0x30, 0x2f, 0x13, 0x83, 0x0d, 0x83, 0xd6, 0x8d, 0x01, 0x93, - 0x29, 0xab, 0x2f, 0xaa, 0x30, 0xb9, 0xb3, 0x32, 0xba, 0x09, 0x42, 0x11, - 0x6d, 0x58, 0x88, 0x32, 0xa8, 0xcc, 0xe0, 0xca, 0x06, 0x8c, 0xc8, 0xc4, - 0x60, 0x43, 0x70, 0x06, 0x1b, 0x06, 0x32, 0x40, 0x03, 0x60, 0x43, 0x21, - 0x4d, 0x69, 0xf0, 0x00, 0x55, 0xd8, 0xd8, 0xec, 0xda, 0x5c, 0xd2, 0xc8, - 0xca, 0xdc, 0xe8, 0xa6, 0x04, 0x41, 0x15, 0x32, 0x3c, 0x17, 0xbb, 0x32, - 0xb9, 0xb9, 0xb4, 0x37, 0xb7, 0x29, 0x01, 0xd1, 0x84, 0x0c, 0xcf, 0xc5, - 0x2e, 0x8c, 0xcd, 0xae, 0x4c, 0x6e, 0x4a, 0x60, 0xd4, 0x21, 0xc3, 0x73, - 0x99, 0x43, 0x0b, 0x23, 0x2b, 0x93, 0x6b, 0x7a, 0x23, 0x2b, 0x63, 0x9b, - 0x12, 0x20, 0x65, 0xc8, 0xf0, 0x5c, 0xe4, 0xca, 0xe6, 0xde, 0xea, 0xe4, - 0xc6, 0xca, 0xe6, 0xa6, 0x04, 0x4e, 0x1d, 0x32, 0x3c, 0x17, 0xbb, 0xb4, - 0xb2, 0xbb, 0x24, 0xb2, 0x29, 0xba, 0x30, 0xba, 0xb2, 0x29, 0x01, 0x54, - 0x87, 0x0c, 0xcf, 0xa5, 0xcc, 0x8d, 0x4e, 0x2e, 0x0f, 0xea, 0x2d, 0xcd, - 0x8d, 0x6e, 0x6e, 0x4a, 0x90, 0x06, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, + 0x10, 0x08, 0x65, 0x82, 0x40, 0x2c, 0x1b, 0x0c, 0x24, 0x92, 0x88, 0x89, + 0xe2, 0x32, 0xf6, 0xc6, 0xf6, 0x26, 0xf7, 0x35, 0x37, 0x16, 0xc6, 0x56, + 0x36, 0x41, 0x20, 0x98, 0x09, 0xc2, 0xb3, 0x6d, 0x40, 0x10, 0x4b, 0xba, + 0x26, 0x8a, 0xc2, 0x78, 0xd4, 0xb9, 0xd5, 0xcd, 0x95, 0x91, 0xc5, 0x4c, + 0x10, 0x88, 0x66, 0x83, 0x81, 0x68, 0xd2, 0x36, 0x51, 0x3c, 0xea, 0xdc, + 0xea, 0xe6, 0xca, 0xc8, 0x64, 0x26, 0x08, 0x84, 0xb3, 0xc1, 0x40, 0x3a, + 0xc9, 0x9b, 0x28, 0x1e, 0x59, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x13, + 0x04, 0xe2, 0xd9, 0x60, 0x20, 0x60, 0x20, 0x85, 0xc1, 0x44, 0xd1, 0x90, + 0x1a, 0x7b, 0x2b, 0x33, 0x33, 0x9b, 0x20, 0x10, 0xd0, 0x06, 0x03, 0x19, + 0x03, 0x89, 0x0c, 0x26, 0x8a, 0xc6, 0xd1, 0xd8, 0x5b, 0x99, 0x99, 0xd9, + 0x04, 0x81, 0x88, 0x36, 0x18, 0x88, 0x19, 0x48, 0x67, 0x30, 0x51, 0x34, + 0x84, 0xc6, 0xde, 0xca, 0xcc, 0xcc, 0x26, 0x08, 0x84, 0xb4, 0xc1, 0x40, + 0xd2, 0x40, 0x52, 0x83, 0x89, 0xda, 0x90, 0x30, 0x55, 0xc6, 0x7d, 0x62, + 0x50, 0x06, 0x68, 0xb0, 0x06, 0x1b, 0x06, 0x02, 0x62, 0x83, 0x09, 0x82, + 0x00, 0x6c, 0x00, 0x36, 0x0c, 0xc4, 0x1b, 0xbc, 0xc1, 0x86, 0x00, 0x0e, + 0x36, 0x0c, 0x83, 0x1b, 0xc4, 0xc1, 0x04, 0xc1, 0xf2, 0x36, 0x04, 0x73, + 0x40, 0xa2, 0x2d, 0x2c, 0xcd, 0x8d, 0xcb, 0x94, 0xd5, 0x17, 0xd4, 0xdb, + 0x5c, 0x1a, 0x5d, 0xda, 0x9b, 0xdb, 0x04, 0xa1, 0xa8, 0x26, 0x08, 0x85, + 0xb5, 0x21, 0x20, 0x26, 0x08, 0xc5, 0x35, 0x41, 0x28, 0xb0, 0x0d, 0x0b, + 0x61, 0x07, 0x77, 0x80, 0x07, 0x79, 0xa0, 0x07, 0x83, 0x1e, 0x10, 0x7b, + 0x00, 0x10, 0xa1, 0x2a, 0xc2, 0x1a, 0x7a, 0x7a, 0x92, 0x22, 0x9a, 0x20, + 0x14, 0xd9, 0x86, 0x65, 0xe8, 0x83, 0x3b, 0xd8, 0x83, 0x3c, 0xf0, 0x83, + 0xc1, 0x0f, 0x86, 0x3d, 0x00, 0x26, 0x08, 0xc4, 0xc4, 0x62, 0xe8, 0x89, + 0xe9, 0x49, 0x6a, 0x82, 0x40, 0x50, 0x1b, 0x04, 0x49, 0x14, 0x36, 0x2c, + 0xa0, 0x10, 0x0a, 0x77, 0xb0, 0x07, 0x79, 0xe0, 0x07, 0x83, 0x1e, 0x80, + 0xc2, 0x1e, 0x8c, 0xc2, 0x86, 0x81, 0x0f, 0xfe, 0x80, 0x14, 0x98, 0x4c, + 0x59, 0x7d, 0x51, 0x85, 0xc9, 0x9d, 0x95, 0xd1, 0x4d, 0x10, 0x0a, 0x6d, + 0xc3, 0x42, 0x98, 0xc2, 0x1d, 0x9c, 0x42, 0x1e, 0xec, 0xc1, 0xa0, 0x07, + 0xc4, 0x1e, 0x8c, 0xc2, 0x86, 0x00, 0x15, 0x36, 0x0c, 0xa5, 0x90, 0x0a, + 0xc0, 0x86, 0xc2, 0x0d, 0xea, 0x40, 0x15, 0x1e, 0x80, 0x86, 0x19, 0xdb, + 0x5b, 0x18, 0xdd, 0x1c, 0x8b, 0x34, 0xb7, 0x39, 0xba, 0x39, 0x1a, 0x73, + 0x69, 0x67, 0x5f, 0x6c, 0x64, 0x34, 0xe6, 0xd2, 0xce, 0xbe, 0xe6, 0xe8, + 0x36, 0x20, 0xac, 0x20, 0xb5, 0x82, 0x28, 0xb8, 0xc2, 0xf5, 0x0a, 0x57, + 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97, 0x34, 0xb2, 0x32, 0x37, 0xba, 0x29, + 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5, 0xae, 0x4c, 0x6e, 0x2e, 0xed, 0xcd, + 0x6d, 0x4a, 0x40, 0x34, 0x21, 0xc3, 0x73, 0xb1, 0x0b, 0x63, 0xb3, 0x2b, + 0x93, 0x9b, 0x12, 0x14, 0x75, 0xc8, 0xf0, 0x5c, 0xe6, 0xd0, 0xc2, 0xc8, + 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca, 0xd8, 0xa6, 0x04, 0x48, 0x19, 0x32, + 0x3c, 0x17, 0xb9, 0xb2, 0xb9, 0xb7, 0x3a, 0xb9, 0xb1, 0xb2, 0xb9, 0x29, + 0x81, 0x53, 0x89, 0x0c, 0xcf, 0x85, 0x2e, 0x0f, 0xae, 0x2c, 0xc8, 0xcd, + 0xed, 0x8d, 0x2e, 0x8c, 0x2e, 0xed, 0xcd, 0x6d, 0x6e, 0x8a, 0xc0, 0x06, + 0x71, 0x50, 0x87, 0x0c, 0xcf, 0xc5, 0x2e, 0xad, 0xec, 0x2e, 0x89, 0x6c, + 0x8a, 0x2e, 0x8c, 0xae, 0x6c, 0x4a, 0x30, 0x07, 0x75, 0xc8, 0xf0, 0x5c, + 0xca, 0xdc, 0xe8, 0xe4, 0xf2, 0xa0, 0xde, 0xd2, 0xdc, 0xe8, 0xe6, 0xa6, + 0x04, 0xaa, 0xd0, 0x85, 0x0c, 0xcf, 0x65, 0xec, 0xad, 0xce, 0x8d, 0xae, + 0x4c, 0x6e, 0x6e, 0x4a, 0xf0, 0x0a, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, @@ -461,23 +338,137 @@ const unsigned char g_main[] = { 0xf3, 0xf8, 0x8b, 0x03, 0x0c, 0x62, 0xf3, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x09, 0x54, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xa0, 0xd4, 0xf4, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x01, 0x10, 0x0c, 0x80, 0x34, 0x00, - 0x00, 0x61, 0x20, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, - 0x2c, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf4, 0x46, 0x00, - 0xa8, 0x94, 0x00, 0x91, 0xb2, 0x2b, 0x84, 0x19, 0x80, 0x52, 0x28, 0x39, - 0x1a, 0x63, 0x04, 0x20, 0x08, 0x82, 0xf8, 0x37, 0x46, 0xd0, 0x9a, 0x73, - 0x4e, 0x7a, 0x23, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x00, - 0x69, 0x84, 0x83, 0x65, 0xca, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, - 0x1e, 0x62, 0x65, 0xd0, 0x31, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0xc6, - 0x97, 0x5c, 0xda, 0x82, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x81, 0x01, - 0x06, 0x0a, 0xb6, 0x45, 0xc9, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, - 0x61, 0xb0, 0x64, 0x5c, 0xa5, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x41, - 0x03, 0x06, 0x4d, 0xd1, 0x8d, 0x26, 0x04, 0xc0, 0x70, 0x44, 0x80, 0x38, - 0xdf, 0x68, 0xc2, 0x10, 0x58, 0xb0, 0xc8, 0x67, 0xba, 0x21, 0x68, 0x06, - 0x0b, 0x14, 0xf9, 0x98, 0xa0, 0xc8, 0xc7, 0x06, 0x45, 0x3e, 0x23, 0x06, - 0x09, 0x00, 0x82, 0x60, 0x80, 0xa8, 0xc1, 0x64, 0x06, 0x66, 0xd0, 0x0d, - 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x80, 0xa8, 0xc1, 0x64, 0x06, 0x66, - 0x70, 0x09, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x80, 0xa8, 0xc1, 0x64, - 0x06, 0x66, 0xc0, 0x05, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x80, 0xa8, - 0xc1, 0x64, 0x06, 0x66, 0xf0, 0x29, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x12, 0xf5, 0xb2, 0xe0, 0x4a, 0x35, + 0xd4, 0x4c, 0x7a, 0x73, 0x2d, 0xf6, 0x8d, 0x89, 0x17, 0x44, 0x58, 0x49, + 0x4c, 0x08, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, + 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0xf0, 0x05, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, + 0x00, 0x79, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, + 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, + 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, + 0x42, 0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, + 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, + 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, + 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, + 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, + 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, + 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, + 0x42, 0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, + 0x00, 0x21, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, + 0x04, 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, + 0x14, 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x5c, 0x23, + 0x00, 0x25, 0x00, 0x14, 0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, + 0x29, 0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, + 0xa1, 0xa3, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0x7c, 0x6e, 0xa3, 0x8a, + 0x95, 0x98, 0xfc, 0xe2, 0xb6, 0x11, 0x31, 0xc6, 0x18, 0x54, 0xee, 0x19, + 0x2e, 0x7f, 0xc2, 0x1e, 0x42, 0xf2, 0x43, 0xa0, 0x19, 0x16, 0x02, 0x05, + 0xab, 0x10, 0x8a, 0x30, 0x42, 0x6d, 0x8e, 0x20, 0x28, 0x06, 0x23, 0x85, + 0x90, 0x47, 0x70, 0x20, 0x60, 0x18, 0x81, 0x18, 0x2e, 0xe1, 0x9c, 0x46, + 0x9a, 0x80, 0x66, 0x92, 0x10, 0x32, 0xc6, 0x18, 0x73, 0xce, 0x49, 0x34, + 0x1d, 0x08, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, + 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, + 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, + 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, + 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, + 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, + 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, + 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, + 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, + 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, + 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, + 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, + 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x86, 0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, + 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x05, 0x1a, + 0x50, 0x04, 0x65, 0x50, 0x1e, 0x54, 0x4a, 0xa2, 0x0c, 0x0a, 0x61, 0x04, + 0xa0, 0x08, 0x0a, 0x84, 0xea, 0x0c, 0x00, 0xd9, 0xb1, 0x1c, 0x86, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x01, 0x79, 0x18, 0x00, + 0x00, 0x5c, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, + 0x44, 0x35, 0x18, 0x63, 0x0b, 0x73, 0x3b, 0x03, 0xb1, 0x2b, 0x93, 0x9b, + 0x4b, 0x7b, 0x73, 0x03, 0x99, 0x71, 0xb9, 0x01, 0x41, 0xa1, 0x0b, 0x3b, + 0x9b, 0x7b, 0x91, 0x2a, 0x62, 0x2a, 0x0a, 0x9a, 0x2a, 0xfa, 0x9a, 0xb9, + 0x81, 0x79, 0x31, 0x4b, 0x73, 0x0b, 0x63, 0x4b, 0xd9, 0x10, 0x04, 0x13, + 0x04, 0xa2, 0x98, 0x20, 0x10, 0xc6, 0x06, 0x61, 0x20, 0x26, 0x08, 0xc4, + 0xb1, 0x41, 0x18, 0x0c, 0x0a, 0x70, 0x73, 0x1b, 0x06, 0xc4, 0x20, 0x26, + 0x08, 0x95, 0x44, 0x60, 0x82, 0x40, 0x20, 0x1b, 0x10, 0x42, 0x59, 0x88, + 0x61, 0x60, 0x80, 0x0d, 0x41, 0xb3, 0x81, 0x00, 0x00, 0x07, 0x98, 0x20, + 0x58, 0xd3, 0x86, 0x00, 0x9a, 0x20, 0x08, 0x00, 0x89, 0xb6, 0xb0, 0x34, + 0x37, 0x2e, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x13, 0x84, 0x82, 0x99, 0x20, 0x14, 0xcd, 0x86, 0x80, 0x98, 0x20, + 0x14, 0xce, 0x04, 0xa1, 0x78, 0x36, 0x2c, 0x04, 0x55, 0x59, 0x17, 0x36, + 0x60, 0x44, 0x06, 0x10, 0xa1, 0x2a, 0xc2, 0x1a, 0x7a, 0x7a, 0x92, 0x22, + 0x9a, 0x20, 0x14, 0xd0, 0x86, 0x65, 0xd8, 0xaa, 0xec, 0xe2, 0x06, 0x6e, + 0xc8, 0x80, 0x09, 0x02, 0x91, 0xb0, 0x18, 0x7a, 0x62, 0x7a, 0x92, 0x9a, + 0x20, 0x10, 0xca, 0x04, 0x81, 0x58, 0x36, 0x08, 0x60, 0x10, 0x06, 0x1b, + 0x16, 0xef, 0xab, 0xb2, 0x8b, 0x1b, 0x30, 0x2f, 0x13, 0x83, 0x0d, 0x83, + 0xd6, 0x8d, 0x01, 0x93, 0x29, 0xab, 0x2f, 0xaa, 0x30, 0xb9, 0xb3, 0x32, + 0xba, 0x09, 0x42, 0x11, 0x6d, 0x58, 0x88, 0x32, 0xa8, 0xcc, 0xe0, 0xca, + 0x06, 0x8c, 0xc8, 0xc4, 0x60, 0x43, 0x70, 0x06, 0x1b, 0x06, 0x32, 0x40, + 0x03, 0x60, 0x43, 0x21, 0x4d, 0x69, 0xf0, 0x00, 0x55, 0xd8, 0xd8, 0xec, + 0xda, 0x5c, 0xd2, 0xc8, 0xca, 0xdc, 0xe8, 0xa6, 0x04, 0x41, 0x15, 0x32, + 0x3c, 0x17, 0xbb, 0x32, 0xb9, 0xb9, 0xb4, 0x37, 0xb7, 0x29, 0x01, 0xd1, + 0x84, 0x0c, 0xcf, 0xc5, 0x2e, 0x8c, 0xcd, 0xae, 0x4c, 0x6e, 0x4a, 0x60, + 0xd4, 0x21, 0xc3, 0x73, 0x99, 0x43, 0x0b, 0x23, 0x2b, 0x93, 0x6b, 0x7a, + 0x23, 0x2b, 0x63, 0x9b, 0x12, 0x20, 0x65, 0xc8, 0xf0, 0x5c, 0xe4, 0xca, + 0xe6, 0xde, 0xea, 0xe4, 0xc6, 0xca, 0xe6, 0xa6, 0x04, 0x4e, 0x1d, 0x32, + 0x3c, 0x17, 0xbb, 0xb4, 0xb2, 0xbb, 0x24, 0xb2, 0x29, 0xba, 0x30, 0xba, + 0xb2, 0x29, 0x01, 0x54, 0x87, 0x0c, 0xcf, 0xa5, 0xcc, 0x8d, 0x4e, 0x2e, + 0x0f, 0xea, 0x2d, 0xcd, 0x8d, 0x6e, 0x6e, 0x4a, 0x90, 0x06, 0x00, 0x00, + 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, + 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, + 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, + 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, + 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, + 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, + 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, + 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, + 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, + 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, + 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, + 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, + 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, + 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, + 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, + 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, + 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, + 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, + 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, + 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, + 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, + 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, + 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, + 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, + 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, + 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, + 0x00, 0x71, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x36, 0xb0, 0x0d, + 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x50, 0x45, 0x41, 0x44, 0xa5, 0x03, 0x0c, + 0x25, 0x61, 0x00, 0x02, 0xe6, 0x17, 0xb7, 0x6d, 0x04, 0xd2, 0x70, 0xf9, + 0xce, 0xe3, 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0x58, + 0xc0, 0x34, 0x5c, 0xbe, 0xf3, 0xf8, 0x8b, 0x03, 0x0c, 0x62, 0xf3, 0x50, + 0x93, 0x5f, 0xdc, 0xb6, 0x09, 0x54, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, + 0x4e, 0x44, 0xa0, 0xd4, 0xf4, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x01, 0x10, + 0x0c, 0x80, 0x34, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x29, 0x00, 0x00, + 0x00, 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x44, 0x0a, 0x61, 0x06, 0xa0, 0x14, 0x4a, 0xae, 0xec, 0xa8, 0x94, + 0x00, 0xbd, 0x11, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x00, + 0x5d, 0xc4, 0x52, 0x59, 0xc1, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, + 0x1b, 0x32, 0x59, 0xcd, 0x31, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x06, + 0x97, 0x50, 0x17, 0x81, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x81, 0xd1, + 0x29, 0x15, 0xe6, 0x24, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x60, 0x78, + 0x8b, 0x95, 0x49, 0xca, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x34, 0x1d, + 0x52, 0x68, 0xa3, 0x09, 0x41, 0x60, 0x81, 0x21, 0x1f, 0x13, 0x0c, 0xf9, + 0xd8, 0x60, 0xc8, 0x67, 0xc4, 0x20, 0x01, 0x40, 0x10, 0x0c, 0x90, 0x31, + 0x78, 0xbe, 0xcf, 0x1a, 0x46, 0x0c, 0x12, 0x00, 0x04, 0xc1, 0x00, 0x19, + 0x83, 0xe7, 0xfb, 0x18, 0x61, 0xc4, 0x20, 0x01, 0x40, 0x10, 0x0c, 0x90, + 0x31, 0x78, 0xbe, 0xaf, 0x0a, 0x46, 0x0c, 0x12, 0x00, 0x04, 0xc1, 0x00, + 0x19, 0x83, 0xe7, 0xfb, 0x30, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/src/render/direct3d12/D3D12_PixelShader_Common.incl b/src/render/direct3d12/D3D12_PixelShader_Common.incl index dc08bcda0..fd86a0adf 100644 --- a/src/render/direct3d12/D3D12_PixelShader_Common.incl +++ b/src/render/direct3d12/D3D12_PixelShader_Common.incl @@ -8,9 +8,9 @@ struct PixelShaderInput cbuffer Constants : register(b1) { float scRGB_output; - float SDR_whitelevel; - float HDR_whitelevel; - float maxCLL; + float color_scale; + float unused1; + float unused2; float4 Yoffset; float4 Rcoeff; @@ -50,11 +50,12 @@ float sRGBfromLinear(float v) float4 GetOutputColor(float4 rgba) { - if (scRGB_output) { - rgba.rgb = scRGBfromNits(rgba.rgb * SDR_whitelevel); - } + float4 output; - return rgba; + output.rgb = rgba.rgb * color_scale; + output.a = rgba.a; + + return output; } float4 GetOutputColorFromSRGB(float3 rgb) @@ -62,14 +63,30 @@ 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; + rgb.r = sRGBtoLinear(rgb.r); + rgb.g = sRGBtoLinear(rgb.g); + rgb.b = sRGBtoLinear(rgb.b); } + + output.rgb = rgb * color_scale; output.a = 1.0; return output; } + +float4 GetOutputColorFromSCRGB(float3 rgb) +{ + float4 output; + + output.rgb = rgb * color_scale; + output.a = 1.0; + + if (!scRGB_output) { + output.r = sRGBfromLinear(output.r); + output.g = sRGBfromLinear(output.g); + output.b = sRGBfromLinear(output.b); + output.rgb = clamp(output.rgb, 0.0, 1.0); + } + + return output; +} diff --git a/src/render/direct3d12/D3D12_PixelShader_HDR10.h b/src/render/direct3d12/D3D12_PixelShader_HDR10.h index 0b605b193..d3cd8e1da 100644 --- a/src/render/direct3d12/D3D12_PixelShader_HDR10.h +++ b/src/render/direct3d12/D3D12_PixelShader_HDR10.h @@ -15,7 +15,7 @@ ; -------------------- ----- ------ -------- -------- ------- ------ ; SV_Target 0 xyzw 0 TARGET float xyzw ; -; shader hash: 968795c6bef99c8e3efb14dda2a7210c +; shader hash: ca751de73a0041df73e385f66530634e ; ; Pipeline Runtime Information: ; @@ -47,9 +47,9 @@ ; { ; ; float scRGB_output; ; Offset: 0 -; float SDR_whitelevel; ; Offset: 4 -; float HDR_whitelevel; ; Offset: 8 -; float maxCLL; ; Offset: 12 +; float color_scale; ; Offset: 4 +; float unused1; ; Offset: 8 +; float unused2; ; Offset: 12 ; float4 Yoffset; ; Offset: 16 ; float4 Rcoeff; ; Offset: 32 ; float4 Gcoeff; ; Offset: 48 @@ -179,95 +179,91 @@ define void @main() { %85 = fmul fast float %74, 0xC066B147C0000000 %86 = call float @dx.op.tertiary.f32(i32 46, float 0xBFB9C0B9A0000000, float %77, float %85) ; FMad(a,b,c) %87 = call float @dx.op.tertiary.f32(i32 46, float 0x3FF1E66780000000, float %78, float %86) ; FMad(a,b,c) - %88 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %4, i32 0) ; CBufferLoadLegacy(handle,regIndex) - %89 = extractvalue %dx.types.CBufRet.f32 %88, 3 - %90 = fdiv fast float %81, %89 - %91 = fdiv fast float %84, %89 - %92 = fdiv fast float %87, %89 - %93 = extractvalue %dx.types.CBufRet.f32 %88, 2 - %94 = fmul fast float %93, %90 - %95 = fmul fast float %93, %91 - %96 = fmul fast float %93, %92 - %97 = fmul fast float %94, 0x3F899999A0000000 - %98 = fmul fast float %95, 0x3F899999A0000000 - %99 = fmul fast float %96, 0x3F899999A0000000 - %100 = extractvalue %dx.types.CBufRet.f32 %88, 0 - %101 = fcmp fast une float %100, 0.000000e+00 - br i1 %101, label %145, label %102 + %88 = fmul fast float %81, 0x3F899999A0000000 + %89 = fmul fast float %84, 0x3F899999A0000000 + %90 = fmul fast float %87, 0x3F899999A0000000 + %91 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %4, i32 0) ; CBufferLoadLegacy(handle,regIndex) + %92 = extractvalue %dx.types.CBufRet.f32 %91, 1 + %93 = fmul fast float %88, %92 + %94 = fmul fast float %89, %92 + %95 = fmul fast float %90, %92 + %96 = extractvalue %dx.types.CBufRet.f32 %91, 0 + %97 = fcmp fast une float %96, 0.000000e+00 + br i1 %97, label %141, label %98 -;