From 12ecdb9ddea6830ac4fbde1a5dce8d5e2e72d3e3 Mon Sep 17 00:00:00 2001 From: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:31:10 -0700 Subject: [PATCH] GPU: Rename some awkwardly named functions (#10642) --- include/SDL3/SDL_gpu.h | 76 +++++++++++++++--------------- src/dynapi/SDL_dynapi.sym | 24 +++++----- src/dynapi/SDL_dynapi_overrides.h | 24 +++++----- src/dynapi/SDL_dynapi_procs.h | 24 +++++----- src/gpu/SDL_gpu.c | 34 ++++++------- src/gpu/SDL_sysgpu.h | 4 +- src/gpu/d3d11/SDL_gpu_d3d11.c | 6 +-- src/gpu/d3d12/SDL_gpu_d3d12.c | 8 ++-- src/gpu/metal/SDL_gpu_metal.m | 6 +-- src/gpu/vulkan/SDL_gpu_vulkan.c | 6 +-- src/render/sdlgpu/SDL_render_gpu.c | 24 +++++----- test/testgpu_spinning_cube.c | 14 +++--- 12 files changed, 125 insertions(+), 125 deletions(-) diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h index 2041144e3f..2549430835 100644 --- a/include/SDL3/SDL_gpu.h +++ b/include/SDL3/SDL_gpu.h @@ -81,7 +81,7 @@ typedef enum SDL_GPUIndexElementSize } SDL_GPUIndexElementSize; /* Texture format support varies depending on driver, hardware, and usage flags. - * In general, you should use SDL_SupportsGPUTextureFormat to query if a format + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format * is supported before using it. However, there are a few guaranteed formats. * * For SAMPLER usage, the following formats are universally supported: @@ -1165,9 +1165,9 @@ extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( * \sa SDL_BindGPUFragmentSamplers * \sa SDL_BindGPUFragmentStorageTextures * \sa SDL_BindGPUComputeStorageTextures - * \sa SDL_BlitGPU + * \sa SDL_BlitGPUTexture * \sa SDL_ReleaseGPUTexture - * \sa SDL_SupportsGPUTextureFormat + * \sa SDL_GPUTextureSupportsFormat */ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( SDL_GPUDevice *device, @@ -1436,8 +1436,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SubmitGPU - * \sa SDL_SubmitGPUAndAcquireFence + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( SDL_GPUDevice *device); @@ -2241,7 +2241,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_GenerateGPUMipmaps( +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( SDL_GPUCommandBuffer *commandBuffer, SDL_GPUTexture *texture); @@ -2260,7 +2260,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GenerateGPUMipmaps( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_BlitGPU( +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( SDL_GPUCommandBuffer *commandBuffer, SDL_GPUBlitRegion *source, SDL_GPUBlitRegion *destination, @@ -2282,9 +2282,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_BlitGPU( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ClaimGPUWindow + * \sa SDL_ClaimWindowForGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUSwapchainComposition( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition); @@ -2301,9 +2301,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUSwapchainComposition( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ClaimGPUWindow + * \sa SDL_ClaimWindowForGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUPresentMode( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode presentMode); @@ -2325,11 +2325,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUPresentMode( * \since This function is available since SDL 3.0.0. * * \sa SDL_AcquireGPUSwapchainTexture - * \sa SDL_UnclaimGPUWindow - * \sa SDL_SupportsGPUPresentMode - * \sa SDL_SupportsGPUSwapchainComposition + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimGPUWindow( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( SDL_GPUDevice *device, SDL_Window *window); @@ -2341,9 +2341,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimGPUWindow( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ClaimGPUWindow + * \sa SDL_ClaimWindowForGPUDevice */ -extern SDL_DECLSPEC void SDLCALL SDL_UnclaimGPUWindow( +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( SDL_GPUDevice *device, SDL_Window *window); @@ -2352,8 +2352,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnclaimGPUWindow( * * This function will fail if the requested present mode or swapchain * composition are unsupported by the device. Check if the parameters are - * supported via SDL_SupportsGPUPresentMode / - * SDL_SupportsGPUSwapchainComposition prior to calling this function. + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. * * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always * supported. @@ -2366,8 +2366,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnclaimGPUWindow( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SupportsGPUPresentMode - * \sa SDL_SupportsGPUSwapchainComposition + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( SDL_GPUDevice *device, @@ -2407,9 +2407,9 @@ extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureForma * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ClaimGPUWindow - * \sa SDL_SubmitGPU - * \sa SDL_SubmitGPUAndAcquireFence + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( SDL_GPUCommandBuffer *commandBuffer, @@ -2433,9 +2433,9 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( * * \sa SDL_AcquireGPUCommandBuffer * \sa SDL_AcquireGPUSwapchainTexture - * \sa SDL_SubmitGPUAndAcquireFence + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ -extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPU( +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( SDL_GPUCommandBuffer *commandBuffer); /** @@ -2457,10 +2457,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPU( * * \sa SDL_AcquireGPUCommandBuffer * \sa SDL_AcquireGPUSwapchainTexture - * \sa SDL_SubmitGPU + * \sa SDL_SubmitGPUCommandBuffer * \sa SDL_ReleaseGPUFence */ -extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUAndAcquireFence( +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( SDL_GPUCommandBuffer *commandBuffer); /** @@ -2470,9 +2470,9 @@ extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUAndAcquireFence( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_WaitGPUForFences + * \sa SDL_WaitForGPUFences */ -extern SDL_DECLSPEC void SDLCALL SDL_WaitGPU( +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( SDL_GPUDevice *device); /** @@ -2486,10 +2486,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitGPU( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SubmitGPUAndAcquireFence - * \sa SDL_WaitGPU + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle */ -extern SDL_DECLSPEC void SDLCALL SDL_WaitGPUForFences( +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( SDL_GPUDevice *device, SDL_bool waitAll, SDL_GPUFence **pFences, @@ -2504,21 +2504,21 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitGPUForFences( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SubmitGPUAndAcquireFence + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( SDL_GPUDevice *device, SDL_GPUFence *fence); /** - * Releases a fence obtained from SDL_SubmitGPUAndAcquireFence. + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. * * \param device a GPU context. * \param fence a fence. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SubmitGPUAndAcquireFence + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( SDL_GPUDevice *device, @@ -2551,7 +2551,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUTextureFormat( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, @@ -2567,7 +2567,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUTextureFormat( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SupportsGPUSampleCount( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sampleCount); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 5f5c739039..82443e13b2 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -40,7 +40,7 @@ SDL3_0.0.0 { SDL_BindGPUVertexSamplers; SDL_BindGPUVertexStorageBuffers; SDL_BindGPUVertexStorageTextures; - SDL_BlitGPU; + SDL_BlitGPUTexture; SDL_BlitSurface9Grid; SDL_BlitSurface; SDL_BlitSurfaceScaled; @@ -50,7 +50,7 @@ SDL3_0.0.0 { SDL_BlitSurfaceUncheckedScaled; SDL_BroadcastCondition; SDL_CaptureMouse; - SDL_ClaimGPUWindow; + SDL_ClaimWindowForGPUDevice; SDL_CleanupTLS; SDL_ClearAudioStream; SDL_ClearClipboardData; @@ -197,7 +197,7 @@ SDL3_0.0.0 { SDL_GamepadHasButton; SDL_GamepadHasSensor; SDL_GamepadSensorEnabled; - SDL_GenerateGPUMipmaps; + SDL_GenerateMipmapsForGPUTexture; SDL_GetAndroidActivity; SDL_GetAndroidCachePath; SDL_GetAndroidExternalStoragePath; @@ -886,12 +886,12 @@ SDL3_0.0.0 { SDL_StopTextInput; SDL_StorageReady; SDL_StringToGUID; - SDL_SubmitGPU; - SDL_SubmitGPUAndAcquireFence; - SDL_SupportsGPUPresentMode; - SDL_SupportsGPUSampleCount; - SDL_SupportsGPUSwapchainComposition; - SDL_SupportsGPUTextureFormat; + SDL_SubmitGPUCommandBuffer; + SDL_SubmitGPUCommandBufferAndAcquireFence; + SDL_WindowSupportsGPUPresentMode; + SDL_GPUTextureSupportsSampleCount; + SDL_WindowSupportsGPUSwapchainComposition; + SDL_GPUTextureSupportsFormat; SDL_SurfaceHasAlternateImages; SDL_SurfaceHasColorKey; SDL_SurfaceHasRLE; @@ -909,7 +909,7 @@ SDL3_0.0.0 { SDL_UCS4ToUTF8; SDL_UnbindAudioStream; SDL_UnbindAudioStreams; - SDL_UnclaimGPUWindow; + SDL_ReleaseWindowFromGPUDevice; SDL_UnloadObject; SDL_UnlockAudioStream; SDL_UnlockJoysticks; @@ -943,8 +943,8 @@ SDL3_0.0.0 { SDL_WaitConditionTimeout; SDL_WaitEvent; SDL_WaitEventTimeout; - SDL_WaitGPU; - SDL_WaitGPUForFences; + SDL_WaitForGPUIdle; + SDL_WaitForGPUFences; SDL_WaitSemaphore; SDL_WaitSemaphoreTimeout; SDL_WaitThread; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index b31a0212d4..258fb19f51 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -65,7 +65,7 @@ #define SDL_BindGPUVertexSamplers SDL_BindGPUVertexSamplers_REAL #define SDL_BindGPUVertexStorageBuffers SDL_BindGPUVertexStorageBuffers_REAL #define SDL_BindGPUVertexStorageTextures SDL_BindGPUVertexStorageTextures_REAL -#define SDL_BlitGPU SDL_BlitGPU_REAL +#define SDL_BlitGPUTexture SDL_BlitGPUTexture_REAL #define SDL_BlitSurface SDL_BlitSurface_REAL #define SDL_BlitSurface9Grid SDL_BlitSurface9Grid_REAL #define SDL_BlitSurfaceScaled SDL_BlitSurfaceScaled_REAL @@ -75,7 +75,7 @@ #define SDL_BlitSurfaceUncheckedScaled SDL_BlitSurfaceUncheckedScaled_REAL #define SDL_BroadcastCondition SDL_BroadcastCondition_REAL #define SDL_CaptureMouse SDL_CaptureMouse_REAL -#define SDL_ClaimGPUWindow SDL_ClaimGPUWindow_REAL +#define SDL_ClaimWindowForGPUDevice SDL_ClaimWindowForGPUDevice_REAL #define SDL_CleanupTLS SDL_CleanupTLS_REAL #define SDL_ClearAudioStream SDL_ClearAudioStream_REAL #define SDL_ClearClipboardData SDL_ClearClipboardData_REAL @@ -222,7 +222,7 @@ #define SDL_GamepadHasButton SDL_GamepadHasButton_REAL #define SDL_GamepadHasSensor SDL_GamepadHasSensor_REAL #define SDL_GamepadSensorEnabled SDL_GamepadSensorEnabled_REAL -#define SDL_GenerateGPUMipmaps SDL_GenerateGPUMipmaps_REAL +#define SDL_GenerateMipmapsForGPUTexture SDL_GenerateMipmapsForGPUTexture_REAL #define SDL_GetAndroidActivity SDL_GetAndroidActivity_REAL #define SDL_GetAndroidCachePath SDL_GetAndroidCachePath_REAL #define SDL_GetAndroidExternalStoragePath SDL_GetAndroidExternalStoragePath_REAL @@ -911,12 +911,12 @@ #define SDL_StopTextInput SDL_StopTextInput_REAL #define SDL_StorageReady SDL_StorageReady_REAL #define SDL_StringToGUID SDL_StringToGUID_REAL -#define SDL_SubmitGPU SDL_SubmitGPU_REAL -#define SDL_SubmitGPUAndAcquireFence SDL_SubmitGPUAndAcquireFence_REAL -#define SDL_SupportsGPUPresentMode SDL_SupportsGPUPresentMode_REAL -#define SDL_SupportsGPUSampleCount SDL_SupportsGPUSampleCount_REAL -#define SDL_SupportsGPUSwapchainComposition SDL_SupportsGPUSwapchainComposition_REAL -#define SDL_SupportsGPUTextureFormat SDL_SupportsGPUTextureFormat_REAL +#define SDL_SubmitGPUCommandBuffer SDL_SubmitGPUCommandBuffer_REAL +#define SDL_SubmitGPUCommandBufferAndAcquireFence SDL_SubmitGPUCommandBufferAndAcquireFence_REAL +#define SDL_WindowSupportsGPUPresentMode SDL_WindowSupportsGPUPresentMode_REAL +#define SDL_GPUTextureSupportsSampleCount SDL_GPUTextureSupportsSampleCount_REAL +#define SDL_WindowSupportsGPUSwapchainComposition SDL_WindowSupportsGPUSwapchainComposition_REAL +#define SDL_GPUTextureSupportsFormat SDL_GPUTextureSupportsFormat_REAL #define SDL_SurfaceHasAlternateImages SDL_SurfaceHasAlternateImages_REAL #define SDL_SurfaceHasColorKey SDL_SurfaceHasColorKey_REAL #define SDL_SurfaceHasRLE SDL_SurfaceHasRLE_REAL @@ -934,7 +934,7 @@ #define SDL_UCS4ToUTF8 SDL_UCS4ToUTF8_REAL #define SDL_UnbindAudioStream SDL_UnbindAudioStream_REAL #define SDL_UnbindAudioStreams SDL_UnbindAudioStreams_REAL -#define SDL_UnclaimGPUWindow SDL_UnclaimGPUWindow_REAL +#define SDL_ReleaseWindowFromGPUDevice SDL_ReleaseWindowFromGPUDevice_REAL #define SDL_UnloadObject SDL_UnloadObject_REAL #define SDL_UnlockAudioStream SDL_UnlockAudioStream_REAL #define SDL_UnlockJoysticks SDL_UnlockJoysticks_REAL @@ -968,8 +968,8 @@ #define SDL_WaitConditionTimeout SDL_WaitConditionTimeout_REAL #define SDL_WaitEvent SDL_WaitEvent_REAL #define SDL_WaitEventTimeout SDL_WaitEventTimeout_REAL -#define SDL_WaitGPU SDL_WaitGPU_REAL -#define SDL_WaitGPUForFences SDL_WaitGPUForFences_REAL +#define SDL_WaitForGPUIdle SDL_WaitForGPUIdle_REAL +#define SDL_WaitForGPUFences SDL_WaitForGPUFences_REAL #define SDL_WaitSemaphore SDL_WaitSemaphore_REAL #define SDL_WaitSemaphoreTimeout SDL_WaitSemaphoreTimeout_REAL #define SDL_WaitThread SDL_WaitThread_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index e0bddc346a..17061e75fa 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -85,7 +85,7 @@ SDL_DYNAPI_PROC(void,SDL_BindGPUVertexBuffers,(SDL_GPURenderPass *a, Uint32 b, S SDL_DYNAPI_PROC(void,SDL_BindGPUVertexSamplers,(SDL_GPURenderPass *a, Uint32 b, SDL_GPUTextureSamplerBinding *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_BindGPUVertexStorageBuffers,(SDL_GPURenderPass *a, Uint32 b, SDL_GPUBuffer **c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_BindGPUVertexStorageTextures,(SDL_GPURenderPass *a, Uint32 b, SDL_GPUTexture **c, Uint32 d),(a,b,c,d),) -SDL_DYNAPI_PROC(void,SDL_BlitGPU,(SDL_GPUCommandBuffer *a, SDL_GPUBlitRegion *b, SDL_GPUBlitRegion *c, SDL_FlipMode d, SDL_GPUFilter e, SDL_bool f),(a,b,c,d,e,f),) +SDL_DYNAPI_PROC(void,SDL_BlitGPUTexture,(SDL_GPUCommandBuffer *a, SDL_GPUBlitRegion *b, SDL_GPUBlitRegion *c, SDL_FlipMode d, SDL_GPUFilter e, SDL_bool f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurface,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurface9Grid,(SDL_Surface *a, const SDL_Rect *b, int c, int d, int e, int f, float g, SDL_ScaleMode h, SDL_Surface *i, const SDL_Rect *j),(a,b,c,d,e,f,g,h,i,j),return) SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) @@ -95,7 +95,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rec SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_BroadcastCondition,(SDL_Condition *a),(a),) SDL_DYNAPI_PROC(SDL_bool,SDL_CaptureMouse,(SDL_bool a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClaimGPUWindow,(SDL_GPUDevice *a, SDL_Window *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_ClaimWindowForGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),) SDL_DYNAPI_PROC(SDL_bool,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ClearClipboardData,(void),(),return) @@ -242,7 +242,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasAxis,(SDL_Gamepad *a, SDL_GamepadAxis b), SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasSensor,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_GenerateGPUMipmaps,(SDL_GPUCommandBuffer *a, SDL_GPUTexture *b),(a,b),) +SDL_DYNAPI_PROC(void,SDL_GenerateMipmapsForGPUTexture,(SDL_GPUCommandBuffer *a, SDL_GPUTexture *b),(a,b),) SDL_DYNAPI_PROC(void*,SDL_GetAndroidActivity,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidCachePath,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidExternalStoragePath,(void),(),return) @@ -921,12 +921,12 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_StopHapticRumble,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_StopTextInput,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_StorageReady,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(SDL_GUID,SDL_StringToGUID,(const char *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_SubmitGPU,(SDL_GPUCommandBuffer *a),(a),) -SDL_DYNAPI_PROC(SDL_GPUFence*,SDL_SubmitGPUAndAcquireFence,(SDL_GPUCommandBuffer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SupportsGPUPresentMode,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUPresentMode c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SupportsGPUSampleCount,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUSampleCount c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SupportsGPUSwapchainComposition,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SupportsGPUTextureFormat,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUTextureType c, SDL_GPUTextureUsageFlags d),(a,b,c,d),return) +SDL_DYNAPI_PROC(void,SDL_SubmitGPUCommandBuffer,(SDL_GPUCommandBuffer *a),(a),) +SDL_DYNAPI_PROC(SDL_GPUFence*,SDL_SubmitGPUCommandBufferAndAcquireFence,(SDL_GPUCommandBuffer *a),(a),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_WindowSupportsGPUPresentMode,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUPresentMode c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_GPUTextureSupportsSampleCount,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUSampleCount c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_WindowSupportsGPUSwapchainComposition,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_GPUTextureSupportsFormat,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUTextureType c, SDL_GPUTextureUsageFlags d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasAlternateImages,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasColorKey,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasRLE,(SDL_Surface *a),(a),return) @@ -944,7 +944,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_TryWaitSemaphore,(SDL_Semaphore *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_UCS4ToUTF8,(Uint32 a, char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStream,(SDL_AudioStream *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStreams,(SDL_AudioStream **a, int b),(a,b),) -SDL_DYNAPI_PROC(void,SDL_UnclaimGPUWindow,(SDL_GPUDevice *a, SDL_Window *b),(a,b),) +SDL_DYNAPI_PROC(void,SDL_ReleaseWindowFromGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_UnloadObject,(void *a),(a),) SDL_DYNAPI_PROC(SDL_bool,SDL_UnlockAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_UnlockJoysticks,(void),(),) @@ -978,8 +978,8 @@ SDL_DYNAPI_PROC(void,SDL_WaitCondition,(SDL_Condition *a, SDL_Mutex *b),(a,b),) SDL_DYNAPI_PROC(SDL_bool,SDL_WaitConditionTimeout,(SDL_Condition *a, SDL_Mutex *b, Sint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_WaitEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_WaitEventTimeout,(SDL_Event *a, Sint32 b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_WaitGPU,(SDL_GPUDevice *a),(a),) -SDL_DYNAPI_PROC(void,SDL_WaitGPUForFences,(SDL_GPUDevice *a, SDL_bool b, SDL_GPUFence **c, Uint32 d),(a,b,c,d),) +SDL_DYNAPI_PROC(void,SDL_WaitForGPUIdle,(SDL_GPUDevice *a),(a),) +SDL_DYNAPI_PROC(void,SDL_WaitForGPUFences,(SDL_GPUDevice *a, SDL_bool b, SDL_GPUFence **c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_WaitSemaphore,(SDL_Semaphore *a),(a),) SDL_DYNAPI_PROC(SDL_bool,SDL_WaitSemaphoreTimeout,(SDL_Semaphore *a, Sint32 b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_WaitThread,(SDL_Thread *a, int *b),(a,b),) diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c index 0c63b9d33d..32d41529f4 100644 --- a/src/gpu/SDL_gpu.c +++ b/src/gpu/SDL_gpu.c @@ -1,4 +1,4 @@ -/* +/* Simple DirectMedia Layer Copyright (C) 1997-2024 Sam Lantinga @@ -546,7 +546,7 @@ Uint32 SDL_GPUTextureFormatTexelBlockSize( } } -SDL_bool SDL_SupportsGPUTextureFormat( +SDL_bool SDL_GPUTextureSupportsFormat( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, @@ -565,7 +565,7 @@ SDL_bool SDL_SupportsGPUTextureFormat( usage); } -SDL_bool SDL_SupportsGPUSampleCount( +SDL_bool SDL_GPUTextureSupportsSampleCount( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sampleCount) @@ -748,7 +748,7 @@ SDL_GPUTexture *SDL_CreateGPUTexture( SDL_assert_release(!"For cube textures: sampleCount must be SDL_GPU_SAMPLECOUNT_1"); failed = true; } - if (!SDL_SupportsGPUTextureFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_CUBE, textureCreateInfo->usageFlags)) { + if (!SDL_GPUTextureSupportsFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_CUBE, textureCreateInfo->usageFlags)) { SDL_assert_release(!"For cube textures: the format is unsupported for the given usageFlags"); failed = true; } @@ -766,7 +766,7 @@ SDL_GPUTexture *SDL_CreateGPUTexture( SDL_assert_release(!"For 3D textures: sampleCount must be SDL_GPU_SAMPLECOUNT_1"); failed = true; } - if (!SDL_SupportsGPUTextureFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_3D, textureCreateInfo->usageFlags)) { + if (!SDL_GPUTextureSupportsFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_3D, textureCreateInfo->usageFlags)) { SDL_assert_release(!"For 3D textures: the format is unsupported for the given usageFlags"); failed = true; } @@ -788,7 +788,7 @@ SDL_GPUTexture *SDL_CreateGPUTexture( failed = true; } } - if (!SDL_SupportsGPUTextureFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_2D, textureCreateInfo->usageFlags)) { + if (!SDL_GPUTextureSupportsFormat(device, textureCreateInfo->format, SDL_GPU_TEXTURETYPE_2D, textureCreateInfo->usageFlags)) { SDL_assert_release(!"For 2D textures: the format is unsupported for the given usageFlags"); failed = true; } @@ -2039,7 +2039,7 @@ void SDL_EndGPUCopyPass( ((CommandBufferCommonHeader *)COPYPASS_COMMAND_BUFFER)->copyPass.inProgress = false; } -void SDL_GenerateGPUMipmaps( +void SDL_GenerateMipmapsForGPUTexture( SDL_GPUCommandBuffer *commandBuffer, SDL_GPUTexture *texture) { @@ -2073,7 +2073,7 @@ void SDL_GenerateGPUMipmaps( texture); } -void SDL_BlitGPU( +void SDL_BlitGPUTexture( SDL_GPUCommandBuffer *commandBuffer, SDL_GPUBlitRegion *source, SDL_GPUBlitRegion *destination, @@ -2140,7 +2140,7 @@ void SDL_BlitGPU( // Submission/Presentation -SDL_bool SDL_SupportsGPUSwapchainComposition( +SDL_bool SDL_WindowSupportsGPUSwapchainComposition( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition) @@ -2161,7 +2161,7 @@ SDL_bool SDL_SupportsGPUSwapchainComposition( swapchainComposition); } -SDL_bool SDL_SupportsGPUPresentMode( +SDL_bool SDL_WindowSupportsGPUPresentMode( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode presentMode) @@ -2182,7 +2182,7 @@ SDL_bool SDL_SupportsGPUPresentMode( presentMode); } -SDL_bool SDL_ClaimGPUWindow( +SDL_bool SDL_ClaimWindowForGPUDevice( SDL_GPUDevice *device, SDL_Window *window) { @@ -2197,7 +2197,7 @@ SDL_bool SDL_ClaimGPUWindow( window); } -void SDL_UnclaimGPUWindow( +void SDL_ReleaseWindowFromGPUDevice( SDL_GPUDevice *device, SDL_Window *window) { @@ -2207,7 +2207,7 @@ void SDL_UnclaimGPUWindow( return; } - device->UnclaimWindow( + device->ReleaseWindow( device->driverData, window); } @@ -2286,7 +2286,7 @@ SDL_GPUTexture *SDL_AcquireGPUSwapchainTexture( pHeight); } -void SDL_SubmitGPU( +void SDL_SubmitGPUCommandBuffer( SDL_GPUCommandBuffer *commandBuffer) { CommandBufferCommonHeader *commandBufferHeader = (CommandBufferCommonHeader *)commandBuffer; @@ -2313,7 +2313,7 @@ void SDL_SubmitGPU( commandBuffer); } -SDL_GPUFence *SDL_SubmitGPUAndAcquireFence( +SDL_GPUFence *SDL_SubmitGPUCommandBufferAndAcquireFence( SDL_GPUCommandBuffer *commandBuffer) { CommandBufferCommonHeader *commandBufferHeader = (CommandBufferCommonHeader *)commandBuffer; @@ -2340,7 +2340,7 @@ SDL_GPUFence *SDL_SubmitGPUAndAcquireFence( commandBuffer); } -void SDL_WaitGPU( +void SDL_WaitForGPUIdle( SDL_GPUDevice *device) { CHECK_DEVICE_MAGIC(device, ); @@ -2349,7 +2349,7 @@ void SDL_WaitGPU( device->driverData); } -void SDL_WaitGPUForFences( +void SDL_WaitForGPUFences( SDL_GPUDevice *device, SDL_bool waitAll, SDL_GPUFence **pFences, diff --git a/src/gpu/SDL_sysgpu.h b/src/gpu/SDL_sysgpu.h index 3d3912f489..d8257cd622 100644 --- a/src/gpu/SDL_sysgpu.h +++ b/src/gpu/SDL_sysgpu.h @@ -604,7 +604,7 @@ struct SDL_GPUDevice SDL_GPURenderer *driverData, SDL_Window *window); - void (*UnclaimWindow)( + void (*ReleaseWindow)( SDL_GPURenderer *driverData, SDL_Window *window); @@ -739,7 +739,7 @@ struct SDL_GPUDevice ASSIGN_DRIVER_FUNC(SupportsSwapchainComposition, name) \ ASSIGN_DRIVER_FUNC(SupportsPresentMode, name) \ ASSIGN_DRIVER_FUNC(ClaimWindow, name) \ - ASSIGN_DRIVER_FUNC(UnclaimWindow, name) \ + ASSIGN_DRIVER_FUNC(ReleaseWindow, name) \ ASSIGN_DRIVER_FUNC(SetSwapchainParameters, name) \ ASSIGN_DRIVER_FUNC(GetSwapchainTextureFormat, name) \ ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \ diff --git a/src/gpu/d3d11/SDL_gpu_d3d11.c b/src/gpu/d3d11/SDL_gpu_d3d11.c index 1bebc3291e..664f66f752 100644 --- a/src/gpu/d3d11/SDL_gpu_d3d11.c +++ b/src/gpu/d3d11/SDL_gpu_d3d11.c @@ -140,7 +140,7 @@ static const GUID D3D_IID_DXGI_DEBUG_ALL = { 0xe48ae283, 0xda80, 0x490b, { 0x87, // Forward Declarations static void D3D11_Wait(SDL_GPURenderer *driverData); -static void D3D11_UnclaimWindow( +static void D3D11_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window); static void D3D11_INTERNAL_DestroyBlitPipelines(SDL_GPURenderer *driverData); @@ -898,7 +898,7 @@ static void D3D11_DestroyDevice( // Release the window data for (Sint32 i = renderer->claimedWindowCount - 1; i >= 0; i -= 1) { - D3D11_UnclaimWindow(device->driverData, renderer->claimedWindows[i]->window); + D3D11_ReleaseWindow(device->driverData, renderer->claimedWindows[i]->window); } SDL_free(renderer->claimedWindows); @@ -5161,7 +5161,7 @@ static void D3D11_INTERNAL_DestroySwapchain( } } -static void D3D11_UnclaimWindow( +static void D3D11_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window) { diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c index 7e3c1be0b7..c1e1bed4f6 100644 --- a/src/gpu/d3d12/SDL_gpu_d3d12.c +++ b/src/gpu/d3d12/SDL_gpu_d3d12.c @@ -843,7 +843,7 @@ struct D3D12UniformBuffer // Foward function declarations -static void D3D12_UnclaimWindow(SDL_GPURenderer *driverData, SDL_Window *window); +static void D3D12_ReleaseWindow(SDL_GPURenderer *driverData, SDL_Window *window); static void D3D12_Wait(SDL_GPURenderer *driverData); static void D3D12_WaitForFences(SDL_GPURenderer *driverData, bool waitAll, SDL_GPUFence **pFences, Uint32 fenceCount); static void D3D12_INTERNAL_ReleaseBlitPipelines(SDL_GPURenderer *driverData); @@ -1391,7 +1391,7 @@ static void D3D12_DestroyDevice(SDL_GPUDevice *device) // Release window data for (Sint32 i = renderer->claimedWindowCount - 1; i >= 0; i -= 1) { - D3D12_UnclaimWindow((SDL_GPURenderer *)renderer, renderer->claimedWindows[i]->window); + D3D12_ReleaseWindow((SDL_GPURenderer *)renderer, renderer->claimedWindows[i]->window); } D3D12_INTERNAL_DestroyRenderer(renderer); @@ -5724,7 +5724,7 @@ static void D3D12_GenerateMipmaps( dstRegion.w = container->header.info.width >> levelIndex; dstRegion.h = container->header.info.height >> levelIndex; - SDL_BlitGPU( + SDL_BlitGPUTexture( commandBuffer, &srcRegion, &dstRegion, @@ -6357,7 +6357,7 @@ static bool D3D12_ClaimWindow( } } -static void D3D12_UnclaimWindow( +static void D3D12_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window) { diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m index 02a94e3066..6a75322c5d 100644 --- a/src/gpu/metal/SDL_gpu_metal.m +++ b/src/gpu/metal/SDL_gpu_metal.m @@ -60,7 +60,7 @@ // Forward Declarations static void METAL_Wait(SDL_GPURenderer *driverData); -static void METAL_UnclaimWindow( +static void METAL_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window); static void METAL_INTERNAL_DestroyBlitResources(SDL_GPURenderer *driverData); @@ -617,7 +617,7 @@ static void METAL_DestroyDevice(SDL_GPUDevice *device) // Release the window data for (Sint32 i = renderer->claimedWindowCount - 1; i >= 0; i -= 1) { - METAL_UnclaimWindow(device->driverData, renderer->claimedWindows[i]->window); + METAL_ReleaseWindow(device->driverData, renderer->claimedWindows[i]->window); } SDL_free(renderer->claimedWindows); @@ -3439,7 +3439,7 @@ static bool METAL_ClaimWindow( } } -static void METAL_UnclaimWindow( +static void METAL_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window) { diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 2ae62771e0..eb0a11d6ce 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -1160,7 +1160,7 @@ struct VulkanRenderer static Uint8 VULKAN_INTERNAL_DefragmentMemory(VulkanRenderer *renderer); static void VULKAN_INTERNAL_BeginCommandBuffer(VulkanRenderer *renderer, VulkanCommandBuffer *commandBuffer); -static void VULKAN_UnclaimWindow(SDL_GPURenderer *driverData, SDL_Window *window); +static void VULKAN_ReleaseWindow(SDL_GPURenderer *driverData, SDL_Window *window); static void VULKAN_Wait(SDL_GPURenderer *driverData); static void VULKAN_WaitForFences(SDL_GPURenderer *driverData, bool waitAll, SDL_GPUFence **pFences, Uint32 fenceCount); static void VULKAN_Submit(SDL_GPUCommandBuffer *commandBuffer); @@ -4788,7 +4788,7 @@ static void VULKAN_DestroyDevice( VULKAN_Wait(device->driverData); for (Sint32 i = renderer->claimedWindowCount - 1; i >= 0; i -= 1) { - VULKAN_UnclaimWindow(device->driverData, renderer->claimedWindows[i]->window); + VULKAN_ReleaseWindow(device->driverData, renderer->claimedWindows[i]->window); } SDL_free(renderer->claimedWindows); @@ -9740,7 +9740,7 @@ static bool VULKAN_ClaimWindow( } } -static void VULKAN_UnclaimWindow( +static void VULKAN_ReleaseWindow( SDL_GPURenderer *driverData, SDL_Window *window) { diff --git a/src/render/sdlgpu/SDL_render_gpu.c b/src/render/sdlgpu/SDL_render_gpu.c index f15928d67d..f7a5e7db75 100644 --- a/src/render/sdlgpu/SDL_render_gpu.c +++ b/src/render/sdlgpu/SDL_render_gpu.c @@ -887,8 +887,8 @@ static SDL_Surface *GPU_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect SDL_DownloadFromGPUTexture(pass, &src, &dst); SDL_EndGPUCopyPass(pass); - SDL_GPUFence *fence = SDL_SubmitGPUAndAcquireFence(data->state.command_buffer); - SDL_WaitGPUForFences(data->device, true, &fence, 1); + SDL_GPUFence *fence = SDL_SubmitGPUCommandBufferAndAcquireFence(data->state.command_buffer); + SDL_WaitForGPUFences(data->device, true, &fence, 1); SDL_ReleaseGPUFence(data->device, fence); data->state.command_buffer = SDL_AcquireGPUCommandBuffer(data->device); @@ -960,7 +960,7 @@ static bool GPU_RenderPresent(SDL_Renderer *renderer) dst.w = swapchain_w; dst.h = swapchain_h; - SDL_BlitGPU(data->state.command_buffer, &src, &dst, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, true); + SDL_BlitGPUTexture(data->state.command_buffer, &src, &dst, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, true); SDL_ReleaseGPUTexture(data->device, data->backbuffer.texture); CreateBackbuffer(data, swapchain_w, swapchain_h, swapchain_fmt); } else { @@ -986,13 +986,13 @@ static bool GPU_RenderPresent(SDL_Renderer *renderer) submit: #if 1 if (data->present_fence) { - SDL_WaitGPUForFences(data->device, true, &data->present_fence, 1); + SDL_WaitForGPUFences(data->device, true, &data->present_fence, 1); SDL_ReleaseGPUFence(data->device, data->present_fence); } - data->present_fence = SDL_SubmitGPUAndAcquireFence(data->state.command_buffer); + data->present_fence = SDL_SubmitGPUCommandBufferAndAcquireFence(data->state.command_buffer); #else - SDL_SubmitGPU(data->state.command_buffer); + SDL_SubmitGPUCommandBuffer(data->state.command_buffer); #endif data->state.command_buffer = SDL_AcquireGPUCommandBuffer(data->device); @@ -1028,12 +1028,12 @@ static void GPU_DestroyRenderer(SDL_Renderer *renderer) } if (data->present_fence) { - SDL_WaitGPUForFences(data->device, true, &data->present_fence, 1); + SDL_WaitForGPUFences(data->device, true, &data->present_fence, 1); SDL_ReleaseGPUFence(data->device, data->present_fence); } if (data->state.command_buffer) { - SDL_SubmitGPU(data->state.command_buffer); + SDL_SubmitGPUCommandBuffer(data->state.command_buffer); data->state.command_buffer = NULL; } @@ -1046,7 +1046,7 @@ static void GPU_DestroyRenderer(SDL_Renderer *renderer) } if (renderer->window) { - SDL_UnclaimGPUWindow(data->device, renderer->window); + SDL_ReleaseWindowFromGPUDevice(data->device, renderer->window); } ReleaseVertexBuffer(data); @@ -1065,10 +1065,10 @@ static bool ChoosePresentMode(SDL_GPUDevice *device, SDL_Window *window, const i case 0: mode = SDL_GPU_PRESENTMODE_MAILBOX; - if (!SDL_SupportsGPUPresentMode(device, window, mode)) { + if (!SDL_WindowSupportsGPUPresentMode(device, window, mode)) { mode = SDL_GPU_PRESENTMODE_IMMEDIATE; - if (!SDL_SupportsGPUPresentMode(device, window, mode)) { + if (!SDL_WindowSupportsGPUPresentMode(device, window, mode)) { mode = SDL_GPU_PRESENTMODE_VSYNC; } } @@ -1239,7 +1239,7 @@ static bool GPU_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_P return false; } - if (!SDL_ClaimGPUWindow(data->device, window)) { + if (!SDL_ClaimWindowForGPUDevice(data->device, window)) { return false; } diff --git a/test/testgpu_spinning_cube.c b/test/testgpu_spinning_cube.c index 4aed3aff2f..96c60415ea 100644 --- a/test/testgpu_spinning_cube.c +++ b/test/testgpu_spinning_cube.c @@ -59,7 +59,7 @@ static void shutdownGPU(void) WindowState *winstate = &window_states[i]; SDL_ReleaseGPUTexture(gpu_device, winstate->tex_depth); SDL_ReleaseGPUTexture(gpu_device, winstate->tex_msaa); - SDL_UnclaimGPUWindow(gpu_device, state->windows[i]); + SDL_ReleaseWindowFromGPUDevice(gpu_device, state->windows[i]); } SDL_free(window_states); window_states = NULL; @@ -316,7 +316,7 @@ Render(SDL_Window *window, const int windownum) if (!swapchain) { /* No swapchain was acquired, probably too many frames in flight */ - SDL_SubmitGPU(cmd); + SDL_SubmitGPUCommandBuffer(cmd); return; } @@ -401,11 +401,11 @@ Render(SDL_Window *window, const int windownum) dst_region = src_region; dst_region.texture = swapchain; - SDL_BlitGPU(cmd, &src_region, &dst_region, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, SDL_FALSE); + SDL_BlitGPUTexture(cmd, &src_region, &dst_region, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, SDL_FALSE); } /* Submit the command buffer! */ - SDL_SubmitGPU(cmd); + SDL_SubmitGPUCommandBuffer(cmd); ++frames; } @@ -477,7 +477,7 @@ init_render_state(int msaa) /* Claim the windows */ for (i = 0; i < state->num_windows; i++) { - SDL_ClaimGPUWindow( + SDL_ClaimWindowForGPUDevice( gpu_device, state->windows[i] ); @@ -526,13 +526,13 @@ init_render_state(int msaa) dst_region.size = sizeof(vertex_data); SDL_UploadToGPUBuffer(copy_pass, &buf_location, &dst_region, SDL_FALSE); SDL_EndGPUCopyPass(copy_pass); - SDL_SubmitGPU(cmd); + SDL_SubmitGPUCommandBuffer(cmd); SDL_ReleaseGPUTransferBuffer(gpu_device, buf_transfer); /* Determine which sample count to use */ render_state.sample_count = SDL_GPU_SAMPLECOUNT_1; - if (msaa && SDL_SupportsGPUSampleCount( + if (msaa && SDL_GPUTextureSupportsSampleCount( gpu_device, SDL_GetGPUSwapchainTextureFormat(gpu_device, state->windows[0]), SDL_GPU_SAMPLECOUNT_4)) {