Commit Graph

103 Commits

Author SHA1 Message Date
Ryan C. Gordon
3a6a3ab64f gpu: Fix memory leak in Vulkan backend. 2024-10-04 04:46:28 -04:00
Sam Lantinga
3234a3b902 Simplified internal SDL_Surface structure 2024-10-01 08:10:04 -07:00
cosmonaut
fa14b53273 GPU Vulkan: Clear up some swapchain edge cases 2024-09-30 15:10:27 -07:00
Evan Hemsley
afdf325fb4 GPU: Add swapchain dimension out params (#11003) 2024-09-30 10:23:19 -07:00
Evan Hemsley
fc242abbd2 GPU: recreate swapchain on window pixel size change event (#10985) 2024-09-28 18:09:56 -07:00
Ethan Lee
0852307b58 gpu: Check Vulkan device features for IsDeviceSuitable 2024-09-27 19:58:30 -04:00
cosmonaut
fb165a542b GPU Vulkan: add resolve info to framebuffer and render pass lookups 2024-09-27 15:57:57 -07:00
cosmonaut
eedd2039f9 GPU: 32-bit component texture formats 2024-09-27 16:26:43 -04:00
Evan Hemsley
05d0656bd6 GPU: Simultaneous compute pass read-write (#10965) 2024-09-27 12:49:37 -07:00
Sam Lantinga
d39acc6d1e Fixed warning C4702: unreachable code 2024-09-27 11:19:54 -07:00
Caleb Cornett
5ff6e8d522 GPU: Add enable_depth_clip to RasterizerState (#10964) 2024-09-27 11:18:54 -05:00
Evan Hemsley
be401dd1e3 GPU: More robust error reporting (#10958)
---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-27 00:30:18 -07:00
cosmonaut
925e47a077 GPU: Fix backwards LogError and SetError calls 2024-09-25 12:47:40 -07:00
cosmonaut
557c6dfb18 GPU: call SDL_SetError where appropriate 2024-09-25 10:47:14 -07:00
Evan Hemsley
980b4ff6db GPU: Vulkan descriptor management rewrite (#10910) 2024-09-20 12:55:39 -07:00
Sam Lantinga
a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
Sam Lantinga
bd04459cde Fix typos (thanks @qndel!)
Fix typos in comments and in one case in a returned error ("insuffient -> insufficient" fb273eb)
codespell src/ *.cpp *.h *.hpp --ignore-words-list unknwn,thid,algebric,statics,pixelX,pEvents,caf,ptd,parms,pEvent,parm,TextureRS,TE,HDA,LOD,datas,UE,xwindows,IIF
cd src; git checkout \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    libm \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    video/khronos \
    video/x11/edid.h \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
2024-09-18 08:18:26 -07:00
Sam Lantinga
8d223b3037 Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
2024-09-17 08:53:27 -07:00
Caleb Cornett
9416917353 GPU: Rework MSAA (#10859) 2024-09-16 12:19:09 -05:00
Sam Lantinga
19243092c6 Renamed SDL_GpuGraphicsPipelineTargetInfo to SDL_GPUGraphicsPipelineTargetInfo
Fixes https://github.com/libsdl-org/SDL/issues/10855
2024-09-15 07:46:26 -07:00
Sam Lantinga
90e01040c5 Added thread-safe environment functions
Also marked the existing functions as unsafe, as they can cause crashes if used in multi-threaded applications.

As a bonus, since the new functions are hashtable based, hint environment lookups are much faster.
2024-09-13 22:14:54 -07:00
Ethan Lee
96e147b2b9 gpu: Rework driver name queries, add GetGPUShaderFormats 2024-09-13 12:29:40 -04:00
Caleb Cornett
94436a938d GPU: Remove unused and incorrect D16 format checks from Vulkan driver 2024-09-13 10:16:02 -05:00
Caleb Cornett
a45a2caf49 GPU: Rename VertexBinding to VertexBufferDescription (#10811) 2024-09-12 18:02:39 -05:00
Ethan Lee
c36982d45c vulkan: Avoid redundant commands for dynamic states 2024-09-12 16:51:32 -04: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
Ethan Lee
9ea0a837ae vulkan: Use a spinlock instead of a mutex for descriptor pools 2024-09-12 15:23:37 -04:00
Caleb Cornett
ddd5723e2e GPU: Remove pitch parameters from indirect draw calls (#10803) 2024-09-11 23:30:14 -07:00
Andrei Alexeyev
64f12bea4a GPU: Remove unnecessary texture format swizzles in Vulkan (#10693) 2024-09-11 09:01:06 -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
1849205733 Fix GDK builds after renames done in #10730 2024-09-07 11:50:40 +03: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
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
David Gow
e3fd581aca GPU: vulkan: Respect swapchain minImageCount
The default value of MAX_FRAMES_IN_FLIGHT (3) may be less than the
minImageCount returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() on
some setups. For example, the Intel IVB Vulkan driver on Wayland returns
a minImageCount of 4, resulting in the following validation warning:

VUID-VkSwapchainCreateInfoKHR-presentMode-02839(ERROR / SPEC): msgNum: -76493605 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-02839 ] | MessageID = 0xfb70ccdb | vkCreateSwapchainKHR(): pCreateInfo->minImageCount 3, which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = 4, maxImageCount = 0). The Vulkan spec states: If presentMode is not VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR nor VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, then minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-02839)
    Objects: 0

Use the minimum image count in that case, as it's as close as we'll get
to our preferred value. Note also that, unlike maxImageCount,
minImageCount is never 0 (the spec states it is always at least 1), so
we don't need a similar check to see if it applies.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-09-05 08:10:18 -07:00
Evan Hemsley
1788be8547 GPU: Add const to some function parameters (#10694) 2024-09-04 13:53:41 -07:00
Sam Lantinga
35dadda327 Fixed build warnings 2024-09-02 17:17:48 -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
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
Sam Lantinga
f827c1322c Renamed SDL_Del* to SDL_Remove* 2024-08-31 07:46:28 -07:00
Anonymous Maarten
31a5f3b833 Fix C4090: 'function': different 'const' qualifiers 2024-08-31 06:49:33 -07:00
Evan Hemsley
12ecdb9dde GPU: Rename some awkwardly named functions (#10642) 2024-08-30 15:31:10 -07:00
Andrei Alexeyev
d1a2c57fb9 GPU: Fix memory leak in VULKAN_CreateDevice (#10631) 2024-08-29 22:15:08 -07:00