From 294dee76cc9a55fdccbae7ac5e24b28310780e6a Mon Sep 17 00:00:00 2001 From: Amos Date: Tue, 13 Jul 2021 02:13:56 -0700 Subject: [PATCH] Update vertex shader in Dear ImGui for color correction for DXGI_FORMAT_R8G8B8A8_UNORM_SRGB Shader taken from https://github.com/ocornut/imgui/issues/1724 --- external/imgui/src/imgui_impl_dx11.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/external/imgui/src/imgui_impl_dx11.cpp b/external/imgui/src/imgui_impl_dx11.cpp index 0690b97b..869dd4e1 100644 --- a/external/imgui/src/imgui_impl_dx11.cpp +++ b/external/imgui/src/imgui_impl_dx11.cpp @@ -350,6 +350,7 @@ bool ImGui_ImplDX11_CreateDeviceObjects() // See https://github.com/ocornut/imgui/pull/638 for sources and details. // Create the vertex shader + // Shader taken from https://github.com/ocornut/imgui/issues/1724 { static const char* vertexShader = "cbuffer vertexBuffer : register(b0) \ @@ -373,9 +374,10 @@ bool ImGui_ImplDX11_CreateDeviceObjects() PS_INPUT main(VS_INPUT input)\ {\ PS_INPUT output;\ - output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\ - output.col = input.col;\ - output.uv = input.uv;\ + output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\ + output.col.xyz = pow(abs(input.col.xyz), 2.2f);\ + output.col.w = input.col.w;\ + output.uv = input.uv;\ return output;\ }";