Skip to content

Commit

Permalink
gpu: Update GPU support queries to better match naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Sep 14, 2024
1 parent d21c1de commit 16ff750
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions include/SDL3/SDL_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

/**
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi.sym
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -675,8 +677,6 @@ SDL3_0.0.0 {
SDL_PushGPUVertexUniformData;
SDL_PutAudioStreamData;
SDL_QueryGPUFence;
SDL_QueryGPUSupport;
SDL_QueryGPUSupportWithProperties;
SDL_Quit;
SDL_QuitSubSystem;
SDL_RaiseWindow;
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi_overrides.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/gpu/SDL_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,15 @@ 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)
{
#ifndef SDL_GPU_DISABLED
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
Expand All @@ -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);
Expand Down

0 comments on commit 16ff750

Please sign in to comment.