SDL: Use the correct namespace for structures

From 667a3e40e9a10a0417ad228b8ce5feedfad8e6dd Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 11 Sep 2024 11:21:09 -0700
Subject: [PATCH] Use the correct namespace for structures

Otherwise the debugger may use the wrong structure definition at runtime.
---
 src/render/direct3d11/SDL_render_d3d11.c | 64 ++++++++---------
 src/render/direct3d12/SDL_render_d3d12.c | 56 +++++++--------
 src/render/vulkan/SDL_render_vulkan.c    | 92 ++++++++++++------------
 3 files changed, 106 insertions(+), 106 deletions(-)

diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index 84b72fb797821..e0ff88976e48b 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -53,19 +53,19 @@
 // Sampler types
 typedef enum
 {
-    SDL_D3D11_SAMPLER_NEAREST_CLAMP,
-    SDL_D3D11_SAMPLER_NEAREST_WRAP,
-    SDL_D3D11_SAMPLER_LINEAR_CLAMP,
-    SDL_D3D11_SAMPLER_LINEAR_WRAP,
-    SDL_NUM_D3D11_SAMPLERS
-} SDL_D3D11_sampler_type;
+    D3D11_SAMPLER_NEAREST_CLAMP,
+    D3D11_SAMPLER_NEAREST_WRAP,
+    D3D11_SAMPLER_LINEAR_CLAMP,
+    D3D11_SAMPLER_LINEAR_WRAP,
+    D3D11_SAMPLER_COUNT
+} D3D11_Sampler;
 
 // Vertex shader, common values
 typedef struct
 {
     Float4X4 model;
     Float4X4 projectionAndView;
-} VertexShaderConstants;
+} D3D11_VertexShaderConstants;
 
 // These should mirror the definitions in D3D11_PixelShader_Common.hlsli
 //static const float TONEMAP_NONE = 0;
@@ -96,13 +96,13 @@ typedef struct
     float sdr_white_point;
 
     float YCbCr_matrix[16];
-} PixelShaderConstants;
+} D3D11_PixelShaderConstants;
 
 typedef struct
 {
     ID3D11Buffer *constants;
-    PixelShaderConstants shader_constants;
-} PixelShaderState;
+    D3D11_PixelShaderConstants shader_constants;
+} D3D11_PixelShaderState;
 
 // Per-vertex data
 typedef struct
@@ -110,7 +110,7 @@ typedef struct
     Float2 pos;
     Float2 tex;
     SDL_FColor color;
-} VertexPositionColor;
+} D3D11_VertexPositionColor;
 
 // Per-texture data
 typedef struct
@@ -173,7 +173,7 @@ typedef struct
     ID3D11PixelShader *pixelShaders[NUM_SHADERS];
     int blendModesCount;
     D3D11_BlendMode *blendModes;
-    ID3D11SamplerState *samplers[SDL_NUM_D3D11_SAMPLERS];
+    ID3D11SamplerState *samplers[D3D11_SAMPLER_COUNT];
     D3D_FEATURE_LEVEL featureLevel;
     bool pixelSizeChanged;
 
@@ -182,7 +182,7 @@ typedef struct
     ID3D11RasterizerState *clippedRasterizer;
 
     // Vertex buffer constants
-    VertexShaderConstants vertexShaderConstantsData;
+    D3D11_VertexShaderConstants vertexShaderConstantsData;
     ID3D11Buffer *vertexShaderConstants;
 
     // Cached renderer properties
@@ -191,7 +191,7 @@ typedef struct
     ID3D11RasterizerState *currentRasterizerState;
     ID3D11BlendState *currentBlendState;
     D3D11_Shader currentShader;
-    PixelShaderState currentShaderState[NUM_SHADERS];
+    D3D11_PixelShaderState currentShaderState[NUM_SHADERS];
     ID3D11ShaderResourceView *currentShaderResource;
     ID3D11SamplerState *currentSampler;
     bool cliprectDirty;
@@ -698,7 +698,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer)
 
     // Setup space to hold vertex shader constants:
     SDL_zero(constantBufferDesc);
-    constantBufferDesc.ByteWidth = sizeof(VertexShaderConstants);
+    constantBufferDesc.ByteWidth = sizeof(D3D11_VertexShaderConstants);
     constantBufferDesc.Usage = D3D11_USAGE_DEFAULT;
     constantBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
     result = ID3D11Device_CreateBuffer(data->d3dDevice,
@@ -721,7 +721,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer)
         { D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_CLAMP },
         { D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_WRAP },
     };
