Skip to content

Commit

Permalink
Implement name property on Vulkan and D3D12
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Jan 13, 2025
1 parent 5151c26 commit f4a7dab
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 205 deletions.
4 changes: 2 additions & 2 deletions include/SDL3/SDL_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a"
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth"
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil"

#define SDL_PROP_GPU_CREATETEXTURE_NAME_STRING "SDL.gpu.createtexture.name"

/**
* Creates a buffer object to be used in graphics or compute workflows.
Expand Down Expand Up @@ -2478,7 +2478,7 @@ extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer(
SDL_GPUDevice *device,
const SDL_GPUBufferCreateInfo *createinfo);

#define SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING "SDL.gpu.buffer.create.name"
#define SDL_PROP_GPU_CREATEBUFFER_NAME_STRING "SDL.gpu.createbuffer.name"

/**
* Creates a transfer buffer to be used when uploading to or downloading from
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/SDL_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ SDL_GPUBuffer *SDL_CreateGPUBuffer(
return NULL;
}

char *debugName = SDL_GetStringProperty(createinfo->props, SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING, NULL);
const char *debugName = SDL_GetStringProperty(createinfo->props, SDL_PROP_GPU_CREATEBUFFER_NAME_STRING, NULL);

return device->CreateBuffer(
device->driverData,
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/SDL_sysgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ struct SDL_GPUDevice
SDL_GPURenderer *driverData,
SDL_GPUBufferUsageFlags usageFlags,
Uint32 size,
char *debugName);
const char *debugName);

SDL_GPUTransferBuffer *(*CreateTransferBuffer)(
SDL_GPURenderer *driverData,
Expand Down
Loading

0 comments on commit f4a7dab

Please sign in to comment.