diff options
author | 2023-03-19 17:59:44 +0100 | |
---|---|---|
committer | 2023-03-20 03:59:44 +1100 | |
commit | ba5ec29211741b9f18334fb94f812c9d3979f582 (patch) | |
tree | 9d4966600b16f3f55e16dd3ded2c40845d49bdd2 /src/osd/modules/render/d3d/d3dhlsl.cpp | |
parent | 4ff301b1349156c570211c0ced362e890284d8dc (diff) |
Swapped R and B channels in lut-default.png, and adjusted D3D9 LUT-application behaviour. (#11004) [Ryan Holtz]
* lut-default.png: Swapped red and blue channels (fixes GitHub #11001).
* render/d3d/d3dlsl.cpp: Changed screen LUT application to be applied during the color convolution pass on raster systems.
Diffstat (limited to 'src/osd/modules/render/d3d/d3dhlsl.cpp')
-rw-r--r-- | src/osd/modules/render/d3d/d3dhlsl.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 68647366665..e2daedff166 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -879,6 +879,7 @@ int shaders::create_resources() color_effect->add_uniform("Scale", uniform::UT_VEC3, uniform::CU_COLOR_SCALE); color_effect->add_uniform("Saturation", uniform::UT_FLOAT, uniform::CU_COLOR_SATURATION); color_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); + color_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); deconverge_effect->add_uniform("ConvergeX", uniform::UT_VEC3, uniform::CU_CONVERGE_LINEAR_X); deconverge_effect->add_uniform("ConvergeY", uniform::UT_VEC3, uniform::CU_CONVERGE_LINEAR_Y); @@ -932,9 +933,6 @@ int shaders::create_resources() prescale_point_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); - default_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); - default_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); - ui_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); ui_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); @@ -942,7 +940,6 @@ int shaders::create_resources() ui_wrap_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); vector_buffer_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); - vector_buffer_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); return 0; } @@ -1159,6 +1156,8 @@ int shaders::color_convolution_pass(d3d_render_target *rt, int source_index, pol uint32_t tint = (uint32_t)poly->tint(); float prim_tint[3] = { ((tint >> 16) & 0xff) / 255.0f, ((tint >> 8) & 0xff) / 255.0f, (tint & 0xff) / 255.0f }; curr_effect->set_vector("PrimTint", 3, prim_tint); + curr_effect->set_texture("LutTexture", !lut_texture ? nullptr : lut_texture->get_finaltex()); + curr_effect->set_bool("UiLutEnable", false); next_index = rt->next_index(next_index); blit(rt->source_surface[next_index].Get(), false, D3DPT_TRIANGLELIST, 0, 2); @@ -1467,6 +1466,7 @@ int shaders::vector_buffer_pass(d3d_render_target *rt, int source_index, poly_in curr_effect->set_texture("Diffuse", rt->target_texture[next_index].Get()); curr_effect->set_texture("LutTexture", !lut_texture ? nullptr : lut_texture->get_finaltex()); + curr_effect->set_bool("UiLutEnable", false); // we need to clear the vector render target here next_index = rt->next_index(next_index); @@ -1486,7 +1486,9 @@ int shaders::screen_pass(d3d_render_target *rt, int source_index, poly_info *pol curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index].Get()); - curr_effect->set_texture("LutTexture", !lut_texture ? nullptr : lut_texture->get_finaltex()); + curr_effect->set_texture("LutTexture", nullptr); + curr_effect->set_bool("LutEnable", false); + curr_effect->set_bool("UiLutEnable", false); blit(backbuffer.Get(), false, poly->type(), vertnum, poly->count()); |