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
300// Forward decl
301struct GPUDevice;
302
304using GPUDeviceRaw = SDL_GPUDevice*;
305
306// Forward decl
307struct GPUDeviceRef;
308
311{
313
316 : value(value)
317 {
318 }
319
321 constexpr GPUDeviceParam(std::nullptr_t _ = nullptr)
322 : value(nullptr)
323 {
324 }
325
327 constexpr explicit operator bool() const { return !!value; }
328
330 constexpr auto operator<=>(const GPUDeviceParam& other) const = default;
331
333 constexpr operator GPUDeviceRaw() const { return value; }
334};
335
337using GPUBufferRaw = SDL_GPUBuffer*;
338
340using GPUTransferBufferRaw = SDL_GPUTransferBuffer*;
341
343using GPUTextureRaw = SDL_GPUTexture*;
344
346using GPUSamplerRaw = SDL_GPUSampler*;
347
349using GPUShaderRaw = SDL_GPUShader*;
350
352using GPUComputePipelineRaw = SDL_GPUComputePipeline*;
353
355using GPUGraphicsPipelineRaw = SDL_GPUGraphicsPipeline*;
356
358using GPUCommandBufferRaw = SDL_GPUCommandBuffer*;
359
361using GPURenderPassRaw = SDL_GPURenderPass*;
362
364using GPUComputePassRaw = SDL_GPUComputePass*;
365
367using GPUCopyPassRaw = SDL_GPUCopyPass*;
368
380using GPUBufferCreateInfo = SDL_GPUBufferCreateInfo;
381
405{
406 GPUBufferRaw m_gPUBuffer;
407
408public:
414 constexpr GPUBuffer(GPUBufferRaw gPUBuffer = {})
415 : m_gPUBuffer(gPUBuffer)
416 {
417 }
418
463 : m_gPUBuffer(CheckError(SDL_CreateGPUBuffer(device, &createinfo)))
464 {
465 }
466
472 constexpr operator GPUBufferRaw() const { return m_gPUBuffer; }
473};
474
482using GPUTransferBufferCreateInfo = SDL_GPUTransferBufferCreateInfo;
483
501{
502 GPUTransferBufferRaw m_gPUTransferBuffer;
503
504public:
510 constexpr GPUTransferBuffer(GPUTransferBufferRaw gPUTransferBuffer = {})
511 : m_gPUTransferBuffer(gPUTransferBuffer)
512 {
513 }
514
543 const GPUTransferBufferCreateInfo& createinfo)
544 : m_gPUTransferBuffer(
545 CheckError(SDL_CreateGPUTransferBuffer(device, &createinfo)))
546 {
547 }
548
554 constexpr operator GPUTransferBufferRaw() const
555 {
556 return m_gPUTransferBuffer;
557 }
558};
559
575using GPUTextureCreateInfo = SDL_GPUTextureCreateInfo;
576
596{
597 GPUTextureRaw m_gPUTexture;
598
599public:
605 constexpr GPUTexture(GPUTextureRaw gPUTexture = {})
606 : m_gPUTexture(gPUTexture)
607 {
608 }
609
666 : m_gPUTexture(CheckError(SDL_CreateGPUTexture(device, &createinfo)))
667 {
668 }
669
675 constexpr operator GPUTextureRaw() const { return m_gPUTexture; }
676};
677
692using GPUSamplerCreateInfo = SDL_GPUSamplerCreateInfo;
693
705{
706 GPUSamplerRaw m_gPUSampler;
707
708public:
714 constexpr GPUSampler(GPUSamplerRaw gPUSampler = {})
715 : m_gPUSampler(gPUSampler)
716 {
717 }
718
741 : m_gPUSampler(CheckError(SDL_CreateGPUSampler(device, &createinfo)))
742 {
743 }
744
750 constexpr operator GPUSamplerRaw() const { return m_gPUSampler; }
751};
752
760using GPUShaderCreateInfo = SDL_GPUShaderCreateInfo;
761
772{
773 GPUShaderRaw m_gPUShader;
774
775public:
781 constexpr GPUShader(GPUShaderRaw gPUShader = {})
782 : m_gPUShader(gPUShader)
783 {
784 }
785
860 : m_gPUShader(CheckError(SDL_CreateGPUShader(device, &createinfo)))
861 {
862 }
863
869 constexpr operator GPUShaderRaw() const { return m_gPUShader; }
870};
871
880using GPUComputePipelineCreateInfo = SDL_GPUComputePipelineCreateInfo;
881
894{
895 GPUComputePipelineRaw m_gPUComputePipeline;
896
897public:
903 constexpr GPUComputePipeline(GPUComputePipelineRaw gPUComputePipeline = {})
904 : m_gPUComputePipeline(gPUComputePipeline)
905 {
906 }
907
954 const GPUComputePipelineCreateInfo& createinfo)
955 : m_gPUComputePipeline(
956 CheckError(SDL_CreateGPUComputePipeline(device, &createinfo)))
957 {
958 }
959
965 constexpr operator GPUComputePipelineRaw() const
966 {
967 return m_gPUComputePipeline;
968 }
969};
970
985using GPUGraphicsPipelineCreateInfo = SDL_GPUGraphicsPipelineCreateInfo;
986
999{
1000 GPUGraphicsPipelineRaw m_gPUGraphicsPipeline;
1001
1002public:
1008 constexpr GPUGraphicsPipeline(GPUGraphicsPipelineRaw gPUGraphicsPipeline = {})
1009 : m_gPUGraphicsPipeline(gPUGraphicsPipeline)
1010 {
1011 }
1012
1035 const GPUGraphicsPipelineCreateInfo& createinfo)
1036 : m_gPUGraphicsPipeline(
1037 CheckError(SDL_CreateGPUGraphicsPipeline(device, &createinfo)))
1038 {
1039 }
1040
1046 constexpr operator GPUGraphicsPipelineRaw() const
1047 {
1048 return m_gPUGraphicsPipeline;
1049 }
1050};
1051
1059using GPUViewport = SDL_GPUViewport;
1060
1069using GPUBufferBinding = SDL_GPUBufferBinding;
1070
1078using GPUIndexElementSize = SDL_GPUIndexElementSize;
1079
1081 SDL_GPU_INDEXELEMENTSIZE_16BIT;
1082
1084 SDL_GPU_INDEXELEMENTSIZE_32BIT;
1085
1094using GPUTextureSamplerBinding = SDL_GPUTextureSamplerBinding;
1095
1108{
1109 GPURenderPassRaw m_gPURenderPass;
1110
1111public:
1117 constexpr GPURenderPass(GPURenderPassRaw gPURenderPass = {})
1118 : m_gPURenderPass(gPURenderPass)
1119 {
1120 }
1121
1127 constexpr operator GPURenderPassRaw() const { return m_gPURenderPass; }
1128
1138 void BindPipeline(GPUGraphicsPipeline graphics_pipeline);
1139
1147 void SetViewport(const GPUViewport& viewport);
1148
1156 void SetScissor(const RectRaw& scissor);
1157
1168 void SetBlendConstants(FColorRaw blend_constants);
1169
1177 void SetStencilReference(Uint8 reference);
1178
1189 void BindVertexBuffers(Uint32 first_slot,
1190 std::span<const GPUBufferBinding> bindings);
1191
1202 void BindIndexBuffer(const GPUBufferBinding& binding,
1203 GPUIndexElementSize index_element_size);
1204
1221 void BindVertexSamplers(
1222 Uint32 first_slot,
1223 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1224
1241 void BindVertexStorageTextures(Uint32 first_slot,
1242 SpanRef<const GPUTextureRaw> storage_textures);
1243
1260 void BindVertexStorageBuffers(Uint32 first_slot,
1261 SpanRef<const GPUBufferRaw> storage_buffers);
1262
1280 Uint32 first_slot,
1281 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1282
1300 Uint32 first_slot,
1301 SpanRef<const GPUTextureRaw> storage_textures);
1302
1319 void BindFragmentStorageBuffers(Uint32 first_slot,
1320 SpanRef<const GPUBufferRaw> storage_buffers);
1321
1344 void DrawIndexedPrimitives(Uint32 num_indices,
1345 Uint32 num_instances,
1346 Uint32 first_index,
1347 Sint32 vertex_offset,
1348 Uint32 first_instance);
1349
1369 void DrawPrimitives(Uint32 num_vertices,
1370 Uint32 num_instances,
1371 Uint32 first_vertex,
1372 Uint32 first_instance);
1373
1390 Uint32 offset,
1391 Uint32 draw_count);
1392
1409 Uint32 offset,
1410 Uint32 draw_count);
1411
1421 void End();
1422};
1423
1436{
1437 GPUComputePassRaw m_gPUComputePass;
1438
1439public:
1445 constexpr GPUComputePass(GPUComputePassRaw gPUComputePass = {})
1446 : m_gPUComputePass(gPUComputePass)
1447 {
1448 }
1449
1455 constexpr operator GPUComputePassRaw() const { return m_gPUComputePass; }
1456
1464 void BindPipeline(GPUComputePipeline compute_pipeline);
1465
1482 void BindSamplers(
1483 Uint32 first_slot,
1484 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings);
1485
1502 void BindStorageTextures(Uint32 first_slot,
1503 SpanRef<const GPUTextureRaw> storage_textures);
1504
1521 void BindStorageBuffers(Uint32 first_slot,
1522 SpanRef<const GPUBufferRaw> storage_buffers);
1523
1543 void Dispatch(Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z);
1544
1562 void DispatchIndirect(GPUBuffer buffer, Uint32 offset);
1563
1573 void End();
1574};
1575
1586using GPUBufferRegion = SDL_GPUBufferRegion;
1587
1597using GPUTextureLocation = SDL_GPUTextureLocation;
1598
1608using GPUBufferLocation = SDL_GPUBufferLocation;
1609
1621using GPUTextureRegion = SDL_GPUTextureRegion;
1622
1632using GPUTextureTransferInfo = SDL_GPUTextureTransferInfo;
1633
1644using GPUTransferBufferLocation = SDL_GPUTransferBufferLocation;
1645
1658{
1659 GPUCopyPassRaw m_gPUCopyPass;
1660
1661public:
1667 constexpr GPUCopyPass(GPUCopyPassRaw gPUCopyPass = {})
1668 : m_gPUCopyPass(gPUCopyPass)
1669 {
1670 }
1671
1677 constexpr operator GPUCopyPassRaw() const { return m_gPUCopyPass; }
1678
1695 void UploadToTexture(const GPUTextureTransferInfo& source,
1696 const GPUTextureRegion& destination,
1697 bool cycle);
1698
1712 void UploadToBuffer(const GPUTransferBufferLocation& source,
1713 const GPUBufferRegion& destination,
1714 bool cycle);
1715
1732 void CopyTextureToTexture(const GPUTextureLocation& source,
1733 const GPUTextureLocation& destination,
1734 Uint32 w,
1735 Uint32 h,
1736 Uint32 d,
1737 bool cycle);
1738
1753 void CopyBufferToBuffer(const GPUBufferLocation& source,
1754 const GPUBufferLocation& destination,
1755 Uint32 size,
1756 bool cycle);
1757
1770 void DownloadFromTexture(const GPUTextureRegion& source,
1771 const GPUTextureTransferInfo& destination);
1772
1784 void DownloadFromBuffer(const GPUBufferRegion& source,
1785 const GPUTransferBufferLocation& destination);
1786
1793 void End();
1794};
1795
1831using GPUColorTargetInfo = SDL_GPUColorTargetInfo;
1832
1877using GPUDepthStencilTargetInfo = SDL_GPUDepthStencilTargetInfo;
1878
1887using GPUStorageTextureReadWriteBinding = SDL_GPUStorageTextureReadWriteBinding;
1888
1897using GPUStorageBufferReadWriteBinding = SDL_GPUStorageBufferReadWriteBinding;
1898
1906using GPUBlitInfo = SDL_GPUBlitInfo;
1907
1918using GPUFence = SDL_GPUFence;
1919
1944{
1945 GPUCommandBufferRaw m_gPUCommandBuffer;
1946
1947public:
1953 constexpr GPUCommandBuffer(GPUCommandBufferRaw gPUCommandBuffer = {})
1954 : m_gPUCommandBuffer(gPUCommandBuffer)
1955 {
1956 }
1957
1963 constexpr operator GPUCommandBufferRaw() const { return m_gPUCommandBuffer; }
1964
1974 void InsertDebugLabel(StringParam text);
1975
1996 void PushDebugGroup(StringParam name);
1997
2006 void PopDebugGroup();
2007
2022 void PushVertexUniformData(Uint32 slot_index, SourceBytes data);
2023
2038 void PushFragmentUniformData(Uint32 slot_index, SourceBytes data);
2039
2054 void PushComputeUniformData(Uint32 slot_index, SourceBytes data);
2055
2079 std::span<const GPUColorTargetInfo> color_target_infos,
2080 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info);
2081
2115 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
2116 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings);
2117
2130
2141
2151 void BlitTexture(const GPUBlitInfo& info);
2152
2197 WindowParam window,
2198 Uint32* swapchain_texture_width = nullptr,
2199 Uint32* swapchain_texture_height = nullptr);
2200
2241 WindowParam window,
2242 Uint32* swapchain_texture_width = nullptr,
2243 Uint32* swapchain_texture_height = nullptr);
2244
2264 void Submit();
2265
2290
2311 void Cancel();
2312};
2313
2324
2326 SDL_GPU_SHADERFORMAT_INVALID;
2327
2329 SDL_GPU_SHADERFORMAT_PRIVATE;
2330
2332 SDL_GPU_SHADERFORMAT_SPIRV;
2333
2335 SDL_GPU_SHADERFORMAT_DXBC;
2336
2338 SDL_GPU_SHADERFORMAT_DXIL;
2339
2341 SDL_GPU_SHADERFORMAT_MSL;
2342
2344 SDL_GPU_SHADERFORMAT_METALLIB;
2345
2372using GPUSwapchainComposition = SDL_GPUSwapchainComposition;
2373
2375 SDL_GPU_SWAPCHAINCOMPOSITION_SDR;
2376
2378 SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR;
2379
2381 SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR;
2382
2384 SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084;
2385
2411using GPUPresentMode = SDL_GPUPresentMode;
2412
2414 SDL_GPU_PRESENTMODE_VSYNC;
2415
2417 SDL_GPU_PRESENTMODE_IMMEDIATE;
2418
2420 SDL_GPU_PRESENTMODE_MAILBOX;
2421
2507using GPUTextureFormat = SDL_GPUTextureFormat;
2508
2510 SDL_GPU_TEXTUREFORMAT_INVALID;
2511
2513 SDL_GPU_TEXTUREFORMAT_A8_UNORM;
2514
2516 SDL_GPU_TEXTUREFORMAT_R8_UNORM;
2517
2519 SDL_GPU_TEXTUREFORMAT_R8G8_UNORM;
2520
2522 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM;
2523
2525 SDL_GPU_TEXTUREFORMAT_R16_UNORM;
2526
2528 SDL_GPU_TEXTUREFORMAT_R16G16_UNORM;
2529
2531 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM;
2532
2534 SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM;
2535
2537 SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM;
2538
2540 SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM;
2541
2543 SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM;
2544
2546 SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM;
2547
2549 SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM;
2550
2552 SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM;
2553
2555 SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM;
2556
2558 SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM;
2559
2561 SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM;
2562
2564 SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM;
2565
2567 SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT;
2568
2570 SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT;
2571
2573 SDL_GPU_TEXTUREFORMAT_R8_SNORM;
2574
2576 SDL_GPU_TEXTUREFORMAT_R8G8_SNORM;
2577
2579 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM;
2580
2582 SDL_GPU_TEXTUREFORMAT_R16_SNORM;
2583
2585 SDL_GPU_TEXTUREFORMAT_R16G16_SNORM;
2586
2588 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM;
2589
2591 SDL_GPU_TEXTUREFORMAT_R16_FLOAT;
2592
2594 SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT;
2595
2597 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT;
2598
2600 SDL_GPU_TEXTUREFORMAT_R32_FLOAT;
2601
2603 SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT;
2604
2606 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT;
2607
2609 SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT;
2610
2612 SDL_GPU_TEXTUREFORMAT_R8_UINT;
2613
2615 SDL_GPU_TEXTUREFORMAT_R8G8_UINT;
2616
2618 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT;
2619
2621 SDL_GPU_TEXTUREFORMAT_R16_UINT;
2622
2624 SDL_GPU_TEXTUREFORMAT_R16G16_UINT;
2625
2627 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT;
2628
2630 SDL_GPU_TEXTUREFORMAT_R32_UINT;
2631
2633 SDL_GPU_TEXTUREFORMAT_R32G32_UINT;
2634
2636 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT;
2637
2639 SDL_GPU_TEXTUREFORMAT_R8_INT;
2640
2642 SDL_GPU_TEXTUREFORMAT_R8G8_INT;
2643
2645 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT;
2646
2648 SDL_GPU_TEXTUREFORMAT_R16_INT;
2649
2651 SDL_GPU_TEXTUREFORMAT_R16G16_INT;
2652
2654 SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT;
2655
2657 SDL_GPU_TEXTUREFORMAT_R32_INT;
2658
2660 SDL_GPU_TEXTUREFORMAT_R32G32_INT;
2661
2663 SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT;
2664
2666 SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB;
2667
2669 SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB;
2670
2672 SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB;
2673
2675 SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB;
2676
2678 SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB;
2679
2681 SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB;
2682
2684 SDL_GPU_TEXTUREFORMAT_D16_UNORM;
2685
2687 SDL_GPU_TEXTUREFORMAT_D24_UNORM;
2688
2690 SDL_GPU_TEXTUREFORMAT_D32_FLOAT;
2691
2693 SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT;
2694
2696 SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT;
2697
2699 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM;
2700
2702 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM;
2703
2705 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM;
2706
2708 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM;
2709
2711 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM;
2712
2714 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM;
2715
2717 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM;
2718
2720 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM;
2721
2723 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM;
2724
2726 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM;
2727
2729 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM;
2730
2732 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM;
2733
2735 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM;
2736
2738 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM;
2739
2741 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB;
2742
2744 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB;
2745
2747 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB;
2748
2750 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB;
2751
2753 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB;
2754
2756 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB;
2757
2759 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB;
2760
2762 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB;
2763
2765 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB;
2766
2768 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB;
2769
2771 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB;
2772
2774 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB;
2775
2777 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB;
2778
2780 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB;
2781
2783 SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT;
2784
2786 SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT;
2787
2789 SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT;
2790
2792 SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT;
2793
2795 SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT;
2796
2798 SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT;
2799
2801 SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT;
2802
2804 SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT;
2805
2807 SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT;
2808
2810 SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT;
2811
2813 SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT;
2814
2816 SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT;
2817
2819 SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT;
2820
2822 SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT;
2823
2831using GPUTextureType = SDL_GPUTextureType;
2832
2834 SDL_GPU_TEXTURETYPE_2D;
2835
2837 SDL_GPU_TEXTURETYPE_2D_ARRAY;
2838
2840 SDL_GPU_TEXTURETYPE_3D;
2841
2843 SDL_GPU_TEXTURETYPE_CUBE;
2844
2846 SDL_GPU_TEXTURETYPE_CUBE_ARRAY;
2847
2869
2871 SDL_GPU_TEXTUREUSAGE_SAMPLER;
2872
2874 SDL_GPU_TEXTUREUSAGE_COLOR_TARGET;
2875
2877 SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET;
2879
2881 SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ;
2883
2886 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ;
2887
2890 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE;
2891
2896constexpr GPUTextureUsageFlags
2898 SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE;
2899
2911using GPUSampleCount = SDL_GPUSampleCount;
2912
2914 SDL_GPU_SAMPLECOUNT_1;
2915
2917 SDL_GPU_SAMPLECOUNT_2;
2918
2920 SDL_GPU_SAMPLECOUNT_4;
2921
2923 SDL_GPU_SAMPLECOUNT_8;
2924
2933{
2934 GPUDeviceRaw m_resource = nullptr;
2935
2936public:
2938 constexpr GPUDevice() = default;
2939
2947 constexpr explicit GPUDevice(const GPUDeviceRaw resource)
2948 : m_resource(resource)
2949 {
2950 }
2951
2953 constexpr GPUDevice(const GPUDevice& other) = delete;
2954
2956 constexpr GPUDevice(GPUDevice&& other)
2957 : GPUDevice(other.release())
2958 {
2959 }
2960
2961 constexpr GPUDevice(const GPUDeviceRef& other) = delete;
2962
2963 constexpr GPUDevice(GPUDeviceRef&& other) = delete;
2964
2983 GPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
2984 : m_resource(
2985 CheckError(SDL_CreateGPUDevice(format_flags, debug_mode, name)))
2986 {
2987 }
2988
3033 : m_resource(CheckError(SDL_CreateGPUDeviceWithProperties(props)))
3034 {
3035 }
3036
3038 ~GPUDevice() { SDL_DestroyGPUDevice(m_resource); }
3039
3042 {
3043 std::swap(m_resource, other.m_resource);
3044 return *this;
3045 }
3046
3048 constexpr GPUDeviceRaw get() const { return m_resource; }
3049
3052 {
3053 auto r = m_resource;
3054 m_resource = nullptr;
3055 return r;
3056 }
3057
3059 constexpr auto operator<=>(const GPUDevice& other) const = default;
3060
3062 constexpr bool operator==(std::nullptr_t _) const { return !m_resource; }
3063
3065 constexpr explicit operator bool() const { return !!m_resource; }
3066
3068 constexpr operator GPUDeviceParam() const { return {m_resource}; }
3069
3078 void Destroy();
3079
3087 const char* GetDriver();
3088
3098
3144 const GPUComputePipelineCreateInfo& createinfo);
3145
3167 const GPUGraphicsPipelineCreateInfo& createinfo);
3168
3190
3263 GPUShader CreateShader(const GPUShaderCreateInfo& createinfo);
3264
3320
3363 GPUBuffer CreateBuffer(const GPUBufferCreateInfo& createinfo);
3364
3392 const GPUTransferBufferCreateInfo& createinfo);
3393
3410 void SetBufferName(GPUBuffer buffer, StringParam text);
3411
3429 void SetTextureName(GPUTexture texture, StringParam text);
3430
3440 void ReleaseTexture(GPUTexture texture);
3441
3451 void ReleaseSampler(GPUSampler sampler);
3452
3462 void ReleaseBuffer(GPUBuffer buffer);
3463
3473 void ReleaseTransferBuffer(GPUTransferBuffer transfer_buffer);
3474
3484 void ReleaseComputePipeline(GPUComputePipeline compute_pipeline);
3485
3495 void ReleaseShader(GPUShader shader);
3496
3506 void ReleaseGraphicsPipeline(GPUGraphicsPipeline graphics_pipeline);
3507
3532
3547 void* MapTransferBuffer(GPUTransferBuffer transfer_buffer, bool cycle);
3548
3556 void UnmapTransferBuffer(GPUTransferBuffer transfer_buffer);
3557
3572 WindowParam window,
3573 GPUSwapchainComposition swapchain_composition);
3574
3589 GPUPresentMode present_mode);
3590
3616 void ClaimWindow(WindowParam window);
3617
3627 void ReleaseWindow(WindowParam window);
3628
3653 GPUSwapchainComposition swapchain_composition,
3654 GPUPresentMode present_mode);
3655
3680 bool SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight);
3681
3693
3709 void WaitForSwapchain(WindowParam window);
3710
3720 void WaitForIdle();
3721
3735 void WaitForFences(bool wait_all, std::span<GPUFence* const> fences);
3736
3747 bool QueryFence(GPUFence* fence);
3748
3760 void ReleaseFence(GPUFence* fence);
3761
3774 GPUTextureType type,
3775 GPUTextureUsageFlags usage);
3776
3787 GPUSampleCount sample_count);
3788};
3789
3792{
3801 : GPUDevice(resource.value)
3802 {
3803 }
3804
3807 : GPUDevice(other.get())
3808 {
3809 }
3810
3813};
3814
3836using GPUPrimitiveType = SDL_GPUPrimitiveType;
3837
3839 SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
3840
3842 SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP;
3843
3845 SDL_GPU_PRIMITIVETYPE_LINELIST;
3846
3848 SDL_GPU_PRIMITIVETYPE_LINESTRIP;
3849
3851 SDL_GPU_PRIMITIVETYPE_POINTLIST;
3852
3861using GPULoadOp = SDL_GPULoadOp;
3862
3864constexpr GPULoadOp GPU_LOADOP_LOAD = SDL_GPU_LOADOP_LOAD;
3865
3867constexpr GPULoadOp GPU_LOADOP_CLEAR = SDL_GPU_LOADOP_CLEAR;
3868
3873constexpr GPULoadOp GPU_LOADOP_DONT_CARE = SDL_GPU_LOADOP_DONT_CARE;
3874
3883using GPUStoreOp = SDL_GPUStoreOp;
3884
3886constexpr GPUStoreOp GPU_STOREOP_STORE = SDL_GPU_STOREOP_STORE;
3887
3892constexpr GPUStoreOp GPU_STOREOP_DONT_CARE = SDL_GPU_STOREOP_DONT_CARE;
3893
3899constexpr GPUStoreOp GPU_STOREOP_RESOLVE = SDL_GPU_STOREOP_RESOLVE;
3900
3907 SDL_GPU_STOREOP_RESOLVE_AND_STORE;
3908
3916using GPUCubeMapFace = SDL_GPUCubeMapFace;
3917
3919 SDL_GPU_CUBEMAPFACE_POSITIVEX;
3920
3922 SDL_GPU_CUBEMAPFACE_NEGATIVEX;
3923
3925 SDL_GPU_CUBEMAPFACE_POSITIVEY;
3926
3928 SDL_GPU_CUBEMAPFACE_NEGATIVEY;
3929
3931 SDL_GPU_CUBEMAPFACE_POSITIVEZ;
3932
3934 SDL_GPU_CUBEMAPFACE_NEGATIVEZ;
3935
3954
3956 SDL_GPU_BUFFERUSAGE_VERTEX;
3957
3959 SDL_GPU_BUFFERUSAGE_INDEX;
3960
3962 SDL_GPU_BUFFERUSAGE_INDIRECT;
3963
3965 SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ;
3967
3970 SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ;
3971
3974 SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE;
3975
3986using GPUTransferBufferUsage = SDL_GPUTransferBufferUsage;
3987
3989 SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD;
3990
3992 SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD;
3993
4001using GPUShaderStage = SDL_GPUShaderStage;
4002
4004 SDL_GPU_SHADERSTAGE_VERTEX;
4005
4007 SDL_GPU_SHADERSTAGE_FRAGMENT;
4008
4016using GPUVertexElementFormat = SDL_GPUVertexElementFormat;
4017
4019 SDL_GPU_VERTEXELEMENTFORMAT_INVALID;
4020
4022 SDL_GPU_VERTEXELEMENTFORMAT_INT;
4023
4025 SDL_GPU_VERTEXELEMENTFORMAT_INT2;
4026
4028 SDL_GPU_VERTEXELEMENTFORMAT_INT3;
4029
4031 SDL_GPU_VERTEXELEMENTFORMAT_INT4;
4032
4034 SDL_GPU_VERTEXELEMENTFORMAT_UINT;
4035
4037 SDL_GPU_VERTEXELEMENTFORMAT_UINT2;
4038
4040 SDL_GPU_VERTEXELEMENTFORMAT_UINT3;
4041
4043 SDL_GPU_VERTEXELEMENTFORMAT_UINT4;
4044
4046 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT;
4047
4049 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2;
4050
4052 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3;
4053
4055 SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4;
4056
4058 SDL_GPU_VERTEXELEMENTFORMAT_BYTE2;
4059
4061 SDL_GPU_VERTEXELEMENTFORMAT_BYTE4;
4062
4064 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2;
4065
4067 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4;
4068
4070 SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM;
4071
4073 SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM;
4074
4076 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM;
4077
4079 SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM;
4080
4082 SDL_GPU_VERTEXELEMENTFORMAT_SHORT2;
4083
4085 SDL_GPU_VERTEXELEMENTFORMAT_SHORT4;
4086
4088 SDL_GPU_VERTEXELEMENTFORMAT_USHORT2;
4089
4091 SDL_GPU_VERTEXELEMENTFORMAT_USHORT4;
4092
4094 SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM;
4095
4097 SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM;
4098
4100 SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM;
4101
4103 SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM;
4104
4106 SDL_GPU_VERTEXELEMENTFORMAT_HALF2;
4107
4109 SDL_GPU_VERTEXELEMENTFORMAT_HALF4;
4110
4118using GPUVertexInputRate = SDL_GPUVertexInputRate;
4119
4122 SDL_GPU_VERTEXINPUTRATE_VERTEX;
4123
4126 SDL_GPU_VERTEXINPUTRATE_INSTANCE;
4127
4135using GPUFillMode = SDL_GPUFillMode;
4136
4138 SDL_GPU_FILLMODE_FILL;
4139
4141 SDL_GPU_FILLMODE_LINE;
4142
4150using GPUCullMode = SDL_GPUCullMode;
4151
4153 SDL_GPU_CULLMODE_NONE;
4154
4156 SDL_GPU_CULLMODE_FRONT;
4157
4159 SDL_GPU_CULLMODE_BACK;
4160
4169using GPUFrontFace = SDL_GPUFrontFace;
4170
4176 SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE;
4177
4179constexpr GPUFrontFace GPU_FRONTFACE_CLOCKWISE = SDL_GPU_FRONTFACE_CLOCKWISE;
4180
4188using GPUCompareOp = SDL_GPUCompareOp;
4189
4191 SDL_GPU_COMPAREOP_INVALID;
4192
4194 SDL_GPU_COMPAREOP_NEVER;
4195
4197 SDL_GPU_COMPAREOP_LESS;
4198
4200 SDL_GPU_COMPAREOP_EQUAL;
4201
4203 SDL_GPU_COMPAREOP_LESS_OR_EQUAL;
4205
4207 SDL_GPU_COMPAREOP_GREATER;
4208
4210 SDL_GPU_COMPAREOP_NOT_EQUAL;
4211
4213 SDL_GPU_COMPAREOP_GREATER_OR_EQUAL;
4215
4217 SDL_GPU_COMPAREOP_ALWAYS;
4218
4227using GPUStencilOp = SDL_GPUStencilOp;
4228
4230 SDL_GPU_STENCILOP_INVALID;
4231
4233 SDL_GPU_STENCILOP_KEEP;
4234
4236 SDL_GPU_STENCILOP_ZERO;
4237
4239 SDL_GPU_STENCILOP_REPLACE;
4240
4243 SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP;
4244
4246 SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP;
4248
4250 SDL_GPU_STENCILOP_INVERT;
4251
4253 SDL_GPU_STENCILOP_INCREMENT_AND_WRAP;
4255
4258 SDL_GPU_STENCILOP_DECREMENT_AND_WRAP;
4259
4271using GPUBlendOp = SDL_GPUBlendOp;
4272
4274 SDL_GPU_BLENDOP_INVALID;
4275
4277constexpr GPUBlendOp GPU_BLENDOP_ADD = SDL_GPU_BLENDOP_ADD;
4278
4280constexpr GPUBlendOp GPU_BLENDOP_SUBTRACT = SDL_GPU_BLENDOP_SUBTRACT;
4281
4284 SDL_GPU_BLENDOP_REVERSE_SUBTRACT;
4285
4287 SDL_GPU_BLENDOP_MIN;
4288
4290 SDL_GPU_BLENDOP_MAX;
4291
4303using GPUBlendFactor = SDL_GPUBlendFactor;
4304
4306 SDL_GPU_BLENDFACTOR_INVALID;
4307
4308constexpr GPUBlendFactor GPU_BLENDFACTOR_ZERO = SDL_GPU_BLENDFACTOR_ZERO;
4309
4310constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE = SDL_GPU_BLENDFACTOR_ONE;
4311
4313 SDL_GPU_BLENDFACTOR_SRC_COLOR;
4314
4316 SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR;
4317
4319 SDL_GPU_BLENDFACTOR_DST_COLOR;
4320
4322 SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR;
4323
4325 SDL_GPU_BLENDFACTOR_SRC_ALPHA;
4326
4328 SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
4329
4331 SDL_GPU_BLENDFACTOR_DST_ALPHA;
4332
4334 SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA;
4335
4337 SDL_GPU_BLENDFACTOR_CONSTANT_COLOR;
4338
4340 SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR;
4341
4343 SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE;
4345
4354
4356 SDL_GPU_COLORCOMPONENT_R;
4357
4359 SDL_GPU_COLORCOMPONENT_G;
4360
4362 SDL_GPU_COLORCOMPONENT_B;
4363
4365 SDL_GPU_COLORCOMPONENT_A;
4366
4374using GPUFilter = SDL_GPUFilter;
4375
4377 SDL_GPU_FILTER_NEAREST;
4378
4380 SDL_GPU_FILTER_LINEAR;
4381
4389using GPUSamplerMipmapMode = SDL_GPUSamplerMipmapMode;
4390
4392 SDL_GPU_SAMPLERMIPMAPMODE_NEAREST;
4393
4395 SDL_GPU_SAMPLERMIPMAPMODE_LINEAR;
4396
4405using GPUSamplerAddressMode = SDL_GPUSamplerAddressMode;
4406
4408 SDL_GPU_SAMPLERADDRESSMODE_REPEAT;
4410
4413 SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT;
4414
4417 SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE;
4418
4426using GPUBlitRegion = SDL_GPUBlitRegion;
4427
4442using GPUIndirectDrawCommand = SDL_GPUIndirectDrawCommand;
4443
4458using GPUIndexedIndirectDrawCommand = SDL_GPUIndexedIndirectDrawCommand;
4459
4467using GPUIndirectDispatchCommand = SDL_GPUIndirectDispatchCommand;
4468
4487using GPUVertexBufferDescription = SDL_GPUVertexBufferDescription;
4488
4501using GPUVertexAttribute = SDL_GPUVertexAttribute;
4502
4513using GPUVertexInputState = SDL_GPUVertexInputState;
4514
4522using GPUStencilOpState = SDL_GPUStencilOpState;
4523
4531using GPUColorTargetBlendState = SDL_GPUColorTargetBlendState;
4532
4549using GPURasterizerState = SDL_GPURasterizerState;
4550
4559using GPUMultisampleState = SDL_GPUMultisampleState;
4560
4569using GPUDepthStencilState = SDL_GPUDepthStencilState;
4570
4579using GPUColorTargetDescription = SDL_GPUColorTargetDescription;
4580
4591using GPUGraphicsPipelineTargetInfo = SDL_GPUGraphicsPipelineTargetInfo;
4592
4607 StringParam name)
4608{
4609 return SDL_GPUSupportsShaderFormats(format_flags, name);
4610}
4611
4623{
4624 return SDL_GPUSupportsProperties(props);
4625}
4626
4646 bool debug_mode,
4647 StringParam name)
4648{
4649 return GPUDevice(format_flags, debug_mode, std::move(name));
4650}
4651
4696{
4697 return GPUDevice(props);
4698}
4699
4700namespace prop::GpuDevice {
4701
4702constexpr auto CREATE_DEBUGMODE_BOOLEAN =
4703 SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN;
4704
4705constexpr auto CREATE_PREFERLOWPOWER_BOOLEAN =
4706 SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN;
4707
4708constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING;
4709
4710constexpr auto CREATE_SHADERS_PRIVATE_BOOLEAN =
4711 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN;
4712
4713constexpr auto CREATE_SHADERS_SPIRV_BOOLEAN =
4714 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN;
4715
4716constexpr auto CREATE_SHADERS_DXBC_BOOLEAN =
4717 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN;
4718
4719constexpr auto CREATE_SHADERS_DXIL_BOOLEAN =
4720 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN;
4721
4722constexpr auto CREATE_SHADERS_MSL_BOOLEAN =
4723 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN;
4724
4725constexpr auto CREATE_SHADERS_METALLIB_BOOLEAN =
4726 SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN;
4727
4728constexpr auto CREATE_D3D12_SEMANTIC_NAME_STRING =
4729 SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING;
4730
4731} // namespace prop::GpuDevice
4732
4743{
4744 SDL_DestroyGPUDevice(device);
4745}
4746
4748
4758inline int GetNumGPUDrivers() { return SDL_GetNumGPUDrivers(); }
4759
4777inline const char* GetGPUDriver(int index) { return SDL_GetGPUDriver(index); }
4778
4787inline const char* GetGPUDeviceDriver(GPUDeviceParam device)
4788{
4789 return SDL_GetGPUDeviceDriver(device);
4790}
4791
4792inline const char* GPUDevice::GetDriver()
4793{
4794 return SDL::GetGPUDeviceDriver(m_resource);
4795}
4796
4807{
4808 return SDL_GetGPUShaderFormats(device);
4809}
4810
4812{
4813 return SDL::GetGPUShaderFormats(m_resource);
4814}
4815
4862 GPUDeviceParam device,
4863 const GPUComputePipelineCreateInfo& createinfo)
4864{
4865 return GPUComputePipeline(device, createinfo);
4866}
4867
4869 const GPUComputePipelineCreateInfo& createinfo)
4870{
4871 return GPUComputePipeline(m_resource, createinfo);
4872}
4873
4874namespace prop::GPUComputePipeline {
4875
4876constexpr auto CREATE_NAME_STRING =
4877 SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING;
4878
4879} // namespace prop::GPUComputePipeline
4880
4903 GPUDeviceParam device,
4904 const GPUGraphicsPipelineCreateInfo& createinfo)
4905{
4906 return GPUGraphicsPipeline(device, createinfo);
4907}
4908
4910 const GPUGraphicsPipelineCreateInfo& createinfo)
4911{
4912 return GPUGraphicsPipeline(m_resource, createinfo);
4913}
4914
4915namespace prop::GPUGraphicsPipeline {
4916
4917constexpr auto CREATE_NAME_STRING =
4918 SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING;
4919
4920} // namespace prop::GPUGraphicsPipeline
4921
4944 const GPUSamplerCreateInfo& createinfo)
4945{
4946 return GPUSampler(device, createinfo);
4947}
4948
4950 const GPUSamplerCreateInfo& createinfo)
4951{
4952 return GPUSampler(m_resource, createinfo);
4953}
4954
4955namespace prop::GPUSampler {
4956
4957constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING;
4958
4959} // namespace prop::GPUSampler
4960
5035 const GPUShaderCreateInfo& createinfo)
5036{
5037 return GPUShader(device, createinfo);
5038}
5039
5041{
5042 return GPUShader(m_resource, createinfo);
5043}
5044
5045namespace prop::GPUShader {
5046
5047constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_SHADER_CREATE_NAME_STRING;
5048
5049} // namespace prop::GPUShader
5050
5107 const GPUTextureCreateInfo& createinfo)
5108{
5109 return GPUTexture(device, createinfo);
5110}
5111
5113 const GPUTextureCreateInfo& createinfo)
5114{
5115 return GPUTexture(m_resource, createinfo);
5116}
5117
5118namespace prop::GPUTexture {
5119
5120constexpr auto CREATE_D3D12_CLEAR_R_FLOAT =
5121 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT;
5122
5123constexpr auto CREATE_D3D12_CLEAR_G_FLOAT =
5124 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT;
5125
5126constexpr auto CREATE_D3D12_CLEAR_B_FLOAT =
5127 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT;
5128
5129constexpr auto CREATE_D3D12_CLEAR_A_FLOAT =
5130 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT;
5131
5132constexpr auto CREATE_D3D12_CLEAR_DEPTH_FLOAT =
5133 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT;
5134
5135constexpr auto CREATE_D3D12_CLEAR_STENCIL_NUMBER =
5136 SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER;
5137
5138constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING;
5139
5140} // namespace prop::GPUTexture
5141
5186 const GPUBufferCreateInfo& createinfo)
5187{
5188 return GPUBuffer(device, createinfo);
5189}
5190
5192{
5193 return GPUBuffer(m_resource, createinfo);
5194}
5195
5196namespace prop::GPUBuffer {
5197
5198constexpr auto CREATE_NAME_STRING = SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING;
5199
5200} // namespace prop::GPUBuffer
5201
5230 GPUDeviceParam device,
5231 const GPUTransferBufferCreateInfo& createinfo)
5232{
5233 return GPUTransferBuffer(device, createinfo);
5234}
5235
5237 const GPUTransferBufferCreateInfo& createinfo)
5238{
5239 return GPUTransferBuffer(m_resource, createinfo);
5240}
5241
5242namespace prop::GPUTransferBuffer {
5243
5244constexpr auto CREATE_NAME_STRING =
5245 SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING;
5246
5247} // namespace prop::GPUTransferBuffer
5248
5267 GPUBuffer buffer,
5268 StringParam text)
5269{
5270 SDL_SetGPUBufferName(device, buffer, text);
5271}
5272
5274{
5275 SDL::SetGPUBufferName(m_resource, buffer, std::move(text));
5276}
5277
5297 GPUTexture texture,
5298 StringParam text)
5299{
5300 SDL_SetGPUTextureName(device, texture, text);
5301}
5302
5304{
5305 SDL::SetGPUTextureName(m_resource, texture, std::move(text));
5306}
5307
5318inline void InsertGPUDebugLabel(GPUCommandBuffer command_buffer,
5319 StringParam text)
5320{
5321 SDL_InsertGPUDebugLabel(command_buffer, text);
5322}
5323
5325{
5326 SDL::InsertGPUDebugLabel(m_gPUCommandBuffer, std::move(text));
5327}
5328
5350inline void PushGPUDebugGroup(GPUCommandBuffer command_buffer, StringParam name)
5351{
5352 SDL_PushGPUDebugGroup(command_buffer, name);
5353}
5354
5356{
5357 SDL::PushGPUDebugGroup(m_gPUCommandBuffer, std::move(name));
5358}
5359
5369inline void PopGPUDebugGroup(GPUCommandBuffer command_buffer)
5370{
5371 SDL_PopGPUDebugGroup(command_buffer);
5372}
5373
5375{
5376 SDL::PopGPUDebugGroup(m_gPUCommandBuffer);
5377}
5378
5389inline void ReleaseGPUTexture(GPUDeviceParam device, GPUTexture texture)
5390{
5391 SDL_ReleaseGPUTexture(device, texture);
5392}
5393
5395{
5396 SDL::ReleaseGPUTexture(m_resource, texture);
5397}
5398
5409inline void ReleaseGPUSampler(GPUDeviceParam device, GPUSampler sampler)
5410{
5411 SDL_ReleaseGPUSampler(device, sampler);
5412}
5413
5415{
5416 SDL::ReleaseGPUSampler(m_resource, sampler);
5417}
5418
5429inline void ReleaseGPUBuffer(GPUDeviceParam device, GPUBuffer buffer)
5430{
5431 SDL_ReleaseGPUBuffer(device, buffer);
5432}
5433
5435{
5436 SDL::ReleaseGPUBuffer(m_resource, buffer);
5437}
5438
5450 GPUTransferBuffer transfer_buffer)
5451{
5452 SDL_ReleaseGPUTransferBuffer(device, transfer_buffer);
5453}
5454
5456{
5457 SDL::ReleaseGPUTransferBuffer(m_resource, transfer_buffer);
5458}
5459
5471 GPUComputePipeline compute_pipeline)
5472{
5473 SDL_ReleaseGPUComputePipeline(device, compute_pipeline);
5474}
5475
5477 GPUComputePipeline compute_pipeline)
5478{
5479 SDL::ReleaseGPUComputePipeline(m_resource, compute_pipeline);
5480}
5481
5492inline void ReleaseGPUShader(GPUDeviceParam device, GPUShader shader)
5493{
5494 SDL_ReleaseGPUShader(device, shader);
5495}
5496
5498{
5499 SDL::ReleaseGPUShader(m_resource, shader);
5500}
5501
5513 GPUGraphicsPipeline graphics_pipeline)
5514{
5515 SDL_ReleaseGPUGraphicsPipeline(device, graphics_pipeline);
5516}
5517
5519 GPUGraphicsPipeline graphics_pipeline)
5520{
5521 SDL::ReleaseGPUGraphicsPipeline(m_resource, graphics_pipeline);
5522}
5523
5549{
5550 return SDL_AcquireGPUCommandBuffer(device);
5551}
5552
5554{
5555 return SDL::AcquireGPUCommandBuffer(m_resource);
5556}
5557
5574 Uint32 slot_index,
5575 SourceBytes data)
5576{
5577 SDL_PushGPUVertexUniformData(
5578 command_buffer, slot_index, data.data(), data.size_bytes());
5579}
5580
5582 SourceBytes data)
5583{
5585 m_gPUCommandBuffer, slot_index, std::move(data));
5586}
5587
5604 Uint32 slot_index,
5605 SourceBytes data)
5606{
5607 SDL_PushGPUFragmentUniformData(
5608 command_buffer, slot_index, data.data(), data.size_bytes());
5609}
5610
5612 SourceBytes data)
5613{
5615 m_gPUCommandBuffer, slot_index, std::move(data));
5616}
5617
5634 Uint32 slot_index,
5635 SourceBytes data)
5636{
5637 SDL_PushGPUComputeUniformData(
5638 command_buffer, slot_index, data.data(), data.size_bytes());
5639}
5640
5642 SourceBytes data)
5643{
5645 m_gPUCommandBuffer, slot_index, std::move(data));
5646}
5647
5672 GPUCommandBuffer command_buffer,
5673 std::span<const GPUColorTargetInfo> color_target_infos,
5674 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info)
5675{
5676 return SDL_BeginGPURenderPass(command_buffer,
5677 color_target_infos.data(),
5678 color_target_infos.size(),
5679 depth_stencil_target_info);
5680}
5681
5683 std::span<const GPUColorTargetInfo> color_target_infos,
5684 OptionalRef<const GPUDepthStencilTargetInfo> depth_stencil_target_info)
5685{
5687 m_gPUCommandBuffer, color_target_infos, depth_stencil_target_info);
5688}
5689
5701 GPUGraphicsPipeline graphics_pipeline)
5702{
5703 SDL_BindGPUGraphicsPipeline(render_pass, graphics_pipeline);
5704}
5705
5707{
5708 SDL::BindGPUGraphicsPipeline(m_gPURenderPass, graphics_pipeline);
5709}
5710
5719inline void SetGPUViewport(GPURenderPass render_pass,
5720 const GPUViewport& viewport)
5721{
5722 SDL_SetGPUViewport(render_pass, &viewport);
5723}
5724
5725inline void GPURenderPass::SetViewport(const GPUViewport& viewport)
5726{
5727 SDL::SetGPUViewport(m_gPURenderPass, viewport);
5728}
5729
5738inline void SetGPUScissor(GPURenderPass render_pass, const RectRaw& scissor)
5739{
5740 SDL_SetGPUScissor(render_pass, &scissor);
5741}
5742
5743inline void GPURenderPass::SetScissor(const RectRaw& scissor)
5744{
5745 SDL::SetGPUScissor(m_gPURenderPass, scissor);
5746}
5747
5759inline void SetGPUBlendConstants(GPURenderPass render_pass,
5760 FColorRaw blend_constants)
5761{
5762 SDL_SetGPUBlendConstants(render_pass, blend_constants);
5763}
5764
5766{
5767 SDL::SetGPUBlendConstants(m_gPURenderPass, blend_constants);
5768}
5769
5778inline void SetGPUStencilReference(GPURenderPass render_pass, Uint8 reference)
5779{
5780 SDL_SetGPUStencilReference(render_pass, reference);
5781}
5782
5784{
5785 SDL::SetGPUStencilReference(m_gPURenderPass, reference);
5786}
5787
5799inline void BindGPUVertexBuffers(GPURenderPass render_pass,
5800 Uint32 first_slot,
5801 std::span<const GPUBufferBinding> bindings)
5802{
5803 SDL_BindGPUVertexBuffers(
5804 render_pass, first_slot, bindings.data(), bindings.size());
5805}
5806
5808 Uint32 first_slot,
5809 std::span<const GPUBufferBinding> bindings)
5810{
5811 SDL::BindGPUVertexBuffers(m_gPURenderPass, first_slot, bindings);
5812}
5813
5825inline void BindGPUIndexBuffer(GPURenderPass render_pass,
5826 const GPUBufferBinding& binding,
5827 GPUIndexElementSize index_element_size)
5828{
5829 SDL_BindGPUIndexBuffer(render_pass, &binding, index_element_size);
5830}
5831
5833 const GPUBufferBinding& binding,
5834 GPUIndexElementSize index_element_size)
5835{
5836 SDL::BindGPUIndexBuffer(m_gPURenderPass, binding, index_element_size);
5837}
5838
5857 GPURenderPass render_pass,
5858 Uint32 first_slot,
5859 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5860{
5861 SDL_BindGPUVertexSamplers(render_pass,
5862 first_slot,
5863 texture_sampler_bindings.data(),
5864 texture_sampler_bindings.size());
5865}
5866
5868 Uint32 first_slot,
5869 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5870{
5872 m_gPURenderPass, first_slot, texture_sampler_bindings);
5873}
5874
5893 GPURenderPass render_pass,
5894 Uint32 first_slot,
5895 SpanRef<const GPUTextureRaw> storage_textures)
5896{
5897 SDL_BindGPUVertexStorageTextures(
5898 render_pass, first_slot, storage_textures.data(), storage_textures.size());
5899}
5900
5902 Uint32 first_slot,
5903 SpanRef<const GPUTextureRaw> storage_textures)
5904{
5906 m_gPURenderPass, first_slot, storage_textures);
5907}
5908
5927 GPURenderPass render_pass,
5928 Uint32 first_slot,
5929 SpanRef<const GPUBufferRaw> storage_buffers)
5930{
5931 SDL_BindGPUVertexStorageBuffers(
5932 render_pass, first_slot, storage_buffers.data(), storage_buffers.size());
5933}
5934
5936 Uint32 first_slot,
5937 SpanRef<const GPUBufferRaw> storage_buffers)
5938{
5940 m_gPURenderPass, first_slot, storage_buffers);
5941}
5942
5961 GPURenderPass render_pass,
5962 Uint32 first_slot,
5963 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5964{
5965 SDL_BindGPUFragmentSamplers(render_pass,
5966 first_slot,
5967 texture_sampler_bindings.data(),
5968 texture_sampler_bindings.size());
5969}
5970
5972 Uint32 first_slot,
5973 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
5974{
5976 m_gPURenderPass, first_slot, texture_sampler_bindings);
5977}
5978
5997 GPURenderPass render_pass,
5998 Uint32 first_slot,
5999 SpanRef<const GPUTextureRaw> storage_textures)
6000{
6001 SDL_BindGPUFragmentStorageTextures(
6002 render_pass, first_slot, storage_textures.data(), storage_textures.size());
6003}
6004
6006 Uint32 first_slot,
6007 SpanRef<const GPUTextureRaw> storage_textures)
6008{
6010 m_gPURenderPass, first_slot, storage_textures);
6011}
6012
6031 GPURenderPass render_pass,
6032 Uint32 first_slot,
6033 SpanRef<const GPUBufferRaw> storage_buffers)
6034{
6035 SDL_BindGPUFragmentStorageBuffers(
6036 render_pass, first_slot, storage_buffers.data(), storage_buffers.size());
6037}
6038
6040 Uint32 first_slot,
6041 SpanRef<const GPUBufferRaw> storage_buffers)
6042{
6044 m_gPURenderPass, first_slot, storage_buffers);
6045}
6046
6071 Uint32 num_indices,
6072 Uint32 num_instances,
6073 Uint32 first_index,
6074 Sint32 vertex_offset,
6075 Uint32 first_instance)
6076{
6077 SDL_DrawGPUIndexedPrimitives(render_pass,
6078 num_indices,
6079 num_instances,
6080 first_index,
6081 vertex_offset,
6082 first_instance);
6083}
6084
6086 Uint32 num_instances,
6087 Uint32 first_index,
6088 Sint32 vertex_offset,
6089 Uint32 first_instance)
6090{
6091 SDL::DrawGPUIndexedPrimitives(m_gPURenderPass,
6092 num_indices,
6093 num_instances,
6094 first_index,
6095 vertex_offset,
6096 first_instance);
6097}
6098
6119inline void DrawGPUPrimitives(GPURenderPass render_pass,
6120 Uint32 num_vertices,
6121 Uint32 num_instances,
6122 Uint32 first_vertex,
6123 Uint32 first_instance)
6124{
6125 SDL_DrawGPUPrimitives(
6126 render_pass, num_vertices, num_instances, first_vertex, first_instance);
6127}
6128
6129inline void GPURenderPass::DrawPrimitives(Uint32 num_vertices,
6130 Uint32 num_instances,
6131 Uint32 first_vertex,
6132 Uint32 first_instance)
6133{
6135 m_gPURenderPass, num_vertices, num_instances, first_vertex, first_instance);
6136}
6137
6155 GPUBuffer buffer,
6156 Uint32 offset,
6157 Uint32 draw_count)
6158{
6159 SDL_DrawGPUPrimitivesIndirect(render_pass, buffer, offset, draw_count);
6160}
6161
6163 Uint32 offset,
6164 Uint32 draw_count)
6165{
6166 SDL::DrawGPUPrimitivesIndirect(m_gPURenderPass, buffer, offset, draw_count);
6167}
6168
6186 GPUBuffer buffer,
6187 Uint32 offset,
6188 Uint32 draw_count)
6189{
6190 SDL_DrawGPUIndexedPrimitivesIndirect(render_pass, buffer, offset, draw_count);
6191}
6192
6194 Uint32 offset,
6195 Uint32 draw_count)
6196{
6198 m_gPURenderPass, buffer, offset, draw_count);
6199}
6200
6211inline void EndGPURenderPass(GPURenderPass render_pass)
6212{
6213 SDL_EndGPURenderPass(render_pass);
6214}
6215
6216inline void GPURenderPass::End() { SDL::EndGPURenderPass(m_gPURenderPass); }
6217
6252 GPUCommandBuffer command_buffer,
6253 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
6254 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings)
6255{
6256 return SDL_BeginGPUComputePass(command_buffer,
6257 storage_texture_bindings.data(),
6258 storage_texture_bindings.size(),
6259 storage_buffer_bindings.data(),
6260 storage_buffer_bindings.size());
6261}
6262
6264 std::span<const GPUStorageTextureReadWriteBinding> storage_texture_bindings,
6265 std::span<const GPUStorageBufferReadWriteBinding> storage_buffer_bindings)
6266{
6268 m_gPUCommandBuffer, storage_texture_bindings, storage_buffer_bindings);
6269}
6270
6280 GPUComputePipeline compute_pipeline)
6281{
6282 SDL_BindGPUComputePipeline(compute_pass, compute_pipeline);
6283}
6284
6286{
6287 SDL::BindGPUComputePipeline(m_gPUComputePass, compute_pipeline);
6288}
6289
6308 GPUComputePass compute_pass,
6309 Uint32 first_slot,
6310 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6311{
6312 SDL_BindGPUComputeSamplers(compute_pass,
6313 first_slot,
6314 texture_sampler_bindings.data(),
6315 texture_sampler_bindings.size());
6316}
6317
6319 Uint32 first_slot,
6320 std::span<const GPUTextureSamplerBinding> texture_sampler_bindings)
6321{
6323 m_gPUComputePass, first_slot, texture_sampler_bindings);
6324}
6325
6344 GPUComputePass compute_pass,
6345 Uint32 first_slot,
6346 SpanRef<const GPUTextureRaw> storage_textures)
6347{
6348 SDL_BindGPUComputeStorageTextures(
6349 compute_pass, first_slot, storage_textures.data(), storage_textures.size());
6350}
6351
6353 Uint32 first_slot,
6354 SpanRef<const GPUTextureRaw> storage_textures)
6355{
6357 m_gPUComputePass, first_slot, storage_textures);
6358}
6359
6378 GPUComputePass compute_pass,
6379 Uint32 first_slot,
6380 SpanRef<const GPUBufferRaw> storage_buffers)
6381{
6382 SDL_BindGPUComputeStorageBuffers(
6383 compute_pass, first_slot, storage_buffers.data(), storage_buffers.size());
6384}
6385
6387 Uint32 first_slot,
6388 SpanRef<const GPUBufferRaw> storage_buffers)
6389{
6391 m_gPUComputePass, first_slot, storage_buffers);
6392}
6393
6414inline void DispatchGPUCompute(GPUComputePass compute_pass,
6415 Uint32 groupcount_x,
6416 Uint32 groupcount_y,
6417 Uint32 groupcount_z)
6418{
6419 SDL_DispatchGPUCompute(
6420 compute_pass, groupcount_x, groupcount_y, groupcount_z);
6421}
6422
6423inline void GPUComputePass::Dispatch(Uint32 groupcount_x,
6424 Uint32 groupcount_y,
6425 Uint32 groupcount_z)
6426{
6428 m_gPUComputePass, groupcount_x, groupcount_y, groupcount_z);
6429}
6430
6450 GPUBuffer buffer,
6451 Uint32 offset)
6452{
6453 SDL_DispatchGPUComputeIndirect(compute_pass, buffer, offset);
6454}
6455
6457{
6458 SDL::DispatchGPUComputeIndirect(m_gPUComputePass, buffer, offset);
6459}
6460
6471inline void EndGPUComputePass(GPUComputePass compute_pass)
6472{
6473 SDL_EndGPUComputePass(compute_pass);
6474}
6475
6476inline void GPUComputePass::End() { SDL::EndGPUComputePass(m_gPUComputePass); }
6477
6494 GPUTransferBuffer transfer_buffer,
6495 bool cycle)
6496{
6497 return SDL_MapGPUTransferBuffer(device, transfer_buffer, cycle);
6498}
6499
6501 bool cycle)
6502{
6503 return SDL::MapGPUTransferBuffer(m_resource, transfer_buffer, cycle);
6504}
6505
6515 GPUTransferBuffer transfer_buffer)
6516{
6517 SDL_UnmapGPUTransferBuffer(device, transfer_buffer);
6518}
6519
6521{
6522 SDL::UnmapGPUTransferBuffer(m_resource, transfer_buffer);
6523}
6524
6538{
6539 return SDL_BeginGPUCopyPass(command_buffer);
6540}
6541
6543{
6544 return SDL::BeginGPUCopyPass(m_gPUCommandBuffer);
6545}
6546
6564inline void UploadToGPUTexture(GPUCopyPass copy_pass,
6565 const GPUTextureTransferInfo& source,
6566 const GPUTextureRegion& destination,
6567 bool cycle)
6568{
6569 SDL_UploadToGPUTexture(copy_pass, &source, &destination, cycle);
6570}
6571
6573 const GPUTextureRegion& destination,
6574 bool cycle)
6575{
6576 SDL::UploadToGPUTexture(m_gPUCopyPass, source, destination, cycle);
6577}
6578
6593inline void UploadToGPUBuffer(GPUCopyPass copy_pass,
6594 const GPUTransferBufferLocation& source,
6595 const GPUBufferRegion& destination,
6596 bool cycle)
6597{
6598 SDL_UploadToGPUBuffer(copy_pass, &source, &destination, cycle);
6599}
6600
6602 const GPUBufferRegion& destination,
6603 bool cycle)
6604{
6605 SDL::UploadToGPUBuffer(m_gPUCopyPass, source, destination, cycle);
6606}
6607
6626 const GPUTextureLocation& source,
6627 const GPUTextureLocation& destination,
6628 Uint32 w,
6629 Uint32 h,
6630 Uint32 d,
6631 bool cycle)
6632{
6633 SDL_CopyGPUTextureToTexture(copy_pass, &source, &destination, w, h, d, cycle);
6634}
6635
6637 const GPUTextureLocation& source,
6638 const GPUTextureLocation& destination,
6639 Uint32 w,
6640 Uint32 h,
6641 Uint32 d,
6642 bool cycle)
6643{
6645 m_gPUCopyPass, source, destination, w, h, d, cycle);
6646}
6647
6664 const GPUBufferLocation& source,
6665 const GPUBufferLocation& destination,
6666 Uint32 size,
6667 bool cycle)
6668{
6669 SDL_CopyGPUBufferToBuffer(copy_pass, &source, &destination, size, cycle);
6670}
6671
6673 const GPUBufferLocation& source,
6674 const GPUBufferLocation& destination,
6675 Uint32 size,
6676 bool cycle)
6677{
6678 SDL::CopyGPUBufferToBuffer(m_gPUCopyPass, source, destination, size, cycle);
6679}
6680
6695 const GPUTextureRegion& source,
6696 const GPUTextureTransferInfo& destination)
6697{
6698 SDL_DownloadFromGPUTexture(copy_pass, &source, &destination);
6699}
6700
6702 const GPUTextureRegion& source,
6703 const GPUTextureTransferInfo& destination)
6704{
6705 SDL::DownloadFromGPUTexture(m_gPUCopyPass, source, destination);
6706}
6707
6721 const GPUBufferRegion& source,
6722 const GPUTransferBufferLocation& destination)
6723{
6724 SDL_DownloadFromGPUBuffer(copy_pass, &source, &destination);
6725}
6726
6728 const GPUBufferRegion& source,
6729 const GPUTransferBufferLocation& destination)
6730{
6731 SDL::DownloadFromGPUBuffer(m_gPUCopyPass, source, destination);
6732}
6733
6741inline void EndGPUCopyPass(GPUCopyPass copy_pass)
6742{
6743 SDL_EndGPUCopyPass(copy_pass);
6744}
6745
6746inline void GPUCopyPass::End() { SDL::EndGPUCopyPass(m_gPUCopyPass); }
6747
6759 GPUTexture texture)
6760{
6761 SDL_GenerateMipmapsForGPUTexture(command_buffer, texture);
6762}
6763
6765{
6766 SDL::GenerateMipmapsForGPUTexture(m_gPUCommandBuffer, texture);
6767}
6768
6779inline void BlitGPUTexture(GPUCommandBuffer command_buffer,
6780 const GPUBlitInfo& info)
6781{
6782 SDL_BlitGPUTexture(command_buffer, &info);
6783}
6784
6786{
6787 SDL::BlitGPUTexture(m_gPUCommandBuffer, info);
6788}
6789
6805 GPUDeviceParam device,
6806 WindowParam window,
6807 GPUSwapchainComposition swapchain_composition)
6808{
6809 return SDL_WindowSupportsGPUSwapchainComposition(
6810 device, window, swapchain_composition);
6811}
6812
6814 WindowParam window,
6815 GPUSwapchainComposition swapchain_composition)
6816{
6818 m_resource, window, swapchain_composition);
6819}
6820
6836 WindowParam window,
6837 GPUPresentMode present_mode)
6838{
6839 return SDL_WindowSupportsGPUPresentMode(device, window, present_mode);
6840}
6841
6843 GPUPresentMode present_mode)
6844{
6845 return SDL::WindowSupportsGPUPresentMode(m_resource, window, present_mode);
6846}
6847
6875{
6876 CheckError(SDL_ClaimWindowForGPUDevice(device, window));
6877}
6878
6880{
6881 SDL::ClaimWindowForGPUDevice(m_resource, window);
6882}
6883
6895 WindowParam window)
6896{
6897 SDL_ReleaseWindowFromGPUDevice(device, window);
6898}
6899
6901{
6902 SDL::ReleaseWindowFromGPUDevice(m_resource, window);
6903}
6904
6929 GPUDeviceParam device,
6930 WindowParam window,
6931 GPUSwapchainComposition swapchain_composition,
6932 GPUPresentMode present_mode)
6933{
6934 return SDL_SetGPUSwapchainParameters(
6935 device, window, swapchain_composition, present_mode);
6936}
6937
6939 WindowParam window,
6940 GPUSwapchainComposition swapchain_composition,
6941 GPUPresentMode present_mode)
6942{
6944 m_resource, window, swapchain_composition, present_mode);
6945}
6946
6973 Uint32 allowed_frames_in_flight)
6974{
6975 return SDL_SetGPUAllowedFramesInFlight(device, allowed_frames_in_flight);
6976}
6977
6978inline bool GPUDevice::SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight)
6979{
6980 return SDL::SetGPUAllowedFramesInFlight(m_resource, allowed_frames_in_flight);
6981}
6982
6995 WindowParam window)
6996{
6997 return SDL_GetGPUSwapchainTextureFormat(device, window);
6998}
6999
7001{
7002 return SDL::GetGPUSwapchainTextureFormat(m_resource, window);
7003}
7004
7050 GPUCommandBuffer command_buffer,
7051 WindowParam window,
7052 Uint32* swapchain_texture_width = nullptr,
7053 Uint32* swapchain_texture_height = nullptr)
7054{
7055 GPUTextureRaw texture;
7056 CheckError(SDL_AcquireGPUSwapchainTexture(command_buffer,
7057 window,
7058 &texture,
7059 swapchain_texture_width,
7060 swapchain_texture_height));
7061 return texture;
7062}
7063
7065 WindowParam window,
7066 Uint32* swapchain_texture_width,
7067 Uint32* swapchain_texture_height)
7068{
7069 return SDL::AcquireGPUSwapchainTexture(m_gPUCommandBuffer,
7070 window,
7071 swapchain_texture_width,
7072 swapchain_texture_height);
7073}
7074
7092{
7093 CheckError(SDL_WaitForGPUSwapchain(device, window));
7094}
7095
7097{
7098 SDL::WaitForGPUSwapchain(m_resource, window);
7099}
7100
7142 GPUCommandBuffer command_buffer,
7143 WindowParam window,
7144 Uint32* swapchain_texture_width = nullptr,
7145 Uint32* swapchain_texture_height = nullptr)
7146{
7147 GPUTextureRaw texture;
7148 CheckError(SDL_WaitAndAcquireGPUSwapchainTexture(command_buffer,
7149 window,
7150 &texture,
7151 swapchain_texture_width,
7152 swapchain_texture_height));
7153 return texture;
7154}
7155
7157 WindowParam window,
7158 Uint32* swapchain_texture_width,
7159 Uint32* swapchain_texture_height)
7160{
7161 return SDL::WaitAndAcquireGPUSwapchainTexture(m_gPUCommandBuffer,
7162 window,
7163 swapchain_texture_width,
7164 swapchain_texture_height);
7165}
7166
7187inline void SubmitGPUCommandBuffer(GPUCommandBuffer command_buffer)
7188{
7189 CheckError(SDL_SubmitGPUCommandBuffer(command_buffer));
7190}
7191
7193{
7194 SDL::SubmitGPUCommandBuffer(m_gPUCommandBuffer);
7195}
7196
7222 GPUCommandBuffer command_buffer)
7223{
7224 return SDL_SubmitGPUCommandBufferAndAcquireFence(command_buffer);
7225}
7226
7228{
7229 return SDL::SubmitGPUCommandBufferAndAcquireFence(m_gPUCommandBuffer);
7230}
7231
7253inline void CancelGPUCommandBuffer(GPUCommandBuffer command_buffer)
7254{
7255 CheckError(SDL_CancelGPUCommandBuffer(command_buffer));
7256}
7257
7259{
7260 SDL::CancelGPUCommandBuffer(m_gPUCommandBuffer);
7261}
7262
7274{
7275 CheckError(SDL_WaitForGPUIdle(device));
7276}
7277
7278inline void GPUDevice::WaitForIdle() { SDL::WaitForGPUIdle(m_resource); }
7279
7295 bool wait_all,
7296 std::span<GPUFence* const> fences)
7297{
7298 CheckError(
7299 SDL_WaitForGPUFences(device, wait_all, fences.data(), fences.size()));
7300}
7301
7302inline void GPUDevice::WaitForFences(bool wait_all,
7303 std::span<GPUFence* const> fences)
7304{
7305 SDL::WaitForGPUFences(m_resource, wait_all, fences);
7306}
7307
7319inline bool QueryGPUFence(GPUDeviceParam device, GPUFence* fence)
7320{
7321 return SDL_QueryGPUFence(device, fence);
7322}
7323
7325{
7326 return SDL::QueryGPUFence(m_resource, fence);
7327}
7328
7341inline void ReleaseGPUFence(GPUDeviceParam device, GPUFence* fence)
7342{
7343 SDL_ReleaseGPUFence(device, fence);
7344}
7345
7347{
7348 SDL::ReleaseGPUFence(m_resource, fence);
7349}
7350
7362{
7363 return SDL_GPUTextureFormatTexelBlockSize(format);
7364}
7365
7379 GPUTextureFormat format,
7380 GPUTextureType type,
7382{
7383 return SDL_GPUTextureSupportsFormat(device, format, type, usage);
7384}
7385
7387 GPUTextureType type,
7389{
7390 return SDL::GPUTextureSupportsFormat(m_resource, format, type, usage);
7391}
7392
7404 GPUTextureFormat format,
7405 GPUSampleCount sample_count)
7406{
7407 return SDL_GPUTextureSupportsSampleCount(device, format, sample_count);
7408}
7409
7411 GPUSampleCount sample_count)
7412{
7413 return SDL::GPUTextureSupportsSampleCount(m_resource, format, sample_count);
7414}
7415
7428 Uint32 width,
7429 Uint32 height,
7430 Uint32 depth_or_layer_count)
7431{
7432 return SDL_CalculateGPUTextureFormatSize(
7433 format, width, height, depth_or_layer_count);
7434}
7435
7437
7438} // namespace SDL
7439
7440#endif /* SDL3PP_GPU_H_ */
An opaque handle representing a buffer.
Definition: SDL3pp_gpu.h:405
GPUBuffer(GPUDeviceParam device, const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:462
constexpr GPUBuffer(GPUBufferRaw gPUBuffer={})
Wraps GPUBuffer.
Definition: SDL3pp_gpu.h:414
An opaque handle representing a command buffer.
Definition: SDL3pp_gpu.h:1944
constexpr GPUCommandBuffer(GPUCommandBufferRaw gPUCommandBuffer={})
Wraps GPUCommandBuffer.
Definition: SDL3pp_gpu.h:1953
An opaque handle representing a compute pass.
Definition: SDL3pp_gpu.h:1436
constexpr GPUComputePass(GPUComputePassRaw gPUComputePass={})
Wraps GPUComputePass.
Definition: SDL3pp_gpu.h:1445
An opaque handle representing a compute pipeline.
Definition: SDL3pp_gpu.h:894
constexpr GPUComputePipeline(GPUComputePipelineRaw gPUComputePipeline={})
Wraps GPUComputePipeline.
Definition: SDL3pp_gpu.h:903
GPUComputePipeline(GPUDeviceParam device, const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:953
An opaque handle representing a copy pass.
Definition: SDL3pp_gpu.h:1658
constexpr GPUCopyPass(GPUCopyPassRaw gPUCopyPass={})
Wraps GPUCopyPass.
Definition: SDL3pp_gpu.h:1667
An opaque handle representing the SDL_GPU context.
Definition: SDL3pp_gpu.h:2933
GPUDevice(PropertiesParam props)
Creates a GPU context.
Definition: SDL3pp_gpu.h:3032
constexpr auto operator<=>(const GPUDevice &other) const =default
Comparison.
GPUDevice & operator=(GPUDevice other)
Assignment operator.
Definition: SDL3pp_gpu.h:3041
~GPUDevice()
Destructor.
Definition: SDL3pp_gpu.h:3038
constexpr GPUDevice(const GPUDevice &other)=delete
Copy constructor.
constexpr GPUDevice(const GPUDeviceRaw resource)
Constructs from GPUDeviceParam.
Definition: SDL3pp_gpu.h:2947
constexpr bool operator==(std::nullptr_t _) const
Comparison.
Definition: SDL3pp_gpu.h:3062
GPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
Creates a GPU context.
Definition: SDL3pp_gpu.h:2983
constexpr GPUDeviceRaw release()
Retrieves underlying GPUDeviceRaw and clear this.
Definition: SDL3pp_gpu.h:3051
constexpr GPUDevice()=default
Default ctor.
constexpr GPUDeviceRaw get() const
Retrieves underlying GPUDeviceRaw.
Definition: SDL3pp_gpu.h:3048
constexpr GPUDevice(GPUDevice &&other)
Move constructor.
Definition: SDL3pp_gpu.h:2956
An opaque handle representing a graphics pipeline.
Definition: SDL3pp_gpu.h:999
constexpr GPUGraphicsPipeline(GPUGraphicsPipelineRaw gPUGraphicsPipeline={})
Wraps GPUGraphicsPipeline.
Definition: SDL3pp_gpu.h:1008
GPUGraphicsPipeline(GPUDeviceParam device, const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:1034
An opaque handle representing a render pass.
Definition: SDL3pp_gpu.h:1108
constexpr GPURenderPass(GPURenderPassRaw gPURenderPass={})
Wraps GPURenderPass.
Definition: SDL3pp_gpu.h:1117
An opaque handle representing a sampler.
Definition: SDL3pp_gpu.h:705
constexpr GPUSampler(GPUSamplerRaw gPUSampler={})
Wraps GPUSampler.
Definition: SDL3pp_gpu.h:714
GPUSampler(GPUDeviceParam device, const GPUSamplerCreateInfo &createinfo)
Creates a sampler object to be used when binding textures in a graphics workflow.
Definition: SDL3pp_gpu.h:740
An opaque handle representing a compiled shader object.
Definition: SDL3pp_gpu.h:772
GPUShader(GPUDeviceParam device, const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:859
constexpr GPUShader(GPUShaderRaw gPUShader={})
Wraps GPUShader.
Definition: SDL3pp_gpu.h:781
An opaque handle representing a texture.
Definition: SDL3pp_gpu.h:596
GPUTexture(GPUDeviceParam device, const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:665
constexpr GPUTexture(GPUTextureRaw gPUTexture={})
Wraps GPUTexture.
Definition: SDL3pp_gpu.h:605
An opaque handle representing a transfer buffer.
Definition: SDL3pp_gpu.h:501
constexpr GPUTransferBuffer(GPUTransferBufferRaw gPUTransferBuffer={})
Wraps GPUTransferBuffer.
Definition: SDL3pp_gpu.h:510
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:542
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:198
void Destroy()
Destroys a GPU context previously returned by GPUDevice.GPUDevice.
Definition: SDL3pp_gpu.h:4747
SDL_GPUDepthStencilState GPUDepthStencilState
A structure specifying the parameters of the graphics pipeline depth stencil state.
Definition: SDL3pp_gpu.h:4569
GPUShaderFormat GetGPUShaderFormats(GPUDeviceParam device)
Returns the supported shader formats for this GPU context.
Definition: SDL3pp_gpu.h:4806
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT
GPU_VERTEXELEMENTFORMAT_UINT.
Definition: SDL3pp_gpu.h:4033
constexpr GPUShaderFormat GPU_SHADERFORMAT_DXIL
DXIL SM6_0 shaders for D3D12.
Definition: SDL3pp_gpu.h:2337
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:5229
void Dispatch(Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z)
Dispatches compute work.
Definition: SDL3pp_gpu.h:6423
void PushComputeUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5641
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2779
constexpr GPUFillMode GPU_FILLMODE_FILL
Polygons will be rendered via rasterization.
Definition: SDL3pp_gpu.h:4137
constexpr GPUShaderFormat GPU_SHADERFORMAT_PRIVATE
Shaders for NDA'd platforms.
Definition: SDL3pp_gpu.h:2328
SDL_GPUTexture * GPUTextureRaw
Alias to raw representation for GPUTexture.
Definition: SDL3pp_gpu.h:343
constexpr GPUCompareOp GPU_COMPAREOP_LESS_OR_EQUAL
The comparison evaluates reference <= test.
Definition: SDL3pp_gpu.h:4202
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084.
Definition: SDL3pp_gpu.h:2383
const char * GetDriver()
Returns the name of the backend used to create this GPU context.
Definition: SDL3pp_gpu.h:4792
int GetNumGPUDrivers()
Get the number of GPU drivers compiled into SDL.
Definition: SDL3pp_gpu.h:4758
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:5603
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:7141
constexpr GPUIndexElementSize GPU_INDEXELEMENTSIZE_32BIT
The index elements are 32-bit.
Definition: SDL3pp_gpu.h:1083
SDL_GPUTextureRegion GPUTextureRegion
A structure specifying a region of a texture.
Definition: SDL3pp_gpu.h:1621
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:5996
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT.
Definition: SDL3pp_gpu.h:2794
constexpr GPUStencilOp GPU_STENCILOP_ZERO
Sets the value to 0.
Definition: SDL3pp_gpu.h:4235
constexpr GPUCompareOp GPU_COMPAREOP_ALWAYS
The comparison always evaluates true.
Definition: SDL3pp_gpu.h:4216
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_UNORM
GPU_TEXTUREFORMAT_R8_UNORM.
Definition: SDL3pp_gpu.h:2515
constexpr GPUBlendOp GPU_BLENDOP_MIN
min(source, destination)
Definition: SDL3pp_gpu.h:4286
SDL_GPUVertexAttribute GPUVertexAttribute
A structure specifying a vertex attribute.
Definition: SDL3pp_gpu.h:4501
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:7049
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:6185
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT2
GPU_VERTEXELEMENTFORMAT_FLOAT2.
Definition: SDL3pp_gpu.h:4048
void WaitForFences(bool wait_all, std::span< GPUFence *const > fences)
Blocks the thread until the given fences are signaled.
Definition: SDL3pp_gpu.h:7302
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:6625
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_FLOAT
GPU_TEXTUREFORMAT_R32G32_FLOAT.
Definition: SDL3pp_gpu.h:2602
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE
Texture supports reads and writes in the same compute shader.
Definition: SDL3pp_gpu.h:2897
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT2_NORM
GPU_VERTEXELEMENTFORMAT_USHORT2_NORM.
Definition: SDL3pp_gpu.h:4099
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_INT
GPU_TEXTUREFORMAT_R8G8_INT.
Definition: SDL3pp_gpu.h:2641
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_UNORM
GPU_TEXTUREFORMAT_ASTC_6x6_UNORM.
Definition: SDL3pp_gpu.h:2710
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_INT
GPU_TEXTUREFORMAT_R16G16B16A16_INT.
Definition: SDL3pp_gpu.h:2653
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_UNORM
GPU_TEXTUREFORMAT_ASTC_12x12_UNORM.
Definition: SDL3pp_gpu.h:2737
void BlitGPUTexture(GPUCommandBuffer command_buffer, const GPUBlitInfo &info)
Blits from a source texture region to a destination texture region.
Definition: SDL3pp_gpu.h:6779
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:7221
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT
GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT.
Definition: SDL3pp_gpu.h:2782
constexpr GPUStencilOp GPU_STENCILOP_INVERT
Bitwise-inverts the current value.
Definition: SDL3pp_gpu.h:4249
constexpr GPUFrontFace GPU_FRONTFACE_CLOCKWISE
A triangle with clockwise vertex winding will be considered front-facing.
Definition: SDL3pp_gpu.h:4179
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D32_FLOAT
GPU_TEXTUREFORMAT_D32_FLOAT.
Definition: SDL3pp_gpu.h:2689
bool SetAllowedFramesInFlight(Uint32 allowed_frames_in_flight)
Configures the maximum allowed number of frames in flight.
Definition: SDL3pp_gpu.h:6978
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT3
GPU_VERTEXELEMENTFORMAT_FLOAT3.
Definition: SDL3pp_gpu.h:4051
constexpr GPUCompareOp GPU_COMPAREOP_GREATER_OR_EQUAL
The comparison evaluates reference >= test.
Definition: SDL3pp_gpu.h:4212
void ReleaseShader(GPUShader shader)
Frees the given shader as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5497
void ReleaseTransferBuffer(GPUTransferBuffer transfer_buffer)
Frees the given transfer buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5455
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT.
Definition: SDL3pp_gpu.h:2800
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:6085
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE2
GPU_VERTEXELEMENTFORMAT_UBYTE2.
Definition: SDL3pp_gpu.h:4063
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:5892
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_LINELIST
A series of separate lines.
Definition: SDL3pp_gpu.h:3844
GPUSampler CreateSampler(const GPUSamplerCreateInfo &createinfo)
Creates a sampler object to be used when binding textures in a graphics workflow.
Definition: SDL3pp_gpu.h:4949
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT4_NORM
GPU_VERTEXELEMENTFORMAT_USHORT4_NORM.
Definition: SDL3pp_gpu.h:4102
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_UINT
GPU_TEXTUREFORMAT_R32_UINT.
Definition: SDL3pp_gpu.h:2629
void PushGPUDebugGroup(GPUCommandBuffer command_buffer, StringParam name)
Begins a debug group with an arbitrary name.
Definition: SDL3pp_gpu.h:5350
void ReleaseGPUSampler(GPUDeviceParam device, GPUSampler sampler)
Frees the given sampler as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5409
bool GPUTextureSupportsSampleCount(GPUDeviceParam device, GPUTextureFormat format, GPUSampleCount sample_count)
Determines if a sample count for a texture format is supported.
Definition: SDL3pp_gpu.h:7403
void * MapTransferBuffer(GPUTransferBuffer transfer_buffer, bool cycle)
Maps a transfer buffer into application address space.
Definition: SDL3pp_gpu.h:6500
void SetGPUBufferName(GPUDeviceParam device, GPUBuffer buffer, StringParam text)
Sets an arbitrary string constant to label a buffer.
Definition: SDL3pp_gpu.h:5266
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_UNORM
GPU_TEXTUREFORMAT_ASTC_8x6_UNORM.
Definition: SDL3pp_gpu.h:2716
void SetGPUViewport(GPURenderPass render_pass, const GPUViewport &viewport)
Sets the current viewport state on a command buffer.
Definition: SDL3pp_gpu.h:5719
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
1 - blend constant
Definition: SDL3pp_gpu.h:4339
GPUComputePipeline CreateComputePipeline(const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:4868
void SetScissor(const RectRaw &scissor)
Sets the current scissor state on a command buffer.
Definition: SDL3pp_gpu.h:5743
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:7386
constexpr GPUCompareOp GPU_COMPAREOP_NOT_EQUAL
The comparison evaluates reference != test.
Definition: SDL3pp_gpu.h:4209
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT2
GPU_VERTEXELEMENTFORMAT_USHORT2.
Definition: SDL3pp_gpu.h:4087
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_UNORM
GPU_TEXTUREFORMAT_R16G16B16A16_UNORM.
Definition: SDL3pp_gpu.h:2530
SDL_GPUColorTargetInfo GPUColorTargetInfo
A structure specifying the parameters of a color target used by a render pass.
Definition: SDL3pp_gpu.h:1831
SDL_GPUCommandBuffer * GPUCommandBufferRaw
Alias to raw representation for GPUCommandBuffer.
Definition: SDL3pp_gpu.h:358
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_UINT
GPU_TEXTUREFORMAT_R16G16_UINT.
Definition: SDL3pp_gpu.h:2623
SDL_GPUCompareOp GPUCompareOp
Specifies a comparison operator for depth, stencil and sampler operations.
Definition: SDL3pp_gpu.h:4188
void CancelGPUCommandBuffer(GPUCommandBuffer command_buffer)
Cancels a command buffer.
Definition: SDL3pp_gpu.h:7253
SDL_GPUDepthStencilTargetInfo GPUDepthStencilTargetInfo
A structure specifying the parameters of a depth-stencil target used by a render pass.
Definition: SDL3pp_gpu.h:1877
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:4271
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_UNORM
GPU_TEXTUREFORMAT_ASTC_10x8_UNORM.
Definition: SDL3pp_gpu.h:2728
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_TRIANGLELIST
A series of separate triangles.
Definition: SDL3pp_gpu.h:3838
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_A8_UNORM
GPU_TEXTUREFORMAT_A8_UNORM.
Definition: SDL3pp_gpu.h:2512
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT4
GPU_VERTEXELEMENTFORMAT_INT4.
Definition: SDL3pp_gpu.h:4030
SDL_GPUGraphicsPipelineTargetInfo GPUGraphicsPipelineTargetInfo
A structure specifying the descriptions of render targets used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4591
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT.
Definition: SDL3pp_gpu.h:2788
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_FLOAT
GPU_TEXTUREFORMAT_R32_FLOAT.
Definition: SDL3pp_gpu.h:2599
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:3899
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
Specifies that the coordinates will clamp to the 0-1 range.
Definition: SDL3pp_gpu.h:4416
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_UNORM
GPU_TEXTUREFORMAT_R16G16_UNORM.
Definition: SDL3pp_gpu.h:2527
SDL_GPUGraphicsPipeline * GPUGraphicsPipelineRaw
Alias to raw representation for GPUGraphicsPipeline.
Definition: SDL3pp_gpu.h:355
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:6119
Uint32 GPUBufferUsageFlags
Specifies how a buffer is intended to be used by the client.
Definition: SDL3pp_gpu.h:3953
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2758
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:6318
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT.
Definition: SDL3pp_gpu.h:2791
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC1_RGBA_UNORM
GPU_TEXTUREFORMAT_BC1_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2548
void BlitTexture(const GPUBlitInfo &info)
Blits from a source texture region to a destination texture region.
Definition: SDL3pp_gpu.h:6785
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:6701
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:5971
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_UINT
GPU_TEXTUREFORMAT_R32G32_UINT.
Definition: SDL3pp_gpu.h:2632
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:5825
SDL_GPUSampler * GPUSamplerRaw
Alias to raw representation for GPUSampler.
Definition: SDL3pp_gpu.h:346
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC3_RGBA_UNORM
GPU_TEXTUREFORMAT_BC3_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2554
void SetGPUTextureName(GPUDeviceParam device, GPUTexture texture, StringParam text)
Sets an arbitrary string constant to label a texture.
Definition: SDL3pp_gpu.h:5296
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:7378
Uint32 GPUTextureFormatTexelBlockSize(GPUTextureFormat format)
Obtains the texel block size for a texture format.
Definition: SDL3pp_gpu.h:7361
SDL_GPUColorTargetDescription GPUColorTargetDescription
A structure specifying the parameters of color targets used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4579
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ
Texture supports storage reads in graphics stages.
Definition: SDL3pp_gpu.h:2880
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:6386
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT2
GPU_VERTEXELEMENTFORMAT_SHORT2.
Definition: SDL3pp_gpu.h:4081
void ReleaseGPUFence(GPUDeviceParam device, GPUFence *fence)
Releases a fence obtained from GPUCommandBuffer.SubmitAndAcquireFence.
Definition: SDL3pp_gpu.h:7341
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_SNORM
GPU_TEXTUREFORMAT_R8_SNORM.
Definition: SDL3pp_gpu.h:2572
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_SAMPLER
Texture supports sampling.
Definition: SDL3pp_gpu.h:2870
GPUCommandBuffer AcquireCommandBuffer()
Acquire a command buffer.
Definition: SDL3pp_gpu.h:5553
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2770
void Cancel()
Cancels a command buffer.
Definition: SDL3pp_gpu.h:7258
void ClaimWindowForGPUDevice(GPUDeviceParam device, WindowParam window)
Claims a window, creating a swapchain structure for it.
Definition: SDL3pp_gpu.h:6874
SDL_GPUIndirectDispatchCommand GPUIndirectDispatchCommand
A structure specifying the parameters of an indexed dispatch command.
Definition: SDL3pp_gpu.h:4467
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_A
the alpha component
Definition: SDL3pp_gpu.h:4364
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE
Buffer supports storage writes in the compute stage.
Definition: SDL3pp_gpu.h:3973
constexpr GPUSamplerMipmapMode GPU_SAMPLERMIPMAPMODE_LINEAR
Linear filtering.
Definition: SDL3pp_gpu.h:4394
constexpr GPUShaderFormat GPU_SHADERFORMAT_DXBC
DXBC SM5_1 shaders for D3D12.
Definition: SDL3pp_gpu.h:2334
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT.
Definition: SDL3pp_gpu.h:2809
void SetStencilReference(Uint8 reference)
Sets the current stencil reference value on a command buffer.
Definition: SDL3pp_gpu.h:5783
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:5470
SDL_GPUVertexBufferDescription GPUVertexBufferDescription
A structure specifying the parameters of vertex buffers used in a graphics pipeline.
Definition: SDL3pp_gpu.h:4487
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R11G11B10_UFLOAT
GPU_TEXTUREFORMAT_R11G11B10_UFLOAT.
Definition: SDL3pp_gpu.h:2608
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COLOR_TARGET
Texture is a color render target.
Definition: SDL3pp_gpu.h:2873
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT
GPU_VERTEXELEMENTFORMAT_INT.
Definition: SDL3pp_gpu.h:4021
constexpr GPUStencilOp GPU_STENCILOP_REPLACE
Sets the value to reference.
Definition: SDL3pp_gpu.h:4238
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_INT
GPU_TEXTUREFORMAT_R16_INT.
Definition: SDL3pp_gpu.h:2647
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT
GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT.
Definition: SDL3pp_gpu.h:2692
void BindFragmentStorageTextures(Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the fragment shader.
Definition: SDL3pp_gpu.h:6005
SDL_GPUMultisampleState GPUMultisampleState
A structure specifying the parameters of the graphics pipeline multisample state.
Definition: SDL3pp_gpu.h:4559
bool QueryFence(GPUFence *fence)
Checks the status of a fence.
Definition: SDL3pp_gpu.h:7324
void UploadToBuffer(const GPUTransferBufferLocation &source, const GPUBufferRegion &destination, bool cycle)
Uploads data from a transfer buffer to a buffer.
Definition: SDL3pp_gpu.h:6601
SDL_GPUIndexedIndirectDrawCommand GPUIndexedIndirectDrawCommand
A structure specifying the parameters of an indexed indirect draw command.
Definition: SDL3pp_gpu.h:4458
constexpr GPUBlendFactor GPU_BLENDFACTOR_DST_COLOR
destination color
Definition: SDL3pp_gpu.h:4318
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT
GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT.
Definition: SDL3pp_gpu.h:2596
void ReleaseComputePipeline(GPUComputePipeline compute_pipeline)
Frees the given compute pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5476
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:5867
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:6162
void ReleaseWindowFromGPUDevice(GPUDeviceParam device, WindowParam window)
Unclaims a window, destroying its swapchain structure.
Definition: SDL3pp_gpu.h:6894
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT4
GPU_VERTEXELEMENTFORMAT_FLOAT4.
Definition: SDL3pp_gpu.h:4054
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT.
Definition: SDL3pp_gpu.h:2815
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:4303
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2749
GPUBuffer CreateBuffer(const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5191
bool QueryGPUFence(GPUDeviceParam device, GPUFence *fence)
Checks the status of a fence.
Definition: SDL3pp_gpu.h:7319
GPUCopyPass BeginCopyPass()
Begins a copy pass on a command buffer.
Definition: SDL3pp_gpu.h:6542
SDL_GPUSampleCount GPUSampleCount
Specifies the sample count of a texture.
Definition: SDL3pp_gpu.h:2911
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT.
Definition: SDL3pp_gpu.h:2812
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32_INT
GPU_TEXTUREFORMAT_R32G32_INT.
Definition: SDL3pp_gpu.h:2659
constexpr GPUBlendOp GPU_BLENDOP_INVALID
GPU_BLENDOP_INVALID.
Definition: SDL3pp_gpu.h:4273
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR
GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR.
Definition: SDL3pp_gpu.h:2380
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:5671
SDL_GPUFillMode GPUFillMode
Specifies the fill mode of the graphics pipeline.
Definition: SDL3pp_gpu.h:4135
SDL_GPUColorTargetBlendState GPUColorTargetBlendState
A structure specifying the blend state of a color target.
Definition: SDL3pp_gpu.h:4531
void BindVertexStorageTextures(Uint32 first_slot, SpanRef< const GPUTextureRaw > storage_textures)
Binds storage textures for use on the vertex shader.
Definition: SDL3pp_gpu.h:5901
GPUDevice CreateGPUDeviceWithProperties(PropertiesParam props)
Creates a GPU context.
Definition: SDL3pp_gpu.h:4695
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:6070
constexpr GPUPresentMode GPU_PRESENTMODE_IMMEDIATE
GPU_PRESENTMODE_IMMEDIATE.
Definition: SDL3pp_gpu.h:2416
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_VERTEX
Buffer is a vertex buffer.
Definition: SDL3pp_gpu.h:3955
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UINT
GPU_TEXTUREFORMAT_R8G8B8A8_UINT.
Definition: SDL3pp_gpu.h:2617
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC4_R_UNORM
GPU_TEXTUREFORMAT_BC4_R_UNORM.
Definition: SDL3pp_gpu.h:2557
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:5856
Uint32 GPUTextureUsageFlags
Specifies how a texture is intended to be used by the client.
Definition: SDL3pp_gpu.h:2868
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ
Buffer supports storage reads in graphics stages.
Definition: SDL3pp_gpu.h:3964
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEZ
GPU_CUBEMAPFACE_POSITIVEZ.
Definition: SDL3pp_gpu.h:3930
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2740
void DispatchIndirect(GPUBuffer buffer, Uint32 offset)
Dispatches compute work with parameters set from a buffer.
Definition: SDL3pp_gpu.h:6456
constexpr GPUCompareOp GPU_COMPAREOP_EQUAL
The comparison evaluates reference == test.
Definition: SDL3pp_gpu.h:4199
SDL_GPUTextureLocation GPUTextureLocation
A structure specifying a location in a texture.
Definition: SDL3pp_gpu.h:1597
SDL_GPUShaderStage GPUShaderStage
Specifies which stage a shader program corresponds to.
Definition: SDL3pp_gpu.h:4001
void SetViewport(const GPUViewport &viewport)
Sets the current viewport state on a command buffer.
Definition: SDL3pp_gpu.h:5725
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT2_NORM
GPU_VERTEXELEMENTFORMAT_SHORT2_NORM.
Definition: SDL3pp_gpu.h:4093
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE4
GPU_VERTEXELEMENTFORMAT_BYTE4.
Definition: SDL3pp_gpu.h:4060
SDL_GPUSamplerMipmapMode GPUSamplerMipmapMode
Specifies a mipmap mode used by a sampler.
Definition: SDL3pp_gpu.h:4389
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR.
Definition: SDL3pp_gpu.h:2377
SDL_GPUGraphicsPipelineCreateInfo GPUGraphicsPipelineCreateInfo
A structure specifying the parameters of a graphics pipeline state.
Definition: SDL3pp_gpu.h:985
GPUTextureFormat GetSwapchainTextureFormat(WindowParam window)
Obtains the texture format of the swapchain for the given window.
Definition: SDL3pp_gpu.h:7000
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR
1 - source color
Definition: SDL3pp_gpu.h:4315
SDL_GPUTextureType GPUTextureType
Specifies the type of a texture.
Definition: SDL3pp_gpu.h:2831
Uint32 GPUShaderFormat
Specifies the format of shader code.
Definition: SDL3pp_gpu.h:2323
Uint8 GPUColorComponentFlags
Specifies which color components are written in a graphics pipeline.
Definition: SDL3pp_gpu.h:4353
SDL_GPUTextureTransferInfo GPUTextureTransferInfo
A structure specifying parameters related to transferring data to or from a texture.
Definition: SDL3pp_gpu.h:1632
void ReleaseFence(GPUFence *fence)
Releases a fence obtained from GPUCommandBuffer.SubmitAndAcquireFence.
Definition: SDL3pp_gpu.h:7346
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B5G5R5A1_UNORM
GPU_TEXTUREFORMAT_B5G5R5A1_UNORM.
Definition: SDL3pp_gpu.h:2539
GPUGraphicsPipeline CreateGraphicsPipeline(const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:4909
void Submit()
Submits a command buffer so its commands can be processed on the GPU.
Definition: SDL3pp_gpu.h:7192
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:6928
constexpr GPUFilter GPU_FILTER_LINEAR
Linear filtering.
Definition: SDL3pp_gpu.h:4379
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:6279
void BindFragmentStorageBuffers(Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the fragment shader.
Definition: SDL3pp_gpu.h:6039
constexpr GPUBlendFactor GPU_BLENDFACTOR_CONSTANT_COLOR
blend constant
Definition: SDL3pp_gpu.h:4336
constexpr GPUVertexInputRate GPU_VERTEXINPUTRATE_VERTEX
Attribute addressing is a function of the vertex index.
Definition: SDL3pp_gpu.h:4121
SDL_GPUPresentMode GPUPresentMode
Specifies the timing that will be used to present swapchain textures to the OS.
Definition: SDL3pp_gpu.h:2411
SDL_GPUBufferBinding GPUBufferBinding
A structure specifying parameters in a buffer binding call.
Definition: SDL3pp_gpu.h:1069
void UnmapTransferBuffer(GPUTransferBuffer transfer_buffer)
Unmaps a previously mapped transfer buffer.
Definition: SDL3pp_gpu.h:6520
void ReleaseSampler(GPUSampler sampler)
Frees the given sampler as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5414
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
GPU_TEXTUREFORMAT_R8G8B8A8_UNORM.
Definition: SDL3pp_gpu.h:2521
SDL_GPUBufferLocation GPUBufferLocation
A structure specifying a location in a buffer.
Definition: SDL3pp_gpu.h:1608
GPUCommandBuffer AcquireGPUCommandBuffer(GPUDeviceParam device)
Acquire a command buffer.
Definition: SDL3pp_gpu.h:5548
SDL_GPUCopyPass * GPUCopyPassRaw
Alias to raw representation for GPUCopyPass.
Definition: SDL3pp_gpu.h:367
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_INT
GPU_TEXTUREFORMAT_R8G8B8A8_INT.
Definition: SDL3pp_gpu.h:2644
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:6636
constexpr GPUTransferBufferUsage GPU_TRANSFERBUFFERUSAGE_UPLOAD
GPU_TRANSFERBUFFERUSAGE_UPLOAD.
Definition: SDL3pp_gpu.h:3988
SDL_GPUBufferCreateInfo GPUBufferCreateInfo
A structure specifying the parameters of a buffer.
Definition: SDL3pp_gpu.h:380
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT
GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT.
Definition: SDL3pp_gpu.h:2605
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:3906
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_SNORM
GPU_TEXTUREFORMAT_R16_SNORM.
Definition: SDL3pp_gpu.h:2581
constexpr GPUPresentMode GPU_PRESENTMODE_VSYNC
GPU_PRESENTMODE_VSYNC.
Definition: SDL3pp_gpu.h:2413
SDL_GPUShader * GPUShaderRaw
Alias to raw representation for GPUShader.
Definition: SDL3pp_gpu.h:349
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_REPEAT
Specifies that the coordinates will wrap around.
Definition: SDL3pp_gpu.h:4407
SDL_GPUBuffer * GPUBufferRaw
Alias to raw representation for GPUBuffer.
Definition: SDL3pp_gpu.h:337
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_HALF4
GPU_VERTEXELEMENTFORMAT_HALF4.
Definition: SDL3pp_gpu.h:4108
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT3
GPU_VERTEXELEMENTFORMAT_UINT3.
Definition: SDL3pp_gpu.h:4039
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEX
GPU_CUBEMAPFACE_NEGATIVEX.
Definition: SDL3pp_gpu.h:3921
void End()
Ends the current compute pass.
Definition: SDL3pp_gpu.h:6476
constexpr GPUShaderStage GPU_SHADERSTAGE_VERTEX
GPU_SHADERSTAGE_VERTEX.
Definition: SDL3pp_gpu.h:4003
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D24_UNORM
GPU_TEXTUREFORMAT_D24_UNORM.
Definition: SDL3pp_gpu.h:2686
SDL_GPUCullMode GPUCullMode
Specifies the facing direction in which triangle faces will be culled.
Definition: SDL3pp_gpu.h:4150
void SetGPUStencilReference(GPURenderPass render_pass, Uint8 reference)
Sets the current stencil reference value on a command buffer.
Definition: SDL3pp_gpu.h:5778
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:6030
void WaitForSwapchain(WindowParam window)
Blocks the thread until a swapchain texture is available to be acquired.
Definition: SDL3pp_gpu.h:7096
constexpr GPUCompareOp GPU_COMPAREOP_LESS
The comparison evaluates reference < test.
Definition: SDL3pp_gpu.h:4196
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET
Texture is a depth stencil target.
Definition: SDL3pp_gpu.h:2876
void DispatchGPUCompute(GPUComputePass compute_pass, Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z)
Dispatches compute work.
Definition: SDL3pp_gpu.h:6414
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT2
GPU_VERTEXELEMENTFORMAT_INT2.
Definition: SDL3pp_gpu.h:4024
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_POINTLIST
A series of separate points.
Definition: SDL3pp_gpu.h:3850
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR
1 - destination color
Definition: SDL3pp_gpu.h:4321
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC7_RGBA_UNORM
GPU_TEXTUREFORMAT_BC7_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2563
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:6251
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:5960
GPUGraphicsPipeline CreateGPUGraphicsPipeline(GPUDeviceParam device, const GPUGraphicsPipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a graphics workflow.
Definition: SDL3pp_gpu.h:4902
constexpr GPUVertexInputRate GPU_VERTEXINPUTRATE_INSTANCE
Attribute addressing is a function of the instance index.
Definition: SDL3pp_gpu.h:4125
SDL_GPUStencilOpState GPUStencilOpState
A structure specifying the stencil operation state of a graphics pipeline.
Definition: SDL3pp_gpu.h:4522
SDL_GPUVertexElementFormat GPUVertexElementFormat
Specifies the format of a vertex attribute.
Definition: SDL3pp_gpu.h:4016
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT
GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT.
Definition: SDL3pp_gpu.h:2566
constexpr GPUShaderStage GPU_SHADERSTAGE_FRAGMENT
GPU_SHADERSTAGE_FRAGMENT.
Definition: SDL3pp_gpu.h:4006
constexpr GPUCompareOp GPU_COMPAREOP_INVALID
GPU_COMPAREOP_INVALID.
Definition: SDL3pp_gpu.h:4190
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC5_RG_UNORM
GPU_TEXTUREFORMAT_BC5_RG_UNORM.
Definition: SDL3pp_gpu.h:2560
bool WindowSupportsSwapchainComposition(WindowParam window, GPUSwapchainComposition swapchain_composition)
Determines whether a swapchain composition is supported by the window.
Definition: SDL3pp_gpu.h:6813
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:5832
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:5926
void UnmapGPUTransferBuffer(GPUDeviceParam device, GPUTransferBuffer transfer_buffer)
Unmaps a previously mapped transfer buffer.
Definition: SDL3pp_gpu.h:6514
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEZ
GPU_CUBEMAPFACE_NEGATIVEZ.
Definition: SDL3pp_gpu.h:3933
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_LINESTRIP
A series of connected lines.
Definition: SDL3pp_gpu.h:3847
GPUBuffer CreateGPUBuffer(GPUDeviceParam device, const GPUBufferCreateInfo &createinfo)
Creates a buffer object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5185
constexpr GPUStencilOp GPU_STENCILOP_DECREMENT_AND_WRAP
Decrements the current value and wraps to the maximum value.
Definition: SDL3pp_gpu.h:4257
void ReleaseWindow(WindowParam window)
Unclaims a window, destroying its swapchain structure.
Definition: SDL3pp_gpu.h:6900
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_UINT
GPU_TEXTUREFORMAT_R8_UINT.
Definition: SDL3pp_gpu.h:2611
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:2919
SDL_GPUTextureSamplerBinding GPUTextureSamplerBinding
A structure specifying parameters in a sampler binding call.
Definition: SDL3pp_gpu.h:1094
constexpr GPUTransferBufferUsage GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
GPU_TRANSFERBUFFERUSAGE_DOWNLOAD.
Definition: SDL3pp_gpu.h:3991
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:5512
constexpr GPUStencilOp GPU_STENCILOP_INVALID
GPU_STENCILOP_INVALID.
Definition: SDL3pp_gpu.h:4229
constexpr GPUTextureType GPU_TEXTURETYPE_CUBE_ARRAY
The texture is a cube array image.
Definition: SDL3pp_gpu.h:2845
SDL_GPUTextureCreateInfo GPUTextureCreateInfo
A structure specifying the parameters of a texture.
Definition: SDL3pp_gpu.h:575
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32_INT
GPU_TEXTUREFORMAT_R32_INT.
Definition: SDL3pp_gpu.h:2656
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:6564
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:6720
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT
GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT.
Definition: SDL3pp_gpu.h:2785
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2671
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT
GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT.
Definition: SDL3pp_gpu.h:2818
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB
GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2668
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_B
the blue component
Definition: SDL3pp_gpu.h:4361
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2761
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_SNORM
GPU_TEXTUREFORMAT_R16G16B16A16_SNORM.
Definition: SDL3pp_gpu.h:2587
constexpr GPUSampleCount GPU_SAMPLECOUNT_8
MSAA 8x.
Definition: SDL3pp_gpu.h:2922
constexpr GPUTextureType GPU_TEXTURETYPE_3D
The texture is a 3-dimensional image.
Definition: SDL3pp_gpu.h:2839
bool SetSwapchainParameters(WindowParam window, GPUSwapchainComposition swapchain_composition, GPUPresentMode present_mode)
Changes the swapchain parameters for the given claimed window.
Definition: SDL3pp_gpu.h:6938
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_INDEX
Buffer is an index buffer.
Definition: SDL3pp_gpu.h:3958
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT
GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT.
Definition: SDL3pp_gpu.h:2569
constexpr GPUIndexElementSize GPU_INDEXELEMENTSIZE_16BIT
The index elements are 16-bit.
Definition: SDL3pp_gpu.h:1080
constexpr GPUStencilOp GPU_STENCILOP_DECREMENT_AND_CLAMP
Decrements the current value and clamps to 0.
Definition: SDL3pp_gpu.h:4245
bool WindowSupportsGPUSwapchainComposition(GPUDeviceParam device, WindowParam window, GPUSwapchainComposition swapchain_composition)
Determines whether a swapchain composition is supported by the window.
Definition: SDL3pp_gpu.h:6804
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT4
GPU_VERTEXELEMENTFORMAT_UINT4.
Definition: SDL3pp_gpu.h:4042
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_UINT
GPU_TEXTUREFORMAT_R16_UINT.
Definition: SDL3pp_gpu.h:2620
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_FLOAT
GPU_TEXTUREFORMAT_R16G16_FLOAT.
Definition: SDL3pp_gpu.h:2593
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:5807
constexpr GPUSampleCount GPU_SAMPLECOUNT_2
MSAA 2x.
Definition: SDL3pp_gpu.h:2916
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE
Texture supports storage writes in the compute stage.
Definition: SDL3pp_gpu.h:2889
void End()
Ends the given render pass.
Definition: SDL3pp_gpu.h:6216
void BindVertexStorageBuffers(Uint32 first_slot, SpanRef< const GPUBufferRaw > storage_buffers)
Binds storage buffers for use on the vertex shader.
Definition: SDL3pp_gpu.h:5935
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:6263
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_UNORM
GPU_TEXTUREFORMAT_ASTC_8x5_UNORM.
Definition: SDL3pp_gpu.h:2713
void ReleaseTexture(GPUTexture texture)
Frees the given texture as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5394
constexpr GPUCullMode GPU_CULLMODE_FRONT
Front-facing triangles are culled.
Definition: SDL3pp_gpu.h:4155
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEY
GPU_CUBEMAPFACE_POSITIVEY.
Definition: SDL3pp_gpu.h:3924
constexpr GPUCompareOp GPU_COMPAREOP_GREATER
The comparison evaluates reference > test.
Definition: SDL3pp_gpu.h:4206
SDL_GPUCubeMapFace GPUCubeMapFace
Specifies the face of a cube map.
Definition: SDL3pp_gpu.h:3916
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_FLOAT
GPU_TEXTUREFORMAT_R16_FLOAT.
Definition: SDL3pp_gpu.h:2590
SDL_GPUSamplerCreateInfo GPUSamplerCreateInfo
A structure specifying the parameters of a sampler.
Definition: SDL3pp_gpu.h:692
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT.
Definition: SDL3pp_gpu.h:2821
void GenerateMipmapsForTexture(GPUTexture texture)
Generates mipmaps for the given texture.
Definition: SDL3pp_gpu.h:6764
constexpr GPUFrontFace GPU_FRONTFACE_COUNTER_CLOCKWISE
A triangle with counter-clockwise vertex winding will be considered front-facing.
Definition: SDL3pp_gpu.h:4175
SDL_GPUComputePipelineCreateInfo GPUComputePipelineCreateInfo
A structure specifying the parameters of a compute pipeline state.
Definition: SDL3pp_gpu.h:880
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:5573
GPUTexture CreateGPUTexture(GPUDeviceParam device, const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5106
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_R
the red component
Definition: SDL3pp_gpu.h:4355
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT.
Definition: SDL3pp_gpu.h:2806
constexpr GPUSamplerMipmapMode GPU_SAMPLERMIPMAPMODE_NEAREST
Point filtering.
Definition: SDL3pp_gpu.h:4391
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE2_NORM
GPU_VERTEXELEMENTFORMAT_BYTE2_NORM.
Definition: SDL3pp_gpu.h:4069
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_HALF2
GPU_VERTEXELEMENTFORMAT_HALF2.
Definition: SDL3pp_gpu.h:4105
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x5_UNORM
GPU_TEXTUREFORMAT_ASTC_6x5_UNORM.
Definition: SDL3pp_gpu.h:2707
constexpr GPUCullMode GPU_CULLMODE_BACK
Back-facing triangles are culled.
Definition: SDL3pp_gpu.h:4158
GPUTransferBuffer CreateTransferBuffer(const GPUTransferBufferCreateInfo &createinfo)
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Definition: SDL3pp_gpu.h:5236
void SetBufferName(GPUBuffer buffer, StringParam text)
Sets an arbitrary string constant to label a buffer.
Definition: SDL3pp_gpu.h:5273
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UINT2
GPU_VERTEXELEMENTFORMAT_UINT2.
Definition: SDL3pp_gpu.h:4036
SDL_GPUTransferBufferLocation GPUTransferBufferLocation
A structure specifying a location in a transfer buffer.
Definition: SDL3pp_gpu.h:1644
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_UNORM
GPU_TEXTUREFORMAT_ASTC_10x6_UNORM.
Definition: SDL3pp_gpu.h:2725
void ReleaseGPUTexture(GPUDeviceParam device, GPUTexture texture)
Frees the given texture as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5389
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_SNORM
GPU_TEXTUREFORMAT_R8G8B8A8_SNORM.
Definition: SDL3pp_gpu.h:2578
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE4
GPU_VERTEXELEMENTFORMAT_UBYTE4.
Definition: SDL3pp_gpu.h:4066
GPUShader CreateGPUShader(GPUDeviceParam device, const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:5034
void PushFragmentUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a fragment uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5611
GPUComputePipeline CreateGPUComputePipeline(GPUDeviceParam device, const GPUComputePipelineCreateInfo &createinfo)
Creates a pipeline object to be used in a compute workflow.
Definition: SDL3pp_gpu.h:4861
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:6593
void PushGPUComputeUniformData(GPUCommandBuffer command_buffer, Uint32 slot_index, SourceBytes data)
Pushes data to a uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5633
constexpr GPUBlendFactor GPU_BLENDFACTOR_INVALID
GPU_BLENDFACTOR_INVALID.
Definition: SDL3pp_gpu.h:4305
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:7427
SDL_GPUStorageTextureReadWriteBinding GPUStorageTextureReadWriteBinding
A structure specifying parameters related to binding textures in a compute pass.
Definition: SDL3pp_gpu.h:1887
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INVALID
GPU_VERTEXELEMENTFORMAT_INVALID.
Definition: SDL3pp_gpu.h:4018
SDL_GPUSwapchainComposition GPUSwapchainComposition
Specifies the texture format and colorspace of the swapchain textures.
Definition: SDL3pp_gpu.h:2372
SDL_GPUPrimitiveType GPUPrimitiveType
Specifies the primitive topology of a graphics pipeline.
Definition: SDL3pp_gpu.h:3836
void PushVertexUniformData(Uint32 slot_index, SourceBytes data)
Pushes data to a vertex uniform slot on the command buffer.
Definition: SDL3pp_gpu.h:5581
constexpr GPUStencilOp GPU_STENCILOP_INCREMENT_AND_CLAMP
Increments the current value and clamps to the maximum value.
Definition: SDL3pp_gpu.h:4242
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT4_NORM
GPU_VERTEXELEMENTFORMAT_SHORT4_NORM.
Definition: SDL3pp_gpu.h:4096
SDL_GPUTransferBufferUsage GPUTransferBufferUsage
Specifies how a transfer buffer is intended to be used by the client.
Definition: SDL3pp_gpu.h:3986
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT.
Definition: SDL3pp_gpu.h:2695
void GenerateMipmapsForGPUTexture(GPUCommandBuffer command_buffer, GPUTexture texture)
Generates mipmaps for the given texture.
Definition: SDL3pp_gpu.h:6758
constexpr GPUTextureType GPU_TEXTURETYPE_2D
The texture is a 2-dimensional image.
Definition: SDL3pp_gpu.h:2833
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:7064
void CopyBufferToBuffer(const GPUBufferLocation &source, const GPUBufferLocation &destination, Uint32 size, bool cycle)
Performs a buffer-to-buffer copy.
Definition: SDL3pp_gpu.h:6672
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_COLOR
source color
Definition: SDL3pp_gpu.h:4312
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC2_RGBA_UNORM
GPU_TEXTUREFORMAT_BC2_RGBA_UNORM.
Definition: SDL3pp_gpu.h:2551
void ReleaseGPUBuffer(GPUDeviceParam device, GPUBuffer buffer)
Frees the given buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5429
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB
GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2665
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B4G4R4A4_UNORM
GPU_TEXTUREFORMAT_B4G4R4A4_UNORM.
Definition: SDL3pp_gpu.h:2542
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2776
void DestroyGPUDevice(GPUDeviceRaw device)
Destroys a GPU context previously returned by GPUDevice.GPUDevice.
Definition: SDL3pp_gpu.h:4742
SDL_GPUBlitInfo GPUBlitInfo
A structure containing parameters for a blit command.
Definition: SDL3pp_gpu.h:1906
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_UNORM
GPU_TEXTUREFORMAT_ASTC_10x10_UNORM.
Definition: SDL3pp_gpu.h:2731
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2743
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:3883
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_12x10_UNORM
GPU_TEXTUREFORMAT_ASTC_12x10_UNORM.
Definition: SDL3pp_gpu.h:2734
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:5700
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2746
constexpr GPUShaderFormat GPU_SHADERFORMAT_METALLIB
Precompiled metallib shaders for Metal.
Definition: SDL3pp_gpu.h:2343
constexpr GPUFillMode GPU_FILLMODE_LINE
Polygon edges will be drawn as line segments.
Definition: SDL3pp_gpu.h:4140
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:6663
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_4x4_UNORM
GPU_TEXTUREFORMAT_ASTC_4x4_UNORM.
Definition: SDL3pp_gpu.h:2698
void WaitForGPUSwapchain(GPUDeviceParam device, WindowParam window)
Blocks the thread until a swapchain texture is available to be acquired.
Definition: SDL3pp_gpu.h:7091
constexpr GPUPrimitiveType GPU_PRIMITIVETYPE_TRIANGLESTRIP
A series of connected triangles.
Definition: SDL3pp_gpu.h:3841
constexpr GPUShaderFormat GPU_SHADERFORMAT_MSL
MSL shaders for Metal.
Definition: SDL3pp_gpu.h:2340
void PopDebugGroup()
Ends the most-recently pushed debug group.
Definition: SDL3pp_gpu.h:5374
void UploadToTexture(const GPUTextureTransferInfo &source, const GPUTextureRegion &destination, bool cycle)
Uploads data from a transfer buffer to a texture.
Definition: SDL3pp_gpu.h:6572
void ReleaseBuffer(GPUBuffer buffer)
Frees the given buffer as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5434
void ReleaseGPUShader(GPUDeviceParam device, GPUShader shader)
Frees the given shader as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5492
constexpr GPUCompareOp GPU_COMPAREOP_NEVER
The comparison always evaluates false.
Definition: SDL3pp_gpu.h:4193
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_SNORM
GPU_TEXTUREFORMAT_R16G16_SNORM.
Definition: SDL3pp_gpu.h:2584
void SetBlendConstants(FColorRaw blend_constants)
Sets the current blend constants on a command buffer.
Definition: SDL3pp_gpu.h:5765
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_ALPHA
source alpha
Definition: SDL3pp_gpu.h:4324
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2755
void SetTextureName(GPUTexture texture, StringParam text)
Sets an arbitrary string constant to label a texture.
Definition: SDL3pp_gpu.h:5303
GPUDevice CreateGPUDevice(GPUShaderFormat format_flags, bool debug_mode, StringParam name)
Creates a GPU context.
Definition: SDL3pp_gpu.h:4645
void * MapGPUTransferBuffer(GPUDeviceParam device, GPUTransferBuffer transfer_buffer, bool cycle)
Maps a transfer buffer into application address space.
Definition: SDL3pp_gpu.h:6493
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2752
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R10G10B10A2_UNORM
GPU_TEXTUREFORMAT_R10G10B10A2_UNORM.
Definition: SDL3pp_gpu.h:2533
void BindPipeline(GPUGraphicsPipeline graphics_pipeline)
Binds a graphics pipeline on a render pass to be used in rendering.
Definition: SDL3pp_gpu.h:5706
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:7294
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B8G8R8A8_UNORM
GPU_TEXTUREFORMAT_B8G8R8A8_UNORM.
Definition: SDL3pp_gpu.h:2545
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:6154
SDL_GPUTransferBufferCreateInfo GPUTransferBufferCreateInfo
A structure specifying the parameters of a transfer buffer.
Definition: SDL3pp_gpu.h:482
constexpr GPULoadOp GPU_LOADOP_DONT_CARE
The previous contents of the texture need not be preserved.
Definition: SDL3pp_gpu.h:3873
constexpr GPUBlendFactor GPU_BLENDFACTOR_ZERO
0
Definition: SDL3pp_gpu.h:4308
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_SNORM
GPU_TEXTUREFORMAT_R8G8_SNORM.
Definition: SDL3pp_gpu.h:2575
SDL_GPURenderPass * GPURenderPassRaw
Alias to raw representation for GPURenderPass.
Definition: SDL3pp_gpu.h:361
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_INT
GPU_TEXTUREFORMAT_R32G32B32A32_INT.
Definition: SDL3pp_gpu.h:2662
constexpr GPUBlendOp GPU_BLENDOP_MAX
max(source, destination)
Definition: SDL3pp_gpu.h:4289
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16_INT
GPU_TEXTUREFORMAT_R16G16_INT.
Definition: SDL3pp_gpu.h:2650
GPUTextureFormat GetGPUSwapchainTextureFormat(GPUDeviceParam device, WindowParam window)
Obtains the texture format of the swapchain for the given window.
Definition: SDL3pp_gpu.h:6994
SDL_GPUBufferRegion GPUBufferRegion
A structure specifying a region of a buffer.
Definition: SDL3pp_gpu.h:1586
GPUShader CreateShader(const GPUShaderCreateInfo &createinfo)
Creates a shader to be used when creating a graphics pipeline.
Definition: SDL3pp_gpu.h:5040
const char * GetGPUDriver(int index)
Get the name of a built in GPU driver.
Definition: SDL3pp_gpu.h:4777
SDL_GPUTextureFormat GPUTextureFormat
Specifies the pixel format of a texture.
Definition: SDL3pp_gpu.h:2507
constexpr GPUStoreOp GPU_STOREOP_STORE
The contents generated during the render pass will be written to memory.
Definition: SDL3pp_gpu.h:3886
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2674
void InsertDebugLabel(StringParam text)
Inserts an arbitrary string label into the command buffer callstream.
Definition: SDL3pp_gpu.h:5324
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2680
GPUTexture CreateTexture(const GPUTextureCreateInfo &createinfo)
Creates a texture object to be used in graphics or compute workflows.
Definition: SDL3pp_gpu.h:5112
constexpr GPUBlendFactor GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
min(source alpha, 1 - destination alpha)
Definition: SDL3pp_gpu.h:4342
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA
1 - destination alpha
Definition: SDL3pp_gpu.h:4333
void BindPipeline(GPUComputePipeline compute_pipeline)
Binds a compute pipeline on a command buffer for use in compute dispatch.
Definition: SDL3pp_gpu.h:6285
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE2
GPU_VERTEXELEMENTFORMAT_BYTE2.
Definition: SDL3pp_gpu.h:4057
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_UNORM
GPU_TEXTUREFORMAT_ASTC_8x8_UNORM.
Definition: SDL3pp_gpu.h:2719
bool TextureSupportsSampleCount(GPUTextureFormat format, GPUSampleCount sample_count)
Determines if a sample count for a texture format is supported.
Definition: SDL3pp_gpu.h:7410
constexpr GPUStencilOp GPU_STENCILOP_KEEP
Keeps the current value.
Definition: SDL3pp_gpu.h:4232
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_INT3
GPU_VERTEXELEMENTFORMAT_INT3.
Definition: SDL3pp_gpu.h:4027
SDL_GPUDevice * GPUDeviceRaw
Alias to raw representation for GPUDevice.
Definition: SDL3pp_gpu.h:304
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ
Buffer supports storage reads in the compute stage.
Definition: SDL3pp_gpu.h:3969
void ClaimWindow(WindowParam window)
Claims a window, creating a swapchain structure for it.
Definition: SDL3pp_gpu.h:6879
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:6727
const char * GetGPUDeviceDriver(GPUDeviceParam device)
Returns the name of the backend used to create this GPU context.
Definition: SDL3pp_gpu.h:4787
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2764
void SetGPUBlendConstants(GPURenderPass render_pass, FColorRaw blend_constants)
Sets the current blend constants on a command buffer.
Definition: SDL3pp_gpu.h:5759
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16G16B16A16_UINT
GPU_TEXTUREFORMAT_R16G16B16A16_UINT.
Definition: SDL3pp_gpu.h:2626
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT.
Definition: SDL3pp_gpu.h:2803
SDL_GPUStorageBufferReadWriteBinding GPUStorageBufferReadWriteBinding
A structure specifying parameters related to binding buffers in a compute pass.
Definition: SDL3pp_gpu.h:1897
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x4_UNORM
GPU_TEXTUREFORMAT_ASTC_5x4_UNORM.
Definition: SDL3pp_gpu.h:2701
void End()
Ends the current copy pass.
Definition: SDL3pp_gpu.h:6746
void ReleaseGraphicsPipeline(GPUGraphicsPipeline graphics_pipeline)
Frees the given graphics pipeline as soon as it is safe to do so.
Definition: SDL3pp_gpu.h:5518
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_USHORT4
GPU_VERTEXELEMENTFORMAT_USHORT4.
Definition: SDL3pp_gpu.h:4090
GPUFence * SubmitAndAcquireFence()
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated...
Definition: SDL3pp_gpu.h:7227
constexpr GPUShaderFormat GPU_SHADERFORMAT_INVALID
INVALID.
Definition: SDL3pp_gpu.h:2325
void WaitForIdle()
Blocks the thread until the GPU is completely idle.
Definition: SDL3pp_gpu.h:7278
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:6377
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_B5G6R5_UNORM
GPU_TEXTUREFORMAT_B5G6R5_UNORM.
Definition: SDL3pp_gpu.h:2536
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:6694
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_UNORM
GPU_TEXTUREFORMAT_R8G8_UNORM.
Definition: SDL3pp_gpu.h:2518
bool WindowSupportsGPUPresentMode(GPUDeviceParam device, WindowParam window, GPUPresentMode present_mode)
Determines whether a presentation mode is supported by the window.
Definition: SDL3pp_gpu.h:6835
void EndGPURenderPass(GPURenderPass render_pass)
Ends the given render pass.
Definition: SDL3pp_gpu.h:6211
constexpr GPUBlendOp GPU_BLENDOP_REVERSE_SUBTRACT
(destination * destination_factor) - (source * source_factor)
Definition: SDL3pp_gpu.h:4283
constexpr GPUColorComponentFlags GPU_COLORCOMPONENT_G
the green component
Definition: SDL3pp_gpu.h:4358
constexpr GPUSwapchainComposition GPU_SWAPCHAINCOMPOSITION_SDR
GPU_SWAPCHAINCOMPOSITION_SDR.
Definition: SDL3pp_gpu.h:2374
constexpr GPUBufferUsageFlags GPU_BUFFERUSAGE_INDIRECT
Buffer is an indirect buffer.
Definition: SDL3pp_gpu.h:3961
SDL_GPURasterizerState GPURasterizerState
A structure specifying the parameters of the graphics pipeline rasterizer state.
Definition: SDL3pp_gpu.h:4549
void WaitForGPUIdle(GPUDeviceParam device)
Blocks the thread until the GPU is completely idle.
Definition: SDL3pp_gpu.h:7273
bool GPUSupportsProperties(PropertiesParam props)
Checks for GPU runtime support.
Definition: SDL3pp_gpu.h:4622
constexpr GPUTextureUsageFlags GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ
Texture supports storage reads in the compute stage.
Definition: SDL3pp_gpu.h:2885
constexpr GPUBlendOp GPU_BLENDOP_SUBTRACT
(source * source_factor) - (destination * destination_factor)
Definition: SDL3pp_gpu.h:4280
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8_INT
GPU_TEXTUREFORMAT_R8_INT.
Definition: SDL3pp_gpu.h:2638
void InsertGPUDebugLabel(GPUCommandBuffer command_buffer, StringParam text)
Inserts an arbitrary string label into the command buffer callstream.
Definition: SDL3pp_gpu.h:5318
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R16_UNORM
GPU_TEXTUREFORMAT_R16_UNORM.
Definition: SDL3pp_gpu.h:2524
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2773
void EndGPUCopyPass(GPUCopyPass copy_pass)
Ends the current copy pass.
Definition: SDL3pp_gpu.h:6741
SDL_GPUSamplerAddressMode GPUSamplerAddressMode
Specifies behavior of texture sampling when the coordinates exceed the 0-1 range.
Definition: SDL3pp_gpu.h:4405
void DispatchGPUComputeIndirect(GPUComputePass compute_pass, GPUBuffer buffer, Uint32 offset)
Dispatches compute work with parameters set from a buffer.
Definition: SDL3pp_gpu.h:6449
bool SetGPUAllowedFramesInFlight(GPUDeviceParam device, Uint32 allowed_frames_in_flight)
Configures the maximum allowed number of frames in flight.
Definition: SDL3pp_gpu.h:6972
constexpr GPUStoreOp GPU_STOREOP_DONT_CARE
The contents generated during the render pass are not needed and may be discarded.
Definition: SDL3pp_gpu.h:3892
constexpr GPULoadOp GPU_LOADOP_CLEAR
The contents of the texture will be cleared to a color.
Definition: SDL3pp_gpu.h:3867
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM
GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM.
Definition: SDL3pp_gpu.h:4078
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:7156
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R32G32B32A32_UINT
GPU_TEXTUREFORMAT_R32G32B32A32_UINT.
Definition: SDL3pp_gpu.h:2635
constexpr GPUTextureType GPU_TEXTURETYPE_2D_ARRAY
The texture is a 2-dimensional array image.
Definition: SDL3pp_gpu.h:2836
SDL_GPUFrontFace GPUFrontFace
Specifies the vertex winding that will cause a triangle to be determined to be front-facing.
Definition: SDL3pp_gpu.h:4169
constexpr GPUPresentMode GPU_PRESENTMODE_MAILBOX
GPU_PRESENTMODE_MAILBOX.
Definition: SDL3pp_gpu.h:2419
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_NEGATIVEY
GPU_CUBEMAPFACE_NEGATIVEY.
Definition: SDL3pp_gpu.h:3927
void PushDebugGroup(StringParam name)
Begins a debug group with an arbitrary name.
Definition: SDL3pp_gpu.h:5355
bool GPUSupportsShaderFormats(GPUShaderFormat format_flags, StringParam name)
Checks for GPU runtime support.
Definition: SDL3pp_gpu.h:4606
constexpr GPUShaderFormat GPU_SHADERFORMAT_SPIRV
SPIR-V shaders for Vulkan.
Definition: SDL3pp_gpu.h:2331
SDL_GPUStencilOp GPUStencilOp
Specifies what happens to a stored stencil value if stencil tests fail or pass.
Definition: SDL3pp_gpu.h:4227
bool WindowSupportsPresentMode(WindowParam window, GPUPresentMode present_mode)
Determines whether a presentation mode is supported by the window.
Definition: SDL3pp_gpu.h:6842
SDL_GPUFence GPUFence
An opaque handle representing a fence.
Definition: SDL3pp_gpu.h:1918
SDL_GPUComputePass * GPUComputePassRaw
Alias to raw representation for GPUComputePass.
Definition: SDL3pp_gpu.h:364
constexpr GPUSamplerAddressMode GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT
Specifies that the coordinates will wrap around mirrored.
Definition: SDL3pp_gpu.h:4412
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:5449
SDL_GPUIndexElementSize GPUIndexElementSize
Specifies the size of elements in an index buffer.
Definition: SDL3pp_gpu.h:1078
SDL_GPUShaderCreateInfo GPUShaderCreateInfo
A structure specifying code and metadata for creating a shader object.
Definition: SDL3pp_gpu.h:760
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:5799
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:6352
void DrawPrimitives(Uint32 num_vertices, Uint32 num_instances, Uint32 first_vertex, Uint32 first_instance)
Draws data using bound graphics state.
Definition: SDL3pp_gpu.h:6129
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT
GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT.
Definition: SDL3pp_gpu.h:2797
void SetGPUScissor(GPURenderPass render_pass, const RectRaw &scissor)
Sets the current scissor state on a command buffer.
Definition: SDL3pp_gpu.h:5738
SDL_GPUVertexInputState GPUVertexInputState
A structure specifying the parameters of a graphics pipeline vertex input state.
Definition: SDL3pp_gpu.h:4513
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_D16_UNORM
GPU_TEXTUREFORMAT_D16_UNORM.
Definition: SDL3pp_gpu.h:2683
void SubmitGPUCommandBuffer(GPUCommandBuffer command_buffer)
Submits a command buffer so its commands can be processed on the GPU.
Definition: SDL3pp_gpu.h:7187
SDL_GPUVertexInputRate GPUVertexInputRate
Specifies the rate at which vertex attributes are pulled from buffers.
Definition: SDL3pp_gpu.h:4118
constexpr GPUFilter GPU_FILTER_NEAREST
Point filtering.
Definition: SDL3pp_gpu.h:4376
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB
GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2767
constexpr GPUCubeMapFace GPU_CUBEMAPFACE_POSITIVEX
GPU_CUBEMAPFACE_POSITIVEX.
Definition: SDL3pp_gpu.h:3918
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:6307
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:6343
GPUCopyPass BeginGPUCopyPass(GPUCommandBuffer command_buffer)
Begins a copy pass on a command buffer.
Definition: SDL3pp_gpu.h:6537
constexpr GPUBlendOp GPU_BLENDOP_ADD
(source * source_factor) + (destination * destination_factor)
Definition: SDL3pp_gpu.h:4277
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:3861
constexpr GPUTextureType GPU_TEXTURETYPE_CUBE
The texture is a cube image.
Definition: SDL3pp_gpu.h:2842
SDL_GPUFilter GPUFilter
Specifies a filter operation used by a sampler.
Definition: SDL3pp_gpu.h:4374
constexpr GPUStencilOp GPU_STENCILOP_INCREMENT_AND_WRAP
Increments the current value and wraps back to 0.
Definition: SDL3pp_gpu.h:4252
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB
GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB.
Definition: SDL3pp_gpu.h:2677
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_INVALID
GPU_TEXTUREFORMAT_INVALID.
Definition: SDL3pp_gpu.h:2509
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_5x5_UNORM
GPU_TEXTUREFORMAT_ASTC_5x5_UNORM.
Definition: SDL3pp_gpu.h:2704
SDL_GPUBlitRegion GPUBlitRegion
A structure specifying a region of a texture used in the blit operation.
Definition: SDL3pp_gpu.h:4426
SDL_GPUViewport GPUViewport
A structure specifying a viewport.
Definition: SDL3pp_gpu.h:1059
GPUShaderFormat GetShaderFormats()
Returns the supported shader formats for this GPU context.
Definition: SDL3pp_gpu.h:4811
SDL_GPUComputePipeline * GPUComputePipelineRaw
Alias to raw representation for GPUComputePipeline.
Definition: SDL3pp_gpu.h:352
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_BYTE4_NORM
GPU_VERTEXELEMENTFORMAT_BYTE4_NORM.
Definition: SDL3pp_gpu.h:4072
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_FLOAT
GPU_VERTEXELEMENTFORMAT_FLOAT.
Definition: SDL3pp_gpu.h:4045
constexpr GPUSampleCount GPU_SAMPLECOUNT_1
No multisampling.
Definition: SDL3pp_gpu.h:2913
SDL_GPUIndirectDrawCommand GPUIndirectDrawCommand
A structure specifying the parameters of an indirect draw command.
Definition: SDL3pp_gpu.h:4442
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:5682
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA
1 - source alpha
Definition: SDL3pp_gpu.h:4327
constexpr GPUBlendFactor GPU_BLENDFACTOR_ONE
1
Definition: SDL3pp_gpu.h:4310
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM
GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM.
Definition: SDL3pp_gpu.h:4075
constexpr GPUVertexElementFormat GPU_VERTEXELEMENTFORMAT_SHORT4
GPU_VERTEXELEMENTFORMAT_SHORT4.
Definition: SDL3pp_gpu.h:4084
void PopGPUDebugGroup(GPUCommandBuffer command_buffer)
Ends the most-recently pushed debug group.
Definition: SDL3pp_gpu.h:5369
constexpr GPULoadOp GPU_LOADOP_LOAD
The previous contents of the texture will be preserved.
Definition: SDL3pp_gpu.h:3864
constexpr GPUCullMode GPU_CULLMODE_NONE
No triangles are culled.
Definition: SDL3pp_gpu.h:4152
constexpr GPUBlendFactor GPU_BLENDFACTOR_DST_ALPHA
destination alpha
Definition: SDL3pp_gpu.h:4330
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:4943
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:6193
void EndGPUComputePass(GPUComputePass compute_pass)
Ends the current compute pass.
Definition: SDL3pp_gpu.h:6471
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_ASTC_10x5_UNORM
GPU_TEXTUREFORMAT_ASTC_10x5_UNORM.
Definition: SDL3pp_gpu.h:2722
constexpr GPUTextureFormat GPU_TEXTUREFORMAT_R8G8_UINT
GPU_TEXTUREFORMAT_R8G8_UINT.
Definition: SDL3pp_gpu.h:2614
SDL_FColor FColorRaw
Alias to raw representation for FColor.
Definition: SDL3pp_pixels.h:81
SDL_Rect RectRaw
Alias to raw representation for Rect.
Definition: SDL3pp_rect.h:28
Sint32 Sint32
A signed 32-bit integer type.
Definition: SDL3pp_stdinc.h:308
Uint32 Uint32
An unsigned 32-bit integer type.
Definition: SDL3pp_stdinc.h:325
Uint8 Uint8
An unsigned 8-bit integer type.
Definition: SDL3pp_stdinc.h:257
Main include header for the SDL3pp library.
Safely wrap GPUDevice for non owning parameters.
Definition: SDL3pp_gpu.h:311
GPUDeviceRaw value
parameter's GPUDeviceRaw
Definition: SDL3pp_gpu.h:312
constexpr GPUDeviceParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_gpu.h:321
constexpr GPUDeviceParam(GPUDeviceRaw value)
Constructs from GPUDeviceRaw.
Definition: SDL3pp_gpu.h:315
constexpr auto operator<=>(const GPUDeviceParam &other) const =default
Comparison.
Semi-safe reference for GPUDevice.
Definition: SDL3pp_gpu.h:3792
GPUDeviceRef(const GPUDeviceRef &other)
Copy constructor.
Definition: SDL3pp_gpu.h:3806
GPUDeviceRef(GPUDeviceParam resource)
Constructs from GPUDeviceParam.
Definition: SDL3pp_gpu.h:3800
~GPUDeviceRef()
Destructor.
Definition: SDL3pp_gpu.h:3812
Safely wrap Properties for non owning parameters.
Definition: SDL3pp_properties.h:52
Safely wrap Window for non owning parameters.
Definition: SDL3pp_video.h:54