Added SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER

This commit is contained in:
Sam Lantinga
2025-09-09 07:36:26 -07:00
parent c5749f0ae7
commit a4b180f515
2 changed files with 9 additions and 1 deletions

View File

@@ -233,11 +233,13 @@ static bool GPU_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_
data->format = format;
data->texture = SDL_CreateGPUTexture(renderdata->device, &tci);
if (!data->texture) {
return false;
}
SDL_PropertiesID props = SDL_GetTextureProperties(texture);
SDL_SetPointerProperty(props, SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER, data->texture);
if (texture->format == SDL_PIXELFORMAT_RGBA32 || texture->format == SDL_PIXELFORMAT_BGRA32) {
data->shader = FRAG_SHADER_TEXTURE_RGBA;
} else {