Skip to content

Commit

Permalink
gpu: Make some void*s const (thatcosmonaut#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Aug 16, 2024
1 parent 734eba7 commit f26bbac
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions include/SDL3/SDL_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuBindFragmentStorageBuffers(
extern SDL_DECLSPEC void SDLCALL SDL_GpuPushVertexUniformData(
SDL_GpuRenderPass *renderPass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

/**
Expand All @@ -1394,7 +1394,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuPushVertexUniformData(
extern SDL_DECLSPEC void SDLCALL SDL_GpuPushFragmentUniformData(
SDL_GpuRenderPass *renderPass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

/* Drawing */
Expand Down Expand Up @@ -1577,7 +1577,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuBindComputeStorageBuffers(
extern SDL_DECLSPEC void SDLCALL SDL_GpuPushComputeUniformData(
SDL_GpuComputePass *computePass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

/**
Expand Down Expand Up @@ -1659,7 +1659,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuUnmapTransferBuffer(
*/
extern SDL_DECLSPEC void SDLCALL SDL_GpuSetTransferData(
SDL_GpuDevice *device,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle);
Expand Down
8 changes: 4 additions & 4 deletions src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,8 @@ SDL_DYNAPI_PROC(void,SDL_GpuBindVertexStorageBuffers,(SDL_GpuRenderPass *a, Uint
SDL_DYNAPI_PROC(void,SDL_GpuBindFragmentSamplers,(SDL_GpuRenderPass *a, Uint32 b, SDL_GpuTextureSamplerBinding *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuBindFragmentStorageTextures,(SDL_GpuRenderPass *a, Uint32 b, SDL_GpuTextureSlice *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuBindFragmentStorageBuffers,(SDL_GpuRenderPass *a, Uint32 b, SDL_GpuBuffer **c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushVertexUniformData,(SDL_GpuRenderPass *a, Uint32 b, void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushFragmentUniformData,(SDL_GpuRenderPass *a, Uint32 b, void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushVertexUniformData,(SDL_GpuRenderPass *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushFragmentUniformData,(SDL_GpuRenderPass *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuDrawIndexedPrimitives,(SDL_GpuRenderPass *a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),)
SDL_DYNAPI_PROC(void,SDL_GpuDrawPrimitives,(SDL_GpuRenderPass *a, Uint32 b, Uint32 c),(a,b,c),)
SDL_DYNAPI_PROC(void,SDL_GpuDrawPrimitivesIndirect,(SDL_GpuRenderPass *a, SDL_GpuBuffer *b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),)
Expand All @@ -1136,12 +1136,12 @@ SDL_DYNAPI_PROC(SDL_GpuComputePass*,SDL_GpuBeginComputePass,(SDL_GpuCommandBuffe
SDL_DYNAPI_PROC(void,SDL_GpuBindComputePipeline,(SDL_GpuComputePass *a, SDL_GpuComputePipeline *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_GpuBindComputeStorageTextures,(SDL_GpuComputePass *a, Uint32 b, SDL_GpuTextureSlice *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuBindComputeStorageBuffers,(SDL_GpuComputePass *a, Uint32 b, SDL_GpuBuffer **c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushComputeUniformData,(SDL_GpuComputePass *a, Uint32 b, void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuPushComputeUniformData,(SDL_GpuComputePass *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuDispatchCompute,(SDL_GpuComputePass *a, Uint32 b, Uint32 c, Uint32 d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuEndComputePass,(SDL_GpuComputePass *a),(a),)
SDL_DYNAPI_PROC(void,SDL_GpuMapTransferBuffer,(SDL_GpuDevice *a, SDL_GpuTransferBuffer *b, SDL_bool c, void **d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_GpuUnmapTransferBuffer,(SDL_GpuDevice *a, SDL_GpuTransferBuffer *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_GpuSetTransferData,(SDL_GpuDevice *a, void *b, SDL_GpuTransferBuffer *c, SDL_GpuBufferCopy *d, SDL_bool e),(a,b,c,d,e),)
SDL_DYNAPI_PROC(void,SDL_GpuSetTransferData,(SDL_GpuDevice *a, const void *b, SDL_GpuTransferBuffer *c, SDL_GpuBufferCopy *d, SDL_bool e),(a,b,c,d,e),)
SDL_DYNAPI_PROC(void,SDL_GpuGetTransferData,(SDL_GpuDevice *a, SDL_GpuTransferBuffer *b, void *c, SDL_GpuBufferCopy *d),(a,b,c,d),)
SDL_DYNAPI_PROC(SDL_GpuCopyPass*,SDL_GpuBeginCopyPass,(SDL_GpuCommandBuffer *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_GpuUploadToTexture,(SDL_GpuCopyPass *a, SDL_GpuTransferBuffer *b, SDL_GpuTextureRegion *c, SDL_GpuBufferImageCopy *d, SDL_bool e),(a,b,c,d,e),)
Expand Down
8 changes: 4 additions & 4 deletions src/gpu/SDL_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ void SDL_GpuBindFragmentStorageBuffers(
void SDL_GpuPushVertexUniformData(
SDL_GpuRenderPass *renderPass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
NULL_ASSERT(renderPass)
Expand All @@ -789,7 +789,7 @@ void SDL_GpuPushVertexUniformData(
void SDL_GpuPushFragmentUniformData(
SDL_GpuRenderPass *renderPass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
NULL_ASSERT(renderPass)
Expand Down Expand Up @@ -961,7 +961,7 @@ void SDL_GpuBindComputeStorageBuffers(
void SDL_GpuPushComputeUniformData(
SDL_GpuComputePass *computePass,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
NULL_ASSERT(computePass)
Expand Down Expand Up @@ -1035,7 +1035,7 @@ void SDL_GpuUnmapTransferBuffer(

void SDL_GpuSetTransferData(
SDL_GpuDevice *device,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle)
Expand Down
8 changes: 4 additions & 4 deletions src/gpu/SDL_gpu_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,13 @@ struct SDL_GpuDevice
void (*PushVertexUniformData)(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

void (*PushFragmentUniformData)(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

void (*DrawIndexedPrimitives)(
Expand Down Expand Up @@ -423,7 +423,7 @@ struct SDL_GpuDevice
void (*PushComputeUniformData)(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes);

void (*DispatchCompute)(
Expand All @@ -449,7 +449,7 @@ struct SDL_GpuDevice

void (*SetTransferData)(
SDL_GpuRenderer *driverData,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle);
Expand Down
12 changes: 6 additions & 6 deletions src/gpu/d3d11/SDL_gpu_d3d11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ static void D3D11_UnmapTransferBuffer(

static void D3D11_SetTransferData(
SDL_GpuRenderer *driverData,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle)
Expand Down Expand Up @@ -3220,7 +3220,7 @@ static void D3D11_INTERNAL_SetUniformBufferData(
D3D11CommandBuffer *commandBuffer,
D3D11Buffer *uniformBuffer,
Uint32 offset,
void *data,
const void *data,
Uint32 dataLength)
{
D3D11_MAPPED_SUBRESOURCE subres;
Expand Down Expand Up @@ -3438,7 +3438,7 @@ static void D3D11_INTERNAL_PushUniformData(
D3D11CommandBuffer *d3d11CommandBuffer,
SDL_GpuShaderStage shaderStage,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
D3D11Renderer *renderer = d3d11CommandBuffer->renderer;
Expand Down Expand Up @@ -4270,7 +4270,7 @@ static void D3D11_EndRenderPass(
static void D3D11_PushVertexUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer *)commandBuffer;
Expand All @@ -4291,7 +4291,7 @@ static void D3D11_PushVertexUniformData(
static void D3D11_PushFragmentUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer *)commandBuffer;
Expand Down Expand Up @@ -4586,7 +4586,7 @@ static void D3D11_BindComputeStorageBuffers(
static void D3D11_PushComputeUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer *)commandBuffer;
Expand Down
10 changes: 5 additions & 5 deletions src/gpu/metal/SDL_gpu_metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ static void METAL_UnmapTransferBuffer(

static void METAL_SetTransferData(
SDL_GpuRenderer *driverData,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle)
Expand Down Expand Up @@ -2564,7 +2564,7 @@ static void METAL_INTERNAL_PushUniformData(
MetalCommandBuffer *metalCommandBuffer,
SDL_GpuShaderStage shaderStage,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
MetalRenderer *renderer = metalCommandBuffer->renderer;
Expand Down Expand Up @@ -2629,7 +2629,7 @@ static void METAL_INTERNAL_PushUniformData(
static void METAL_PushVertexUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
Expand All @@ -2650,7 +2650,7 @@ static void METAL_PushVertexUniformData(
static void METAL_PushFragmentUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
Expand Down Expand Up @@ -2953,7 +2953,7 @@ static void METAL_BindComputeStorageBuffers(
static void METAL_PushComputeUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
Expand Down
10 changes: 5 additions & 5 deletions src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -7450,7 +7450,7 @@ static void VULKAN_INTERNAL_PushUniformData(
VulkanCommandBuffer *commandBuffer,
VulkanUniformBuffer *uniformBuffer,
VulkanUniformBufferStage uniformBufferStage,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
Uint32 blockSize =
Expand Down Expand Up @@ -7852,7 +7852,7 @@ static void VULKAN_BindIndexBuffer(
static void VULKAN_PushVertexUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer *)commandBuffer;
Expand All @@ -7874,7 +7874,7 @@ static void VULKAN_PushVertexUniformData(
static void VULKAN_PushFragmentUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer *)commandBuffer;
Expand Down Expand Up @@ -8103,7 +8103,7 @@ static void VULKAN_BindComputeStorageBuffers(
static void VULKAN_PushComputeUniformData(
SDL_GpuCommandBuffer *commandBuffer,
Uint32 slotIndex,
void *data,
const void *data,
Uint32 dataLengthInBytes)
{
VulkanCommandBuffer *vulkanCommandBuffer = (VulkanCommandBuffer *)commandBuffer;
Expand Down Expand Up @@ -8482,7 +8482,7 @@ static void VULKAN_UnmapTransferBuffer(

static void VULKAN_SetTransferData(
SDL_GpuRenderer *driverData,
void *data,
const void *data,
SDL_GpuTransferBuffer *transferBuffer,
SDL_GpuBufferCopy *copyParams,
SDL_bool cycle)
Expand Down

0 comments on commit f26bbac

Please sign in to comment.