Skip to content

Commit bada266

Browse files
committed
Cleanup
-Remove obsolete property -Clean up API version checks
1 parent a269ffb commit bada266

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

include/SDL3/SDL_gpu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,6 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDeviceWithProperties(
23452345
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib"
23462346
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN "SDL.gpu.device.create.d3d12.allowtier1resourcebinding"
23472347
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
2348-
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_ADDITIONAL_FEATURES_POINTER "SDL.gpu.device.create.vulkan.additional_features"
23492348
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER "SDL.gpu.device.create.vulkan.options"
23502349

23512350

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11384,9 +11384,11 @@ static bool VULKAN_INTERNAL_ValidateOptInFeatures(VulkanRenderer *renderer, VkPh
1138411384
{
1138511385
bool supportsAllFeatures = true;
1138611386

11387-
if (renderer->desiredApiVersion < VK_API_VERSION_1_1) {
11387+
int minorVersion = VK_API_VERSION_MINOR(renderer->desiredApiVersion);
11388+
11389+
if (minorVersion < 1) {
1138811390
supportsAllFeatures &= VULKAN_INTERNAL_ValidateOptInVulkan10Features(&renderer->desiredVulkan10DeviceFeatures, vk10Features);
11389-
} else if (renderer->desiredApiVersion < VK_API_VERSION_1_2) {
11391+
} else if (minorVersion < 2) {
1139011392
// Query device features using the pre-1.2 structures
1139111393
VkPhysicalDevice16BitStorageFeatures storage = { 0 };
1139211394
storage.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES;
@@ -11549,8 +11551,8 @@ static bool VULKAN_INTERNAL_TryAddDeviceFeatures_Vulkan_12_Or_Later(VkPhysicalDe
1154911551
Uint32 apiVersion,
1155011552
VkBaseOutStructure *src)
1155111553
{
11552-
SDL_assert(apiVersion >= VK_API_VERSION_1_2);
11553-
11554+
int minorVersion = VK_API_VERSION_MINOR(apiVersion);
11555+
SDL_assert(apiVersion >= 2);
1155411556
bool hasAdded = VULKAN_INTERNAL_TryAddDeviceFeatures_Vulkan_11(dst10, dst11, src);
1155511557
if (!hasAdded) {
1155611558
switch (src->sType) {
@@ -11574,7 +11576,7 @@ static bool VULKAN_INTERNAL_TryAddDeviceFeatures_Vulkan_12_Or_Later(VkPhysicalDe
1157411576

1157511577
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES:
1157611578
{
11577-
if (apiVersion >= VK_API_VERSION_1_3) {
11579+
if (minorVersion >= 3) {
1157811580
VkPhysicalDeviceVulkan13Features *newFeatures = (VkPhysicalDeviceVulkan13Features *)src;
1157911581
VULKAN_INTERNAL_AddDeviceFeatures(&dst13->robustImageAccess,
1158011582
&dst13->maintenance4,
@@ -11619,9 +11621,10 @@ static bool VULKAN_INTERNAL_AddOptInVulkanOptions(SDL_PropertiesID props, Vulkan
1161911621
&features->robustBufferAccess);
1162011622
}
1162111623

11622-
bool supportsHigherLevelFeatures = renderer->desiredApiVersion > VK_API_VERSION_1_0;
11624+
int minorVersion = VK_API_VERSION_MINOR(renderer->desiredApiVersion);
11625+
bool supportsHigherLevelFeatures = minorVersion > 0;
1162311626
if (supportsHigherLevelFeatures && options->feature_list) {
11624-
if (renderer->desiredApiVersion < VK_API_VERSION_1_2) {
11627+
if (minorVersion < 2) {
1162511628
// Iterate through the entire list and combine all requested features
1162611629
VkBaseOutStructure *nextStructure = (VkBaseOutStructure *)options->feature_list;
1162711630
while (nextStructure) {

0 commit comments

Comments
 (0)