Sam Lantinga
32668c4ddd
Palettized textures will always use SDL_SCALEMODE_NEAREST.
...
Our algorithm for pixel art doesn't work on 8-bit images, needs further investigation.
Fixes https://github.com/libsdl-org/SDL/issues/14129
2025-10-03 14:29:47 -07:00
Sam Lantinga
d333044462
Fixed destination coordinates when using scale with the software renderer
...
Fixes https://github.com/libsdl-org/SDL/issues/14051
2025-10-03 13:58:45 -07:00
Sam Lantinga
a864dcac25
Added support for using the GPU renderer as an offscreen renderer
...
SDL_CreateGPURenderer() now allows passing in an existing GPU device and passing in a NULL window to create an offscreen renderer.
Also renamed SDL_SetRenderGPUState() to SDL_SetGPURenderState().
2025-10-01 23:32:18 -07:00
Sam Lantinga
8d7cd3c6c2
Fixed line endings
2025-10-01 14:01:59 -07:00
Sam Lantinga
9735c45db6
Added an advanced shader for the GPU renderer
...
This allows us to support YUV colorspaces and HDR in the GPU renderer.
Fixes https://github.com/libsdl-org/SDL/issues/11281
Fixes https://github.com/libsdl-org/SDL/issues/11282
2025-10-01 07:17:55 -07:00
Sam Lantinga
fe3b399b7e
Added support for P010 pixel format in SDL_UpdateNVTexture()
2025-10-01 07:17:55 -07:00
Sam Lantinga
548063e578
Fixed pixel shader for palettized textures using pixelart scaling
2025-10-01 07:17:55 -07:00
Wohlstand
e3d65796f4
SDL_render_psp.c: Implemented working viewport support
...
Backported from the SDL2 branch
2025-09-29 19:09:26 -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
595f7b7ed9
Revert "Fixed Vulkan validation error"
...
This reverts commit b82b1f416f .
The renderer should not be enabling depth clamping.
2025-09-29 06:08:27 -07:00
Sam Lantinga
b65590159b
Each application palette corresponds to one hardware palette
...
When the application modifies the palette, any textures that use it will automatically be updated.
2025-09-28 22:10:06 -07:00
Sam Lantinga
5d311635cf
Added Vulkan support for palettized textures
2025-09-28 22:10:06 -07:00
Sam Lantinga
e2fe23ddab
Added hardware accelerated support for palettized textures
...
Supported backends: direct3d, direct3d11, direct3d12, gpu, metal, opengl, opengles2
2025-09-28 22:10:06 -07:00
Sam Lantinga
524ba0a4ad
Reduce the size of the D3D12 vertex shader constants
...
This is needed to add more fragment shader constants in the future as we're already at our 64 size limit
2025-09-28 22:10:06 -07:00
Sam Lantinga
5622eef5a8
Fixed memory leak if requested renderer isn't available
2025-09-28 22:10:06 -07:00
Sam Lantinga
2a01e12d34
Simplify palette code
...
Each texture gets its own palette, the palette is updated when it is rendered if necessary, rendering is flushed if a texture render is already queued up.
Trying to share palettes and handle the different cases of queued rendering and changing palettes in the middle of the frame ends up being very complicated, so we'll keep it simple for now.
2025-09-28 22:10:06 -07:00
Sam Lantinga
7dcc09986d
Test changing the palette for a single texture
2025-09-28 22:10:06 -07:00
Sam Lantinga
264b436dba
Fixed changing palettes while rendering is in flight
2025-09-28 22:10:06 -07:00
Sam Lantinga
0b4b254a53
Added support for textures with palettes
...
Closes https://github.com/libsdl-org/SDL/pull/6192
2025-09-28 22:10:06 -07:00
Fierelier
3fd0b46215
[SDL3] [PS2] Framebuffer resolution + 240p/480p + PAL support ( #13993 )
...
* Do not override NTSC/PAL
* Fix PS2 build instructions
* Add PS2 GS hints
Allows for switching between NTSC/PAL, progressive/interlaced, etc
2025-09-21 07:50:14 -07:00
Sam Lantinga
25b2d2c821
Use new parameter validation macro
2025-09-18 20:58:32 -07:00
Sam Lantinga
ee1c90a358
Improved handling of function parameter validation
...
SDL supports the following use cases:
* Normal operation with fast parameter checks (default):
SDL_SetHint(SDL_HINT_INVALID_PARAM_CHECKS, "1");
* Object parameters are checked for use-after-free issues:
SDL_SetHint(SDL_HINT_INVALID_PARAM_CHECKS, "2");
* Enable full validation, plus assert on invalid parameters:
#define SDL_ASSERT_INVALID_PARAMS
* Disable all parameter validation:
#define SDL_DISABLE_INVALID_PARAMS
2025-09-18 20:58:32 -07:00
Ryan C. Gordon
3ee29f2e7a
render: Don't default to vsync=0 on Emscripten.
...
Fixes #12805 .
2025-09-16 12:30:22 -04:00
Andrei Alexeyev
287e786120
render/gpu: fix copypaste error in render initialization
2025-09-15 10:29:04 -07:00
Sam Lantinga
e7784b7bf7
Set GPU properties for maximum hardware compatibility
...
Resolves https://github.com/libsdl-org/SDL/issues/13928
2025-09-11 21:30:58 -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
Jaan Soulier
ed6a72a7fd
Fix reallocation of GPU renderer vertex buffer
2025-09-09 20:28:14 -07:00
Sam Lantinga
b7dba970e1
Fixed setting SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER
2025-09-09 17:34:34 -07:00
Sam Lantinga
a4b180f515
Added SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER
2025-09-09 17:34:34 -07:00
Ryan C. Gordon
11411bb5ef
renderer: Don't use wrapping on NPOT textures if the renderer can't handle it.
...
Fixes #13887 .
2025-09-08 17:09:41 -04:00
nightmareci
2f5bc17ea6
Fix support for Windows XP and up ( #13904 )
2025-09-08 13:00:26 -07:00
Sam Lantinga
174d411b50
Fixed ERROR: IDXGIFactory::CreateSwapChain: The flag DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING is only allowed for FLIP swapchains
2025-09-07 16:54:03 -07:00
Sam Lantinga
ab17d66884
Make sure the surface used for a software renderer is a valid format
...
Fixes https://github.com/libsdl-org/SDL/issues/13323
2025-09-07 12:55:33 -07:00
Sam Lantinga
cd6b68a9fb
Define the behavior of a negative width or height passed to SDL_RenderFillRect()
...
The software renderer now matches the 3D renderer behavior by rendering a reversed rectangle (extending width or height in the opposite direction) when width or height is negative. It also now renders no rectangle if the width and height are 0.
Fixes https://github.com/libsdl-org/SDL/issues/13400
2025-09-07 12:28:37 -07:00
Sam Lantinga
ec33da05b3
Added SDL_HINT_RENDER_DIRECT3D11_WARP
...
Fixes https://github.com/libsdl-org/SDL/issues/13002
2025-09-07 11:00:59 -07:00
Sam Lantinga
466f93aee1
Fixed pitch and chroma issues with the Vulkan planar YUV texture update functions
...
Fixes https://github.com/libsdl-org/SDL/issues/13734
2025-09-07 10:19:00 -07:00
Sam Lantinga
fb2daa2f5f
Updated the documentation for SDL_GetRenderLogicalPresentation()
...
Fixes https://github.com/libsdl-org/SDL/issues/13791
2025-09-06 11:21:36 -07:00
Sam Lantinga
02fc571cfd
Fixed build
2025-09-06 10:12:01 -07:00
Sam Lantinga
5605f85d84
Check the return value of SDL_SW_CopyYUVToRGB()
2025-09-06 10:07:09 -07:00
Sam Lantinga
61e41c61dc
Select the shader based on the inputs, not colorspace
...
Fixes https://github.com/libsdl-org/SDL/issues/13880
2025-09-06 08:58:17 -07:00
Sam Lantinga
fbbc29159a
Leave letterbox borders set to the frame clear color
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
2025-09-02 20:14:34 -07:00
Sam Lantinga
ef19c72015
Set the texture scale and address mode when creating a texture
...
Fixes https://github.com/libsdl-org/sdl2-compat/issues/506
2025-09-02 18:05:31 -07:00
Sam Lantinga
285df94623
Renamed SDL_GPURenderStateDesc to SDL_GPURenderStateCreateInfo for consistency with GPU API conventions
...
Fixes https://github.com/libsdl-org/SDL/issues/12817
2025-08-27 09:14:19 -07:00
Frank Praznik
152ba829a1
video: Try to reconfigure the window for OpenGL without destroying it
...
When attaching a renderer (GL based specifically) to a window that was not created with the appropriate flags, the window would be destroyed and recreated to configure it for the desired rendering backend. While most of the issues with this have been mitigated over time, there can still be some undesirable side effects from doing so on certain platforms.
If the window was just created and was never configured for any graphics context, it is possible that the reconfiguration can be done without destroying the window first.
The Wayland implementation fixes an issue when creating a window with the fullscreen flag on wlroots based Wayland compositors, and can likely be extended to other platforms to avoid unnecessarily destroying/recreating a window in the very common case where a window is created, followed immediately by attaching a renderer.
2025-08-27 12:10:48 -04:00
ceski
270737584e
Fix vsync-off support for direct3d11
2025-08-24 21:33:02 +03:00
Petar Popovic
b63c32e790
SDL_SetRenderDrawBlendMode(): Remove redundant param check
2025-08-08 14:05:33 -04:00
Sam Lantinga
8dedf44929
Fixed warning: initialization of pointer of type 'VkSampler' (aka 'struct VkSampler_T *') to null from a constant boolean expression
...
Fixes https://github.com/libsdl-org/SDL/issues/13628
2025-08-03 07:24:51 -07:00
Petar Popovic
09221820f6
Fix potential memory leak in SDL_render_gles2.c
2025-07-31 16:18:47 -07:00
Brenton Bostick
f361034ac3
fix typos
2025-07-27 08:10:03 -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