The simple shader is only for HDR10 RGB textures

The use case for this is 2D render target overlays on HDR10 output. In this case we've already done the conversion to the output colorspace and we just want to get the pixels on the screen as fast as possible. Video frames still need YUV conversion, so they shouldn't go through this output path.
This commit is contained in:
Sam Lantinga
2026-09-10 09:04:13 -07:00
parent 21f4bc47b6
commit 15c9ab245f
3 changed files with 6 additions and 3 deletions

View File

@@ -2283,7 +2283,8 @@ static D3D11_Shader SelectShader(SDL_Renderer *renderer, const D3D11_PixelShader
{
if (shader_constants) {
if (renderer->current_colorspace == SDL_COLORSPACE_HDR10) {
if (shader_constants->input_type == INPUTTYPE_HDR10 &&
if (shader_constants->texture_type == TEXTURETYPE_RGB &&
shader_constants->input_type == INPUTTYPE_HDR10 &&
!PQShaderScalesInput(shader_constants)) {
// Do a simple 1-1 copy
return SHADER_RGB_SIMPLE;

View File

@@ -2748,7 +2748,8 @@ static D3D12_Shader SelectShader(SDL_Renderer *renderer, const D3D12_PixelShader
{
if (shader_constants) {
if (renderer->current_colorspace == SDL_COLORSPACE_HDR10) {
if (shader_constants->input_type == INPUTTYPE_HDR10 &&
if (shader_constants->texture_type == TEXTURETYPE_RGB &&
shader_constants->input_type == INPUTTYPE_HDR10 &&
!PQShaderScalesInput(shader_constants)) {
// Do a simple 1-1 copy
return SHADER_RGB_SIMPLE;

View File

@@ -3576,7 +3576,8 @@ static VULKAN_Shader SelectShader(SDL_Renderer *renderer, const VULKAN_PixelShad
{
if (shader_constants) {
if (renderer->current_colorspace == SDL_COLORSPACE_HDR10) {
if (shader_constants->input_type == INPUTTYPE_HDR10 &&
if (shader_constants->texture_type == TEXTURETYPE_RGB &&
shader_constants->input_type == INPUTTYPE_HDR10 &&
!PQShaderScalesInput(shader_constants)) {
// Do a simple 1-1 copy
return SHADER_RGB_SIMPLE;