@@ -334,7 +334,6 @@ typedef struct SDL_GPUDevice SDL_GPUDevice;
334
334
* \since This struct is available since SDL 3.1.3
335
335
*
336
336
* \sa SDL_CreateGPUBuffer
337
- * \sa SDL_SetGPUBufferName
338
337
* \sa SDL_UploadToGPUBuffer
339
338
* \sa SDL_DownloadFromGPUBuffer
340
339
* \sa SDL_CopyGPUBufferToBuffer
@@ -374,7 +373,6 @@ typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer;
374
373
* \since This struct is available since SDL 3.1.3
375
374
*
376
375
* \sa SDL_CreateGPUTexture
377
- * \sa SDL_SetGPUTextureName
378
376
* \sa SDL_UploadToGPUTexture
379
377
* \sa SDL_DownloadFromGPUTexture
380
378
* \sa SDL_CopyGPUTextureToTexture
@@ -2247,6 +2245,10 @@ extern SDL_DECLSPEC SDL_GPUShaderFormat SDLCALL SDL_GetGPUShaderFormats(SDL_GPUD
2247
2245
* - [[texture]]: Sampled textures, followed by read-only storage textures,
2248
2246
* followed by read-write storage textures
2249
2247
*
2248
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2249
+ *
2250
+ * - `SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2251
+ *
2250
2252
* \param device a GPU Context.
2251
2253
* \param createinfo a struct describing the state of the compute pipeline to
2252
2254
* create.
@@ -2262,9 +2264,15 @@ extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline
2262
2264
SDL_GPUDevice * device ,
2263
2265
const SDL_GPUComputePipelineCreateInfo * createinfo );
2264
2266
2267
+ #define SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING "SDL.gpu.computepipeline.create.name"
2268
+
2265
2269
/**
2266
2270
* Creates a pipeline object to be used in a graphics workflow.
2267
2271
*
2272
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2273
+ *
2274
+ * - `SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2275
+ *
2268
2276
* \param device a GPU Context.
2269
2277
* \param createinfo a struct describing the state of the graphics pipeline to
2270
2278
* create.
@@ -2281,10 +2289,16 @@ extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeli
2281
2289
SDL_GPUDevice * device ,
2282
2290
const SDL_GPUGraphicsPipelineCreateInfo * createinfo );
2283
2291
2292
+ #define SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING "SDL.gpu.graphicspipeline.create.name"
2293
+
2284
2294
/**
2285
2295
* Creates a sampler object to be used when binding textures in a graphics
2286
2296
* workflow.
2287
2297
*
2298
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2299
+ *
2300
+ * - `SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2301
+ *
2288
2302
* \param device a GPU Context.
2289
2303
* \param createinfo a struct describing the state of the sampler to create.
2290
2304
* \returns a sampler object on success, or NULL on failure; call
@@ -2300,6 +2314,8 @@ extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
2300
2314
SDL_GPUDevice * device ,
2301
2315
const SDL_GPUSamplerCreateInfo * createinfo );
2302
2316
2317
+ #define SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING "SDL.gpu.sampler.create.name"
2318
+
2303
2319
/**
2304
2320
* Creates a shader to be used when creating a graphics pipeline.
2305
2321
*
@@ -2357,6 +2373,10 @@ extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
2357
2373
* SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING with
2358
2374
* SDL_CreateGPUDeviceWithProperties().
2359
2375
*
2376
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2377
+ *
2378
+ * - `SDL_PROP_GPU_SHADER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2379
+ *
2360
2380
* \param device a GPU Context.
2361
2381
* \param createinfo a struct describing the state of the shader to create.
2362
2382
* \returns a shader object on success, or NULL on failure; call
@@ -2371,6 +2391,8 @@ extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader(
2371
2391
SDL_GPUDevice * device ,
2372
2392
const SDL_GPUShaderCreateInfo * createinfo );
2373
2393
2394
+ #define SDL_PROP_GPU_SHADER_CREATE_NAME_STRING "SDL.gpu.shader.create.name"
2395
+
2374
2396
/**
2375
2397
* Creates a texture object to be used in graphics or compute workflows.
2376
2398
*
@@ -2408,6 +2430,7 @@ extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader(
2408
2430
* - `SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8`: (Direct3D 12
2409
2431
* only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET,
2410
2432
* clear the texture to a stencil of this value. Defaults to zero.
2433
+ * - `SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2411
2434
*
2412
2435
* \param device a GPU Context.
2413
2436
* \param createinfo a struct describing the state of the texture to create.
@@ -2437,7 +2460,7 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
2437
2460
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a"
2438
2461
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth"
2439
2462
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil"
2440
-
2463
+ #define SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING "SDL.gpu.texture.create.name"
2441
2464
2442
2465
/**
2443
2466
* Creates a buffer object to be used in graphics or compute workflows.
@@ -2453,14 +2476,17 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
2453
2476
* [this blog post](https://moonside.games/posts/sdl-gpu-concepts-cycling/)
2454
2477
* .
2455
2478
*
2479
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2480
+ *
2481
+ * - `SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2482
+ *
2456
2483
* \param device a GPU Context.
2457
2484
* \param createinfo a struct describing the state of the buffer to create.
2458
2485
* \returns a buffer object on success, or NULL on failure; call
2459
2486
* SDL_GetError() for more information.
2460
2487
*
2461
2488
* \since This function is available since SDL 3.1.3.
2462
2489
*
2463
- * \sa SDL_SetGPUBufferName
2464
2490
* \sa SDL_UploadToGPUBuffer
2465
2491
* \sa SDL_DownloadFromGPUBuffer
2466
2492
* \sa SDL_CopyGPUBufferToBuffer
@@ -2478,13 +2504,19 @@ extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer(
2478
2504
SDL_GPUDevice * device ,
2479
2505
const SDL_GPUBufferCreateInfo * createinfo );
2480
2506
2507
+ #define SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING "SDL.gpu.buffer.create.name"
2508
+
2481
2509
/**
2482
2510
* Creates a transfer buffer to be used when uploading to or downloading from
2483
2511
* graphics resources.
2484
2512
*
2485
2513
* Download buffers can be particularly expensive to create, so it is good
2486
2514
* practice to reuse them if data will be downloaded regularly.
2487
2515
*
2516
+ * There are optional properties that can be provided through `props`. These are the supported properties:
2517
+ *
2518
+ * - `SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.
2519
+ *
2488
2520
* \param device a GPU Context.
2489
2521
* \param createinfo a struct describing the state of the transfer buffer to
2490
2522
* create.
@@ -2503,21 +2535,24 @@ extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer(
2503
2535
SDL_GPUDevice * device ,
2504
2536
const SDL_GPUTransferBufferCreateInfo * createinfo );
2505
2537
2538
+ #define SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING "SDL.gpu.transferbuffer.create.name"
2539
+
2506
2540
/* Debug Naming */
2507
2541
2508
2542
/**
2509
2543
* Sets an arbitrary string constant to label a buffer.
2510
2544
*
2511
- * Useful for debugging .
2545
+ * You should use SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING with SDL_CreateGPUBuffer instead of this function to avoid thread safety issues .
2512
2546
*
2513
2547
* \param device a GPU Context.
2514
2548
* \param buffer a buffer to attach the name to.
2515
2549
* \param text a UTF-8 string constant to mark as the name of the buffer.
2516
2550
*
2517
- * \threadsafety This function is not thread safe, you must synchronize calls
2518
- * to this function.
2551
+ * \threadsafety This function is not thread safe, you must make sure the buffer is not simultaneously used by any other thread.
2519
2552
*
2520
2553
* \since This function is available since SDL 3.1.3.
2554
+ *
2555
+ * \sa SDL_CreateGPUBuffer
2521
2556
*/
2522
2557
extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName (
2523
2558
SDL_GPUDevice * device ,
@@ -2527,16 +2562,17 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName(
2527
2562
/**
2528
2563
* Sets an arbitrary string constant to label a texture.
2529
2564
*
2530
- * Useful for debugging .
2565
+ * You should use SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING with SDL_CreateGPUTexture instead of this function to avoid thread safety issues .
2531
2566
*
2532
2567
* \param device a GPU Context.
2533
2568
* \param texture a texture to attach the name to.
2534
2569
* \param text a UTF-8 string constant to mark as the name of the texture.
2535
2570
*
2536
- * \threadsafety This function is not thread safe, you must synchronize calls
2537
- * to this function.
2571
+ * \threadsafety This function is not thread safe, you must make sure the texture is not simultaneously used by any other thread.
2538
2572
*
2539
2573
* \since This function is available since SDL 3.1.3.
2574
+ *
2575
+ * \sa SDL_CreateGPUTexture
2540
2576
*/
2541
2577
extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName (
2542
2578
SDL_GPUDevice * device ,
0 commit comments