-    SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_NUM_D3D11_SAMPLERS);
+    SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == D3D11_SAMPLER_COUNT);
     SDL_zero(samplerDesc);
     samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
     samplerDesc.MipLODBias = 0.0f;
@@ -1834,7 +1834,7 @@ static bool D3D11_QueueNoOp(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
 
 static bool D3D11_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
 {
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    D3D11_VertexPositionColor *verts = (D3D11_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(D3D11_VertexPositionColor), 0, &cmd->data.draw.first);
     int i;
     SDL_FColor color = cmd->data.draw.color;
     bool convert_color = SDL_RenderingLinearSpace(renderer);
@@ -1868,7 +1868,7 @@ static bool D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
 {
     int i;
     int count = indices ? num_indices : num_vertices;
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    D3D11_VertexPositionColor *verts = (D3D11_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(D3D11_VertexPositionColor), 0, &cmd->data.draw.first);
     bool convert_color = SDL_RenderingLinearSpace(renderer);
     D3D11_TextureData *textureData = texture ? (D3D11_TextureData *)texture->internal : NULL;
     float u_scale = textureData ? (float)texture->w / textureData->w : 0.0f;
@@ -1923,7 +1923,7 @@ static bool D3D11_UpdateVertexBuffer(SDL_Renderer *renderer,
     D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal;
     HRESULT result = S_OK;
     const int vbidx = rendererData->currentVertexBuffer;
-    const UINT stride = sizeof(VertexPositionColor);
+    const UINT stride = sizeof(D3D11_VertexPositionColor);
     const UINT offset = 0;
 
     if (dataSizeInBytes == 0) {
@@ -2087,7 +2087,7 @@ static ID3D11RenderTargetView *D3D11_GetCurrentRenderTargetView(SDL_Renderer *re
     }
 }
 
-static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Texture *texture, PixelShaderConstants *constants)
+static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Texture *texture, D3D11_PixelShaderConstants *constants)
 {
     float output_headroom;
 
@@ -2150,7 +2150,7 @@ static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC
 }
 
 static bool D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd,
-                              D3D11_Shader shader, const PixelShaderConstants *shader_constants,
+                              D3D11_Shader shader, const D3D11_PixelShaderConstants *shader_constants,
                               const int numShaderResources, ID3D11ShaderResourceView **shaderResources,
                               ID3D11SamplerState *sampler, const Float4X4 *matrix)
 
@@ -2163,8 +2163,8 @@ static bool D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *
     const SDL_BlendMode blendMode = cmd->data.draw.blend;
     ID3D11BlendState *blendState = NULL;
     bool updateSubresource = false;
-    PixelShaderState *shader_state = &rendererData->currentShaderState[shader];
-    PixelShaderConstants solid_constants;
+    D3D11_PixelShaderState *shader_state = &rendererData->currentShaderState[shader];
+    D3D11_PixelShaderConstants solid_constants;
 
     if (numShaderResources > 0) {
         shaderResource = shaderResources[0];
@@ -2308,7 +2308,7 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal;
     D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal;
     ID3D11SamplerState *textureSampler;
-    PixelShaderConstants constants;
+    D3D11_PixelShaderConstants constants;
 
     if (!textureData) {
         return SDL_SetError("Texture is not currently available");
@@ -2320,10 +2320,10 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     case D3D11_FILTER_MIN_MAG_MIP_POINT:
         switch (cmd->data.draw.texture_address_mode) {
         case SDL_TEXTURE_ADDRESS_CLAMP:
-            textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_NEAREST_CLAMP];
+            textureSampler = rendererData->samplers[D3D11_SAMPLER_NEAREST_CLAMP];
             break;
         case SDL_TEXTURE_ADDRESS_WRAP:
-            textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_NEAREST_WRAP];
+            textureSampler = rendererData->samplers[D3D11_SAMPLER_NEAREST_WRAP];
             break;
         default:
             return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode);
@@ -2332,10 +2332,10 @@ static bool D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     case D3D11_FILTER_MIN_MAG_MIP_LINEAR:
         switch (cmd->data.draw.texture_address_mode) {
         case SDL_TEXTURE_ADDRESS_CLAMP:
-            textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_LINEAR_CLAMP];
+            textureSampler = rendererData->samplers[D3D11_SAMPLER_LINEAR_CLAMP];
             break;
         case SDL_TEXTURE_ADDRESS_WRAP:
-            textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_LINEAR_WRAP];
+            textureSampler = rendererData->samplers[D3D11_SAMPLER_LINEAR_WRAP];
             break;
         default:
             return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode);
