Commit Graph

27 Commits

Author SHA1 Message Date
Caleb Cornett 4f722d372a
GPU: Metal vertex buffer indices should grow upward (#10837) 2024-09-15 20:17:43 -05:00
Ethan Lee 96e147b2b9 gpu: Rework driver name queries, add GetGPUShaderFormats 2024-09-13 12:29:40 -04:00
Caleb Cornett a45a2caf49
GPU: Rename VertexBinding to VertexBufferDescription (#10811) 2024-09-12 18:02:39 -05:00
Evan Hemsley 66489f91bb
GPU: Cube Arrays (#10800)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-12 13:41:46 -07:00
Caleb Cornett ddd5723e2e
GPU: Remove pitch parameters from indirect draw calls (#10803) 2024-09-11 23:30:14 -07:00
Evan Hemsley 2b8a349b26
Add SDL_BindGPUComputeSamplers (#10778)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-10 19:20:14 -07:00
Evan Hemsley 0b6f993dea
GPU: Zero-init handling (#10786) 2024-09-10 18:17:08 -07:00
Andrei Alexeyev 1e9ff723ad GPU: fix SDL_GetGPUSwapchainTextureFormat error return value 2024-09-10 08:36:57 -07:00
cosmonaut d3091b9538 Remove SDL_GPUDepthStencilValue struct 2024-09-09 10:55:05 -07:00
Evan Hemsley 668e2f82d2
Add load op and clear color to SDL_BlitGPUTexture (#10767) 2024-09-09 10:19:52 -07:00
Evan Hemsley 68a9991ec9
GPU: Document structs (#10742) 2024-09-07 08:29:14 -07:00
Daniel Ludwig 0a44ea1b0b Amend use of non-standard compiler syntax 2024-09-07 11:50:40 +03:00
Caleb Cornett 9730f62e8c
GPU: Rename struct members and parameters for SDL3 naming conventions (#10730)
---------

Co-authored-by: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com>
2024-09-06 16:38:23 -07:00
Sam Lantinga 8edb901724 Fixed crashes in Metal renderer due to ARC releasing references on random memory in newly allocated structs 2024-09-05 19:48:33 -07:00
Caleb Cornett 2d4eb29c37
Add SDL_SetGPUBlendConstants, SDL_SetGPUStencilReference (#10704) 2024-09-05 17:41:23 -05:00
Sam Lantinga 387774ab8a Build config flags are either defined or undefined, never 0
This is for consistency with CMake build configuration

Also added SDL_VIDEO_RENDER_GPU to the non-CMake build configurations
2024-09-05 09:52:40 -07:00
Quinn X. J. f61d4db39a GPU: `colorAttachmentDescriptions` should be `const`
The `colorAttachmentDescriptions` field of `SDL_GPUGraphicsPipelineAttachmentInfo` should be marked `const`,
similarly to the `vertexBindings` and `vertexAttributes` fields of `SDL_GPUVertexInputState`.
2024-09-05 05:22:52 -07:00
Evan Hemsley 1788be8547
GPU: Add const to some function parameters (#10694) 2024-09-04 13:53:41 -07:00
Andrei Alexeyev fb7245fb93
GPU: Add support for more texture formats (#10641) 2024-09-02 19:14:48 -05:00
Caleb Cornett f405def691
Change GPU flag enums to defines (#10681) 2024-09-02 15:19:43 -07:00
Davis Gallinghouse deb313dd99 GPU: Compile Metal shader source from NSString
Using the @() syntax to construct an NSString assumes the parenthesized
pointer is null-terminated, but the Metal shader source included in
render/sdlgpu/shaders/metal.h is not null-terminated.

Quoting the clang documentation on Objective-C literals:

    When the type of the parenthesized expression is (char *) or (const
    char *), the result of the boxed expression is a pointer to an
    NSString object containing equivalent character data, which is
    assumed to be ‘\0’-terminated and UTF-8 encoded.

Because the @() syntax assumes null-termination, it may read garbage
data after the shader source (up to the next null byte), which can then
cause the Metal shader compiler to fail. To prevent this, instead of
using the @() boxing syntax, we explicitly construct an NSString using
the string length passed by the caller.
2024-09-02 07:20:36 -07:00
Sam Lantinga b17ca32d8c Changed GPU driver names to match renderer driver names
Fixes https://github.com/libsdl-org/SDL/issues/10650
2024-08-31 10:06:27 -07:00
Jan Sedivy 00708b976a GPU Metal: Fix uninitialized memory 2024-08-31 07:29:32 -07:00
Evan Hemsley 12ecdb9dde
GPU: Rename some awkwardly named functions (#10642) 2024-08-30 15:31:10 -07:00
Sam Lantinga 5518aca054 Use stdbool internally in SDL 2024-08-29 18:54:05 -07:00
Sam Lantinga d70578b9aa Renamed Gpu to GPU 2024-08-29 17:33:52 -07:00
cosmonaut 2e7d5bb429 Add the SDL_GPU API
Project Lead: Evan Hemsley <evan@moonside.games>

Co-designer, Metal Port, Console Ports:

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>

Production, QA, Debug:

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>

SDL_Render Driver, Bugfixes:

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

Additional D3D12 Programming, Bugfixes:

Co-authored-by: Bart van der Werf <bluelive@gmail.com>

Bugfixes and Feedback:

Co-authored-by: Zakary Strange <zakarystrange@gmail.com>
Co-authored-by: meyraud705 <meyraud705@gmail.com>
Co-authored-by: Joshua T. Fisher <playmer@gmail.com>
Co-authored-by: Topi Ritala <ritalat@fastmail.com>
Co-authored-by: David Gow <david@ingeniumdigital.com>

Original API Proposal:

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2024-08-29 15:57:29 -07:00