Ozkan Sezer
5f304b3a47
Fix builed error after commit 0e45b824e3 due to -Wunused-variable
2024-09-29 15:40:02 +03:00
Sam Lantinga
0e45b824e3
renderer: always update the output pixel size at startup
...
Fixes https://github.com/libsdl-org/SDL/issues/10990
2024-09-29 05:22:28 -07:00
Evan Hemsley
66f6b40c92
Render GPU: Don't call GetWindowSizeInPixels during RenderPreset ( #10984 )
2024-09-28 18:01:16 -07: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
Petar Popovic
457d0edeaf
Remove some extra semicolons
2024-09-26 20:01:56 +03:00
Ryan C. Gordon
3abb213083
opengl: Fixed SDL_RENDERCMD_SETDRAWCOLOR code checking the wrong variable.
2024-09-25 23:14:32 -04:00
Ryan C. Gordon
961cd51611
opengl: Removed a FIXME (this is documented as not-thread-safe now.
2024-09-25 23:14:32 -04:00
Ryan C. Gordon
4c48ff51f8
render: SDL_RenderPresent now behaves when a render target is currently set.
...
It'll temporarily unbind it, draw letterboxing if necessary, present, and
then rebind the previous render target.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
7a6a0becb8
render: Fixed a FIXME for SDL_SetRenderViewport with a negative size.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
54459def69
render: Remove the logical presentation render target.
...
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.
Fixes #8736 .
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
bf7a48cdcc
render/gpu: Change some memcpy calls to SDL_memcpy.
2024-09-25 16:26:36 -04:00
Simon McVittie
23f855a970
render: Integrate fix-shaders.sh into build-shaders.sh
...
By writing the fxc and dxc output to a temporary file and then
converting that temporary file to the desired filename, we avoid
the incompatible semantics of sed -i on GNU systems (sed -i does not
create a backup filename, and does not take an argument unless it is
"bundled") and macOS (sed -i requires an argument, possibly empty).
Resolves: https://github.com/libsdl-org/SDL/issues/10878
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-18 10:38:59 -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
c68e9e157c
Fixed typo
2024-09-17 10:59:28 -07:00
Sam Lantinga
7edd43c276
Don't define render_drivers if SDL_RENDER_DISABLED is set
...
Fixes https://github.com/libsdl-org/SDL/issues/10861
2024-09-17 08:46:05 -07:00
Simon McVittie
4b3058d58d
render: Don't try to rebuild D3D11, D3D12, Metal shaders without spirv-cross
...
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07:00
Simon McVittie
13500bbf50
render: Fix detection of fxc, dxc in build-shaders.sh
...
We want `$USE_FXC` to default to the result of evaluating the variable
`$HAVE_FXC`, not the literal string `HAVE_FXC`, and the same for dxc.
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07: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
Sam Lantinga
4d135fb696
Fixed color scale when rendering to an sRGB render target
2024-09-11 14:23:58 -07:00
Sam Lantinga
86e393b523
Clarify that INPUTTYPE_UNSPECIFIED is correct for RGB textures
2024-09-11 14:23:58 -07:00
Sam Lantinga
92255d36d4
We already have functions for converting between sRGB and linear space
2024-09-11 14:23:58 -07:00
Sam Lantinga
667a3e40e9
Use the correct namespace for structures
...
Otherwise the debugger may use the wrong structure definition at runtime.
2024-09-11 14:23:58 -07:00
Sam Lantinga
4123023d3e
Renamed sdlgpu to gpu
2024-09-11 08:34:51 -07:00
Evan Hemsley
0b6f993dea
GPU: Zero-init handling ( #10786 )
2024-09-10 18:17:08 -07:00
Evan Hemsley
668e2f82d2
Add load op and clear color to SDL_BlitGPUTexture ( #10767 )
2024-09-09 10:19:52 -07:00
Petar Popovic
d2ef15d8e6
Fix warnings: calloc-transposed-args
2024-09-08 19:28:11 -07:00
Anonymous Maarten
4c0cb94b96
vulkan: VULKAN_CreateTexture returns a boolean
...
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where failure needs to return false (0).
2024-09-08 13:14:18 +02:00
Anonymous Maarten
3eb49ac862
vulken: VULKAN_CreateTexture returns a boolean
...
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where success needs to return true (1).
2024-09-08 12:42:55 +02:00
cosmonaut
1a13acac09
Always blit to the swapchain in GPU_RenderPresent
...
Fixes #10744
2024-09-07 08:43:02 -07: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
Ryan C. Gordon
ac08dde1b2
windows: Clean out things that should be using `defined(SDL_PLATFORM_WINDOWS)`.
2024-09-06 13:28:39 -04:00
Ryan C. Gordon
154452a726
winrt: Removed WinRT/Windows Phone/UWP support.
...
Fixes #10724 .
2024-09-06 13:28:39 -04:00
Sam Lantinga
1381cc8554
Add a step to fix generated shader code
2024-09-06 09:09:01 -07:00
Sam Lantinga
379aea5c2d
Fixed warnings building with Visual Studio
2024-09-05 20:24:30 -07: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
Sylvain
41810c823d
Compilation without vulkan: SDL_GPU_VULKAN is always defined for some plateform (at android, macos), test against 0 or 1
2024-09-05 05:36:21 -07:00
Sam Lantinga
35dadda327
Fixed build warnings
2024-09-02 17:17:48 -07:00
Caleb Cornett
f405def691
Change GPU flag enums to defines ( #10681 )
2024-09-02 15:19:43 -07:00
coffeechriph
b15d79a35a
Fix texture_rgba_frag for metal in SDL_shaders_gpu.c
2024-08-31 20:09:11 -07:00
Sam Lantinga
6c30a0f60b
Added scaleMode validation to SDL_SetTextureScaleMode()
2024-08-31 09:43:02 -07:00
Sam Lantinga
f827c1322c
Renamed SDL_Del* to SDL_Remove*
2024-08-31 07:46:28 -07:00
Sam Lantinga
2010a22f44
Removed unneeded separate return statement.
2024-08-31 07:26:13 -07:00
Sam Lantinga
4759a97c09
Fixed return value from D3D12_UpdateVertexBuffer()
...
Fixes https://github.com/libsdl-org/SDL/issues/10649
2024-08-31 07:26:13 -07:00
Evan Hemsley
12ecdb9dde
GPU: Rename some awkwardly named functions ( #10642 )
2024-08-30 15:31:10 -07:00
Sam Lantinga
bef07023d6
Fixed memory leak if the GPU renderer can't be initialized
...
DestroyRenderer needs to be set before we return false from GPU_CreateRenderer()
2024-08-30 14:49:49 -07:00
Sam Lantinga
b602c449e5
Remove SDL_SCALEMODE_BEST
...
Fixes https://github.com/libsdl-org/SDL/issues/10619
2024-08-30 10:30:14 -07:00
Sam Lantinga
40d85109ac
Fixed crash when using the dummy video driver
...
The higher level code will clean up the renderer if initialization fails.
2024-08-30 07:16:47 -07:00
Sam Lantinga
16fb8e54cb
Fixed the colorspace for YUV textures using native RGB representations
...
Fixes https://github.com/libsdl-org/SDL/issues/10624
2024-08-29 20:55:09 -07:00
Sam Lantinga
858589919a
Temporarily use the GPU renderer by default so we get testing feedback
2024-08-29 17:33:52 -07:00