@@ -2458,7 +2458,7 @@ static bool D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
         {
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
+            const size_t start = first / sizeof(D3D11_VertexPositionColor);
             D3D11_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, 0, NULL, NULL, NULL);
             D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, start, count);
             break;
@@ -2468,8 +2468,8 @@ static bool D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
         {
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
-            const VertexPositionColor *verts = (VertexPositionColor *)(((Uint8 *)vertices) + first);
+            const size_t start = first / sizeof(D3D11_VertexPositionColor);
+            const D3D11_VertexPositionColor *verts = (D3D11_VertexPositionColor *)(((Uint8 *)vertices) + first);
             D3D11_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, 0, NULL, NULL, NULL);
             D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count);
             if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) {
@@ -2492,7 +2492,7 @@ static bool D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
             SDL_Texture *texture = cmd->data.draw.texture;
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
+            const size_t start = first / sizeof(D3D11_VertexPositionColor);
 
             if (texture) {
                 D3D11_SetCopyState(renderer, cmd, NULL);
diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c
index ba03d543ea9ce..054a3d60a92e5 100644
--- a/src/render/direct3d12/SDL_render_d3d12.c
+++ b/src/render/direct3d12/SDL_render_d3d12.c
@@ -59,19 +59,19 @@ extern "C" {
 // Sampler types
 typedef enum
 {
-    SDL_D3D12_SAMPLER_NEAREST_CLAMP,
-    SDL_D3D12_SAMPLER_NEAREST_WRAP,
-    SDL_D3D12_SAMPLER_LINEAR_CLAMP,
-    SDL_D3D12_SAMPLER_LINEAR_WRAP,
-    SDL_D3D12_NUM_SAMPLERS
-} SDL_D3D12_sampler_type;
+    D3D12_SAMPLER_NEAREST_CLAMP,
+    D3D12_SAMPLER_NEAREST_WRAP,
+    D3D12_SAMPLER_LINEAR_CLAMP,
+    D3D12_SAMPLER_LINEAR_WRAP,
+    D3D12_SAMPLER_COUNT
+} D3D12_Sampler;
 
 // Vertex shader, common values
 typedef struct
 {
     Float4X4 model;
     Float4X4 projectionAndView;
-} VertexShaderConstants;
+} D3D12_VertexShaderConstants;
 
 // These should mirror the definitions in D3D12_PixelShader_Common.hlsli
 //static const float TONEMAP_NONE = 0;
@@ -102,7 +102,7 @@ typedef struct
     float sdr_white_point;
 
     float YCbCr_matrix[16];
-} PixelShaderConstants;
+} D3D12_PixelShaderConstants;
 
 // Per-vertex data
 typedef struct
@@ -110,7 +110,7 @@ typedef struct
     Float2 pos;
     Float2 tex;
     SDL_FColor color;
-} VertexPositionColor;
+} D3D12_VertexPositionColor;
 
 // Per-texture data
 typedef struct
@@ -154,7 +154,7 @@ typedef struct
 typedef struct
 {
     D3D12_Shader shader;
-    PixelShaderConstants shader_constants;
+    D3D12_PixelShaderConstants shader_constants;
     SDL_BlendMode blendMode;
     D3D12_PRIMITIVE_TOPOLOGY_TYPE topology;
     DXGI_FORMAT rtvFormat;
@@ -226,7 +226,7 @@ typedef struct
     D3D12_PipelineState *currentPipelineState;
 
     D3D12_VertexBuffer vertexBuffers[SDL_D3D12_NUM_VERTEX_BUFFERS];
-    D3D12_CPU_DESCRIPTOR_HANDLE samplers[SDL_D3D12_NUM_SAMPLERS];
+    D3D12_CPU_DESCRIPTOR_HANDLE samplers[D3D12_SAMPLER_COUNT];
 
     // Data for staging/allocating textures
     ID3D12Resource *uploadBuffers[SDL_D3D12_NUM_UPLOAD_BUFFERS];
@@ -237,7 +237,7 @@ typedef struct
     D3D12_SRVPoolNode srvPoolNodes[SDL_D3D12_MAX_NUM_TEXTURES];
 
     // Vertex buffer constants
-    VertexShaderConstants vertexShaderConstantsData;
+    D3D12_VertexShaderConstants vertexShaderConstantsData;
 
     // Cached renderer properties
     DXGI_MODE_ROTATION rotation;
@@ -752,7 +752,7 @@ static HRESULT D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, si
     }
 
     data->vertexBuffers[vbidx].view.BufferLocation = ID3D12Resource_GetGPUVirtualAddress(data->vertexBuffers[vbidx].resource);
