SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_gpu.h
1#ifndef SDL3PP_GPU_H_
2#define SDL3PP_GPU_H_
3
4#include <SDL3/SDL_gpu.h>
5#include "SDL3pp_pixels.h"
6#include "SDL3pp_properties.h"
7#include "SDL3pp_rect.h"
8#include "SDL3pp_stdinc.h"
9#include "SDL3pp_surface.h"
10#include "SDL3pp_video.h"
11
12namespace SDL {
13
297// Forward decl
298struct GPUDevice;
299
301using GPUDeviceRaw = SDL_GPUDevice*;
302
303// Forward decl
304struct GPUDeviceRef;
305
308{
310
313 : value(value)
314 {
315 }
316
318 constexpr GPUDeviceParam(std::nullptr_t _ = nullptr)
319 : value(nullptr)
320 {
321 }
322
324 constexpr explicit operator bool() const { return !!value; }
325
327 constexpr auto operator<=>(const GPUDeviceParam& other) const = default;
328
330 constexpr operator GPUDeviceRaw() const { return value; }
331};
332
334using GPUBufferRaw = SDL_GPUBuffer*;
335
336// Forward decl
337struct GPUBuffer;
338
340using GPUTransferBufferRaw = SDL_GPUTransferBuffer*;
341
342// Forward decl
343struct GPUTransferBuffer;
344
346using GPUTextureRaw = SDL_GPUTexture*;
347
348// Forward decl
349struct GPUTexture;
350
352using GPUSamplerRaw = SDL_GPUSampler*;
353
354// Forward decl
355struct GPUSampler;
356
358using GPUShaderRaw = SDL_GPUShader*;
359
360// Forward decl
361struct GPUShader;
362
364using GPUComputePipelineRaw = SDL_GPUComputePipeline*;
365
366// Forward decl
367struct GPUComputePipeline;
368
370using GPUGraphicsPipelineRaw = SDL_GPUGraphicsPipeline*;
371
372// Forward decl
374
376using GPUCommandBufferRaw = SDL_GPUCommandBuffer*;
377
378// Forward decl
379struct GPUCommandBuffer;
380
382using GPURenderPassRaw = SDL_GPURenderPass*;
383
384// Forward decl
385struct GPURenderPass;
386
388using GPUComputePassRaw = SDL_GPUComputePass*;
389
390// Forward decl
391struct GPUComputePass;
392
394using GPUCopyPassRaw = SDL_GPUCopyPass*;
395
396// Forward decl
397struct GPUCopyPass;
398
410using GPUBufferCreateInfo = SDL_GPUBufferCreateInfo;
411
434{
435 GPUBufferRaw m_gPUBuffer;
436
437public:
443 constexpr GPUBuffer(GPUBufferRaw gPUBuffer = {})
444 : m_gPUBuffer(gPUBuffer)
445 {
446 }
447
492 : m_gPUBuffer(CheckError(SDL_CreateGPUBuffer(device, &createinfo)))
493 {
494 }
495
501 constexpr operator GPUBufferRaw() const { return m_gPUBuffer; }
502};
503
511using GPUTransferBufferCreateInfo = SDL_GPUTransferBufferCreateInfo;
512
530{
531 GPUTransferBufferRaw m_gPUTransferBuffer;
532
533public:
539 constexpr GPUTransferBuffer(GPUTransferBufferRaw gPUTransferBuffer = {})
540 : m_gPUTransferBuffer(gPUTransferBuffer)
541 {
542 }
543
572 const GPUTransferBufferCreateInfo& createinfo)
573 : m_gPUTransferBuffer(
574 CheckError(SDL_CreateGPUTransferBuffer(device, &createinfo)))
575 {
576 }
577
583 constexpr operator GPUTransferBufferRaw() const
584 {
585 return m_gPUTransferBuffer;
586 }
587};
588
604using GPUTextureCreateInfo = SDL_GPUTextureCreateInfo;
605
625{
626 GPUTextureRaw m_gPUTexture;
627
628public:
634 constexpr GPUTexture(GPUTextureRaw gPUTexture = {})
635 : m_gPUTexture(gPUTexture)
636 {
637 }
638
695 : m_gPUTexture(CheckError(SDL_CreateGPUTexture(device, &createinfo)))
696 {
697 }
698
704 constexpr operator GPUTextureRaw() const { return m_gPUTexture; }
705};
706
721using GPUSamplerCreateInfo = SDL_GPUSamplerCreateInfo;
722
734{
735 GPUSamplerRaw m_gPUSampler;
736
737public:
743 constexpr GPUSampler(GPUSamplerRaw gPUSampler = {})
744 : m_gPUSampler(gPUSampler)
745 {
746 }
747
770 : m_gPUSampler(CheckError(SDL_CreateGPUSampler(device, &createinfo)))
771 {
772 }
773
779 constexpr operator GPUSamplerRaw() const { return m_gPUSampler; }
780};
781
789using GPUShaderCreateInfo = SDL_GPUShaderCreateInfo;
790
801{
802 GPUShaderRaw m_gPUShader;
803
804public:
810 constexpr GPUShader(GPUShaderRaw gPUShader = {})
811 : m_gPUShader(gPUShader)
812 {
813 }
814
889 : m_gPUShader(CheckError(SDL_CreateGPUShader(device, &createinfo)))
890 {
891 }
892
898 constexpr operator GPUShaderRaw() const { return m_gPUShader; }
899};
900
909using GPUComputePipelineCreateInfo = SDL_GPUComputePipelineCreateInfo;
910
923{
924 GPUComputePipelineRaw m_gPUComputePipeline;
925
926public:
932 constexpr GPUComputePipeline(GPUComputePipelineRaw gPUComputePipeline = {})
933 : m_gPUComputePipeline(gPUComputePipeline)
934 {
935 }
936
983 const GPUComputePipelineCreateInfo& createinfo)
984 : m_gPUComputePipeline(
985 CheckError(SDL_CreateGPUComputePipeline(device, &createinfo)))
986 {
987 }
988
994 constexpr operator GPUComputePipelineRaw() const
995 {
996 return m_gPUComputePipeline;
997 }
998};
999
1014using GPUGraphicsPipelineCreateInfo = SDL_GPUGraphicsPipelineCreateInfo;
1015
1028{
1029 GPUGraphicsPipelineRaw m_gPUGraphicsPipeline;
1030
1031public:
1037 constexpr GPUGraphicsPipeline(GPUGraphicsPipelineRaw gPUGraphicsPipeline = {})
1038 : m_gPUGraphicsPipeline(gPUGraphicsPipeline)
1039 {
1040 }
1041
1064 const GPUGraphicsPipelineCreateInfo& createinfo)
1065 : m_gPUGraphicsPipeline(
1066 CheckError(SDL_CreateGPUGraphicsPipeline(device, &createinfo)))
1067 {
1068 }
1069
1075 constexpr operator GPUGraphicsPipelineRaw() const
1076 {
1077 return m_gPUGraphicsPipeline;
1078 }
1079};
1080
1088using GPUViewport = SDL_GPUViewport;
1089
1098using GPUBufferBinding = SDL_GPUBufferBinding;
1099
1107using GPUIndexElementSize = SDL_GPUIndexElementSize;
1108
1110 SDL_GPU_INDEXELEMENTSIZE_16BIT;
1111
1113 SDL_GPU_INDEXELEMENTSIZE_32BIT;
1114
1123using GPUTextureSamplerBinding = SDL_GPUTextureSamplerBinding;
1124
1137{
1138 GPURenderPassRaw m_gPURenderPass;
1139
1140public:
1146 constexpr GPURenderPass(GPURenderPassRaw gPURenderPass = {})
1147 : m_gPURenderPass(gPURenderPass)
1148 {
1149 }
1150
1156 constexpr operator GPURenderPassRaw() const { return m_gPURenderPass; }
1157
1167 void BindPipeline(GPUGraphicsPipeline graphics_pipeline);
1168
1176 void SetViewport(const GPUViewport& viewport);
1177
1185 void SetScissor(const RectRaw& scissor);
1186
1197 void SetBlendConstants(FColorRaw blend_constants);
1198
1206 void SetStencilReference(Uint8 reference);
1207
1218 void BindVertexBuffers(Uint32 first_slot,
1219 std::span<const GPUBufferBinding> bindings);
1220
1231 void BindIndexBuffer(const GPUBufferBinding& binding,
1232 GPUIndexElementSize index_element_size);
1233
1250 void BindVertexSamplers(
1251 Uint32 first_slot,
1252 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1253
1270 void BindVertexStorageTextures(Uint32 first_slot,
1271 SpanRef<const GPUTextureRaw> storage_textures);
1272
1289 void BindVertexStorageBuffers(Uint32 first_slot,
1290 SpanRef<const GPUBufferRaw> storage_buffers);
1291
1309 Uint32 first_slot,
1310 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1311
1329 Uint32 first_slot,
1330 SpanRef<const GPUTextureRaw> storage_textures);
1331
1348 void BindFragmentStorageBuffers(Uint32 first_slot,
1349 SpanRef<const GPUBufferRaw> storage_buffers);
1350
1373 void DrawIndexedPrimitives(Uint32 num_indices,
1374 Uint32 num_instances,
1375 Uint32 first_index,
1376 Sint32 vertex_offset,
1377 Uint32 first_instance);
1378
1398 void DrawPrimitives(Uint32 num_vertices,
1399 Uint32 num_instances,
1400 Uint32 first_vertex,
1401 Uint32 first_instance);
1402
1419 Uint32 offset,
1420 Uint32 draw_count);
1421
1438 Uint32 offset,
1439 Uint32 draw_count);
1440
1449 void End();
1450};
1451
1464{
1465 GPUComputePassRaw m_gPUComputePass;
1466
1467public:
1473 constexpr GPUComputePass(GPUComputePassRaw gPUComputePass = {})
1474 : m_gPUComputePass(gPUComputePass)
1475 {
1476 }
1477
1483 constexpr operator GPUComputePassRaw() const { return m_gPUComputePass; }
1484
1492 void BindPipeline(GPUComputePipeline compute_pipeline);
1493
1510 void BindSamplers(
1511 Uint32 first_slot,
1512 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1513
1530 void BindStorageTextures(Uint32 first_slot,
1531 SpanRef<const GPUTextureRaw> storage_textures);
1532
1549 void BindStorageBuffers(Uint32 first_slot,
1550 SpanRef<const GPUBufferRaw> storage_buffers);
1551
1571 void Dispatch(Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z);
1572
1589 void DispatchIndirect(GPUBuffer buffer, Uint32 offset);
1590
1599 void End();
1600};
1601
1612using GPUBufferRegion = SDL_GPUBufferRegion;
1613
1623using GPUTextureLocation = SDL_GPUTextureLocation;
1624
1634using GPUBufferLocation = SDL_GPUBufferLocation;
1635
1647using GPUTextureRegion = SDL_GPUTextureRegion;
1648
1658using GPUTextureTransferInfo = SDL_GPUTextureTransferInfo;
1659
1670using GPUTransferBufferLocation = SDL_GPUTransferBufferLocation;
1671
1684{
1685 GPUCopyPassRaw m_gPUCopyPass;
1686
1687public:
1693 constexpr GPUCopyPass(GPUCopyPassRaw gPUCopyPass = {})
1694 : m_gPUCopyPass(gPUCopyPass)
1695 {
1696 }
1697
1703 constexpr operator GPUCopyPassRaw() const { return m_gPUCopyPass; }
1704
1721 void UploadToTexture(const GPUTextureTransferInfo& source,
1722 const GPUTextureRegion& destination,
1723 bool cycle);
1724
1738 void UploadToBuffer(const GPUTransferBufferLocation& source,
1739 const GPUBufferRegion& destination,
1740 bool cycle);
1741
1758 void CopyTextureToTexture(const GPUTextureLocation& source,
1759 const GPUTextureLocation& destination,
1760 Uint32 w,
1761 Uint32 h,
1762 Uint32 d,
1763 bool cycle);
1764
1779 void CopyBufferToBuffer(const GPUBufferLocation& source,
1780 const GPUBufferLocation& destination,
1781 Uint32 size,
1782 bool cycle);
1783
1796 void DownloadFromTexture(const GPUTextureRegion& source,
1797 const GPUTextureTransferInfo& destination);
1798
1810 void DownloadFromBuffer(const GPUBufferRegion& source,
1811 const GPUTransferBufferLocation& destination);
1812
1818 void End();
1819};
1820
1856using GPUColorTargetInfo = SDL_GPUColorTargetInfo;
1857
1902using GPUDepthStencilTargetInfo = SDL_GPUDepthStencilTargetInfo;
1903
1912using GPUStorageTextureReadWriteBinding = SDL_GPUStorageTextureReadWriteBinding;
1913
1922using GPUStorageBufferReadWriteBinding = SDL_GPUStorageBufferReadWriteBinding;
1923
1931using GPUBlitInfo = SDL_GPUBlitInfo;
1932
1943using GPUFence = SDL_GPUFence;
1944
1969{
1970 GPUCommandBufferRaw m_gPUCommandBuffer;
1971
1972public:
1978 constexpr GPUCommandBuffer(GPUCommandBufferRaw gPUCommandBuffer = {})
1979 : m_gPUCommandBuffer(gPUCommandBuffer)
1980 {
1981 }
1982
1988 constexpr operator GPUCommandBufferRaw() const { return m_gPUCommandBuffer; }
1989
1999 void InsertDebugLabel(StringParam text);
2000
2021 void PushDebugGroup(StringParam name);
2022
2030 void PopDebugGroup();
2031
2046 void PushVertexUniformData(Uint32 slot_index, SourceBytes data);
2047
2062 void PushFragmentUniformData(Uint32 slot_index, SourceBytes data);
2063
2078 void PushComputeUniformData(Uint32 slot_index, SourceBytes data);
2079
2103 std::span<const GPUColorTargetInfo> color_target_infos,
2104 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info);
2105
2139 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
2140 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings);
2141
2154
2165
2175 void BlitTexture(const GPUBlitInfo& info);
2176
2221 WindowParam window,
2222 Uint32* swapchain_texture_width = nullptr,
2223 Uint32* swapchain_texture_height = nullptr);
2224
2265 WindowParam window,
2266 Uint32* swapchain_texture_width = nullptr,
2267 Uint32* swapchain_texture_height = nullptr);
2268
2288 void Submit();
2289
2314
2335 void Cancel();
2336};
2337
2348
2350 SDL_GPU_SHADERFORMAT_INVALID;
2351
2353 SDL_GPU_SHADERFORMAT_PRIVATE;
2354
2356 SDL_GPU_SHADERFORMAT_SPIRV;
2357
2359 SDL_GPU_SHADERFORMAT_DXBC;
2360
2362 SDL_GPU_SHADERFORMAT_DXIL;
2363
2365 SDL_GPU_SHADERFORMAT_MSL;
2366
2368 SDL_GPU_SHADERFORMAT_METALLIB;
2369
2395using GPUSwapchainComposition = SDL_GPUSwapchainComposition;
2396
2398 SDL_GPU_SWAPCHAINCOMPOSITION_SDR;
2399
2401 SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR;
2402
2404 SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR;
2405
2407 SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084;
2408
2434using GPUPresentMode = SDL_GPUPresentMode;
2435
2437 SDL_GPU_PRESENTMODE_VSYNC;
2438
2440 SDL_GPU_PRESENTMODE_IMMEDIATE;
2441
2443 SDL_GPU_PRESENTMODE_MAILBOX;
2444
2530using GPUTextureFormat = SDL_GPUTextureFormat;
2531
2533 SDL_GPU_TEXTUREFORMAT_INVALID;
2534
2536 SDL_GPU_TEXTUREFORMAT_A8_UNORM;
2537
2539 SDL_GPU_TEXTUREFORMAT_R8_UNORM;
2540
2542 SDL_GPU_TEXTUREFORMAT_R8G8_UNORM;
2543
2545 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM;
2546
2548 SDL_GPU_TEXTUREFORMAT_R16_UNORM;
2549
2551 SDL_GPU_TEXTUREFORMAT_R16G16_UNORM;
2552
2554 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM;
2555
2557 SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM;
2558
2560 SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM;
2561
2563 SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM;
2564
2566 SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM;
2567
2569 SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM;
2570
2572 SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM;
2573
2575 SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM;
2576
2578 SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM;
2579
2581 SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM;
2582
2584 SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM;
2585
2587 SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM;
2588
2590 SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT;
2591
2593 SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT;
2594
2596 SDL_GPU_TEXTUREFORMAT_R8_SNORM;
2597
2599 SDL_GPU_TEXTUREFORMAT_R8G8_SNORM;
2600
2602 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM;
2603
2605 SDL_GPU_TEXTUREFORMAT_R16_SNORM;
2606
2608 SDL_GPU_TEXTUREFORMAT_R16G16_SNORM;
2609
2611 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM;
2612
2614 SDL_GPU_TEXTUREFORMAT_R16_FLOAT;
2615
2617 SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT;
2618
2620 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT;
2621
2623 SDL_GPU_TEXTUREFORMAT_R32_FLOAT;
2624
2626 SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT;
2627
2629 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT;
2630
2632 SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT;
2633
2635 SDL_GPU_TEXTUREFORMAT_R8_UINT;
2636
2638 SDL_GPU_TEXTUREFORMAT_R8G8_UINT;
2639
2641 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT;
2642
2644 SDL_GPU_TEXTUREFORMAT_R16_UINT;
2645
2647 SDL_GPU_TEXTUREFORMAT_R16G16_UINT;
2648
2650 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT;
2651
2653 SDL_GPU_TEXTUREFORMAT_R32_UINT;
2654
2656 SDL_GPU_TEXTUREFORMAT_R32G32_UINT;
2657
2659 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT;
2660
2662 SDL_GPU_TEXTUREFORMAT_R8_INT;
2663
2665 SDL_GPU_TEXTUREFORMAT_R8G8_INT;
2666
2668 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT;
2669
2671 SDL_GPU_TEXTUREFORMAT_R16_INT;
2672
2674 SDL_GPU_TEXTUREFORMAT_R16G16_INT;
2675
2677 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT;
2678
2680 SDL_GPU_TEXTUREFORMAT_R32_INT;
2681
2683 SDL_GPU_TEXTUREFORMAT_R32G32_INT;
2684
2686 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT;
2687
2689 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB;
2690
2692 SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB;
2693
2695 SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB;
2696
2698 SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB;
2699
2701 SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB;
2702
2704 SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB;
2705
2707 SDL_GPU_TEXTUREFORMAT_D16_UNORM;
2708
2710 SDL_GPU_TEXTUREFORMAT_D24_UNORM;
2711
2713 SDL_GPU_TEXTUREFORMAT_D32_FLOAT;
2714
2716 SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT;
2717
2719 SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT;
2720
2722 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM;
2723
2725 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM;
2726
2728 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM;
2729
2731 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM;
2732
2734 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM;
2735
2737 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM;
2738
2740 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM;
2741
2743 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM;
2744
2746 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM;
2747
2749 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM;
2750
2752 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM;
2753
2755 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM;
2756
2758 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM;
2759
2761 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM;
2762
2764 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB;
2765
2767 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB;
2768
2770 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB;
2771
2773 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB;
2774
2776 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB;
2777
2779 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB;
2780
2782 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB;
2783
2785 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB;
2786
2788 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB;
2789
2791 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB;
2792
2794 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB;
2795
2797 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB;
2798
2800 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB;
2801
2803 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB;
2804
2806 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT;
2807
2809 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT;
2810
2812 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT;
2813
2815 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT;
2816
2818 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT;
2819
2821 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT;
2822
2824 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT;
2825
2827 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT;
2828
2830 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT;
2831
2833 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT;
2834
2836 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT;
2837
2839 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT;
2840
2842 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT;
2843
2845 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT;
2846
2854using GPUTextureType = SDL_GPUTextureType;
2855
2857 SDL_GPU_TEXTURETYPE_2D;
2858
2860 SDL_GPU_TEXTURETYPE_2D_ARRAY;
2861
2863 SDL_GPU_TEXTURETYPE_3D;
2864
2866 SDL_GPU_TEXTURETYPE_CUBE;
2867
2869 SDL_GPU_TEXTURETYPE_CUBE_ARRAY;
2870
2892
2894 SDL_GPU_TEXTUREUSAGE_SAMPLER;
2895
2897 SDL_GPU_TEXTUREUSAGE_COLOR_TARGET;
2898
2900 SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET;
2902
2904 SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ;
2906
2909 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ;
2910
2913 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE;
2914
2919constexpr GPUTextureUsageFlags
2921 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE;
2922
2934using GPUSampleCount = SDL_GPUSampleCount;
2935
2937 SDL_GPU_SAMPLECOUNT_1;
2938
2939constexpr GPUSampleCount GPU_SAMPLECOUNT_2 = SDL_GPU_SAMPLECOUNT_2;
2940
2941constexpr GPUSampleCount GPU_SAMPLECOUNT_4 = SDL_GPU_SAMPLECOUNT_4;
2942
2943constexpr GPUSampleCount GPU_SAMPLECOUNT_8 = SDL_GPU_SAMPLECOUNT_8;
2944
2953{
2954 GPUDeviceRaw m_resource = nullptr;
2955
2956public:
2958 constexpr GPUDevice() = default;
2959
2967 constexpr explicit GPUDevice(const GPUDeviceRaw resource)
2968 : m_resource(resource)
2969 {
2970 }
2971
2973 constexpr GPUDevice(const GPUDevice& other) = delete;
2974
2976 constexpr GPUDevice(GPUDevice&& other)
2977 : GPUDevice(other.release())
2978 {
2979 }
2980
2981 constexpr GPUDevice(const GPUDeviceRef& other) = delete;
2982
2983 constexpr GPUDevice(GPUDeviceRef&& other) = delete;
2984
3003 GPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
3004 : m_resource(
3005 CheckError(SDL_CreateGPUDevice(format_flags, debug_mode, name)))
3006 {
3007 }
3008
3053 : m_resource(CheckError(SDL_CreateGPUDeviceWithProperties(props)))
3054 {
3055 }
3056
3058 ~GPUDevice() { SDL_DestroyGPUDevice(m_resource); }
3059
3062 {
3063 std::swap(m_resource, other.m_resource);
3064 return *this;
3065 }
3066
3068 constexpr GPUDeviceRaw get() const { return m_resource; }
3069
3072 {
3073 auto r = m_resource;
3074 m_resource = nullptr;
3075 return r;
3076 }
3077
3079 constexpr auto operator<=>(const GPUDevice& other) const = default;
3080
3082 constexpr bool operator==(std::nullptr_t _) const { return !m_resource; }
3083
3085 constexpr explicit operator bool() const { return !!m_resource; }
3086
3088 constexpr operator GPUDeviceParam() const { return {m_resource}; }
3089
3097 void Destroy();
3098
3106 const char* GetDriver();
3107
3117
3163 const GPUComputePipelineCreateInfo& createinfo);
3164
3186 const GPUGraphicsPipelineCreateInfo& createinfo);
3187
3209
3282 GPUShader CreateShader(const GPUShaderCreateInfo& createinfo);
3283
3339
3382 GPUBuffer CreateBuffer(const GPUBufferCreateInfo& createinfo);
3383
3411 const GPUTransferBufferCreateInfo& createinfo);
3412
3429 void SetBufferName(GPUBuffer buffer, StringParam text);
3430
3448 void SetTextureName(GPUTexture texture, StringParam text);
3449
3459 void ReleaseTexture(GPUTexture texture);
3460
3470 void ReleaseSampler(GPUSampler sampler);
3471
3481 void ReleaseBuffer(GPUBuffer buffer);
3482
3492 void ReleaseTransferBuffer(GPUTransferBuffer transfer_buffer);
3493
3503 void ReleaseComputePipeline(GPUComputePipeline compute_pipeline);
3504
3514 void ReleaseShader(GPUShader shader);
3515
3525 void ReleaseGraphicsPipeline(GPUGraphicsPipeline graphics_pipeline);
3526
3551
3566 void* MapTransferBuffer(GPUTransferBuffer transfer_buffer, bool cycle);
3567
3575 void UnmapTransferBuffer(GPUTransferBuffer transfer_buffer);
3576
3591 WindowParam window,
3592 GPUSwapchainComposition swapchain_composition);
3593
3608 GPUPresentMode present_mode);
3609
3634 void ClaimWindow(WindowParam window);
3635
3645 void ReleaseWindow(WindowParam window);
3646
3671 GPUSwapchainComposition swapchain_composition,
3672 GPUPresentMode present_mode);
3673
3698 bool SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight);
3699
3711
3727 void WaitForSwapchain(WindowParam window);
3728
3738 void WaitForIdle();
3739
3753 void WaitForFences(bool wait_all, std::span<GPUFence* const> fences);
3754
3765 bool QueryFence(GPUFence* fence);
3766
3778 void ReleaseFence(GPUFence* fence);
3779
3792 GPUTextureType type,
3793 GPUTextureUsageFlags usage);
3794
3805 GPUSampleCount sample_count);
3806#ifdef SDL_PLATFORM_GDK
3807
3819 void GDKSuspendGPU();
3820
3832 void GDKResumeGPU();
3833
3834#endif /* SDL_PLATFORM_GDK */
3835};
3836
3839{
3848 : GPUDevice(resource.value)
3849 {
3850 }
3851
3854 : GPUDevice(other.get())
3855 {
3856 }
3857
3860};
3861
3882using GPUPrimitiveType = SDL_GPUPrimitiveType;
3883
3885 SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
3886
3888 SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP;
3889
3891 SDL_GPU_PRIMITIVETYPE_LINELIST;
3892
3894 SDL_GPU_PRIMITIVETYPE_LINESTRIP;
3895
3897 SDL_GPU_PRIMITIVETYPE_POINTLIST;
3898
3907using GPULoadOp = SDL_GPULoadOp;
3908
3910constexpr GPULoadOp GPU_LOADOP_LOAD = SDL_GPU_LOADOP_LOAD;
3911
3913constexpr GPULoadOp GPU_LOADOP_CLEAR = SDL_GPU_LOADOP_CLEAR;
3914
3919constexpr GPULoadOp GPU_LOADOP_DONT_CARE = SDL_GPU_LOADOP_DONT_CARE;
3920
3929using GPUStoreOp = SDL_GPUStoreOp;
3930
3932constexpr GPUStoreOp GPU_STOREOP_STORE = SDL_GPU_STOREOP_STORE;
3933
3938constexpr GPUStoreOp GPU_STOREOP_DONT_CARE = SDL_GPU_STOREOP_DONT_CARE;
3939
3945constexpr GPUStoreOp GPU_STOREOP_RESOLVE = SDL_GPU_STOREOP_RESOLVE;
3946
3953 SDL_GPU_STOREOP_RESOLVE_AND_STORE;
3954
3962using GPUCubeMapFace = SDL_GPUCubeMapFace;
3963
3965 SDL_GPU_CUBEMAPFACE_POSITIVEX;
3966
3968 SDL_GPU_CUBEMAPFACE_NEGATIVEX;
3969
3971 SDL_GPU_CUBEMAPFACE_POSITIVEY;
3972
3974 SDL_GPU_CUBEMAPFACE_NEGATIVEY;
3975
3977 SDL_GPU_CUBEMAPFACE_POSITIVEZ;
3978
3980 SDL_GPU_CUBEMAPFACE_NEGATIVEZ;
3981
4000
4002 SDL_GPU_BUFFERUSAGE_VERTEX;
4003
4005 SDL_GPU_BUFFERUSAGE_INDEX;
4006
4008 SDL_GPU_BUFFERUSAGE_INDIRECT;
4009
4011 SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ;
4013
4016 SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ;
4017
4020 SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE;
4021
4032using GPUTransferBufferUsage = SDL_GPUTransferBufferUsage;
4033
4035 SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD;
4036
4038 SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD;
4039
4047using GPUShaderStage = SDL_GPUShaderStage;
4048
4050 SDL_GPU_SHADERSTAGE_VERTEX;
4051
4053 SDL_GPU_SHADERSTAGE_FRAGMENT;
4054
4062using GPUVertexElementFormat = SDL_GPUVertexElementFormat;
4063
4065 SDL_GPU_VERTEXELEMENTFORMAT_INVALID;
4066
4068 SDL_GPU_VERTEXELEMENTFORMAT_INT;
4069
4071 SDL_GPU_VERTEXELEMENTFORMAT_INT2;
4072
4074 SDL_GPU_VERTEXELEMENTFORMAT_INT3;
4075
4077 SDL_GPU_VERTEXELEMENTFORMAT_INT4;
4078
4080 SDL_GPU_VERTEXELEMENTFORMAT_UINT;
4081
4083 SDL_GPU_VERTEXELEMENTFORMAT_UINT2;
4084
4086 SDL_GPU_VERTEXELEMENTFORMAT_UINT3;
4087
4089 SDL_GPU_VERTEXELEMENTFORMAT_UINT4;
4090
4092 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT;
4093
4095 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2;
4096
4098 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3;
4099
4101 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4;
4102
4104 SDL_GPU_VERTEXELEMENTFORMAT_BYTE2;
4105
4107 SDL_GPU_VERTEXELEMENTFORMAT_BYTE4;
4108
4110 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2;
4111
4113 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4;
4114
4116 SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM;
4117
4119 SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM;
4120
4122 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM;
4123
4125 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM;
4126
4128 SDL_GPU_VERTEXELEMENTFORMAT_SHORT2;
4129
4131 SDL_GPU_VERTEXELEMENTFORMAT_SHORT4;
4132
4134 SDL_GPU_VERTEXELEMENTFORMAT_USHORT2;
4135
4137 SDL_GPU_VERTEXELEMENTFORMAT_USHORT4;
4138
4140 SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM;
4141
4143 SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM;
4144
4146 SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM;
4147
4149 SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM;
4150
4152 SDL_GPU_VERTEXELEMENTFORMAT_HALF2;
4153
4155 SDL_GPU_VERTEXELEMENTFORMAT_HALF4;
4156
4164using GPUVertexInputRate = SDL_GPUVertexInputRate;
4165
4168 SDL_GPU_VERTEXINPUTRATE_VERTEX;
4169
4172 SDL_GPU_VERTEXINPUTRATE_INSTANCE;
4173
4181using GPUFillMode = SDL_GPUFillMode;
4182
4184 SDL_GPU_FILLMODE_FILL;
4185
4187 SDL_GPU_FILLMODE_LINE;
4188
4196using GPUCullMode = SDL_GPUCullMode;
4197
4199 SDL_GPU_CULLMODE_NONE;
4200
4202 SDL_GPU_CULLMODE_FRONT;
4203
4205 SDL_GPU_CULLMODE_BACK;
4206
4215using GPUFrontFace = SDL_GPUFrontFace;
4216
4222 SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE;
4223
4225constexpr GPUFrontFace GPU_FRONTFACE_CLOCKWISE = SDL_GPU_FRONTFACE_CLOCKWISE;
4226
4234using GPUCompareOp = SDL_GPUCompareOp;
4235
4237 SDL_GPU_COMPAREOP_INVALID;
4238
4240 SDL_GPU_COMPAREOP_NEVER;
4241
4243 SDL_GPU_COMPAREOP_LESS;
4244
4246 SDL_GPU_COMPAREOP_EQUAL;
4247
4249 SDL_GPU_COMPAREOP_LESS_OR_EQUAL;
4251
4253 SDL_GPU_COMPAREOP_GREATER;
4254
4256 SDL_GPU_COMPAREOP_NOT_EQUAL;
4257
4259 SDL_GPU_COMPAREOP_GREATER_OR_EQUAL;
4261
4263 SDL_GPU_COMPAREOP_ALWAYS;
4264
4273using GPUStencilOp = SDL_GPUStencilOp;
4274
4276 SDL_GPU_STENCILOP_INVALID;
4277
4279 SDL_GPU_STENCILOP_KEEP;
4280
4282 SDL_GPU_STENCILOP_ZERO;
4283
4285 SDL_GPU_STENCILOP_REPLACE;
4286
4289 SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP;
4290
4292 SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP;
4294
4296 SDL_GPU_STENCILOP_INVERT;
4297
4299 SDL_GPU_STENCILOP_INCREMENT_AND_WRAP;
4301
4304 SDL_GPU_STENCILOP_DECREMENT_AND_WRAP;
4305
4317using GPUBlendOp = SDL_GPUBlendOp;
4318
4320 SDL_GPU_BLENDOP_INVALID;
4321
4323constexpr GPUBlendOp GPU_BLENDOP_ADD = SDL_GPU_BLENDOP_ADD;
4324
4326constexpr GPUBlendOp GPU_BLENDOP_SUBTRACT = SDL_GPU_BLENDOP_SUBTRACT;
4327
4330 SDL_GPU_BLENDOP_REVERSE_SUBTRACT;
4331
4333 SDL_GPU_BLENDOP_MIN;
4334
4336 SDL_GPU_BLENDOP_MAX;
4337
4349using GPUBlendFactor = SDL_GPUBlendFactor;
4350
4352 SDL_GPU_BLENDFACTOR_INVALID;
4353
4354constexpr GPUBlendFactor GPU_BLENDFACTOR_ZERO = SDL_GPU_BLENDFACTOR_ZERO;
4355
4356constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE = SDL_GPU_BLENDFACTOR_ONE;
4357
4359 SDL_GPU_BLENDFACTOR_SRC_COLOR;
4360
4362 SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR;
4363
4365 SDL_GPU_BLENDFACTOR_DST_COLOR;
4366
4368 SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR;
4369
4371 SDL_GPU_BLENDFACTOR_SRC_ALPHA;
4372
4374 SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
4375
4377 SDL_GPU_BLENDFACTOR_DST_ALPHA;
4378
4380 SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA;
4381
4383 SDL_GPU_BLENDFACTOR_CONSTANT_COLOR;
4384
4386 SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR;
4387
4389 SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE;
4391
4400
4402 SDL_GPU_COLORCOMPONENT_R;
4403
4405 SDL_GPU_COLORCOMPONENT_G;
4406
4408 SDL_GPU_COLORCOMPONENT_B;
4409
4411 SDL_GPU_COLORCOMPONENT_A;
4412
4420using GPUFilter = SDL_GPUFilter;
4421
4423 SDL_GPU_FILTER_NEAREST;
4424
4426 SDL_GPU_FILTER_LINEAR;
4427
4435using GPUSamplerMipmapMode = SDL_GPUSamplerMipmapMode;
4436
4438 SDL_GPU_SAMPLERMIPMAPMODE_NEAREST;
4439
4441 SDL_GPU_SAMPLERMIPMAPMODE_LINEAR;
4442
4451using GPUSamplerAddressMode = SDL_GPUSamplerAddressMode;
4452
4454 SDL_GPU_SAMPLERADDRESSMODE_REPEAT;
4456
4459 SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT;
4460
4463 SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE;
4464
4472using GPUBlitRegion = SDL_GPUBlitRegion;
4473
4488using GPUIndirectDrawCommand = SDL_GPUIndirectDrawCommand;
4489
4504using GPUIndexedIndirectDrawCommand = SDL_GPUIndexedIndirectDrawCommand;
4505
4513using GPUIndirectDispatchCommand = SDL_GPUIndirectDispatchCommand;
4514
4533using GPUVertexBufferDescription = SDL_GPUVertexBufferDescription;
4534
4547using GPUVertexAttribute = SDL_GPUVertexAttribute;
4548
4559using GPUVertexInputState = SDL_GPUVertexInputState;
4560
4568using GPUStencilOpState = SDL_GPUStencilOpState;
4569
4577using GPUColorTargetBlendState = SDL_GPUColorTargetBlendState;
4578
4595using GPURasterizerState = SDL_GPURasterizerState;
4596
4605using GPUMultisampleState = SDL_GPUMultisampleState;
4606
4615using GPUDepthStencilState = SDL_GPUDepthStencilState;
4616
4625using GPUColorTargetDescription = SDL_GPUColorTargetDescription;
4626
4637using GPUGraphicsPipelineTargetInfo = SDL_GPUGraphicsPipelineTargetInfo;
4638
4653 StringParam name)
4654{
4655 return SDL_GPUSupportsShaderFormats(format_flags, name);
4656}
4657
4669{
4670 return SDL_GPUSupportsProperties(props);
4671}
4672
4692 bool debug_mode,
4693 StringParam name)
4694{
4695 return GPUDevice(format_flags, debug_mode, std::move(name));
4696}
4697
4742{
4743 return GPUDevice(props);
4744}
4745
4746namespace prop::GpuDevice {
4747
4748constexpr auto CREATE_DEBUGMODE_BOOLEAN =
4749 SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN;
4750
4751constexpr auto CREATE_PREFERLOWPOWER_BOOLEAN =
4752 SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN;
4753
4754constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING;
4755
4756constexpr auto CREATE_SHADERS_PRIVATE_BOOLEAN =
4757 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN;
4758
4759constexpr auto CREATE_SHADERS_SPIRV_BOOLEAN =
4760 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN;
4761
4762constexpr auto CREATE_SHADERS_DXBC_BOOLEAN =
4763 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN;
4764
4765constexpr auto CREATE_SHADERS_DXIL_BOOLEAN =
4766 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN;
4767
4768constexpr auto CREATE_SHADERS_MSL_BOOLEAN =
4769 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN;
4770
4771constexpr auto CREATE_SHADERS_METALLIB_BOOLEAN =
4772 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN;
4773
4774constexpr auto CREATE_D3D12_SEMANTIC_NAME_STRING =
4775 SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING;
4776
4777} // namespace prop::GpuDevice
4778
4789{
4790 SDL_DestroyGPUDevice(device);
4791}
4792
4794
4804inline int GetNumGPUDrivers() { return SDL_GetNumGPUDrivers(); }
4805
4823inline const char* GetGPUDriver(int index) { return SDL_GetGPUDriver(index); }
4824
4833inline const char* GetGPUDeviceDriver(GPUDeviceParam device)
4834{
4835 return SDL_GetGPUDeviceDriver(device);
4836}
4837
4838inline const char* GPUDevice::GetDriver()
4839{
4840 return SDL::GetGPUDeviceDriver(m_resource);
4841}
4842
4853{
4854 return SDL_GetGPUShaderFormats(device);
4855}
4856
4858{
4859 return SDL::GetGPUShaderFormats(m_resource);
4860}
4861
4908 GPUDeviceParam device,
4909 const GPUComputePipelineCreateInfo& createinfo)
4910{
4911 return GPUComputePipeline(device, createinfo);
4912}
4913
4915 const GPUComputePipelineCreateInfo& createinfo)
4916{
4917 return GPUComputePipeline(m_resource, createinfo);
4918}
4919
4920namespace prop::GPUComputePipeline {
4921
4922constexpr auto CREATE_NAME_STRING =
4923 SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING;
4924
4925} // namespace prop::GPUComputePipeline
4926
4949 GPUDeviceParam device,
4950 const GPUGraphicsPipelineCreateInfo& createinfo)
4951{
4952 return GPUGraphicsPipeline(device, createinfo);
4953}
4954
4956 const GPUGraphicsPipelineCreateInfo& createinfo)
4957{
4958 return GPUGraphicsPipeline(m_resource, createinfo);
4959}
4960
4961namespace prop::GPUGraphicsPipeline {
4962
4963constexpr auto CREATE_NAME_STRING =
4964 SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING;
4965
4966} // namespace prop::GPUGraphicsPipeline
4967
4990 const GPUSamplerCreateInfo& createinfo)
4991{
4992 return GPUSampler(device, createinfo);
4993}
4994
4996 const GPUSamplerCreateInfo& createinfo)
4997{
4998 return GPUSampler(m_resource, createinfo);
4999}
5000
5001namespace prop::GPUSampler {
5002
5003constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING;
5004
5005} // namespace prop::GPUSampler
5006
5078 const GPUShaderCreateInfo& createinfo)
5079{
5080 return GPUShader(device, createinfo);
5081}
5082
5084{
5085 return GPUShader(m_resource, createinfo);
5086}
5087
5088namespace prop::GPUShader {
5089
5090constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_SHADER_CREATE_NAME_STRING;
5091
5092} // namespace prop::GPUShader
5093
5150 const GPUTextureCreateInfo& createinfo)
5151{
5152 return GPUTexture(device, createinfo);
5153}
5154
5156 const GPUTextureCreateInfo& createinfo)
5157{
5158 return GPUTexture(m_resource, createinfo);
5159}
5160
5161namespace prop::GPUTexture {
5162
5163constexpr auto CREATE_D3D12_CLEAR_R_FLOAT =
5164 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT;
5165
5166constexpr auto CREATE_D3D12_CLEAR_G_FLOAT =
5167 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT;
5168
5169constexpr auto CREATE_D3D12_CLEAR_B_FLOAT =
5170 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT;
5171
5172constexpr auto CREATE_D3D12_CLEAR_A_FLOAT =
5173 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT;
5174
5175constexpr auto CREATE_D3D12_CLEAR_DEPTH_FLOAT =
5176 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT;
5177
5178#if SDL_VERSION_ATLEAST(3, 2, 12)
5179
5180constexpr auto CREATE_D3D12_CLEAR_STENCIL_NUMBER =
5181 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER;
5182
5183#endif // SDL_VERSION_ATLEAST(3, 2, 12)
5184
5185constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING;
5186
5187} // namespace prop::GPUTexture
5188
5233 const GPUBufferCreateInfo& createinfo)
5234{
5235 return GPUBuffer(device, createinfo);
5236}
5237
5239{
5240 return GPUBuffer(m_resource, createinfo);
5241}
5242
5243namespace prop::GPUBuffer {
5244
5245constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING;
5246
5247} // namespace prop::GPUBuffer
5248
5277 GPUDeviceParam device,
5278 const GPUTransferBufferCreateInfo& createinfo)
5279{
5280 return GPUTransferBuffer(device, createinfo);
5281}
5282
5284 const GPUTransferBufferCreateInfo& createinfo)
5285{
5286 return GPUTransferBuffer(m_resource, createinfo);
5287}
5288
5289namespace prop::GPUTransferBuffer {
5290
5291constexpr auto CREATE_NAME_STRING =
5292 SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING;
5293
5294} // namespace prop::GPUTransferBuffer
5295
5314 GPUBuffer buffer,
5315 StringParam text)
5316{
5317 SDL_SetGPUBufferName(device, buffer, text);
5318}
5319
5321{
5322 SDL::SetGPUBufferName(m_resource, buffer, std::move(text));
5323}
5324
5343 GPUTexture texture,
5344 StringParam text)
5345{
5346 SDL_SetGPUTextureName(device, texture, text);
5347}
5348
5350{
5351 SDL::SetGPUTextureName(m_resource, texture, std::move(text));
5352}
5353
5364inline void InsertGPUDebugLabel(GPUCommandBuffer command_buffer,
5365 StringParam text)
5366{
5367 SDL_InsertGPUDebugLabel(command_buffer, text);
5368}
5369
5371{
5372 SDL::InsertGPUDebugLabel(m_gPUCommandBuffer, std::move(text));
5373}
5374
5396inline void PushGPUDebugGroup(GPUCommandBuffer command_buffer, StringParam name)
5397{
5398 SDL_PushGPUDebugGroup(command_buffer, name);
5399}
5400
5402{
5403 SDL::PushGPUDebugGroup(m_gPUCommandBuffer, std::move(name));
5404}
5405
5415inline void PopGPUDebugGroup(GPUCommandBuffer command_buffer)
5416{
5417 SDL_PopGPUDebugGroup(command_buffer);
5418}
5419
5421{
5422 SDL::PopGPUDebugGroup(m_gPUCommandBuffer);
5423}
5424
5435inline void ReleaseGPUTexture(GPUDeviceParam device, GPUTexture texture)
5436{
5437 SDL_ReleaseGPUTexture(device, texture);
5438}
5439
5441{
5442 SDL::ReleaseGPUTexture(m_resource, texture);
5443}
5444
5455inline void ReleaseGPUSampler(GPUDeviceParam device, GPUSampler sampler)
5456{
5457 SDL_ReleaseGPUSampler(device, sampler);
5458}
5459
5461{
5462 SDL::ReleaseGPUSampler(m_resource, sampler);
5463}
5464
5475inline void ReleaseGPUBuffer(GPUDeviceParam device, GPUBuffer buffer)
5476{
5477 SDL_ReleaseGPUBuffer(device, buffer);
5478}
5479
5481{
5482 SDL::ReleaseGPUBuffer(m_resource, buffer);
5483}
5484
5496 GPUTransferBuffer transfer_buffer)
5497{
5498 SDL_ReleaseGPUTransferBuffer(device, transfer_buffer);
5499}
5500
5502{
5503 SDL::ReleaseGPUTransferBuffer(m_resource, transfer_buffer);
5504}
5505
5517 GPUComputePipeline compute_pipeline)
5518{
5519 SDL_ReleaseGPUComputePipeline(device, compute_pipeline);
5520}
5521
5523 GPUComputePipeline compute_pipeline)
5524{
5525 SDL::ReleaseGPUComputePipeline(m_resource, compute_pipeline);
5526}
5527
5538inline void ReleaseGPUShader(GPUDeviceParam device, GPUShader shader)
5539{
5540 SDL_ReleaseGPUShader(device, shader);
5541}
5542
5544{
5545 SDL::ReleaseGPUShader(m_resource, shader);
5546}
5547
5559 GPUGraphicsPipeline graphics_pipeline)
5560{
5561 SDL_ReleaseGPUGraphicsPipeline(device, graphics_pipeline);
5562}
5563
5565 GPUGraphicsPipeline graphics_pipeline)
5566{
5567 SDL::ReleaseGPUGraphicsPipeline(m_resource, graphics_pipeline);
5568}
5569
5595{
5596 return SDL_AcquireGPUCommandBuffer(device);
5597}
5598
5600{
5601 return SDL::AcquireGPUCommandBuffer(m_resource);
5602}
5603
5620 Uint32 slot_index,
5621 SourceBytes data)
5622{
5623 SDL_PushGPUVertexUniformData(
5624 command_buffer, slot_index, data.data(), data.size_bytes());
5625}
5626
5628 SourceBytes data)
5629{
5631 m_gPUCommandBuffer, slot_index, std::move(data));
5632}
5633
5650 Uint32 slot_index,
5651 SourceBytes data)
5652{
5653 SDL_PushGPUFragmentUniformData(
5654 command_buffer, slot_index, data.data(), data.size_bytes());
5655}
5656
5658 SourceBytes data)
5659{
5661 m_gPUCommandBuffer, slot_index, std::move(data));
5662}
5663
5680 Uint32 slot_index,
5681 SourceBytes data)
5682{
5683 SDL_PushGPUComputeUniformData(
5684 command_buffer, slot_index, data.data(), data.size_bytes());
5685}
5686
5688 SourceBytes data)
5689{
5691 m_gPUCommandBuffer, slot_index, std::move(data));
5692}
5693
5718 GPUCommandBuffer command_buffer,
5719 std::span<const GPUColorTargetInfo> color_target_infos,
5720 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info)
5721{
5722 return SDL_BeginGPURenderPass(command_buffer,
5723 color_target_infos.data(),
5724 color_target_infos.size(),
5725 depth_stencil_target_info);
5726}
5727
5729 std::span<const GPUColorTargetInfo> color_target_infos,
5730 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info)
5731{
5733 m_gPUCommandBuffer, color_target_infos, depth_stencil_target_info);
5734}
5735
5747 GPUGraphicsPipeline graphics_pipeline)
5748{
5749 SDL_BindGPUGraphicsPipeline(render_pass, graphics_pipeline);
5750}
5751
5753{
5754 SDL::BindGPUGraphicsPipeline(m_gPURenderPass, graphics_pipeline);
5755}
5756
5765inline void SetGPUViewport(GPURenderPass render_pass,
5766 const GPUViewport& viewport)
5767{
5768 SDL_SetGPUViewport(render_pass, &viewport);
5769}
5770
5771inline void GPURenderPass::SetViewport(const GPUViewport& viewport)
5772{
5773 SDL::SetGPUViewport(m_gPURenderPass, viewport);
5774}
5775
5784inline void SetGPUScissor(GPURenderPass render_pass, const RectRaw& scissor)
5785{
5786 SDL_SetGPUScissor(render_pass, &scissor);
5787}
5788
5789inline void GPURenderPass::SetScissor(const RectRaw& scissor)
5790{
5791 SDL::SetGPUScissor(m_gPURenderPass, scissor);
5792}
5793
5805inline void SetGPUBlendConstants(GPURenderPass render_pass,
5806 FColorRaw blend_constants)
5807{
5808 SDL_SetGPUBlendConstants(render_pass, blend_constants);
5809}
5810
5812{
5813 SDL::SetGPUBlendConstants(m_gPURenderPass, blend_constants);
5814}
5815
5824inline void SetGPUStencilReference(GPURenderPass render_pass, Uint8 reference)
5825{
5826 SDL_SetGPUStencilReference(render_pass, reference);
5827}
5828
5830{
5831 SDL::SetGPUStencilReference(m_gPURenderPass, reference);
5832}
5833
5844inline void BindGPUVertexBuffers(GPURenderPass render_pass,
5845 Uint32 first_slot,
5846 std::span<const GPUBufferBinding> bindings)
5847{
5848 SDL_BindGPUVertexBuffers(
5849 render_pass, first_slot, bindings.data(), bindings.size());
5850}
5851
5853 Uint32 first_slot,
5854 std::span<const GPUBufferBinding> bindings)
5855{
5856 SDL::BindGPUVertexBuffers(m_gPURenderPass, first_slot, bindings);
5857}
5858
5869inline void BindGPUIndexBuffer(GPURenderPass render_pass,
5870 const GPUBufferBinding& binding,
5871 GPUIndexElementSize index_element_size)
5872{
5873 SDL_BindGPUIndexBuffer(render_pass, &binding, index_element_size);
5874}
5875
5877 const GPUBufferBinding& binding,
5878 GPUIndexElementSize index_element_size)
5879{
5880 SDL::BindGPUIndexBuffer(m_gPURenderPass, binding, index_element_size);
5881}
5882
5900 GPURenderPass render_pass,
5901 Uint32 first_slot,
5902 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5903{
5904 SDL_BindGPUVertexSamplers(render_pass,
5905 first_slot,
5906 texture_sampler_bindings.data(),
5907 texture_sampler_bindings.size());
5908}
5909
5911 Uint32 first_slot,
5912 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5913{
5915 m_gPURenderPass, first_slot, texture_sampler_bindings);
5916}
5917
5936 GPURenderPass render_pass,
5937 Uint32 first_slot,
5938 SpanRef<const GPUTextureRaw> storage_textures)
5939{
5940 SDL_BindGPUVertexStorageTextures(
5941 render_pass, first_slot, storage_textures.data(), storage_textures.size());
5942}
5943
5945 Uint32 first_slot,
5946 SpanRef<const GPUTextureRaw> storage_textures)
5947{
5949 m_gPURenderPass, first_slot, storage_textures);
5950}
5951
5970 GPURenderPass render_pass,
5971 Uint32 first_slot,
5972 SpanRef<const GPUBufferRaw> storage_buffers)
5973{
5974 SDL_BindGPUVertexStorageBuffers(
5975 render_pass, first_slot, storage_buffers.data(), storage_buffers.size());
5976}
5977
5979 Uint32 first_slot,
5980 SpanRef<const GPUBufferRaw> storage_buffers)
5981{
5983 m_gPURenderPass, first_slot, storage_buffers);
5984}
5985
6003 GPURenderPass render_pass,
6004 Uint32 first_slot,
6005 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6006{
6007 SDL_BindGPUFragmentSamplers(render_pass,
6008 first_slot,
6009 texture_sampler_bindings.data(),
6010 texture_sampler_bindings.size());
6011}
6012
6014 Uint32 first_slot,
6015 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6016{
6018 m_gPURenderPass, first_slot, texture_sampler_bindings);
6019}
6020
6039 GPURenderPass render_pass,
6040 Uint32 first_slot,
6041 SpanRef<const GPUTextureRaw> storage_textures)
6042{
6043 SDL_BindGPUFragmentStorageTextures(
6044 render_pass, first_slot, storage_textures.data(), storage_textures.size());
6045}
6046
6048 Uint32 first_slot,
6049 SpanRef<const GPUTextureRaw> storage_textures)
6050{
6052 m_gPURenderPass, first_slot, storage_textures);
6053}
6054
6073 GPURenderPass render_pass,
6074 Uint32 first_slot,
6075 SpanRef<const GPUBufferRaw> storage_buffers)
6076{
6077 SDL_BindGPUFragmentStorageBuffers(
6078 render_pass, first_slot, storage_buffers.data(), storage_buffers.size());
6079}
6080
6082 Uint32 first_slot,
6083 SpanRef<const GPUBufferRaw> storage_buffers)
6084{
6086 m_gPURenderPass, first_slot, storage_buffers);
6087}
6088
6113 Uint32 num_indices,
6114 Uint32 num_instances,
6115 Uint32 first_index,
6116 Sint32 vertex_offset,
6117 Uint32 first_instance)
6118{
6119 SDL_DrawGPUIndexedPrimitives(render_pass,
6120 num_indices,
6121 num_instances,
6122 first_index,
6123 vertex_offset,
6124 first_instance);
6125}
6126
6128 Uint32 num_instances,
6129 Uint32 first_index,
6130 Sint32 vertex_offset,
6131 Uint32 first_instance)
6132{
6133 SDL::DrawGPUIndexedPrimitives(m_gPURenderPass,
6134 num_indices,
6135 num_instances,
6136 first_index,
6137 vertex_offset,
6138 first_instance);
6139}
6140
6161inline void DrawGPUPrimitives(GPURenderPass render_pass,
6162 Uint32 num_vertices,
6163 Uint32 num_instances,
6164 Uint32 first_vertex,
6165 Uint32 first_instance)
6166{
6167 SDL_DrawGPUPrimitives(
6168 render_pass, num_vertices, num_instances, first_vertex, first_instance);
6169}
6170
6171inline void GPURenderPass::DrawPrimitives(Uint32 num_vertices,
6172 Uint32 num_instances,
6173 Uint32 first_vertex,
6174 Uint32 first_instance)
6175{
6177 m_gPURenderPass, num_vertices, num_instances, first_vertex, first_instance);
6178}
6179
6197 GPUBuffer buffer,
6198 Uint32 offset,
6199 Uint32 draw_count)
6200{
6201 SDL_DrawGPUPrimitivesIndirect(render_pass, buffer, offset, draw_count);
6202}
6203
6205 Uint32 offset,
6206 Uint32 draw_count)
6207{
6208 SDL::DrawGPUPrimitivesIndirect(m_gPURenderPass, buffer, offset, draw_count);
6209}
6210
6228 GPUBuffer buffer,
6229 Uint32 offset,
6230 Uint32 draw_count)
6231{
6232 SDL_DrawGPUIndexedPrimitivesIndirect(render_pass, buffer, offset, draw_count);
6233}
6234
6236 Uint32 offset,
6237 Uint32 draw_count)
6238{
6240 m_gPURenderPass, buffer, offset, draw_count);
6241}
6242
6253inline void EndGPURenderPass(GPURenderPass render_pass)
6254{
6255 SDL_EndGPURenderPass(render_pass);
6256}
6257
6258inline void GPURenderPass::End() { SDL::EndGPURenderPass(m_gPURenderPass); }
6259
6294 GPUCommandBuffer command_buffer,
6295 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
6296 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings)
6297{
6298 return SDL_BeginGPUComputePass(command_buffer,
6299 storage_texture_bindings.data(),
6300 storage_texture_bindings.size(),
6301 storage_buffer_bindings.data(),
6302 storage_buffer_bindings.size());
6303}
6304
6306 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
6307 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings)
6308{
6310 m_gPUCommandBuffer, storage_texture_bindings, storage_buffer_bindings);
6311}
6312
6322 GPUComputePipeline compute_pipeline)
6323{
6324 SDL_BindGPUComputePipeline(compute_pass, compute_pipeline);
6325}
6326
6328{
6329 SDL::BindGPUComputePipeline(m_gPUComputePass, compute_pipeline);
6330}
6331
6349 GPUComputePass compute_pass,
6350 Uint32 first_slot,
6351 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6352{
6353 SDL_BindGPUComputeSamplers(compute_pass,
6354 first_slot,
6355 texture_sampler_bindings.data(),
6356 texture_sampler_bindings.size());
6357}
6358
6360 Uint32 first_slot,
6361 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6362{
6364 m_gPUComputePass, first_slot, texture_sampler_bindings);
6365}
6366
6385 GPUComputePass compute_pass,
6386 Uint32 first_slot,
6387 SpanRef<const GPUTextureRaw> storage_textures)
6388{
6389 SDL_BindGPUComputeStorageTextures(
6390 compute_pass, first_slot, storage_textures.data(), storage_textures.size());
6391}
6392
6394 Uint32 first_slot,
6395 SpanRef<const GPUTextureRaw> storage_textures)
6396{
6398 m_gPUComputePass, first_slot, storage_textures);
6399}
6400
6419 GPUComputePass compute_pass,
6420 Uint32 first_slot,
6421 SpanRef<const GPUBufferRaw> storage_buffers)
6422{
6423 SDL_BindGPUComputeStorageBuffers(
6424 compute_pass, first_slot, storage_buffers.data(), storage_buffers.size());
6425}
6426
6428 Uint32 first_slot,
6429 SpanRef<const GPUBufferRaw> storage_buffers)
6430{
6432 m_gPUComputePass, first_slot, storage_buffers);
6433}
6434
6455inline void DispatchGPUCompute(GPUComputePass compute_pass,
6456 Uint32 groupcount_x,
6457 Uint32 groupcount_y,
6458 Uint32 groupcount_z)
6459{
6460 SDL_DispatchGPUCompute(
6461 compute_pass, groupcount_x, groupcount_y, groupcount_z);
6462}
6463
6464inline void GPUComputePass::Dispatch(Uint32 groupcount_x,
6465 Uint32 groupcount_y,
6466 Uint32 groupcount_z)
6467{
6469 m_gPUComputePass, groupcount_x, groupcount_y, groupcount_z);
6470}
6471
6490 GPUBuffer buffer,
6491 Uint32 offset)
6492{
6493 SDL_DispatchGPUComputeIndirect(compute_pass, buffer, offset);
6494}
6495
6497{
6498 SDL::DispatchGPUComputeIndirect(m_gPUComputePass, buffer, offset);
6499}
6500
6511inline void EndGPUComputePass(GPUComputePass compute_pass)
6512{
6513 SDL_EndGPUComputePass(compute_pass);
6514}
6515
6516inline void GPUComputePass::End() { SDL::EndGPUComputePass(m_gPUComputePass); }
6517
6534 GPUTransferBuffer transfer_buffer,
6535 bool cycle)
6536{
6537 return SDL_MapGPUTransferBuffer(device, transfer_buffer, cycle);
6538}
6539
6541 bool cycle)
6542{
6543 return SDL::MapGPUTransferBuffer(m_resource, transfer_buffer, cycle);
6544}
6545
6555 GPUTransferBuffer transfer_buffer)
6556{
6557 SDL_UnmapGPUTransferBuffer(device, transfer_buffer);
6558}
6559
6561{
6562 SDL::UnmapGPUTransferBuffer(m_resource, transfer_buffer);
6563}
6564
6578{
6579 return SDL_BeginGPUCopyPass(command_buffer);
6580}
6581
6583{
6584 return SDL::BeginGPUCopyPass(m_gPUCommandBuffer);
6585}
6586
6604inline void UploadToGPUTexture(GPUCopyPass copy_pass,
6605 const GPUTextureTransferInfo& source,
6606 const GPUTextureRegion& destination,
6607 bool cycle)
6608{
6609 SDL_UploadToGPUTexture(copy_pass, &source, &destination, cycle);
6610}
6611
6613 const GPUTextureRegion& destination,
6614 bool cycle)
6615{
6616 SDL::UploadToGPUTexture(m_gPUCopyPass, source, destination, cycle);
6617}
6618
6633inline void UploadToGPUBuffer(GPUCopyPass copy_pass,
6634 const GPUTransferBufferLocation& source,
6635 const GPUBufferRegion& destination,
6636 bool cycle)
6637{
6638 SDL_UploadToGPUBuffer(copy_pass, &source, &destination, cycle);
6639}
6640
6642 const GPUBufferRegion& destination,
6643 bool cycle)
6644{
6645 SDL::UploadToGPUBuffer(m_gPUCopyPass, source, destination, cycle);
6646}
6647
6666 const GPUTextureLocation& source,
6667 const GPUTextureLocation& destination,
6668 Uint32 w,
6669 Uint32 h,
6670 Uint32 d,
6671 bool cycle)
6672{
6673 SDL_CopyGPUTextureToTexture(copy_pass, &source, &destination, w, h, d, cycle);
6674}
6675
6677 const GPUTextureLocation& source,
6678 const GPUTextureLocation& destination,
6679 Uint32 w,
6680 Uint32 h,
6681 Uint32 d,
6682 bool cycle)
6683{
6685 m_gPUCopyPass, source, destination, w, h, d, cycle);
6686}
6687
6704 const GPUBufferLocation& source,
6705 const GPUBufferLocation& destination,
6706 Uint32 size,
6707 bool cycle)
6708{
6709 SDL_CopyGPUBufferToBuffer(copy_pass, &source, &destination, size, cycle);
6710}
6711
6713 const GPUBufferLocation& source,
6714 const GPUBufferLocation& destination,
6715 Uint32 size,
6716 bool cycle)
6717{
6718 SDL::CopyGPUBufferToBuffer(m_gPUCopyPass, source, destination, size, cycle);
6719}
6720
6735 const GPUTextureRegion& source,
6736 const GPUTextureTransferInfo& destination)
6737{
6738 SDL_DownloadFromGPUTexture(copy_pass, &source, &destination);
6739}
6740
6742 const GPUTextureRegion& source,
6743 const GPUTextureTransferInfo& destination)
6744{
6745 SDL::DownloadFromGPUTexture(m_gPUCopyPass, source, destination);
6746}
6747
6761 const GPUBufferRegion& source,
6762 const GPUTransferBufferLocation& destination)
6763{
6764 SDL_DownloadFromGPUBuffer(copy_pass, &source, &destination);
6765}
6766
6768 const GPUBufferRegion& source,
6769 const GPUTransferBufferLocation& destination)
6770{
6771 SDL::DownloadFromGPUBuffer(m_gPUCopyPass, source, destination);
6772}
6773
6781inline void EndGPUCopyPass(GPUCopyPass copy_pass)
6782{
6783 SDL_EndGPUCopyPass(copy_pass);
6784}
6785
6786inline void GPUCopyPass::End() { SDL::EndGPUCopyPass(m_gPUCopyPass); }
6787
6799 GPUTexture texture)
6800{
6801 SDL_GenerateMipmapsForGPUTexture(command_buffer, texture);
6802}
6803
6805{
6806 SDL::GenerateMipmapsForGPUTexture(m_gPUCommandBuffer, texture);
6807}
6808
6819inline void BlitGPUTexture(GPUCommandBuffer command_buffer,
6820 const GPUBlitInfo& info)
6821{
6822 SDL_BlitGPUTexture(command_buffer, &info);
6823}
6824
6826{
6827 SDL::BlitGPUTexture(m_gPUCommandBuffer, info);
6828}
6829
6845 GPUDeviceParam device,
6846 WindowParam window,
6847 GPUSwapchainComposition swapchain_composition)
6848{
6849 return SDL_WindowSupportsGPUSwapchainComposition(
6850 device, window, swapchain_composition);
6851}
6852
6854 WindowParam window,
6855 GPUSwapchainComposition swapchain_composition)
6856{
6858 m_resource, window, swapchain_composition);
6859}
6860
6876 WindowParam window,
6877 GPUPresentMode present_mode)
6878{
6879 return SDL_WindowSupportsGPUPresentMode(device, window, present_mode);
6880}
6881
6883 GPUPresentMode present_mode)
6884{
6885 return SDL::WindowSupportsGPUPresentMode(m_resource, window, present_mode);
6886}
6887
6914{
6915 CheckError(SDL_ClaimWindowForGPUDevice(device, window));
6916}
6917
6919{
6920 SDL::ClaimWindowForGPUDevice(m_resource, window);
6921}
6922
6934 WindowParam window)
6935{
6936 SDL_ReleaseWindowFromGPUDevice(device, window);
6937}
6938
6940{
6941 SDL::ReleaseWindowFromGPUDevice(m_resource, window);
6942}
6943
6967 GPUDeviceParam device,
6968 WindowParam window,
6969 GPUSwapchainComposition swapchain_composition,
6970 GPUPresentMode present_mode)
6971{
6972 return SDL_SetGPUSwapchainParameters(
6973 device, window, swapchain_composition, present_mode);
6974}
6975
6977 WindowParam window,
6978 GPUSwapchainComposition swapchain_composition,
6979 GPUPresentMode present_mode)
6980{
6982 m_resource, window, swapchain_composition, present_mode);
6983}
6984
7011 Uint32 allowed_frames_in_flight)
7012{
7013 return SDL_SetGPUAllowedFramesInFlight(device, allowed_frames_in_flight);
7014}
7015
7016inline bool GPUDevice::SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight)
7017{
7018 return SDL::SetGPUAllowedFramesInFlight(m_resource, allowed_frames_in_flight);
7019}
7020
7033 WindowParam window)
7034{
7035 return SDL_GetGPUSwapchainTextureFormat(device, window);
7036}
7037
7039{
7040 return SDL::GetGPUSwapchainTextureFormat(m_resource, window);
7041}
7042
7088 GPUCommandBuffer command_buffer,
7089 WindowParam window,
7090 Uint32* swapchain_texture_width = nullptr,
7091 Uint32* swapchain_texture_height = nullptr)
7092{
7093 GPUTextureRaw texture;
7094 CheckError(SDL_AcquireGPUSwapchainTexture(command_buffer,
7095 window,
7096 &texture,
7097 swapchain_texture_width,
7098 swapchain_texture_height));
7099 return texture;
7100}
7101
7103 WindowParam window,
7104 Uint32* swapchain_texture_width,
7105 Uint32* swapchain_texture_height)
7106{
7107 return SDL::AcquireGPUSwapchainTexture(m_gPUCommandBuffer,
7108 window,
7109 swapchain_texture_width,
7110 swapchain_texture_height);
7111}
7112
7130{
7131 CheckError(SDL_WaitForGPUSwapchain(device, window));
7132}
7133
7135{
7136 SDL::WaitForGPUSwapchain(m_resource, window);
7137}
7138
7180 GPUCommandBuffer command_buffer,
7181 WindowParam window,
7182 Uint32* swapchain_texture_width = nullptr,
7183 Uint32* swapchain_texture_height = nullptr)
7184{
7185 GPUTextureRaw texture;
7186 CheckError(SDL_WaitAndAcquireGPUSwapchainTexture(command_buffer,
7187 window,
7188 &texture,
7189 swapchain_texture_width,
7190 swapchain_texture_height));
7191 return texture;
7192}
7193
7195 WindowParam window,
7196 Uint32* swapchain_texture_width,
7197 Uint32* swapchain_texture_height)
7198{
7199 return SDL::WaitAndAcquireGPUSwapchainTexture(m_gPUCommandBuffer,
7200 window,
7201 swapchain_texture_width,
7202 swapchain_texture_height);
7203}
7204
7225inline void SubmitGPUCommandBuffer(GPUCommandBuffer command_buffer)
7226{
7227 CheckError(SDL_SubmitGPUCommandBuffer(command_buffer));
7228}
7229
7231{
7232 SDL::SubmitGPUCommandBuffer(m_gPUCommandBuffer);
7233}
7234
7260 GPUCommandBuffer command_buffer)
7261{
7262 return SDL_SubmitGPUCommandBufferAndAcquireFence(command_buffer);
7263}
7264
7266{
7267 return SDL::SubmitGPUCommandBufferAndAcquireFence(m_gPUCommandBuffer);
7268}
7269
7291inline void CancelGPUCommandBuffer(GPUCommandBuffer command_buffer)
7292{
7293 CheckError(SDL_CancelGPUCommandBuffer(command_buffer));
7294}
7295
7297{
7298 SDL::CancelGPUCommandBuffer(m_gPUCommandBuffer);
7299}
7300
7312{
7313 CheckError(SDL_WaitForGPUIdle(device));
7314}
7315
7316inline void GPUDevice::WaitForIdle() { SDL::WaitForGPUIdle(m_resource); }
7317
7333 bool wait_all,
7334 std::span<GPUFence* const> fences)
7335{
7336 CheckError(
7337 SDL_WaitForGPUFences(device, wait_all, fences.data(), fences.size()));
7338}
7339
7340inline void GPUDevice::WaitForFences(bool wait_all,
7341 std::span<GPUFence* const> fences)
7342{
7343 SDL::WaitForGPUFences(m_resource, wait_all, fences);
7344}
7345
7357inline bool QueryGPUFence(GPUDeviceParam device, GPUFence* fence)
7358{
7359 return SDL_QueryGPUFence(device, fence);
7360}
7361
7363{
7364 return SDL::QueryGPUFence(m_resource, fence);
7365}
7366
7379inline void ReleaseGPUFence(GPUDeviceParam device, GPUFence* fence)
7380{
7381 SDL_ReleaseGPUFence(device, fence);
7382}
7383
7385{
7386 SDL::ReleaseGPUFence(m_resource, fence);
7387}
7388
7400{
7401 return SDL_GPUTextureFormatTexelBlockSize(format);
7402}
7403
7416 GPUTextureFormat format,
7417 GPUTextureType type,
7419{
7420 return SDL_GPUTextureSupportsFormat(device, format, type, usage);
7421}
7422
7424 GPUTextureType type,
7426{
7427 return SDL::GPUTextureSupportsFormat(m_resource, format, type, usage);
7428}
7429
7441 GPUTextureFormat format,
7442 GPUSampleCount sample_count)
7443{
7444 return SDL_GPUTextureSupportsSampleCount(device, format, sample_count);
7445}
7446
7448 GPUSampleCount sample_count)
7449{
7450 return SDL::GPUTextureSupportsSampleCount(m_resource, format, sample_count);
7451}
7452
7465 Uint32 width,
7466 Uint32 height,
7467 Uint32 depth_or_layer_count)
7468{
7469 return SDL_CalculateGPUTextureFormatSize(
7470 format, width, height, depth_or_layer_count);
7471}
7472
7473#ifdef SDL_PLATFORM_GDK
7474
7488inline void GDKSuspendGPU(GPUDeviceParam device) { SDL_GDKSuspendGPU(device); }
7489
7490inline void GPUDevice::GDKSuspendGPU() { SDL::GDKSuspendGPU(m_resource); }
7491
7505inline void GDKResumeGPU(GPUDeviceParam device) { SDL_GDKResumeGPU(device); }
7506
7507inline void GPUDevice::GDKResumeGPU() { SDL::GDKResumeGPU(m_resource); }
7508
7509#endif /* SDL_PLATFORM_GDK */
7510
7512
7513} // namespace SDL
7514
7515#endif /* SDL3PP_GPU_H_ */
An opaque handle representing a buffer.
Definition: SDL3pp_gpu.h:434
GPUBuffer(GPUDeviceParam device, const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:491
constexpr GPUBuffer(GPUBufferRaw gPUBuffer={})
Wraps GPUBuffer.
Definition: SDL3pp_gpu.h:443
An opaque handle representing a command buffer.
Definition: SDL3pp_gpu.h:1969
constexpr GPUCommandBuffer(GPUCommandBufferRaw gPUCommandBuffer={})
Wraps GPUCommandBuffer.
Definition: SDL3pp_gpu.h:1978
An opaque handle representing a compute pass.
Definition: SDL3pp_gpu.h:1464
constexpr GPUComputePass(GPUComputePassRaw gPUComputePass={})
Wraps GPUComputePass.
Definition: SDL3pp_gpu.h:1473
An opaque handle representing a compute pipeline.
Definition: SDL3pp_gpu.h:923
constexpr GPUComputePipeline(GPUComputePipelineRaw gPUComputePipeline={})
Wraps GPUComputePipeline.
Definition: SDL3pp_gpu.h:932
GPUComputePipeline(GPUDeviceParam device, const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:982
An opaque handle representing a copy pass.
Definition: SDL3pp_gpu.h:1684
constexpr GPUCopyPass(GPUCopyPassRaw gPUCopyPass={})
Wraps GPUCopyPass.
Definition: SDL3pp_gpu.h:1693
An opaque handle representing the SDL_GPU context.
Definition: SDL3pp_gpu.h:2953
GPUDevice(PropertiesParam props)
Creates a GPU context.
Definition: SDL3pp_gpu.h:3052
constexpr auto operator<=>(const GPUDevice &other) const =default
Comparison.
GPUDevice & operator=(GPUDevice other)
Assignment operator.
Definition: SDL3pp_gpu.h:3061
~GPUDevice()
Destructor.
Definition: SDL3pp_gpu.h:3058
constexpr GPUDevice(const GPUDevice &other)=delete
Copy constructor.
constexpr GPUDevice(const GPUDeviceRaw resource)
Constructs from GPUDeviceParam.
Definition: SDL3pp_gpu.h:2967
constexpr bool operator==(std::nullptr_t _) const
Comparison.
Definition: SDL3pp_gpu.h:3082
GPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
Creates a GPU context.
Definition: SDL3pp_gpu.h:3003
constexpr GPUDeviceRaw release()
Retrieves underlying GPUDeviceRaw and clear this.
Definition: SDL3pp_gpu.h:3071
constexpr GPUDevice()=default
Default ctor.
constexpr GPUDeviceRaw get() const
Retrieves underlying GPUDeviceRaw.
Definition: SDL3pp_gpu.h:3068
constexpr GPUDevice(GPUDevice &&other)
Move constructor.
Definition: SDL3pp_gpu.h:2976
An opaque handle representing a graphics pipeline.
Definition: SDL3pp_gpu.h:1028
constexpr GPUGraphicsPipeline(GPUGraphicsPipelineRaw gPUGraphicsPipeline={})
Wraps GPUGraphicsPipeline.
Definition: SDL3pp_gpu.h:1037
GPUGraphicsPipeline(GPUDeviceParam device, const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:1063
An opaque handle representing a render pass.
Definition: SDL3pp_gpu.h:1137
constexpr GPURenderPass(GPURenderPassRaw gPURenderPass={})
Wraps GPURenderPass.
Definition: SDL3pp_gpu.h:1146
An opaque handle representing a sampler.
Definition: SDL3pp_gpu.h:734
constexpr GPUSampler(GPUSamplerRaw gPUSampler={})
Wraps GPUSampler.
Definition: SDL3pp_gpu.h:743
GPUSampler(GPUDeviceParam device, const GPUSamplerCreateInfo &createinfo)
Creates a sampler object to be used when binding textures in a graphics workflow.
Definition: SDL3pp_gpu.h:769
An opaque handle representing a compiled shader object.
Definition: SDL3pp_gpu.h:801
GPUShader(GPUDeviceParam device, const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:888
constexpr GPUShader(GPUShaderRaw gPUShader={})
Wraps GPUShader.
Definition: SDL3pp_gpu.h:810
An opaque handle representing a texture.
Definition: SDL3pp_gpu.h:625
GPUTexture(GPUDeviceParam device, const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:694
constexpr GPUTexture(GPUTextureRaw gPUTexture={})
Wraps GPUTexture.
Definition: SDL3pp_gpu.h:634
An opaque handle representing a transfer buffer.
Definition: SDL3pp_gpu.h:530
constexpr GPUTransferBuffer(GPUTransferBufferRaw gPUTransferBuffer={})
Wraps GPUTransferBuffer.
Definition: SDL3pp_gpu.h:539
GPUTransferBuffer(GPUDeviceParam device, const GPUTransferBufferCreateInfo &createinfo)
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Definition: SDL3pp_gpu.h:571
Optional-like shim for references.
Definition: SDL3pp_optionalRef.h:20
Source byte stream.
Definition: SDL3pp_strings.h:239
constexpr size_t size_bytes() const
Retrieves contained size in bytes.
Definition: SDL3pp_strings.h:303
constexpr const char * data() const
Retrieves contained data.
Definition: SDL3pp_strings.h:306
span-like for empty-derived structs
Definition: SDL3pp_spanRef.h:24
constexpr T * data() const
Retrieves contained data.
Definition: SDL3pp_spanRef.h:75
constexpr size_t size() const
Retrieves contained size.
Definition: SDL3pp_spanRef.h:69
Helpers to use C++ strings parameters.
Definition: SDL3pp_strings.h:43
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition: SDL3pp_error.h:197
void Destroy()
Destroys a GPU context previously returned by GPUDevice.GPUDevice.
Definition: SDL3pp_gpu.h:4793
SDL_GPUDepthStencilState GPUDepthStencilState
A structure specifying the parameters of the graphics pipeline depth stencil state.
Definition: SDL3pp_gpu.h:4615
GPUShaderFormat GetGPUShaderFormats(GPUDeviceParam device)
Returns the supported shader formats for this GPU context.
Definition: SDL3pp_gpu.h:4852
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT
GPU_VERTEXELEMENTFORMAT_UINT.
Definition: SDL3pp_gpu.h:4079
constexpr GPUShaderFormat GPU_SHADERFORMAT_DXIL
DXIL SM6_0 shaders for D3D12.
Definition: SDL3pp_gpu.h:2361
GPUTransferBuffer CreateGPUTransferBuffer(GPUDeviceParam device, const GPUTransferBufferCreateInfo &createinfo)
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Definition: SDL3pp_gpu.h:5276
void Dispatch(Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z)
Dispatches compute work.
Definition: SDL3pp_gpu.h:6464
void PushComputeUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5687
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2802
constexpr GPUFillMode GPU_FILLMODE_FILL
Polygons will be rendered via rasterization.
Definition: SDL3pp_gpu.h:4183
constexpr GPUShaderFormat GPU_SHADERFORMAT_PRIVATE
Shaders for NDA'd platforms.
Definition: SDL3pp_gpu.h:2352
SDL_GPUTexture * GPUTextureRaw
Alias to raw representation for GPUTexture.
Definition: SDL3pp_gpu.h:346
constexpr GPUCompareOp GPU_COMPAREOP_LESS_OR_EQUAL
The comparison evaluates reference <= test.
Definition: SDL3pp_gpu.h:4248
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084.
Definition: SDL3pp_gpu.h:2406
const char * GetDriver()
Returns the name of the backend used to create this GPU context.
Definition: SDL3pp_gpu.h:4838
int GetNumGPUDrivers()
Get the number of GPU drivers compiled into SDL.
Definition: SDL3pp_gpu.h:4804
void PushGPUFragmentUniformData(GPUCommandBuffer command_buffer, Uint32 slot_index, SourceBytes data)
Pushes data to a fragment uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5649
GPUTexture WaitAndAcquireGPUSwapchainTexture(GPUCommandBuffer command_buffer, WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr)
Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
Definition: SDL3pp_gpu.h:7179
constexpr GPUIndexElementSize GPU_INDEXELEMENTSIZE_32BIT
The index elements are 32-bit.
Definition: SDL3pp_gpu.h:1112
SDL_GPUTextureRegion GPUTextureRegion
A structure specifying a region of a texture.
Definition: SDL3pp_gpu.h:1647
void BindGPUFragmentStorageTextures(GPURenderPass render_pass, Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the fragment shader.
Definition: SDL3pp_gpu.h:6038
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT.
Definition: SDL3pp_gpu.h:2817
constexpr GPUStencilOp GPU_STENCILOP_ZERO
Sets the value to 0.
Definition: SDL3pp_gpu.h:4281
constexpr GPUCompareOp GPU_COMPAREOP_ALWAYS
The comparison always evaluates true.
Definition: SDL3pp_gpu.h:4262
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_UNORM
GPU_TEXTUREFORMAT_R8_UNORM.
Definition: SDL3pp_gpu.h:2538
constexpr GPUBlendOp GPU_BLENDOP_MIN
min(source, destination)
Definition: SDL3pp_gpu.h:4332
SDL_GPUVertexAttribute GPUVertexAttribute
A structure specifying a vertex attribute.
Definition: SDL3pp_gpu.h:4547
GPUTexture AcquireGPUSwapchainTexture(GPUCommandBuffer command_buffer, WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr)
Acquire a texture to use in presentation.
Definition: SDL3pp_gpu.h:7087
void DrawGPUIndexedPrimitivesIndirect(GPURenderPass render_pass, GPUBuffer buffer, Uint32 offset, Uint32 draw_count)
Draws data using bound graphics state with an index buffer enabled and with draw parameters set from ...
Definition: SDL3pp_gpu.h:6227
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT2
GPU_VERTEXELEMENTFORMAT_FLOAT2.
Definition: SDL3pp_gpu.h:4094
void WaitForFences(bool wait_all, std::span< GPUFence *const > fences)
Blocks the thread until the given fences are signaled.
Definition: SDL3pp_gpu.h:7340
void CopyGPUTextureToTexture(GPUCopyPass copy_pass, const GPUTextureLocation &source, const GPUTextureLocation &destination, Uint32 w, Uint32 h, Uint32 d, bool cycle)
Performs a texture-to-texture copy.
Definition: SDL3pp_gpu.h:6665
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_FLOAT
GPU_TEXTUREFORMAT_R32G32_FLOAT.
Definition: SDL3pp_gpu.h:2625
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE
Texture supports reads and writes in the same compute shader.
Definition: SDL3pp_gpu.h:2920
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT2_NORM
GPU_VERTEXELEMENTFORMAT_USHORT2_NORM.
Definition: SDL3pp_gpu.h:4145
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_INT
GPU_TEXTUREFORMAT_R8G8_INT.
Definition: SDL3pp_gpu.h:2664
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_UNORM
GPU_TEXTUREFORMAT_ASTC_6x6_UNORM.
Definition: SDL3pp_gpu.h:2733
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_INT
GPU_TEXTUREFORMAT_R16G16B16A16_INT.
Definition: SDL3pp_gpu.h:2676
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_UNORM
GPU_TEXTUREFORMAT_ASTC_12x12_UNORM.
Definition: SDL3pp_gpu.h:2760
void BlitGPUTexture(GPUCommandBuffer command_buffer, const GPUBlitInfo &info)
Blits from a source texture region to a destination texture region.
Definition: SDL3pp_gpu.h:6819
GPUFence * SubmitGPUCommandBufferAndAcquireFence(GPUCommandBuffer command_buffer)
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated...
Definition: SDL3pp_gpu.h:7259
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT
GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT.
Definition: SDL3pp_gpu.h:2805
constexpr GPUStencilOp GPU_STENCILOP_INVERT
Bitwise-inverts the current value.
Definition: SDL3pp_gpu.h:4295
constexpr GPUFrontFace GPU_FRONTFACE_CLOCKWISE
A triangle with clockwise vertex winding will be considered front-facing.
Definition: SDL3pp_gpu.h:4225
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D32_FLOAT
GPU_TEXTUREFORMAT_D32_FLOAT.
Definition: SDL3pp_gpu.h:2712
bool SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight)
Configures the maximum allowed number of frames in flight.
Definition: SDL3pp_gpu.h:7016
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT3
GPU_VERTEXELEMENTFORMAT_FLOAT3.
Definition: SDL3pp_gpu.h:4097
constexpr GPUCompareOp GPU_COMPAREOP_GREATER_OR_EQUAL
The comparison evaluates reference >= test.
Definition: SDL3pp_gpu.h:4258
void ReleaseShader(GPUShader shader)
Frees the given shader as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5543
void ReleaseTransferBuffer(GPUTransferBuffer transfer_buffer)
Frees the given transfer buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5501
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT.
Definition: SDL3pp_gpu.h:2823
void DrawIndexedPrimitives(Uint32 num_indices, Uint32 num_instances, Uint32 first_index, Sint32 vertex_offset, Uint32 first_instance)
Draws data using bound graphics state with an index buffer and instancing enabled.
Definition: SDL3pp_gpu.h:6127
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE2
GPU_VERTEXELEMENTFORMAT_UBYTE2.
Definition: SDL3pp_gpu.h:4109
void BindGPUVertexStorageTextures(GPURenderPass render_pass, Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the vertex shader.
Definition: SDL3pp_gpu.h:5935
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_LINELIST
A series of separate lines.
Definition: SDL3pp_gpu.h:3890
GPUSampler CreateSampler(const GPUSamplerCreateInfo &createinfo)
Creates a sampler object to be used when binding textures in a graphics workflow.
Definition: SDL3pp_gpu.h:4995
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT4_NORM
GPU_VERTEXELEMENTFORMAT_USHORT4_NORM.
Definition: SDL3pp_gpu.h:4148
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_UINT
GPU_TEXTUREFORMAT_R32_UINT.
Definition: SDL3pp_gpu.h:2652
void PushGPUDebugGroup(GPUCommandBuffer command_buffer, StringParam name)
Begins a debug group with an arbitrary name.
Definition: SDL3pp_gpu.h:5396
void ReleaseGPUSampler(GPUDeviceParam device, GPUSampler sampler)
Frees the given sampler as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5455
bool GPUTextureSupportsSampleCount(GPUDeviceParam device, GPUTextureFormat format, GPUSampleCount sample_count)
Determines if a sample count for a texture format is supported.
Definition: SDL3pp_gpu.h:7440
void * MapTransferBuffer(GPUTransferBuffer transfer_buffer, bool cycle)
Maps a transfer buffer into application address space.
Definition: SDL3pp_gpu.h:6540
void SetGPUBufferName(GPUDeviceParam device, GPUBuffer buffer, StringParam text)
Sets an arbitrary string constant to label a buffer.
Definition: SDL3pp_gpu.h:5313
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_UNORM
GPU_TEXTUREFORMAT_ASTC_8x6_UNORM.
Definition: SDL3pp_gpu.h:2739
void SetGPUViewport(GPURenderPass render_pass, const GPUViewport &viewport)
Sets the current viewport state on a command buffer.
Definition: SDL3pp_gpu.h:5765
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
1 - blend constant
Definition: SDL3pp_gpu.h:4385
GPUComputePipeline CreateComputePipeline(const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:4914
void SetScissor(const RectRaw &scissor)
Sets the current scissor state on a command buffer.
Definition: SDL3pp_gpu.h:5789
bool TextureSupportsFormat(GPUTextureFormat format, GPUTextureType type, GPUTextureUsageFlags usage)
Determines whether a texture format is supported for a given type and usage.
Definition: SDL3pp_gpu.h:7423
constexpr GPUCompareOp GPU_COMPAREOP_NOT_EQUAL
The comparison evaluates reference != test.
Definition: SDL3pp_gpu.h:4255
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT2
GPU_VERTEXELEMENTFORMAT_USHORT2.
Definition: SDL3pp_gpu.h:4133
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_UNORM
GPU_TEXTUREFORMAT_R16G16B16A16_UNORM.
Definition: SDL3pp_gpu.h:2553
SDL_GPUColorTargetInfo GPUColorTargetInfo
A structure specifying the parameters of a color target used by a render pass.
Definition: SDL3pp_gpu.h:1856
SDL_GPUCommandBuffer * GPUCommandBufferRaw
Alias to raw representation for GPUCommandBuffer.
Definition: SDL3pp_gpu.h:376
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_UINT
GPU_TEXTUREFORMAT_R16G16_UINT.
Definition: SDL3pp_gpu.h:2646
SDL_GPUCompareOp GPUCompareOp
Specifies a comparison operator for depth, stencil and sampler operations.
Definition: SDL3pp_gpu.h:4234
void CancelGPUCommandBuffer(GPUCommandBuffer command_buffer)
Cancels a command buffer.
Definition: SDL3pp_gpu.h:7291
SDL_GPUDepthStencilTargetInfo GPUDepthStencilTargetInfo
A structure specifying the parameters of a depth-stencil target used by a render pass.
Definition: SDL3pp_gpu.h:1902
SDL_GPUBlendOp GPUBlendOp
Specifies the operator to be used when pixels in a render target are blended with existing pixels in ...
Definition: SDL3pp_gpu.h:4317
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_UNORM
GPU_TEXTUREFORMAT_ASTC_10x8_UNORM.
Definition: SDL3pp_gpu.h:2751
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_TRIANGLELIST
A series of separate triangles.
Definition: SDL3pp_gpu.h:3884
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_A8_UNORM
GPU_TEXTUREFORMAT_A8_UNORM.
Definition: SDL3pp_gpu.h:2535
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT4
GPU_VERTEXELEMENTFORMAT_INT4.
Definition: SDL3pp_gpu.h:4076
SDL_GPUGraphicsPipelineTargetInfo GPUGraphicsPipelineTargetInfo
A structure specifying the descriptions of render targets used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4637
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT.
Definition: SDL3pp_gpu.h:2811
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_FLOAT
GPU_TEXTUREFORMAT_R32_FLOAT.
Definition: SDL3pp_gpu.h:2622
constexpr GPUStoreOp GPU_STOREOP_RESOLVE
The multisample contents generated during the render pass will be resolved to a non-multisample textu...
Definition: SDL3pp_gpu.h:3945
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
Specifies that the coordinates will clamp to the 0-1 range.
Definition: SDL3pp_gpu.h:4462
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_UNORM
GPU_TEXTUREFORMAT_R16G16_UNORM.
Definition: SDL3pp_gpu.h:2550
SDL_GPUGraphicsPipeline * GPUGraphicsPipelineRaw
Alias to raw representation for GPUGraphicsPipeline.
Definition: SDL3pp_gpu.h:370
void DrawGPUPrimitives(GPURenderPass render_pass, Uint32 num_vertices, Uint32 num_instances, Uint32 first_vertex, Uint32 first_instance)
Draws data using bound graphics state.
Definition: SDL3pp_gpu.h:6161
Uint32 GPUBufferUsageFlags
Specifies how a buffer is intended to be used by the client.
Definition: SDL3pp_gpu.h:3999
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2781
void BindSamplers(Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the compute shader.
Definition: SDL3pp_gpu.h:6359
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT.
Definition: SDL3pp_gpu.h:2814
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC1_RGBA_UNORM
GPU_TEXTUREFORMAT_BC1_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2571
void BlitTexture(const GPUBlitInfo &info)
Blits from a source texture region to a destination texture region.
Definition: SDL3pp_gpu.h:6825
void DownloadFromTexture(const GPUTextureRegion &source, const GPUTextureTransferInfo &destination)
Copies data from a texture to a transfer buffer on the GPU timeline.
Definition: SDL3pp_gpu.h:6741
void BindFragmentSamplers(Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the fragment shader.
Definition: SDL3pp_gpu.h:6013
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_UINT
GPU_TEXTUREFORMAT_R32G32_UINT.
Definition: SDL3pp_gpu.h:2655
void BindGPUIndexBuffer(GPURenderPass render_pass, const GPUBufferBinding &binding, GPUIndexElementSize index_element_size)
Binds an index buffer on a command buffer for use with subsequent draw calls.
Definition: SDL3pp_gpu.h:5869
SDL_GPUSampler * GPUSamplerRaw
Alias to raw representation for GPUSampler.
Definition: SDL3pp_gpu.h:352
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC3_RGBA_UNORM
GPU_TEXTUREFORMAT_BC3_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2577
void SetGPUTextureName(GPUDeviceParam device, GPUTexture texture, StringParam text)
Sets an arbitrary string constant to label a texture.
Definition: SDL3pp_gpu.h:5342
bool GPUTextureSupportsFormat(GPUDeviceParam device, GPUTextureFormat format, GPUTextureType type, GPUTextureUsageFlags usage)
Determines whether a texture format is supported for a given type and usage.
Definition: SDL3pp_gpu.h:7415
Uint32 GPUTextureFormatTexelBlockSize(GPUTextureFormat format)
Obtains the texel block size for a texture format.
Definition: SDL3pp_gpu.h:7399
SDL_GPUColorTargetDescription GPUColorTargetDescription
A structure specifying the parameters of color targets used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4625
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ
Texture supports storage reads in graphics stages.
Definition: SDL3pp_gpu.h:2903
void BindStorageBuffers(Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers as readonly for use on the compute pipeline.
Definition: SDL3pp_gpu.h:6427
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT2
GPU_VERTEXELEMENTFORMAT_SHORT2.
Definition: SDL3pp_gpu.h:4127
void ReleaseGPUFence(GPUDeviceParam device, GPUFence *fence)
Releases a fence obtained from GPUCommandBuffer.SubmitAndAcquireFence.
Definition: SDL3pp_gpu.h:7379
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_SNORM
GPU_TEXTUREFORMAT_R8_SNORM.
Definition: SDL3pp_gpu.h:2595
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_SAMPLER
Texture supports sampling.
Definition: SDL3pp_gpu.h:2893
GPUCommandBuffer AcquireCommandBuffer()
Acquire a command buffer.
Definition: SDL3pp_gpu.h:5599
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2793
void Cancel()
Cancels a command buffer.
Definition: SDL3pp_gpu.h:7296
void ClaimWindowForGPUDevice(GPUDeviceParam device, WindowParam window)
Claims a window, creating a swapchain structure for it.
Definition: SDL3pp_gpu.h:6913
SDL_GPUIndirectDispatchCommand GPUIndirectDispatchCommand
A structure specifying the parameters of an indexed dispatch command.
Definition: SDL3pp_gpu.h:4513
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_A
the alpha component
Definition: SDL3pp_gpu.h:4410
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE
Buffer supports storage writes in the compute stage.
Definition: SDL3pp_gpu.h:4019
constexpr GPUSamplerMipmapMode GPU_SAMPLERMIPMAPMODE_LINEAR
Linear filtering.
Definition: SDL3pp_gpu.h:4440
constexpr GPUShaderFormat GPU_SHADERFORMAT_DXBC
DXBC SM5_1 shaders for D3D12.
Definition: SDL3pp_gpu.h:2358
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT.
Definition: SDL3pp_gpu.h:2832
void SetStencilReference(Uint8 reference)
Sets the current stencil reference value on a command buffer.
Definition: SDL3pp_gpu.h:5829
void ReleaseGPUComputePipeline(GPUDeviceParam device, GPUComputePipeline compute_pipeline)
Frees the given compute pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5516
SDL_GPUVertexBufferDescription GPUVertexBufferDescription
A structure specifying the parameters of vertex buffers used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4533
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R11G11B10_UFLOAT
GPU_TEXTUREFORMAT_R11G11B10_UFLOAT.
Definition: SDL3pp_gpu.h:2631
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COLOR_TARGET
Texture is a color render target.
Definition: SDL3pp_gpu.h:2896
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT
GPU_VERTEXELEMENTFORMAT_INT.
Definition: SDL3pp_gpu.h:4067
constexpr GPUStencilOp GPU_STENCILOP_REPLACE
Sets the value to reference.
Definition: SDL3pp_gpu.h:4284
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_INT
GPU_TEXTUREFORMAT_R16_INT.
Definition: SDL3pp_gpu.h:2670
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT
GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT.
Definition: SDL3pp_gpu.h:2715
void BindFragmentStorageTextures(Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the fragment shader.
Definition: SDL3pp_gpu.h:6047
SDL_GPUMultisampleState GPUMultisampleState
A structure specifying the parameters of the graphics pipeline multisample state.
Definition: SDL3pp_gpu.h:4605
bool QueryFence(GPUFence *fence)
Checks the status of a fence.
Definition: SDL3pp_gpu.h:7362
void UploadToBuffer(const GPUTransferBufferLocation &source, const GPUBufferRegion &destination, bool cycle)
Uploads data from a transfer buffer to a buffer.
Definition: SDL3pp_gpu.h:6641
SDL_GPUIndexedIndirectDrawCommand GPUIndexedIndirectDrawCommand
A structure specifying the parameters of an indexed indirect draw command.
Definition: SDL3pp_gpu.h:4504
constexpr GPUBlendFactor GPU_BLENDFACTOR_DST_COLOR
destination color
Definition: SDL3pp_gpu.h:4364
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT
GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT.
Definition: SDL3pp_gpu.h:2619
void ReleaseComputePipeline(GPUComputePipeline compute_pipeline)
Frees the given compute pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5522
void BindVertexSamplers(Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the vertex shader.
Definition: SDL3pp_gpu.h:5910
void DrawPrimitivesIndirect(GPUBuffer buffer, Uint32 offset, Uint32 draw_count)
Draws data using bound graphics state and with draw parameters set from a buffer.
Definition: SDL3pp_gpu.h:6204
void ReleaseWindowFromGPUDevice(GPUDeviceParam device, WindowParam window)
Unclaims a window, destroying its swapchain structure.
Definition: SDL3pp_gpu.h:6933
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT4
GPU_VERTEXELEMENTFORMAT_FLOAT4.
Definition: SDL3pp_gpu.h:4100
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT.
Definition: SDL3pp_gpu.h:2838
SDL_GPUBlendFactor GPUBlendFactor
Specifies a blending factor to be used when pixels in a render target are blended with existing pixel...
Definition: SDL3pp_gpu.h:4349
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2772
GPUBuffer CreateBuffer(const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5238
bool QueryGPUFence(GPUDeviceParam device, GPUFence *fence)
Checks the status of a fence.
Definition: SDL3pp_gpu.h:7357
GPUCopyPass BeginCopyPass()
Begins a copy pass on a command buffer.
Definition: SDL3pp_gpu.h:6582
SDL_GPUSampleCount GPUSampleCount
Specifies the sample count of a texture.
Definition: SDL3pp_gpu.h:2934
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT.
Definition: SDL3pp_gpu.h:2835
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_INT
GPU_TEXTUREFORMAT_R32G32_INT.
Definition: SDL3pp_gpu.h:2682
constexpr GPUBlendOp GPU_BLENDOP_INVALID
GPU_BLENDOP_INVALID.
Definition: SDL3pp_gpu.h:4319
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR
GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR.
Definition: SDL3pp_gpu.h:2403
GPURenderPass BeginGPURenderPass(GPUCommandBuffer command_buffer, std::span< const GPUColorTargetInfo > color_target_infos, OptionalRef< const GPUDepthStencilTargetInfo > depth_stencil_target_info)
Begins a render pass on a command buffer.
Definition: SDL3pp_gpu.h:5717
SDL_GPUFillMode GPUFillMode
Specifies the fill mode of the graphics pipeline.
Definition: SDL3pp_gpu.h:4181
SDL_GPUColorTargetBlendState GPUColorTargetBlendState
A structure specifying the blend state of a color target.
Definition: SDL3pp_gpu.h:4577
void BindVertexStorageTextures(Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the vertex shader.
Definition: SDL3pp_gpu.h:5944
GPUDevice CreateGPUDeviceWithProperties(PropertiesParam props)
Creates a GPU context.
Definition: SDL3pp_gpu.h:4741
void DrawGPUIndexedPrimitives(GPURenderPass render_pass, Uint32 num_indices, Uint32 num_instances, Uint32 first_index, Sint32 vertex_offset, Uint32 first_instance)
Draws data using bound graphics state with an index buffer and instancing enabled.
Definition: SDL3pp_gpu.h:6112
constexpr GPUPresentMode GPU_PRESENTMODE_IMMEDIATE
GPU_PRESENTMODE_IMMEDIATE.
Definition: SDL3pp_gpu.h:2439
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_VERTEX
Buffer is a vertex buffer.
Definition: SDL3pp_gpu.h:4001
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UINT
GPU_TEXTUREFORMAT_R8G8B8A8_UINT.
Definition: SDL3pp_gpu.h:2640
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC4_R_UNORM
GPU_TEXTUREFORMAT_BC4_R_UNORM.
Definition: SDL3pp_gpu.h:2580
void BindGPUVertexSamplers(GPURenderPass render_pass, Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the vertex shader.
Definition: SDL3pp_gpu.h:5899
Uint32 GPUTextureUsageFlags
Specifies how a texture is intended to be used by the client.
Definition: SDL3pp_gpu.h:2891
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ
Buffer supports storage reads in graphics stages.
Definition: SDL3pp_gpu.h:4010
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEZ
GPU_CUBEMAPFACE_POSITIVEZ.
Definition: SDL3pp_gpu.h:3976
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2763
void DispatchIndirect(GPUBuffer buffer, Uint32 offset)
Dispatches compute work with parameters set from a buffer.
Definition: SDL3pp_gpu.h:6496
constexpr GPUCompareOp GPU_COMPAREOP_EQUAL
The comparison evaluates reference == test.
Definition: SDL3pp_gpu.h:4245
SDL_GPUTextureLocation GPUTextureLocation
A structure specifying a location in a texture.
Definition: SDL3pp_gpu.h:1623
SDL_GPUShaderStage GPUShaderStage
Specifies which stage a shader program corresponds to.
Definition: SDL3pp_gpu.h:4047
void SetViewport(const GPUViewport &viewport)
Sets the current viewport state on a command buffer.
Definition: SDL3pp_gpu.h:5771
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT2_NORM
GPU_VERTEXELEMENTFORMAT_SHORT2_NORM.
Definition: SDL3pp_gpu.h:4139
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE4
GPU_VERTEXELEMENTFORMAT_BYTE4.
Definition: SDL3pp_gpu.h:4106
SDL_GPUSamplerMipmapMode GPUSamplerMipmapMode
Specifies a mipmap mode used by a sampler.
Definition: SDL3pp_gpu.h:4435
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR.
Definition: SDL3pp_gpu.h:2400
SDL_GPUGraphicsPipelineCreateInfo GPUGraphicsPipelineCreateInfo
A structure specifying the parameters of a graphics pipeline state.
Definition: SDL3pp_gpu.h:1014
GPUTextureFormat GetSwapchainTextureFormat(WindowParam window)
Obtains the texture format of the swapchain for the given window.
Definition: SDL3pp_gpu.h:7038
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR
1 - source color
Definition: SDL3pp_gpu.h:4361
SDL_GPUTextureType GPUTextureType
Specifies the type of a texture.
Definition: SDL3pp_gpu.h:2854
Uint32 GPUShaderFormat
Specifies the format of shader code.
Definition: SDL3pp_gpu.h:2347
Uint8 GPUColorComponentFlags
Specifies which color components are written in a graphics pipeline.
Definition: SDL3pp_gpu.h:4399
SDL_GPUTextureTransferInfo GPUTextureTransferInfo
A structure specifying parameters related to transferring data to or from a texture.
Definition: SDL3pp_gpu.h:1658
void ReleaseFence(GPUFence *fence)
Releases a fence obtained from GPUCommandBuffer.SubmitAndAcquireFence.
Definition: SDL3pp_gpu.h:7384
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B5G5R5A1_UNORM
GPU_TEXTUREFORMAT_B5G5R5A1_UNORM.
Definition: SDL3pp_gpu.h:2562
GPUGraphicsPipeline CreateGraphicsPipeline(const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:4955
void Submit()
Submits a command buffer so its commands can be processed on the GPU.
Definition: SDL3pp_gpu.h:7230
bool SetGPUSwapchainParameters(GPUDeviceParam device, WindowParam window, GPUSwapchainComposition swapchain_composition, GPUPresentMode present_mode)
Changes the swapchain parameters for the given claimed window.
Definition: SDL3pp_gpu.h:6966
constexpr GPUFilter GPU_FILTER_LINEAR
Linear filtering.
Definition: SDL3pp_gpu.h:4425
void BindGPUComputePipeline(GPUComputePass compute_pass, GPUComputePipeline compute_pipeline)
Binds a compute pipeline on a command buffer for use in compute dispatch.
Definition: SDL3pp_gpu.h:6321
void BindFragmentStorageBuffers(Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the fragment shader.
Definition: SDL3pp_gpu.h:6081
constexpr GPUBlendFactor GPU_BLENDFACTOR_CONSTANT_COLOR
blend constant
Definition: SDL3pp_gpu.h:4382
constexpr GPUVertexInputRate GPU_VERTEXINPUTRATE_VERTEX
Attribute addressing is a function of the vertex index.
Definition: SDL3pp_gpu.h:4167
SDL_GPUPresentMode GPUPresentMode
Specifies the timing that will be used to present swapchain textures to the OS.
Definition: SDL3pp_gpu.h:2434
SDL_GPUBufferBinding GPUBufferBinding
A structure specifying parameters in a buffer binding call.
Definition: SDL3pp_gpu.h:1098
void UnmapTransferBuffer(GPUTransferBuffer transfer_buffer)
Unmaps a previously mapped transfer buffer.
Definition: SDL3pp_gpu.h:6560
void ReleaseSampler(GPUSampler sampler)
Frees the given sampler as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5460
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
GPU_TEXTUREFORMAT_R8G8B8A8_UNORM.
Definition: SDL3pp_gpu.h:2544
SDL_GPUBufferLocation GPUBufferLocation
A structure specifying a location in a buffer.
Definition: SDL3pp_gpu.h:1634
GPUCommandBuffer AcquireGPUCommandBuffer(GPUDeviceParam device)
Acquire a command buffer.
Definition: SDL3pp_gpu.h:5594
SDL_GPUCopyPass * GPUCopyPassRaw
Alias to raw representation for GPUCopyPass.
Definition: SDL3pp_gpu.h:394
void GDKSuspendGPU()
Call this to suspend GPU operation on Xbox when you receive the EVENT_DID_ENTER_BACKGROUND event.
Definition: SDL3pp_gpu.h:7490
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_INT
GPU_TEXTUREFORMAT_R8G8B8A8_INT.
Definition: SDL3pp_gpu.h:2667
void CopyTextureToTexture(const GPUTextureLocation &source, const GPUTextureLocation &destination, Uint32 w, Uint32 h, Uint32 d, bool cycle)
Performs a texture-to-texture copy.
Definition: SDL3pp_gpu.h:6676
constexpr GPUTransferBufferUsage GPU_TRANSFERBUFFERUSAGE_UPLOAD
GPU_TRANSFERBUFFERUSAGE_UPLOAD.
Definition: SDL3pp_gpu.h:4034
SDL_GPUBufferCreateInfo GPUBufferCreateInfo
A structure specifying the parameters of a buffer.
Definition: SDL3pp_gpu.h:410
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT
GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT.
Definition: SDL3pp_gpu.h:2628
constexpr GPUStoreOp GPU_STOREOP_RESOLVE_AND_STORE
The multisample contents generated during the render pass will be resolved to a non-multisample textu...
Definition: SDL3pp_gpu.h:3952
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_SNORM
GPU_TEXTUREFORMAT_R16_SNORM.
Definition: SDL3pp_gpu.h:2604
constexpr GPUPresentMode GPU_PRESENTMODE_VSYNC
GPU_PRESENTMODE_VSYNC.
Definition: SDL3pp_gpu.h:2436
SDL_GPUShader * GPUShaderRaw
Alias to raw representation for GPUShader.
Definition: SDL3pp_gpu.h:358
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_REPEAT
Specifies that the coordinates will wrap around.
Definition: SDL3pp_gpu.h:4453
SDL_GPUBuffer * GPUBufferRaw
Alias to raw representation for GPUBuffer.
Definition: SDL3pp_gpu.h:334
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_HALF4
GPU_VERTEXELEMENTFORMAT_HALF4.
Definition: SDL3pp_gpu.h:4154
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT3
GPU_VERTEXELEMENTFORMAT_UINT3.
Definition: SDL3pp_gpu.h:4085
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEX
GPU_CUBEMAPFACE_NEGATIVEX.
Definition: SDL3pp_gpu.h:3967
void End()
Ends the current compute pass.
Definition: SDL3pp_gpu.h:6516
constexpr GPUShaderStage GPU_SHADERSTAGE_VERTEX
GPU_SHADERSTAGE_VERTEX.
Definition: SDL3pp_gpu.h:4049
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D24_UNORM
GPU_TEXTUREFORMAT_D24_UNORM.
Definition: SDL3pp_gpu.h:2709
SDL_GPUCullMode GPUCullMode
Specifies the facing direction in which triangle faces will be culled.
Definition: SDL3pp_gpu.h:4196
void SetGPUStencilReference(GPURenderPass render_pass, Uint8 reference)
Sets the current stencil reference value on a command buffer.
Definition: SDL3pp_gpu.h:5824
void BindGPUFragmentStorageBuffers(GPURenderPass render_pass, Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the fragment shader.
Definition: SDL3pp_gpu.h:6072
void WaitForSwapchain(WindowParam window)
Blocks the thread until a swapchain texture is available to be acquired.
Definition: SDL3pp_gpu.h:7134
constexpr GPUCompareOp GPU_COMPAREOP_LESS
The comparison evaluates reference < test.
Definition: SDL3pp_gpu.h:4242
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET
Texture is a depth stencil target.
Definition: SDL3pp_gpu.h:2899
void DispatchGPUCompute(GPUComputePass compute_pass, Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z)
Dispatches compute work.
Definition: SDL3pp_gpu.h:6455
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT2
GPU_VERTEXELEMENTFORMAT_INT2.
Definition: SDL3pp_gpu.h:4070
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_POINTLIST
A series of separate points.
Definition: SDL3pp_gpu.h:3896
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR
1 - destination color
Definition: SDL3pp_gpu.h:4367
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC7_RGBA_UNORM
GPU_TEXTUREFORMAT_BC7_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2586
GPUComputePass BeginGPUComputePass(GPUCommandBuffer command_buffer, std::span< const GPUStorageTextureReadWriteBinding > storage_texture_bindings, std::span< const GPUStorageBufferReadWriteBinding > storage_buffer_bindings)
Begins a compute pass on a command buffer.
Definition: SDL3pp_gpu.h:6293
void BindGPUFragmentSamplers(GPURenderPass render_pass, Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the fragment shader.
Definition: SDL3pp_gpu.h:6002
GPUGraphicsPipeline CreateGPUGraphicsPipeline(GPUDeviceParam device, const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:4948
constexpr GPUVertexInputRate GPU_VERTEXINPUTRATE_INSTANCE
Attribute addressing is a function of the instance index.
Definition: SDL3pp_gpu.h:4171
SDL_GPUStencilOpState GPUStencilOpState
A structure specifying the stencil operation state of a graphics pipeline.
Definition: SDL3pp_gpu.h:4568
SDL_GPUVertexElementFormat GPUVertexElementFormat
Specifies the format of a vertex attribute.
Definition: SDL3pp_gpu.h:4062
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT
GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT.
Definition: SDL3pp_gpu.h:2589
constexpr GPUShaderStage GPU_SHADERSTAGE_FRAGMENT
GPU_SHADERSTAGE_FRAGMENT.
Definition: SDL3pp_gpu.h:4052
constexpr GPUCompareOp GPU_COMPAREOP_INVALID
GPU_COMPAREOP_INVALID.
Definition: SDL3pp_gpu.h:4236
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC5_RG_UNORM
GPU_TEXTUREFORMAT_BC5_RG_UNORM.
Definition: SDL3pp_gpu.h:2583
bool WindowSupportsSwapchainComposition(WindowParam window, GPUSwapchainComposition swapchain_composition)
Determines whether a swapchain composition is supported by the window.
Definition: SDL3pp_gpu.h:6853
void BindIndexBuffer(const GPUBufferBinding &binding, GPUIndexElementSize index_element_size)
Binds an index buffer on a command buffer for use with subsequent draw calls.
Definition: SDL3pp_gpu.h:5876
void BindGPUVertexStorageBuffers(GPURenderPass render_pass, Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the vertex shader.
Definition: SDL3pp_gpu.h:5969
void UnmapGPUTransferBuffer(GPUDeviceParam device, GPUTransferBuffer transfer_buffer)
Unmaps a previously mapped transfer buffer.
Definition: SDL3pp_gpu.h:6554
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEZ
GPU_CUBEMAPFACE_NEGATIVEZ.
Definition: SDL3pp_gpu.h:3979
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_LINESTRIP
A series of connected lines.
Definition: SDL3pp_gpu.h:3893
GPUBuffer CreateGPUBuffer(GPUDeviceParam device, const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5232
constexpr GPUStencilOp GPU_STENCILOP_DECREMENT_AND_WRAP
Decrements the current value and wraps to the maximum value.
Definition: SDL3pp_gpu.h:4303
void ReleaseWindow(WindowParam window)
Unclaims a window, destroying its swapchain structure.
Definition: SDL3pp_gpu.h:6939
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_UINT
GPU_TEXTUREFORMAT_R8_UINT.
Definition: SDL3pp_gpu.h:2634
SDL_GPUTransferBuffer * GPUTransferBufferRaw
Alias to raw representation for GPUTransferBuffer.
Definition: SDL3pp_gpu.h:340
constexpr GPUSampleCount GPU_SAMPLECOUNT_4
MSAA 4x.
Definition: SDL3pp_gpu.h:2941
SDL_GPUTextureSamplerBinding GPUTextureSamplerBinding
A structure specifying parameters in a sampler binding call.
Definition: SDL3pp_gpu.h:1123
constexpr GPUTransferBufferUsage GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
GPU_TRANSFERBUFFERUSAGE_DOWNLOAD.
Definition: SDL3pp_gpu.h:4037
void ReleaseGPUGraphicsPipeline(GPUDeviceParam device, GPUGraphicsPipeline graphics_pipeline)
Frees the given graphics pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5558
constexpr GPUStencilOp GPU_STENCILOP_INVALID
GPU_STENCILOP_INVALID.
Definition: SDL3pp_gpu.h:4275
constexpr GPUTextureType GPU_TEXTURETYPE_CUBE_ARRAY
The texture is a cube array image.
Definition: SDL3pp_gpu.h:2868
SDL_GPUTextureCreateInfo GPUTextureCreateInfo
A structure specifying the parameters of a texture.
Definition: SDL3pp_gpu.h:604
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_INT
GPU_TEXTUREFORMAT_R32_INT.
Definition: SDL3pp_gpu.h:2679
void UploadToGPUTexture(GPUCopyPass copy_pass, const GPUTextureTransferInfo &source, const GPUTextureRegion &destination, bool cycle)
Uploads data from a transfer buffer to a texture.
Definition: SDL3pp_gpu.h:6604
void DownloadFromGPUBuffer(GPUCopyPass copy_pass, const GPUBufferRegion &source, const GPUTransferBufferLocation &destination)
Copies data from a buffer to a transfer buffer on the GPU timeline.
Definition: SDL3pp_gpu.h:6760
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT
GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT.
Definition: SDL3pp_gpu.h:2808
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2694
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT
GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT.
Definition: SDL3pp_gpu.h:2841
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB
GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2691
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_B
the blue component
Definition: SDL3pp_gpu.h:4407
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2784
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_SNORM
GPU_TEXTUREFORMAT_R16G16B16A16_SNORM.
Definition: SDL3pp_gpu.h:2610
constexpr GPUSampleCount GPU_SAMPLECOUNT_8
MSAA 8x.
Definition: SDL3pp_gpu.h:2943
constexpr GPUTextureType GPU_TEXTURETYPE_3D
The texture is a 3-dimensional image.
Definition: SDL3pp_gpu.h:2862
bool SetSwapchainParameters(WindowParam window, GPUSwapchainComposition swapchain_composition, GPUPresentMode present_mode)
Changes the swapchain parameters for the given claimed window.
Definition: SDL3pp_gpu.h:6976
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_INDEX
Buffer is an index buffer.
Definition: SDL3pp_gpu.h:4004
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT
GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT.
Definition: SDL3pp_gpu.h:2592
constexpr GPUIndexElementSize GPU_INDEXELEMENTSIZE_16BIT
The index elements are 16-bit.
Definition: SDL3pp_gpu.h:1109
constexpr GPUStencilOp GPU_STENCILOP_DECREMENT_AND_CLAMP
Decrements the current value and clamps to 0.
Definition: SDL3pp_gpu.h:4291
bool WindowSupportsGPUSwapchainComposition(GPUDeviceParam device, WindowParam window, GPUSwapchainComposition swapchain_composition)
Determines whether a swapchain composition is supported by the window.
Definition: SDL3pp_gpu.h:6844
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT4
GPU_VERTEXELEMENTFORMAT_UINT4.
Definition: SDL3pp_gpu.h:4088
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_UINT
GPU_TEXTUREFORMAT_R16_UINT.
Definition: SDL3pp_gpu.h:2643
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_FLOAT
GPU_TEXTUREFORMAT_R16G16_FLOAT.
Definition: SDL3pp_gpu.h:2616
void BindVertexBuffers(Uint32 first_slot, std::span< const GPUBufferBinding > bindings)
Binds vertex buffers on a command buffer for use with subsequent draw calls.
Definition: SDL3pp_gpu.h:5852
constexpr GPUSampleCount GPU_SAMPLECOUNT_2
MSAA 2x.
Definition: SDL3pp_gpu.h:2939
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE
Texture supports storage writes in the compute stage.
Definition: SDL3pp_gpu.h:2912
void End()
Ends the given render pass.
Definition: SDL3pp_gpu.h:6258
void BindVertexStorageBuffers(Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the vertex shader.
Definition: SDL3pp_gpu.h:5978
GPUComputePass BeginComputePass(std::span< const GPUStorageTextureReadWriteBinding > storage_texture_bindings, std::span< const GPUStorageBufferReadWriteBinding > storage_buffer_bindings)
Begins a compute pass on a command buffer.
Definition: SDL3pp_gpu.h:6305
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_UNORM
GPU_TEXTUREFORMAT_ASTC_8x5_UNORM.
Definition: SDL3pp_gpu.h:2736
void ReleaseTexture(GPUTexture texture)
Frees the given texture as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5440
constexpr GPUCullMode GPU_CULLMODE_FRONT
Front-facing triangles are culled.
Definition: SDL3pp_gpu.h:4201
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEY
GPU_CUBEMAPFACE_POSITIVEY.
Definition: SDL3pp_gpu.h:3970
constexpr GPUCompareOp GPU_COMPAREOP_GREATER
The comparison evaluates reference > test.
Definition: SDL3pp_gpu.h:4252
SDL_GPUCubeMapFace GPUCubeMapFace
Specifies the face of a cube map.
Definition: SDL3pp_gpu.h:3962
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_FLOAT
GPU_TEXTUREFORMAT_R16_FLOAT.
Definition: SDL3pp_gpu.h:2613
SDL_GPUSamplerCreateInfo GPUSamplerCreateInfo
A structure specifying the parameters of a sampler.
Definition: SDL3pp_gpu.h:721
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT.
Definition: SDL3pp_gpu.h:2844
void GenerateMipmapsForTexture(GPUTexture texture)
Generates mipmaps for the given texture.
Definition: SDL3pp_gpu.h:6804
constexpr GPUFrontFace GPU_FRONTFACE_COUNTER_CLOCKWISE
A triangle with counter-clockwise vertex winding will be considered front-facing.
Definition: SDL3pp_gpu.h:4221
SDL_GPUComputePipelineCreateInfo GPUComputePipelineCreateInfo
A structure specifying the parameters of a compute pipeline state.
Definition: SDL3pp_gpu.h:909
void PushGPUVertexUniformData(GPUCommandBuffer command_buffer, Uint32 slot_index, SourceBytes data)
Pushes data to a vertex uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5619
GPUTexture CreateGPUTexture(GPUDeviceParam device, const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5149
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_R
the red component
Definition: SDL3pp_gpu.h:4401
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT.
Definition: SDL3pp_gpu.h:2829
constexpr GPUSamplerMipmapMode GPU_SAMPLERMIPMAPMODE_NEAREST
Point filtering.
Definition: SDL3pp_gpu.h:4437
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE2_NORM
GPU_VERTEXELEMENTFORMAT_BYTE2_NORM.
Definition: SDL3pp_gpu.h:4115
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_HALF2
GPU_VERTEXELEMENTFORMAT_HALF2.
Definition: SDL3pp_gpu.h:4151
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_UNORM
GPU_TEXTUREFORMAT_ASTC_6x5_UNORM.
Definition: SDL3pp_gpu.h:2730
constexpr GPUCullMode GPU_CULLMODE_BACK
Back-facing triangles are culled.
Definition: SDL3pp_gpu.h:4204
GPUTransferBuffer CreateTransferBuffer(const GPUTransferBufferCreateInfo &createinfo)
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Definition: SDL3pp_gpu.h:5283
void SetBufferName(GPUBuffer buffer, StringParam text)
Sets an arbitrary string constant to label a buffer.
Definition: SDL3pp_gpu.h:5320
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT2
GPU_VERTEXELEMENTFORMAT_UINT2.
Definition: SDL3pp_gpu.h:4082
SDL_GPUTransferBufferLocation GPUTransferBufferLocation
A structure specifying a location in a transfer buffer.
Definition: SDL3pp_gpu.h:1670
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_UNORM
GPU_TEXTUREFORMAT_ASTC_10x6_UNORM.
Definition: SDL3pp_gpu.h:2748
void ReleaseGPUTexture(GPUDeviceParam device, GPUTexture texture)
Frees the given texture as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5435
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_SNORM
GPU_TEXTUREFORMAT_R8G8B8A8_SNORM.
Definition: SDL3pp_gpu.h:2601
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE4
GPU_VERTEXELEMENTFORMAT_UBYTE4.
Definition: SDL3pp_gpu.h:4112
GPUShader CreateGPUShader(GPUDeviceParam device, const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:5077
void PushFragmentUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a fragment uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5657
GPUComputePipeline CreateGPUComputePipeline(GPUDeviceParam device, const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:4907
void GDKResumeGPU(GPUDeviceParam device)
Call this to resume GPU operation on Xbox when you receive the EVENT_WILL_ENTER_FOREGROUND event.
Definition: SDL3pp_gpu.h:7505
void UploadToGPUBuffer(GPUCopyPass copy_pass, const GPUTransferBufferLocation &source, const GPUBufferRegion &destination, bool cycle)
Uploads data from a transfer buffer to a buffer.
Definition: SDL3pp_gpu.h:6633
void PushGPUComputeUniformData(GPUCommandBuffer command_buffer, Uint32 slot_index, SourceBytes data)
Pushes data to a uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5679
constexpr GPUBlendFactor GPU_BLENDFACTOR_INVALID
GPU_BLENDFACTOR_INVALID.
Definition: SDL3pp_gpu.h:4351
Uint32 CalculateGPUTextureFormatSize(GPUTextureFormat format, Uint32 width, Uint32 height, Uint32 depth_or_layer_count)
Calculate the size in bytes of a texture format with dimensions.
Definition: SDL3pp_gpu.h:7464
SDL_GPUStorageTextureReadWriteBinding GPUStorageTextureReadWriteBinding
A structure specifying parameters related to binding textures in a compute pass.
Definition: SDL3pp_gpu.h:1912
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INVALID
GPU_VERTEXELEMENTFORMAT_INVALID.
Definition: SDL3pp_gpu.h:4064
SDL_GPUSwapchainComposition GPUSwapchainComposition
Specifies the texture format and colorspace of the swapchain textures.
Definition: SDL3pp_gpu.h:2395
SDL_GPUPrimitiveType GPUPrimitiveType
Specifies the primitive topology of a graphics pipeline.
Definition: SDL3pp_gpu.h:3882
void PushVertexUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a vertex uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5627
constexpr GPUStencilOp GPU_STENCILOP_INCREMENT_AND_CLAMP
Increments the current value and clamps to the maximum value.
Definition: SDL3pp_gpu.h:4288
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT4_NORM
GPU_VERTEXELEMENTFORMAT_SHORT4_NORM.
Definition: SDL3pp_gpu.h:4142
SDL_GPUTransferBufferUsage GPUTransferBufferUsage
Specifies how a transfer buffer is intended to be used by the client.
Definition: SDL3pp_gpu.h:4032
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT.
Definition: SDL3pp_gpu.h:2718
void GenerateMipmapsForGPUTexture(GPUCommandBuffer command_buffer, GPUTexture texture)
Generates mipmaps for the given texture.
Definition: SDL3pp_gpu.h:6798
constexpr GPUTextureType GPU_TEXTURETYPE_2D
The texture is a 2-dimensional image.
Definition: SDL3pp_gpu.h:2856
GPUTexture AcquireSwapchainTexture(WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr)
Acquire a texture to use in presentation.
Definition: SDL3pp_gpu.h:7102
void CopyBufferToBuffer(const GPUBufferLocation &source, const GPUBufferLocation &destination, Uint32 size, bool cycle)
Performs a buffer-to-buffer copy.
Definition: SDL3pp_gpu.h:6712
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_COLOR
source color
Definition: SDL3pp_gpu.h:4358
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC2_RGBA_UNORM
GPU_TEXTUREFORMAT_BC2_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2574
void ReleaseGPUBuffer(GPUDeviceParam device, GPUBuffer buffer)
Frees the given buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5475
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB
GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2688
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B4G4R4A4_UNORM
GPU_TEXTUREFORMAT_B4G4R4A4_UNORM.
Definition: SDL3pp_gpu.h:2565
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2799
void DestroyGPUDevice(GPUDeviceRaw device)
Destroys a GPU context previously returned by GPUDevice.GPUDevice.
Definition: SDL3pp_gpu.h:4788
SDL_GPUBlitInfo GPUBlitInfo
A structure containing parameters for a blit command.
Definition: SDL3pp_gpu.h:1931
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_UNORM
GPU_TEXTUREFORMAT_ASTC_10x10_UNORM.
Definition: SDL3pp_gpu.h:2754
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2766
SDL_GPUStoreOp GPUStoreOp
Specifies how the contents of a texture attached to a render pass are treated at the end of the rende...
Definition: SDL3pp_gpu.h:3929
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_UNORM
GPU_TEXTUREFORMAT_ASTC_12x10_UNORM.
Definition: SDL3pp_gpu.h:2757
void BindGPUGraphicsPipeline(GPURenderPass render_pass, GPUGraphicsPipeline graphics_pipeline)
Binds a graphics pipeline on a render pass to be used in rendering.
Definition: SDL3pp_gpu.h:5746
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2769
constexpr GPUShaderFormat GPU_SHADERFORMAT_METALLIB
Precompiled metallib shaders for Metal.
Definition: SDL3pp_gpu.h:2367
constexpr GPUFillMode GPU_FILLMODE_LINE
Polygon edges will be drawn as line segments.
Definition: SDL3pp_gpu.h:4186
void CopyGPUBufferToBuffer(GPUCopyPass copy_pass, const GPUBufferLocation &source, const GPUBufferLocation &destination, Uint32 size, bool cycle)
Performs a buffer-to-buffer copy.
Definition: SDL3pp_gpu.h:6703
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_UNORM
GPU_TEXTUREFORMAT_ASTC_4x4_UNORM.
Definition: SDL3pp_gpu.h:2721
void WaitForGPUSwapchain(GPUDeviceParam device, WindowParam window)
Blocks the thread until a swapchain texture is available to be acquired.
Definition: SDL3pp_gpu.h:7129
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_TRIANGLESTRIP
A series of connected triangles.
Definition: SDL3pp_gpu.h:3887
constexpr GPUShaderFormat GPU_SHADERFORMAT_MSL
MSL shaders for Metal.
Definition: SDL3pp_gpu.h:2364
void PopDebugGroup()
Ends the most-recently pushed debug group.
Definition: SDL3pp_gpu.h:5420
void UploadToTexture(const GPUTextureTransferInfo &source, const GPUTextureRegion &destination, bool cycle)
Uploads data from a transfer buffer to a texture.
Definition: SDL3pp_gpu.h:6612
void ReleaseBuffer(GPUBuffer buffer)
Frees the given buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5480
void ReleaseGPUShader(GPUDeviceParam device, GPUShader shader)
Frees the given shader as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5538
constexpr GPUCompareOp GPU_COMPAREOP_NEVER
The comparison always evaluates false.
Definition: SDL3pp_gpu.h:4239
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_SNORM
GPU_TEXTUREFORMAT_R16G16_SNORM.
Definition: SDL3pp_gpu.h:2607
void SetBlendConstants(FColorRaw blend_constants)
Sets the current blend constants on a command buffer.
Definition: SDL3pp_gpu.h:5811
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_ALPHA
source alpha
Definition: SDL3pp_gpu.h:4370
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2778
void SetTextureName(GPUTexture texture, StringParam text)
Sets an arbitrary string constant to label a texture.
Definition: SDL3pp_gpu.h:5349
GPUDevice CreateGPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
Creates a GPU context.
Definition: SDL3pp_gpu.h:4691
void * MapGPUTransferBuffer(GPUDeviceParam device, GPUTransferBuffer transfer_buffer, bool cycle)
Maps a transfer buffer into application address space.
Definition: SDL3pp_gpu.h:6533
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2775
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R10G10B10A2_UNORM
GPU_TEXTUREFORMAT_R10G10B10A2_UNORM.
Definition: SDL3pp_gpu.h:2556
void BindPipeline(GPUGraphicsPipeline graphics_pipeline)
Binds a graphics pipeline on a render pass to be used in rendering.
Definition: SDL3pp_gpu.h:5752
void WaitForGPUFences(GPUDeviceParam device, bool wait_all, std::span< GPUFence *const > fences)
Blocks the thread until the given fences are signaled.
Definition: SDL3pp_gpu.h:7332
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B8G8R8A8_UNORM
GPU_TEXTUREFORMAT_B8G8R8A8_UNORM.
Definition: SDL3pp_gpu.h:2568
void DrawGPUPrimitivesIndirect(GPURenderPass render_pass, GPUBuffer buffer, Uint32 offset, Uint32 draw_count)
Draws data using bound graphics state and with draw parameters set from a buffer.
Definition: SDL3pp_gpu.h:6196
SDL_GPUTransferBufferCreateInfo GPUTransferBufferCreateInfo
A structure specifying the parameters of a transfer buffer.
Definition: SDL3pp_gpu.h:511
constexpr GPULoadOp GPU_LOADOP_DONT_CARE
The previous contents of the texture need not be preserved.
Definition: SDL3pp_gpu.h:3919
constexpr GPUBlendFactor GPU_BLENDFACTOR_ZERO
0
Definition: SDL3pp_gpu.h:4354
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_SNORM
GPU_TEXTUREFORMAT_R8G8_SNORM.
Definition: SDL3pp_gpu.h:2598
SDL_GPURenderPass * GPURenderPassRaw
Alias to raw representation for GPURenderPass.
Definition: SDL3pp_gpu.h:382
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_INT
GPU_TEXTUREFORMAT_R32G32B32A32_INT.
Definition: SDL3pp_gpu.h:2685
constexpr GPUBlendOp GPU_BLENDOP_MAX
max(source, destination)
Definition: SDL3pp_gpu.h:4335
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_INT
GPU_TEXTUREFORMAT_R16G16_INT.
Definition: SDL3pp_gpu.h:2673
GPUTextureFormat GetGPUSwapchainTextureFormat(GPUDeviceParam device, WindowParam window)
Obtains the texture format of the swapchain for the given window.
Definition: SDL3pp_gpu.h:7032
SDL_GPUBufferRegion GPUBufferRegion
A structure specifying a region of a buffer.
Definition: SDL3pp_gpu.h:1612
GPUShader CreateShader(const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:5083
const char * GetGPUDriver(int index)
Get the name of a built in GPU driver.
Definition: SDL3pp_gpu.h:4823
SDL_GPUTextureFormat GPUTextureFormat
Specifies the pixel format of a texture.
Definition: SDL3pp_gpu.h:2530
constexpr GPUStoreOp GPU_STOREOP_STORE
The contents generated during the render pass will be written to memory.
Definition: SDL3pp_gpu.h:3932
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2697
void InsertDebugLabel(StringParam text)
Inserts an arbitrary string label into the command buffer callstream.
Definition: SDL3pp_gpu.h:5370
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2703
GPUTexture CreateTexture(const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5155
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
min(source alpha, 1 - destination alpha)
Definition: SDL3pp_gpu.h:4388
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA
1 - destination alpha
Definition: SDL3pp_gpu.h:4379
void BindPipeline(GPUComputePipeline compute_pipeline)
Binds a compute pipeline on a command buffer for use in compute dispatch.
Definition: SDL3pp_gpu.h:6327
void GDKSuspendGPU(GPUDeviceParam device)
Call this to suspend GPU operation on Xbox when you receive the EVENT_DID_ENTER_BACKGROUND event.
Definition: SDL3pp_gpu.h:7488
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE2
GPU_VERTEXELEMENTFORMAT_BYTE2.
Definition: SDL3pp_gpu.h:4103
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_UNORM
GPU_TEXTUREFORMAT_ASTC_8x8_UNORM.
Definition: SDL3pp_gpu.h:2742
bool TextureSupportsSampleCount(GPUTextureFormat format, GPUSampleCount sample_count)
Determines if a sample count for a texture format is supported.
Definition: SDL3pp_gpu.h:7447
constexpr GPUStencilOp GPU_STENCILOP_KEEP
Keeps the current value.
Definition: SDL3pp_gpu.h:4278
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT3
GPU_VERTEXELEMENTFORMAT_INT3.
Definition: SDL3pp_gpu.h:4073
SDL_GPUDevice * GPUDeviceRaw
Alias to raw representation for GPUDevice.
Definition: SDL3pp_gpu.h:301
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ
Buffer supports storage reads in the compute stage.
Definition: SDL3pp_gpu.h:4015
void ClaimWindow(WindowParam window)
Claims a window, creating a swapchain structure for it.
Definition: SDL3pp_gpu.h:6918
void DownloadFromBuffer(const GPUBufferRegion &source, const GPUTransferBufferLocation &destination)
Copies data from a buffer to a transfer buffer on the GPU timeline.
Definition: SDL3pp_gpu.h:6767
const char * GetGPUDeviceDriver(GPUDeviceParam device)
Returns the name of the backend used to create this GPU context.
Definition: SDL3pp_gpu.h:4833
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2787
void SetGPUBlendConstants(GPURenderPass render_pass, FColorRaw blend_constants)
Sets the current blend constants on a command buffer.
Definition: SDL3pp_gpu.h:5805
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_UINT
GPU_TEXTUREFORMAT_R16G16B16A16_UINT.
Definition: SDL3pp_gpu.h:2649
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT.
Definition: SDL3pp_gpu.h:2826
SDL_GPUStorageBufferReadWriteBinding GPUStorageBufferReadWriteBinding
A structure specifying parameters related to binding buffers in a compute pass.
Definition: SDL3pp_gpu.h:1922
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_UNORM
GPU_TEXTUREFORMAT_ASTC_5x4_UNORM.
Definition: SDL3pp_gpu.h:2724
void End()
Ends the current copy pass.
Definition: SDL3pp_gpu.h:6786
void ReleaseGraphicsPipeline(GPUGraphicsPipeline graphics_pipeline)
Frees the given graphics pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5564
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT4
GPU_VERTEXELEMENTFORMAT_USHORT4.
Definition: SDL3pp_gpu.h:4136
GPUFence * SubmitAndAcquireFence()
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated...
Definition: SDL3pp_gpu.h:7265
constexpr GPUShaderFormat GPU_SHADERFORMAT_INVALID
INVALID.
Definition: SDL3pp_gpu.h:2349
void WaitForIdle()
Blocks the thread until the GPU is completely idle.
Definition: SDL3pp_gpu.h:7316
void BindGPUComputeStorageBuffers(GPUComputePass compute_pass, Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers as readonly for use on the compute pipeline.
Definition: SDL3pp_gpu.h:6418
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B5G6R5_UNORM
GPU_TEXTUREFORMAT_B5G6R5_UNORM.
Definition: SDL3pp_gpu.h:2559
void DownloadFromGPUTexture(GPUCopyPass copy_pass, const GPUTextureRegion &source, const GPUTextureTransferInfo &destination)
Copies data from a texture to a transfer buffer on the GPU timeline.
Definition: SDL3pp_gpu.h:6734
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_UNORM
GPU_TEXTUREFORMAT_R8G8_UNORM.
Definition: SDL3pp_gpu.h:2541
bool WindowSupportsGPUPresentMode(GPUDeviceParam device, WindowParam window, GPUPresentMode present_mode)
Determines whether a presentation mode is supported by the window.
Definition: SDL3pp_gpu.h:6875
void EndGPURenderPass(GPURenderPass render_pass)
Ends the given render pass.
Definition: SDL3pp_gpu.h:6253
constexpr GPUBlendOp GPU_BLENDOP_REVERSE_SUBTRACT
(destination * destination_factor) - (source * source_factor)
Definition: SDL3pp_gpu.h:4329
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_G
the green component
Definition: SDL3pp_gpu.h:4404
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_SDR
GPU_SWAPCHAINCOMPOSITION_SDR.
Definition: SDL3pp_gpu.h:2397
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_INDIRECT
Buffer is an indirect buffer.
Definition: SDL3pp_gpu.h:4007
SDL_GPURasterizerState GPURasterizerState
A structure specifying the parameters of the graphics pipeline rasterizer state.
Definition: SDL3pp_gpu.h:4595
void WaitForGPUIdle(GPUDeviceParam device)
Blocks the thread until the GPU is completely idle.
Definition: SDL3pp_gpu.h:7311
bool GPUSupportsProperties(PropertiesParam props)
Checks for GPU runtime support.
Definition: SDL3pp_gpu.h:4668
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ
Texture supports storage reads in the compute stage.
Definition: SDL3pp_gpu.h:2908
constexpr GPUBlendOp GPU_BLENDOP_SUBTRACT
(source * source_factor) - (destination * destination_factor)
Definition: SDL3pp_gpu.h:4326
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_INT
GPU_TEXTUREFORMAT_R8_INT.
Definition: SDL3pp_gpu.h:2661
void InsertGPUDebugLabel(GPUCommandBuffer command_buffer, StringParam text)
Inserts an arbitrary string label into the command buffer callstream.
Definition: SDL3pp_gpu.h:5364
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_UNORM
GPU_TEXTUREFORMAT_R16_UNORM.
Definition: SDL3pp_gpu.h:2547
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2796
void EndGPUCopyPass(GPUCopyPass copy_pass)
Ends the current copy pass.
Definition: SDL3pp_gpu.h:6781
SDL_GPUSamplerAddressMode GPUSamplerAddressMode
Specifies behavior of texture sampling when the coordinates exceed the 0-1 range.
Definition: SDL3pp_gpu.h:4451
void DispatchGPUComputeIndirect(GPUComputePass compute_pass, GPUBuffer buffer, Uint32 offset)
Dispatches compute work with parameters set from a buffer.
Definition: SDL3pp_gpu.h:6489
bool SetGPUAllowedFramesInFlight(GPUDeviceParam device, Uint32 allowed_frames_in_flight)
Configures the maximum allowed number of frames in flight.
Definition: SDL3pp_gpu.h:7010
constexpr GPUStoreOp GPU_STOREOP_DONT_CARE
The contents generated during the render pass are not needed and may be discarded.
Definition: SDL3pp_gpu.h:3938
constexpr GPULoadOp GPU_LOADOP_CLEAR
The contents of the texture will be cleared to a color.
Definition: SDL3pp_gpu.h:3913
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM
GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM.
Definition: SDL3pp_gpu.h:4124
GPUTexture WaitAndAcquireSwapchainTexture(WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr)
Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
Definition: SDL3pp_gpu.h:7194
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_UINT
GPU_TEXTUREFORMAT_R32G32B32A32_UINT.
Definition: SDL3pp_gpu.h:2658
void GDKResumeGPU()
Call this to resume GPU operation on Xbox when you receive the EVENT_WILL_ENTER_FOREGROUND event.
Definition: SDL3pp_gpu.h:7507
constexpr GPUTextureType GPU_TEXTURETYPE_2D_ARRAY
The texture is a 2-dimensional array image.
Definition: SDL3pp_gpu.h:2859
SDL_GPUFrontFace GPUFrontFace
Specifies the vertex winding that will cause a triangle to be determined to be front-facing.
Definition: SDL3pp_gpu.h:4215
constexpr GPUPresentMode GPU_PRESENTMODE_MAILBOX
GPU_PRESENTMODE_MAILBOX.
Definition: SDL3pp_gpu.h:2442
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEY
GPU_CUBEMAPFACE_NEGATIVEY.
Definition: SDL3pp_gpu.h:3973
void PushDebugGroup(StringParam name)
Begins a debug group with an arbitrary name.
Definition: SDL3pp_gpu.h:5401
bool GPUSupportsShaderFormats(GPUShaderFormat format_flags, StringParam name)
Checks for GPU runtime support.
Definition: SDL3pp_gpu.h:4652
constexpr GPUShaderFormat GPU_SHADERFORMAT_SPIRV
SPIR-V shaders for Vulkan.
Definition: SDL3pp_gpu.h:2355
SDL_GPUStencilOp GPUStencilOp
Specifies what happens to a stored stencil value if stencil tests fail or pass.
Definition: SDL3pp_gpu.h:4273
bool WindowSupportsPresentMode(WindowParam window, GPUPresentMode present_mode)
Determines whether a presentation mode is supported by the window.
Definition: SDL3pp_gpu.h:6882
SDL_GPUFence GPUFence
An opaque handle representing a fence.
Definition: SDL3pp_gpu.h:1943
SDL_GPUComputePass * GPUComputePassRaw
Alias to raw representation for GPUComputePass.
Definition: SDL3pp_gpu.h:388
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT
Specifies that the coordinates will wrap around mirrored.
Definition: SDL3pp_gpu.h:4458
void ReleaseGPUTransferBuffer(GPUDeviceParam device, GPUTransferBuffer transfer_buffer)
Frees the given transfer buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5495
SDL_GPUIndexElementSize GPUIndexElementSize
Specifies the size of elements in an index buffer.
Definition: SDL3pp_gpu.h:1107
SDL_GPUShaderCreateInfo GPUShaderCreateInfo
A structure specifying code and metadata for creating a shader object.
Definition: SDL3pp_gpu.h:789
void BindGPUVertexBuffers(GPURenderPass render_pass, Uint32 first_slot, std::span< const GPUBufferBinding > bindings)
Binds vertex buffers on a command buffer for use with subsequent draw calls.
Definition: SDL3pp_gpu.h:5844
void BindStorageTextures(Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures as readonly for use on the compute pipeline.
Definition: SDL3pp_gpu.h:6393
void DrawPrimitives(Uint32 num_vertices, Uint32 num_instances, Uint32 first_vertex, Uint32 first_instance)
Draws data using bound graphics state.
Definition: SDL3pp_gpu.h:6171
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT.
Definition: SDL3pp_gpu.h:2820
void SetGPUScissor(GPURenderPass render_pass, const RectRaw &scissor)
Sets the current scissor state on a command buffer.
Definition: SDL3pp_gpu.h:5784
SDL_GPUVertexInputState GPUVertexInputState
A structure specifying the parameters of a graphics pipeline vertex input state.
Definition: SDL3pp_gpu.h:4559
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D16_UNORM
GPU_TEXTUREFORMAT_D16_UNORM.
Definition: SDL3pp_gpu.h:2706
void SubmitGPUCommandBuffer(GPUCommandBuffer command_buffer)
Submits a command buffer so its commands can be processed on the GPU.
Definition: SDL3pp_gpu.h:7225
SDL_GPUVertexInputRate GPUVertexInputRate
Specifies the rate at which vertex attributes are pulled from buffers.
Definition: SDL3pp_gpu.h:4164
constexpr GPUFilter GPU_FILTER_NEAREST
Point filtering.
Definition: SDL3pp_gpu.h:4422
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2790
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEX
GPU_CUBEMAPFACE_POSITIVEX.
Definition: SDL3pp_gpu.h:3964
void BindGPUComputeSamplers(GPUComputePass compute_pass, Uint32 first_slot, std::span< const GPUTextureSamplerBinding > texture_sampler_bindings)
Binds texture-sampler pairs for use on the compute shader.
Definition: SDL3pp_gpu.h:6348
void BindGPUComputeStorageTextures(GPUComputePass compute_pass, Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures as readonly for use on the compute pipeline.
Definition: SDL3pp_gpu.h:6384
GPUCopyPass BeginGPUCopyPass(GPUCommandBuffer command_buffer)
Begins a copy pass on a command buffer.
Definition: SDL3pp_gpu.h:6577
constexpr GPUBlendOp GPU_BLENDOP_ADD
(source * source_factor) + (destination * destination_factor)
Definition: SDL3pp_gpu.h:4323
SDL_GPULoadOp GPULoadOp
Specifies how the contents of a texture attached to a render pass are treated at the beginning of the...
Definition: SDL3pp_gpu.h:3907
constexpr GPUTextureType GPU_TEXTURETYPE_CUBE
The texture is a cube image.
Definition: SDL3pp_gpu.h:2865
SDL_GPUFilter GPUFilter
Specifies a filter operation used by a sampler.
Definition: SDL3pp_gpu.h:4420
constexpr GPUStencilOp GPU_STENCILOP_INCREMENT_AND_WRAP
Increments the current value and wraps back to 0.
Definition: SDL3pp_gpu.h:4298
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2700
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_INVALID
GPU_TEXTUREFORMAT_INVALID.
Definition: SDL3pp_gpu.h:2532
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_UNORM
GPU_TEXTUREFORMAT_ASTC_5x5_UNORM.
Definition: SDL3pp_gpu.h:2727
SDL_GPUBlitRegion GPUBlitRegion
A structure specifying a region of a texture used in the blit operation.
Definition: SDL3pp_gpu.h:4472
SDL_GPUViewport GPUViewport
A structure specifying a viewport.
Definition: SDL3pp_gpu.h:1088
GPUShaderFormat GetShaderFormats()
Returns the supported shader formats for this GPU context.
Definition: SDL3pp_gpu.h:4857
SDL_GPUComputePipeline * GPUComputePipelineRaw
Alias to raw representation for GPUComputePipeline.
Definition: SDL3pp_gpu.h:364
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE4_NORM
GPU_VERTEXELEMENTFORMAT_BYTE4_NORM.
Definition: SDL3pp_gpu.h:4118
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT
GPU_VERTEXELEMENTFORMAT_FLOAT.
Definition: SDL3pp_gpu.h:4091
constexpr GPUSampleCount GPU_SAMPLECOUNT_1
No multisampling.
Definition: SDL3pp_gpu.h:2936
SDL_GPUIndirectDrawCommand GPUIndirectDrawCommand
A structure specifying the parameters of an indirect draw command.
Definition: SDL3pp_gpu.h:4488
GPURenderPass BeginRenderPass(std::span< const GPUColorTargetInfo > color_target_infos, OptionalRef< const GPUDepthStencilTargetInfo > depth_stencil_target_info)
Begins a render pass on a command buffer.
Definition: SDL3pp_gpu.h:5728
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA
1 - source alpha
Definition: SDL3pp_gpu.h:4373
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE
1
Definition: SDL3pp_gpu.h:4356
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM
GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM.
Definition: SDL3pp_gpu.h:4121
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT4
GPU_VERTEXELEMENTFORMAT_SHORT4.
Definition: SDL3pp_gpu.h:4130
void PopGPUDebugGroup(GPUCommandBuffer command_buffer)
Ends the most-recently pushed debug group.
Definition: SDL3pp_gpu.h:5415
constexpr GPULoadOp GPU_LOADOP_LOAD
The previous contents of the texture will be preserved.
Definition: SDL3pp_gpu.h:3910
constexpr GPUCullMode GPU_CULLMODE_NONE
No triangles are culled.
Definition: SDL3pp_gpu.h:4198
constexpr GPUBlendFactor GPU_BLENDFACTOR_DST_ALPHA
destination alpha
Definition: SDL3pp_gpu.h:4376
GPUSampler CreateGPUSampler(GPUDeviceParam device, const GPUSamplerCreateInfo &createinfo)
Creates a sampler object to be used when binding textures in a graphics workflow.
Definition: SDL3pp_gpu.h:4989
void DrawIndexedPrimitivesIndirect(GPUBuffer buffer, Uint32 offset, Uint32 draw_count)
Draws data using bound graphics state with an index buffer enabled and with draw parameters set from ...
Definition: SDL3pp_gpu.h:6235
void EndGPUComputePass(GPUComputePass compute_pass)
Ends the current compute pass.
Definition: SDL3pp_gpu.h:6511
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_UNORM
GPU_TEXTUREFORMAT_ASTC_10x5_UNORM.
Definition: SDL3pp_gpu.h:2745
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_UINT
GPU_TEXTUREFORMAT_R8G8_UINT.
Definition: SDL3pp_gpu.h:2637
SDL_FColor FColorRaw
Alias to raw representation for FColor.
Definition: SDL3pp_pixels.h:89
SDL_Rect RectRaw
Alias to raw representation for Rect.
Definition: SDL3pp_rect.h:34
::Uint32 Uint32
An unsigned 32-bit integer type.
Definition: SDL3pp_stdinc.h:341
::Uint8 Uint8
An unsigned 8-bit integer type.
Definition: SDL3pp_stdinc.h:289
::Sint32 Sint32
A signed 32-bit integer type.
Definition: SDL3pp_stdinc.h:328
Main include header for the SDL3pp library.
Safely wrap GPUDevice for non owning parameters.
Definition: SDL3pp_gpu.h:308
GPUDeviceRaw value
parameter's GPUDeviceRaw
Definition: SDL3pp_gpu.h:309
constexpr GPUDeviceParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_gpu.h:318
constexpr GPUDeviceParam(GPUDeviceRaw value)
Constructs from GPUDeviceRaw.
Definition: SDL3pp_gpu.h:312
constexpr auto operator<=>(const GPUDeviceParam &other) const =default
Comparison.
Semi-safe reference for GPUDevice.
Definition: SDL3pp_gpu.h:3839
GPUDeviceRef(const GPUDeviceRef &other)
Copy constructor.
Definition: SDL3pp_gpu.h:3853
GPUDeviceRef(GPUDeviceParam resource)
Constructs from GPUDeviceParam.
Definition: SDL3pp_gpu.h:3847
~GPUDeviceRef()
Destructor.
Definition: SDL3pp_gpu.h:3859
Safely wrap Properties for non owning parameters.
Definition: SDL3pp_properties.h:52
Safely wrap Window for non owning parameters.
Definition: SDL3pp_video.h:54