Commit Graph

95 Commits

Author SHA1 Message Date
Ethan Lee
e8065ad9a0 gpu: Update the CHECK_DEVICE_MAGIC comments one more time.
Me fail English? That's unpossible!
2026-02-01 14:02:58 -05:00
Ethan Lee
415cc64d2f gpu: Update comments above CHECK_DEVICE_MAGIC macro 2026-02-01 13:54:27 -05:00
Aaron Benjamin
9a91d7236a GPU: OpenXR integration (#14837)
Based on Beyley's initial draft in #11601.

Co-authored-by: Beyley Cardellio <ep1cm1n10n123@gmail.com>
Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
2026-01-30 17:18:51 -05:00
Cameron Cawley
25583798a0 Fix mapping between surface and GPU pixel formats 2026-01-18 12:48:24 -08:00
Sam Lantinga
5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
Edgar San Martin, Jr.
bd29d60d3c GPU: Add bounds validation for slot bindings and uniform data pushes. (#14692) 2025-12-23 08:36:06 -08:00
Evan Hemsley
2b1904a849 GPU: Prefer D3D12 over Vulkan when available 2025-12-01 17:50:23 -05:00
Antti Ala-Fossi
29f3844b01 Fix assert in SDL_BeginGPURenderPass 2025-11-25 10:46:53 -08:00
cosmonaut
b067dfa345 GPU: Validate that buffer size is at least 4 bytes 2025-10-13 11:04:59 -07:00
Sam Lantinga
a2a60f75c7 Temporarily disabled texture binding validation
There are some advanced use cases that trip over this, so temporarily disabling the validation pending further review.

Reference: https://github.com/libsdl-org/SDL/issues/13871
2025-10-08 19:50:48 -07:00
Sam Lantinga
8a5f9a3837 Removed validate_feature_indirect_draw_first_instance_disabled (thanks @rabbit-ecl!)
It was incorrectly checking the direct draw functions instead of checking indirect draw buffers.
2025-09-30 11:36:29 -07:00
Sam Lantinga
2809ce9389 Set enable_depth_clip to true by default if SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN is false 2025-09-29 13:28:00 -07:00
Sam Lantinga
f61e271e11 Generalize and validate optional GPU feature properties
Fixes https://github.com/libsdl-org/SDL/issues/13139
Fixes https://github.com/libsdl-org/SDL/issues/13138
2025-09-29 12:42:47 -07:00
Sam Lantinga
25b2d2c821 Use new parameter validation macro 2025-09-18 20:58:32 -07:00
cosmonaut
9603360b7e GPU: Allow rendering into depth texture layers and levels 2025-09-13 07:11:43 -07:00
Sam Lantinga
035eed351c Added SDL_GetPixelFormatFromGPUTextureFormat() and SDL_GetGPUTextureFormatFromPixelFormat()
Fixes https://github.com/libsdl-org/SDL/issues/13899
2025-09-10 12:08:04 -07:00
Jordan Saunders
265236d952 Fix two uninitialized variables
Found when running in valgrind looking at another issue.

- RenderPass' depth_stencil_target
    Tripped in SDL_BindGPUFragmentSamplers when not binding a DS target

- VulkanCommandBuffer's swapchainRequested
    Tripped in VULKAN_Submit for the end transition barrier when
    creating an image. The field is only reset when reused, not on first
    use
2025-08-30 06:05:22 -07:00
Petar Popovic
6a5af95364 SDL_gpu.c: Fixed deref-before-check warning 2025-07-26 12:08:23 -07:00
Ryan C. Gordon
07ef532681 hints: Renamed SDL_HINT_LOG_BACKENDS to SDL_DEBUG_LOGGING.
This still logs backend choices, but we might use it for other things. For
example, what Android device is being used, or all the devices we enumerated,
etc.

Ideally this eventually logs all the stuff we often have to ask followup
questions about.
2025-07-22 13:19:30 -04:00
Ryan C. Gordon
10004ab0ea hints: Added SDL_HINT_LOG_BACKENDS.
Fixes #13354.
2025-07-14 19:49:38 -04:00
Ryan C. Gordon
190afc0f4f gpu: Fixed uninitialized variable in SDL_AcquireGPUCommandBuffer().
Fixes #13191.
2025-07-11 18:18:47 -04:00
WillyJL
4eff36ef53 SDL3 GPU: Fix -Wbool-conversion warnings 2025-06-29 13:32:21 -04:00
Sam Lantinga
d7939abf42 Use consistent style for pointer declarations and casts 2025-06-18 10:03:44 -07:00
Evan Hemsley
fbba5b272a GPU: Binding validation and prevent null dereference if expected binding is missing (#13164) 2025-06-02 13:39:58 -07:00
cosmonaut
2dad6534b8 GPU: Add missing compute-writeable texture formats 2025-05-19 18:08:35 -07:00
Ethan Lee
510126ee63 gpu: Check shader format support in PrepareDriver 2025-05-19 08:20:33 -07:00
Logan
8289656a4e GPU: Update to set supported shader formats inside CreateDevice 2025-05-18 18:32:50 -07:00
Evan Hemsley
b08d79b832 GPU: Check that a texture format is valid for compute writes (#13044) 2025-05-14 16:24:05 -07:00
Evan Hemsley
604c192154 GPU: Always return NULL if beginning a pass fails an assert check 2025-05-14 15:23:23 -07:00
cosmonaut
252129f433 GPU: Debug mode layer and level index checks
Resolves #13033
2025-05-14 12:22:18 -07:00
Manuel
f85f83ec7c SDL GPU: Implemented opt out Vulkan device features (#13016) 2025-05-13 17:28:28 -07:00
Evan Hemsley
86b206dadf GPU: Special case to avoid assert on GenerateMipmaps (#12995) 2025-05-09 21:45:54 -07:00
Evan Hemsley
a163257295 GPU: Validate that textures are not bound for both read and write on render passes (#12925) 2025-04-29 16:52:52 -07:00
Eri the Switch
3343cb2147 gpu: rework alpha-to-coverage validation 2025-04-23 19:28:11 -07:00
Caleb Cornett
44710a248c gpu: alpha-to-coverage support 2025-04-04 11:39:08 -07:00
Sam Lantinga
39a3b14dfe Renamed SDL_GetGPUDeviceDebugProperties() to SDL_GetGPUDeviceProperties()
We may want to extend this with additional properties in the future.

Also removed SDL_PROP_GPU_DEVICE_DEBUG_VULKAN_CONFORMANCE_STRING. If we need feature level queries we can add them in the future.
2025-04-03 14:59:11 -07:00
Lucas Murray
f78aa4d8ea GPU: Expose debug information from devices
Co-authored-by: Nikita Kogut <glinka1202@gmail.com>
2025-04-03 08:52:51 -07:00
Sam Lantinga
2fbb583290 SDL_ClaimWindowForGPUDevice() should fail for transparent windows
The GPU API doesn't currently support transparent windows (transparent swapchain effects doesn't seem possible on D3D12) so we should explicitly fail so users don't expect transparency and then not get it.

Fixes https://github.com/libsdl-org/SDL/issues/12410
2025-03-21 12:14:20 -07:00
Caleb Cornett
9fcca83512 gpu: Validate that CopyGPUTextureToTexture formats match 2025-03-09 17:29:47 -04:00
Ethan Lee
db817a37f4 gpu: Fix forward declaration and inclusion of PrivateGPUDriver 2025-02-24 15:46:39 -05:00
Caleb Cornett
60b7faa987 gpu: Validate that reserved struct members are unset 2025-02-24 08:57:09 -08:00
coffeechriph
55fd205ba4 Add missing integer texture formats to SDL_GPUTextureFormatTexelBlockSize (#12151) 2025-02-11 14:21:30 -08:00
cosmonaut
4294c06836 GPU: Check texture format support in pipeline creation 2025-01-14 10:16:20 -08:00
Evan Hemsley
fb6df93384 GPU: Add name properties to resources (#11946) 2025-01-13 17:29:08 -08:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Evan Hemsley
3ee39f6c3f GPU: Revise swapchain acquisition (#11633)
---------

Co-authored-by: Lucas Murray <22484+lmurray@users.noreply.github.com>
2024-12-11 11:16:35 -08:00
Anonymous Maarten
fb71b44231 gpu: define EXPAND_ARRAY_IF_NEEDED macro once and make it function-like 2024-12-09 00:01:16 +01:00
Evan Hemsley
fa5f84fb6e GPU: Add SetGPUAllowedFramesInFlight (#11599) 2024-12-06 11:56:20 -08:00
cosmonaut
5a74aadac9 GPU: Null check shader inputs in CreateGPUGraphicsPipeline 2024-11-12 14:31:13 -08:00
Evan Hemsley
119b4fa5f5 GPU: Remove D3D11 backend and allow D3D12 to ingest DXBC (#11456) 2024-11-12 10:55:21 -08:00