-    data->vertexBuffers[vbidx].view.StrideInBytes = sizeof(VertexPositionColor);
+    data->vertexBuffers[vbidx].view.StrideInBytes = sizeof(D3D12_VertexPositionColor);
     data->vertexBuffers[vbidx].size = size;
 
     return result;
@@ -1106,7 +1106,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
         { D3D12_FILTER_MIN_MAG_MIP_LINEAR, D3D12_TEXTURE_ADDRESS_MODE_CLAMP },
         { D3D12_FILTER_MIN_MAG_MIP_LINEAR, D3D12_TEXTURE_ADDRESS_MODE_WRAP },
     };
-    SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_D3D12_NUM_SAMPLERS);
+    SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == D3D12_SAMPLER_COUNT);
     SDL_zero(samplerDesc);
     samplerDesc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
     samplerDesc.MipLODBias = 0.0f;
@@ -2294,7 +2294,7 @@ static bool D3D12_QueueNoOp(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
 
 static bool D3D12_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
 {
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    D3D12_VertexPositionColor *verts = (D3D12_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(D3D12_VertexPositionColor), 0, &cmd->data.draw.first);
     int i;
     SDL_FColor color = cmd->data.draw.color;
     bool convert_color = SDL_RenderingLinearSpace(renderer);
@@ -2328,7 +2328,7 @@ static bool D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
 {
     int i;
     int count = indices ? num_indices : num_vertices;
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    D3D12_VertexPositionColor *verts = (D3D12_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(D3D12_VertexPositionColor), 0, &cmd->data.draw.first);
     bool convert_color = SDL_RenderingLinearSpace(renderer);
     D3D12_TextureData *textureData = texture ? (D3D12_TextureData *)texture->internal : NULL;
     float u_scale = textureData ? (float)texture->w / textureData->w : 0.0f;
@@ -2517,7 +2517,7 @@ static bool D3D12_UpdateViewport(SDL_Renderer *renderer)
     return true;
 }
 
-static void D3D12_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Texture *texture, PixelShaderConstants *constants)
+static void D3D12_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Texture *texture, D3D12_PixelShaderConstants *constants)
 {
     float output_headroom;
 
@@ -2579,7 +2579,7 @@ static void D3D12_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC
     }
 }
 
-static bool D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, D3D12_Shader shader, const PixelShaderConstants *shader_constants,
+static bool D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, D3D12_Shader shader, const D3D12_PixelShaderConstants *shader_constants,
                               D3D12_PRIMITIVE_TOPOLOGY_TYPE topology,
                               const int numShaderResources, D3D12_CPU_DESCRIPTOR_HANDLE *shaderResources,
                               D3D12_CPU_DESCRIPTOR_HANDLE *sampler, const Float4X4 *matrix)
@@ -2594,7 +2594,7 @@ static bool D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *
     D3D12_CPU_DESCRIPTOR_HANDLE firstShaderResource;
     DXGI_FORMAT rtvFormat = rendererData->renderTargetFormat;
     D3D12_PipelineState *currentPipelineState = rendererData->currentPipelineState;;
-    PixelShaderConstants solid_constants;
+    D3D12_PixelShaderConstants solid_constants;
 
     if (rendererData->textureRenderTarget) {
         rtvFormat = rendererData->textureRenderTarget->mainTextureFormat;
@@ -2735,7 +2735,7 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal;
     D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal;
     D3D12_CPU_DESCRIPTOR_HANDLE *textureSampler;
-    PixelShaderConstants constants;
+    D3D12_PixelShaderConstants constants;
 
     D3D12_SetupShaderConstants(renderer, cmd, texture, &constants);
 
@@ -2743,10 +2743,10 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     case D3D12_FILTER_MIN_MAG_MIP_POINT:
         switch (cmd->data.draw.texture_address_mode) {
         case SDL_TEXTURE_ADDRESS_CLAMP:
-            textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_NEAREST_CLAMP];
+            textureSampler = &rendererData->samplers[D3D12_SAMPLER_NEAREST_CLAMP];
             break;
         case SDL_TEXTURE_ADDRESS_WRAP:
-            textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_NEAREST_WRAP];
+            textureSampler = &rendererData->samplers[D3D12_SAMPLER_NEAREST_WRAP];
             break;
         default:
             return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode);
