mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
f9768816515e3c385c3b9812a3f6f64384f9dfa9

The VULKAN_InvalidateCachedState() function seems to be meant to invalidate any _cached_ state, i.e. global state of the API which may have been modified outside the renderer. However, at the moment, the Vulkan renderer also resets a number of internal variables which track buffers, offsets, etc, in use. As a result, the renderer can get into an inconsistant state and/or lose data. For example, if VULKAN_InvalidateCachedState() is called in between two calls to VULKAN_UpdateVertexBuffer(), the data from the first call will be overwritten by that from the second, as the number of the next vertex buffer to use will be reset to 0. This can result in rendering errors, as the same vertex data is used incorrectly for several calls. By no longer resetting this 'internal' state here, those glitches disappear. However, I haven't tested this with any applications which mix the Vulkan renderer with their own Vulkan code (do any such applications exist?), so this may be insufficient in case a full flush of the renderer state -- and possibly a wait on the appropriate fence -- could be required. Signed-off-by: David Gow <david@ingeniumdigital.com>
Simple DirectMedia Layer (SDL) Version 3.0
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting with README.md. If you are migrating to SDL 3.0 from SDL 2.0, the changes are extensively documented in README-migration.md.
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Languages
C
86.4%
C++
5.9%
Objective-C
3.4%
CMake
1.6%
Perl
0.8%
Other
1.7%