Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
32a4fe2
Add hint to specify Vulkan API version to use
TheSniperFan Oct 10, 2025
c0ea6bf
Fix incorrect use of strings
TheSniperFan Oct 10, 2025
6c4d2c0
Change hint to only specify minor version
TheSniperFan Oct 10, 2025
90926f7
Update include/SDL3/SDL_hints.h
TheSniperFan Oct 10, 2025
db9532a
Revert "Change hint to only specify minor version"
TheSniperFan Oct 10, 2025
4b66c16
Handle errors when parsing hint
TheSniperFan Oct 10, 2025
1721814
Use standard version string format
TheSniperFan Oct 11, 2025
0310602
Allow requesting additional Vulkan device features
TheSniperFan Oct 11, 2025
0bddc9c
Rename VulkanRenderer.desiredDeviceFeatures
TheSniperFan Oct 11, 2025
962026f
Handle multiple chaining of structures
TheSniperFan Oct 11, 2025
9cd9bbd
Add Vulkan options property
TheSniperFan Oct 12, 2025
9dac2f6
Handle Vulkan 1.1 features properly
TheSniperFan Oct 12, 2025
b938d6e
Gate Vulkan feature requests by API version
TheSniperFan Oct 12, 2025
872aa0a
Fix CI errors
TheSniperFan Oct 12, 2025
a269ffb
Validate requested extensions
TheSniperFan Oct 17, 2025
bada266
Cleanup
TheSniperFan Oct 18, 2025
cff7d01
Implement opt-in instance extensions
TheSniperFan Oct 18, 2025
b00b4df
Implement opt-in device extensions
TheSniperFan Oct 18, 2025
4cbb2a0
Add missing const
TheSniperFan Oct 18, 2025
9e26c5a
Update comment
TheSniperFan Oct 18, 2025
e357936
Fix compile error
TheSniperFan Oct 18, 2025
d95f1d8
Remove obsolete error check
TheSniperFan Oct 18, 2025
a198c8c
Clear extension name pointers after initialization
TheSniperFan Oct 18, 2025
24749c4
Update include/SDL3/SDL_gpu.h
TheSniperFan Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/SDL3/SDL_hints.h
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,16 @@ extern "C" {
*/
#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY"

/**
* Specify the Vulkan API version to create the instance with.
*
* This hint should be set before creating a Vulkan window. Expects a
* version string delimited by underscores. E.g. 1_0_0 or 1_3_0
*
* \since This hint is available since SDL 3.xx.
*/
#define SDL_HINT_VULKAN_REQUEST_API_VERSION "SDL_VULKAN_REQUEST_API_VERSION"

/**
* A variable controlling how the fact chunk affects the loading of a WAVE
* file.
Expand Down
16 changes: 16 additions & 0 deletions src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -11205,6 +11205,22 @@ static Uint8 VULKAN_INTERNAL_CreateInstance(VulkanRenderer *renderer)
appInfo.pEngineName = "SDLGPU";
appInfo.engineVersion = SDL_VERSION;
appInfo.apiVersion = VK_MAKE_VERSION(1, 0, 0);
const char *hint = SDL_GetHint(SDL_HINT_VULKAN_REQUEST_API_VERSION);
if (hint) {
char *text = SDL_strdup(hint);
int numFound = 0;
int version[3] = { 0, 0, 0 };
char *saveptr = NULL;
char *token = SDL_strtok_r(text, "_", &saveptr);
while (token != NULL && numFound < 3) {
version[numFound] = SDL_atoi(token);
numFound++;
token = SDL_strtok_r(NULL, "_", &saveptr);
}

appInfo.apiVersion = VK_MAKE_VERSION(version[0], version[1], version[2]);
SDL_free(text);
}

createFlags = 0;

Expand Down
Loading