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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 347 additions and 285 deletions

View file

@ -3316,7 +3316,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice(
* \param window an SDL_Window that has been claimed.
* \param swapchain_composition the desired composition of the swapchain.
* \param present_mode the desired present mode for the swapchain.
* \returns true if successful, false on error.
* \returns true if successful, false on error; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@ -3350,20 +3350,22 @@ extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureForma
* When a swapchain texture is acquired on a command buffer, it will
* automatically be submitted for presentation when the command buffer is
* submitted. The swapchain texture should only be referenced by the command
* buffer used to acquire it. The swapchain texture handle can be NULL under
* buffer used to acquire it. The swapchain texture handle can be filled in with NULL under
* certain conditions. This is not necessarily an error. If this function
* returns false then there is an error. The swapchain texture is managed by
* the implementation and must not be freed by the user. The texture
* dimensions will be the width and height of the claimed window. You can
* obtain these dimensions by calling SDL_GetWindowSizeInPixels. You MUST NOT
* returns false then there is an error.
*
* The swapchain texture is managed by
* the implementation and must not be freed by the user. You MUST NOT
* call this function from any thread other than the one that created the
* window.
*
* \param command_buffer a command buffer.
* \param window a window that has been claimed.
* \param swapchainTexture a pointer filled in with a swapchain texture
* \param swapchain_texture a pointer filled in with a swapchain texture
* handle.
* \returns true on success, false on error.
* \param swapchain_texture_width a pointer filled in with the swapchain texture width, may be NULL.
* \param swapchain_texture_height a pointer filled in with the swapchain texture height, may be NULL.
* \returns true on success, false on error; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@ -3375,7 +3377,9 @@ extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureForma
extern SDL_DECLSPEC bool SDLCALL SDL_AcquireGPUSwapchainTexture(
SDL_GPUCommandBuffer *command_buffer,
SDL_Window *window,
SDL_GPUTexture **swapchainTexture);
SDL_GPUTexture **swapchain_texture,
Uint32 *swapchain_texture_width,
Uint32 *swapchain_texture_height);
/**
* Submits a command buffer so its commands can be processed on the GPU.