@@ -2755,10 +2755,10 @@ static bool D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *
     case D3D12_FILTER_MIN_MAG_MIP_LINEAR:
         switch (cmd->data.draw.texture_address_mode) {
         case SDL_TEXTURE_ADDRESS_CLAMP:
-            textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_LINEAR_CLAMP];
+            textureSampler = &rendererData->samplers[D3D12_SAMPLER_LINEAR_CLAMP];
             break;
         case SDL_TEXTURE_ADDRESS_WRAP:
-            textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_LINEAR_WRAP];
+            textureSampler = &rendererData->samplers[D3D12_SAMPLER_LINEAR_WRAP];
             break;
         default:
             return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode);
@@ -2899,7 +2899,7 @@ static bool D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
         {
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
+            const size_t start = first / sizeof(D3D12_VertexPositionColor);
             D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 0, NULL, NULL, NULL);
             D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_POINTLIST, start, count);
             break;
@@ -2909,8 +2909,8 @@ static bool D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
         {
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
-            const VertexPositionColor *verts = (VertexPositionColor *)(((Uint8 *)vertices) + first);
+            const size_t start = first / sizeof(D3D12_VertexPositionColor);
+            const D3D12_VertexPositionColor *verts = (D3D12_VertexPositionColor *)(((Uint8 *)vertices) + first);
             D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, 0, NULL, NULL, NULL);
             D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count);
             if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) {
@@ -2933,7 +2933,7 @@ static bool D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
             SDL_Texture *texture = cmd->data.draw.texture;
             const size_t count = cmd->data.draw.count;
             const size_t first = cmd->data.draw.first;
-            const size_t start = first / sizeof(VertexPositionColor);
+            const size_t start = first / sizeof(D3D12_VertexPositionColor);
 
             if (texture) {
                 D3D12_SetCopyState(renderer, cmd, NULL);
diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c
index b504c0108f86c..2bd6e53122df2 100644
--- a/src/render/vulkan/SDL_render_vulkan.c
+++ b/src/render/vulkan/SDL_render_vulkan.c
@@ -152,27 +152,27 @@ VULKAN_FUNCTIONS()
 
 // Renderpass types
 typedef enum {
-    SDL_VULKAN_RENDERPASS_LOAD = 0,
-    SDL_VULKAN_RENDERPASS_CLEAR = 1,
-    SDL_VULKAN_NUM_RENDERPASSES
-} SDL_vulkan_renderpass_type;
+    VULKAN_RENDERPASS_LOAD = 0,
+    VULKAN_RENDERPASS_CLEAR = 1,
+    VULKAN_RENDERPASS_COUNT
+} VULKAN_RenderPass;
 
 // Sampler types
 typedef enum
 {
-    SDL_VULKAN_SAMPLER_NEAREST_CLAMP,
-    SDL_VULKAN_SAMPLER_NEAREST_WRAP,
-    SDL_VULKAN_SAMPLER_LINEAR_CLAMP,
-    SDL_VULKAN_SAMPLER_LINEAR_WRAP,
-    SDL_VULKAN_NUM_SAMPLERS
-} SDL_vulkan_sampler_type;
+    VULKAN_SAMPLER_NEAREST_CLAMP,
+    VULKAN_SAMPLER_NEAREST_WRAP,
+    VULKAN_SAMPLER_LINEAR_CLAMP,
+    VULKAN_SAMPLER_LINEAR_WRAP,
+    VULKAN_SAMPLER_COUNT
+} VULKAN_Sampler;
 
 // Vertex shader, common values
 typedef struct
 {
     Float4X4 model;
     Float4X4 projectionAndView;
-} VertexShaderConstants;
+} VULKAN_VertexShaderConstants;
 
 // These should mirror the definitions in VULKAN_PixelShader_Common.hlsli
 //static const float TONEMAP_NONE = 0;
@@ -205,7 +205,7 @@ typedef struct
     float tonemap_factor1;
     float tonemap_factor2;
     float sdr_white_point;
