GPU: Add swapchain dimension out params (#11003)

This commit is contained in:
Evan Hemsley
2024-09-30 10:23:19 -07:00
committed by GitHub
parent b3388d5753
commit afdf325fb4
11 changed files with 347 additions and 285 deletions

View File

@@ -333,7 +333,7 @@ Render(SDL_Window *window, const int windownum)
SDL_GPURenderPass *pass;
SDL_GPUBufferBinding vertex_binding;
SDL_GPUBlitInfo blit_info;
int drawablew, drawableh;
Uint32 drawablew, drawableh;
/* Acquire the swapchain texture */
@@ -342,7 +342,7 @@ Render(SDL_Window *window, const int windownum)
SDL_Log("Failed to acquire command buffer :%s", SDL_GetError());
quit(2);
}
if (!SDL_AcquireGPUSwapchainTexture(cmd, state->windows[windownum], &swapchainTexture)) {
if (!SDL_AcquireGPUSwapchainTexture(cmd, state->windows[windownum], &swapchainTexture, &drawablew, &drawableh)) {
SDL_Log("Failed to acquire swapchain texture: %s", SDL_GetError());
quit(2);
}
@@ -353,8 +353,6 @@ Render(SDL_Window *window, const int windownum)
return;
}
SDL_GetWindowSizeInPixels(window, &drawablew, &drawableh);
/*
* Do some rotation with Euler angles. It is not a fixed axis as
* quaterions would be, but the effect is cool.