From 16ff7503b7baac7f92f2274d73cca944f0a97337 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Fri, 13 Sep 2024 23:08:44 -0400 Subject: [PATCH] gpu: Update GPU support queries to better match naming conventions --- include/SDL3/SDL_gpu.h | 8 ++++---- src/dynapi/SDL_dynapi.sym | 4 ++-- src/dynapi/SDL_dynapi_overrides.h | 4 ++-- src/dynapi/SDL_dynapi_procs.h | 4 ++-- src/gpu/SDL_gpu.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h index b90587366..da578d9a5 100644 --- a/include/SDL3/SDL_gpu.h +++ b/include/SDL3/SDL_gpu.h @@ -1688,7 +1688,7 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding * * \sa SDL_CreateGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUSupport( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats( SDL_GPUShaderFormat format_flags, const char *name); @@ -1702,7 +1702,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUSupport( * * \sa SDL_CreateGPUDeviceWithProperties */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUSupportWithProperties( +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties( SDL_PropertiesID props); /** @@ -1720,7 +1720,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUSupportWithProperties( * \sa SDL_GetGPUShaderFormats * \sa SDL_GetGPUDeviceDriver * \sa SDL_DestroyGPUDevice - * \sa SDL_QueryGPUSupport + * \sa SDL_GPUSupportsShaderFormats */ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( SDL_GPUShaderFormat format_flags, @@ -1767,7 +1767,7 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( * \sa SDL_GetGPUShaderFormats * \sa SDL_GetGPUDeviceDriver * \sa SDL_DestroyGPUDevice - * \sa SDL_QueryGPUSupportWithProperties + * \sa SDL_GPUSupportsProperties */ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( SDL_PropertiesID props); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 5f21c4740..e44ed771a 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -192,6 +192,8 @@ SDL3_0.0.0 { SDL_GL_SetSwapInterval; SDL_GL_SwapWindow; SDL_GL_UnloadLibrary; + SDL_GPUSupportsProperties; + SDL_GPUSupportsShaderFormats; SDL_GPUTextureFormatTexelBlockSize; SDL_GPUTextureSupportsFormat; SDL_GPUTextureSupportsSampleCount; @@ -675,8 +677,6 @@ SDL3_0.0.0 { SDL_PushGPUVertexUniformData; SDL_PutAudioStreamData; SDL_QueryGPUFence; - SDL_QueryGPUSupport; - SDL_QueryGPUSupportWithProperties; SDL_Quit; SDL_QuitSubSystem; SDL_RaiseWindow; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 8b4ebc54f..74a4b0bd8 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -217,6 +217,8 @@ #define SDL_GL_SetSwapInterval SDL_GL_SetSwapInterval_REAL #define SDL_GL_SwapWindow SDL_GL_SwapWindow_REAL #define SDL_GL_UnloadLibrary SDL_GL_UnloadLibrary_REAL +#define SDL_GPUSupportsProperties SDL_GPUSupportsProperties_REAL +#define SDL_GPUSupportsShaderFormats SDL_GPUSupportsShaderFormats_REAL #define SDL_GPUTextureFormatTexelBlockSize SDL_GPUTextureFormatTexelBlockSize_REAL #define SDL_GPUTextureSupportsFormat SDL_GPUTextureSupportsFormat_REAL #define SDL_GPUTextureSupportsSampleCount SDL_GPUTextureSupportsSampleCount_REAL @@ -700,8 +702,6 @@ #define SDL_PushGPUVertexUniformData SDL_PushGPUVertexUniformData_REAL #define SDL_PutAudioStreamData SDL_PutAudioStreamData_REAL #define SDL_QueryGPUFence SDL_QueryGPUFence_REAL -#define SDL_QueryGPUSupport SDL_QueryGPUSupport_REAL -#define SDL_QueryGPUSupportWithProperties SDL_QueryGPUSupportWithProperties_REAL #define SDL_Quit SDL_Quit_REAL #define SDL_QuitSubSystem SDL_QuitSubSystem_REAL #define SDL_RaiseWindow SDL_RaiseWindow_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 6c32801ca..29d5adc2c 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -237,6 +237,8 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SetAttribute,(SDL_GLattr a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SetSwapInterval,(int a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SwapWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GL_UnloadLibrary,(void),(),) +SDL_DYNAPI_PROC(SDL_bool,SDL_GPUSupportsProperties,(SDL_PropertiesID a),(a),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_GPUSupportsShaderFormats,(SDL_GPUShaderFormat a, const char *b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GPUTextureFormatTexelBlockSize,(SDL_GPUTextureFormat a),(a),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_GPUTextureSupportsSampleCount,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUSampleCount c),(a,b,c),return) @@ -711,8 +713,6 @@ SDL_DYNAPI_PROC(void,SDL_PushGPUFragmentUniformData,(SDL_GPUCommandBuffer *a, Ui SDL_DYNAPI_PROC(void,SDL_PushGPUVertexUniformData,(SDL_GPUCommandBuffer *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(SDL_bool,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_QueryGPUFence,(SDL_GPUDevice *a, SDL_GPUFence *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_QueryGPUSupport,(SDL_GPUShaderFormat a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_QueryGPUSupportWithProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(void,SDL_Quit,(void),(),) SDL_DYNAPI_PROC(void,SDL_QuitSubSystem,(SDL_InitFlags a),(a),) SDL_DYNAPI_PROC(SDL_bool,SDL_RaiseWindow,(SDL_Window *a),(a),return) diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c index fef2c9822..0b07ff882 100644 --- a/src/gpu/SDL_gpu.c +++ b/src/gpu/SDL_gpu.c @@ -468,7 +468,7 @@ static void SDL_GPU_FillProperties( SDL_SetStringProperty(props, SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING, name); } -SDL_bool SDL_QueryGPUSupport( +SDL_bool SDL_GPUSupportsShaderFormats( SDL_GPUShaderFormat format_flags, const char *name) { @@ -476,7 +476,7 @@ SDL_bool SDL_QueryGPUSupport( bool result; SDL_PropertiesID props = SDL_CreateProperties(); SDL_GPU_FillProperties(props, format_flags, SDL_FALSE, name); - result = SDL_QueryGPUSupportWithProperties(props); + result = SDL_GPUSupportsProperties(props); SDL_DestroyProperties(props); return result; #else @@ -485,7 +485,7 @@ SDL_bool SDL_QueryGPUSupport( #endif } -SDL_bool SDL_QueryGPUSupportWithProperties(SDL_PropertiesID props) +SDL_bool SDL_GPUSupportsProperties(SDL_PropertiesID props) { #ifndef SDL_GPU_DISABLED return (SDL_GPUSelectBackend(props) != NULL);