-} PixelShaderConstants;
+} VULKAN_PixelShaderConstants;
 
 // Per-vertex data
 typedef struct
@@ -213,7 +213,7 @@ typedef struct
     float pos[2];
     float tex[2];
     SDL_FColor color;
-} VertexPositionColor;
+} VULKAN_VertexPositionColor;
 
 // Vulkan Buffer
 typedef struct
@@ -240,7 +240,7 @@ typedef struct
 typedef struct
 {
     VULKAN_Image mainImage;
-    VkRenderPass mainRenderpasses[SDL_VULKAN_NUM_RENDERPASSES];
+    VkRenderPass mainRenderpasses[VULKAN_RENDERPASS_COUNT];
     VkFramebuffer mainFramebuffer;
     VULKAN_Buffer stagingBuffer;
     VkFilter scaleMode;
@@ -264,7 +264,7 @@ typedef struct
 typedef struct
 {
     VULKAN_Shader shader;
-    PixelShaderConstants shader_constants;
+    VULKAN_PixelShaderConstants shader_constants;
     SDL_BlendMode blendMode;
     VkPrimitiveTopology topology;
     VkFormat format;
@@ -308,7 +308,7 @@ typedef struct
     int vsync;
 
     VkFramebuffer *framebuffers;
-    VkRenderPass renderPasses[SDL_VULKAN_NUM_RENDERPASSES];
+    VkRenderPass renderPasses[VULKAN_RENDERPASS_COUNT];
     VkRenderPass currentRenderPass;
 
     VkShaderModule vertexShaderModules[NUM_SHADERS];
@@ -318,7 +318,7 @@ typedef struct
 
     // Vertex buffer data
     VULKAN_Buffer vertexBuffers[SDL_VULKAN_NUM_VERTEX_BUFFERS];
-    VertexShaderConstants vertexShaderConstantsData;
+    VULKAN_VertexShaderConstants vertexShaderConstantsData;
 
     // Data for staging/allocating textures
     VULKAN_Buffer **uploadBuffers;
@@ -330,7 +330,7 @@ typedef struct
     uint32_t currentConstantBufferIndex;
     int32_t currentConstantBufferOffset;
 
-    VkSampler samplers[SDL_VULKAN_NUM_SAMPLERS];
+    VkSampler samplers[VULKAN_SAMPLER_COUNT];
     VkDescriptorPool **descriptorPools;
     uint32_t *numDescriptorPools;
     uint32_t currentDescriptorPoolIndex;
@@ -542,7 +542,7 @@ static void VULKAN_DestroyAll(SDL_Renderer *renderer)
         VULKAN_DestroyBuffer(rendererData, &rendererData->vertexBuffers[i]);
     }
     SDL_memset(rendererData->vertexBuffers, 0, sizeof(rendererData->vertexBuffers));
-    for (uint32_t i = 0; i < SDL_VULKAN_NUM_RENDERPASSES; i++) {
+    for (uint32_t i = 0; i < VULKAN_RENDERPASS_COUNT; i++) {
         if (rendererData->renderPasses[i] != VK_NULL_HANDLE) {
             vkDestroyRenderPass(rendererData->device, rendererData->renderPasses[i], NULL);
             rendererData->renderPasses[i] = VK_NULL_HANDLE;
@@ -902,15 +902,15 @@ static void VULKAN_BeginRenderPass(VULKAN_RenderData *rendererData, VkAttachment
     switch (loadOp) {
     case VK_ATTACHMENT_LOAD_OP_CLEAR:
         rendererData->currentRenderPass = rendererData->textureRenderTarget ?
-            rendererData->textureRenderTarget->mainRenderpasses[SDL_VULKAN_RENDERPASS_CLEAR] :
-            rendererData->renderPasses[SDL_VULKAN_RENDERPASS_CLEAR];
+            rendererData->textureRenderTarget->mainRenderpasses[VULKAN_RENDERPASS_CLEAR] :
+            rendererData->renderPasses[VULKAN_RENDERPASS_CLEAR];
         break;
 
     case VK_ATTACHMENT_LOAD_OP_LOAD:
     default:
         rendererData->currentRenderPass = rendererData->textureRenderTarget ?
-            rendererData->textureRenderTarget->mainRenderpasses[SDL_VULKAN_RENDERPASS_LOAD] :
-            rendererData->renderPasses[SDL_VULKAN_RENDERPASS_LOAD];
+            rendererData->textureRenderTarget->mainRenderpasses[VULKAN_RENDERPASS_LOAD] :
+            rendererData->renderPasses[VULKAN_RENDERPASS_LOAD];
         break;
     }
 
@@ -1926,7 +1926,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
             { VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE },
             { VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_REPEAT },
         };
-        SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_VULKAN_NUM_SAMPLERS);
+        SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == VULKAN_SAMPLER_COUNT);
         VkSamplerCreateInfo samplerCreateInfo = { 0 };
         samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
         samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
@@ -1962,7 +1962,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
 }
 
 static VkResult VULKAN_CreateFramebuffersAndRenderPasses(SDL_Renderer *renderer, int w, int h,
-    VkFormat format, int imageViewCount, VkImageView *imageViews, VkFramebuffer *framebuffers, VkRenderPass renderPasses[SDL_VULKAN_NUM_RENDERPASSES])
+    VkFormat format, int imageViewCount, VkImageView *imageViews, VkFramebuffer *framebuffers, VkRenderPass renderPasses[VULKAN_RENDERPASS_COUNT])
 {
     VULKAN_RenderData *rendererData = (VULKAN_RenderData *) renderer->internal;
     VkResult result;
@@ -2013,14 +2013,14 @@ static VkResult VULKAN_CreateFramebuffersAndRenderPasses(SDL_Renderer *renderer,
     renderPassCreateInfo.dependencyCount = 1;
     renderPassCreateInfo.pDependencies = &subPassDependency;
 
-    result = vkCreateRenderPass(rendererData->device, &renderPassCreateInfo, NULL, &renderPasses[SDL_VULKAN_RENDERPASS_LOAD]);
+    result = vkCreateRenderPass(rendererData->device, &renderPassCreateInfo, NULL, &renderPasses[VULKAN_RENDERPASS_LOAD]);
     if (result != VK_SUCCESS) {
         SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateRenderPass(): %s\n", SDL_Vulkan_GetResultString(result));
         return result;
     }
 
     attachmentDescription.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
-    result = vkCreateRenderPass(rendererData->device, &renderPassCreateInfo, NULL, &renderPasses[SDL_VULKAN_RENDERPASS_CLEAR]);
+    result = vkCreateRenderPass(rendererData->device, &renderPassCreateInfo, NULL, &renderPasses[VULKAN_RENDERPASS_CLEAR]);
     if (result != VK_SUCCESS) {
         SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateRenderPass(): %s\n", SDL_Vulkan_GetResultString(result));
         return result;
@@ -2029,7 +2029,7 @@ static VkResult VULKAN_CreateFramebuffersAndRenderPasses(SDL_Renderer *renderer,
     VkFramebufferCreateInfo framebufferCreateInfo = { 0 };
     framebufferCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
     framebufferCreateInfo.pNext = NULL;
-    framebufferCreateInfo.renderPass = rendererData->renderPasses[SDL_VULKAN_RENDERPASS_LOAD];
+    framebufferCreateInfo.renderPass = rendererData->renderPasses[VULKAN_RENDERPASS_LOAD];
     framebufferCreateInfo.attachmentCount = 1;
     framebufferCreateInfo.width = w;
     framebufferCreateInfo.height = h;
@@ -3072,7 +3072,7 @@ static bool VULKAN_QueueNoOp(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
 
 static bool VULKAN_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
 {
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    VULKAN_VertexPositionColor *verts = (VULKAN_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VULKAN_VertexPositionColor), 0, &cmd->data.draw.first);
     int i;
     bool convert_color = SDL_RenderingLinearSpace(renderer);
 
@@ -3102,7 +3102,7 @@ static bool VULKAN_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
 {
     int i;
     int count = indices ? num_indices : num_vertices;
-    VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first);
+    VULKAN_VertexPositionColor *verts = (VULKAN_VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VULKAN_VertexPositionColor), 0, &cmd->data.draw.first);
     bool convert_color = SDL_RenderingLinearSpace(renderer);
     VULKAN_TextureData *textureData = texture ? (VULKAN_TextureData *)texture->internal : NULL;
     float u_scale = textureData ? (float)texture->w / textureData->width : 0.0f;
@@ -3255,7 +3255,7 @@ static bool VULKAN_UpdateClipRect(SDL_Renderer *renderer)
     return true;
 }
 
-static void VULKAN_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Texture *texture, PixelShaderConstants *constants)
+static voi

(Patch may be truncated, please check the link at the top of this post.)