Added an advanced shader for the GPU renderer

This allows us to support YUV colorspaces and HDR in the GPU renderer.

Fixes https://github.com/libsdl-org/SDL/issues/11281
Fixes https://github.com/libsdl-org/SDL/issues/11282
This commit is contained in:
Sam Lantinga
2025-09-29 21:23:15 -07:00
parent fe3b399b7e
commit 9735c45db6
42 changed files with 5205 additions and 3589 deletions

View File

@@ -864,6 +864,12 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Re
*
* - `SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER`: the SDL_GPUTexture associated
* with the texture
* - `SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER`: the SDL_GPUTexture associated
* with the UV plane of an NV12 texture
* - `SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER`: the SDL_GPUTexture associated
* with the U plane of a YUV texture
* - `SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER`: the SDL_GPUTexture associated
* with the V plane of a YUV texture
*
* \param texture the texture to query.
* \returns a valid property ID on success or 0 on failure; call
@@ -902,6 +908,9 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Textur
#define SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBER "SDL.texture.opengles2.target"
#define SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER "SDL.texture.vulkan.texture"
#define SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER "SDL.texture.gpu.texture"
#define SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER "SDL.texture.gpu.texture_uv"
#define SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER "SDL.texture.gpu.texture_u"
#define SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER "SDL.texture.gpu.texture_v"
/**
* Get the renderer that created an SDL_Texture.