mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Renamed SDL_GetGPUDeviceDebugProperties() to SDL_GetGPUDeviceProperties()
We may want to extend this with additional properties in the future. Also removed SDL_PROP_GPU_DEVICE_DEBUG_VULKAN_CONFORMANCE_STRING. If we need feature level queries we can add them in the future.
This commit is contained in:
@@ -586,11 +586,11 @@ SDL_GPUShaderFormat SDL_GetGPUShaderFormats(SDL_GPUDevice *device)
|
||||
return device->shader_formats;
|
||||
}
|
||||
|
||||
SDL_PropertiesID SDL_GetGPUDeviceDebugProperties(SDL_GPUDevice *device)
|
||||
SDL_PropertiesID SDL_GetGPUDeviceProperties(SDL_GPUDevice *device)
|
||||
{
|
||||
CHECK_DEVICE_MAGIC(device, 0);
|
||||
|
||||
return device->GetDeviceDebugProperties(device);
|
||||
return device->GetDeviceProperties(device);
|
||||
}
|
||||
|
||||
Uint32 SDL_GPUTextureFormatTexelBlockSize(
|
||||
|
@@ -463,7 +463,7 @@ struct SDL_GPUDevice
|
||||
|
||||
void (*DestroyDevice)(SDL_GPUDevice *device);
|
||||
|
||||
SDL_PropertiesID (*GetDeviceDebugProperties)(SDL_GPUDevice *device);
|
||||
SDL_PropertiesID (*GetDeviceProperties)(SDL_GPUDevice *device);
|
||||
|
||||
// State Creation
|
||||
|
||||
@@ -896,7 +896,7 @@ struct SDL_GPUDevice
|
||||
result->func = name##_##func;
|
||||
#define ASSIGN_DRIVER(name) \
|
||||
ASSIGN_DRIVER_FUNC(DestroyDevice, name) \
|
||||
ASSIGN_DRIVER_FUNC(GetDeviceDebugProperties, name) \
|
||||
ASSIGN_DRIVER_FUNC(GetDeviceProperties, name) \
|
||||
ASSIGN_DRIVER_FUNC(CreateComputePipeline, name) \
|
||||
ASSIGN_DRIVER_FUNC(CreateGraphicsPipeline, name) \
|
||||
ASSIGN_DRIVER_FUNC(CreateSampler, name) \
|
||||
|
@@ -765,7 +765,7 @@ struct D3D12Renderer
|
||||
// FIXME: these might not be necessary since we're not using custom heaps
|
||||
bool UMA;
|
||||
bool UMACacheCoherent;
|
||||
SDL_PropertiesID debugProps;
|
||||
SDL_PropertiesID props;
|
||||
Uint32 allowedFramesInFlight;
|
||||
|
||||
// Indirect command signatures
|
||||
@@ -1536,7 +1536,7 @@ static void D3D12_INTERNAL_DestroyRenderer(D3D12Renderer *renderer)
|
||||
SDL_free(renderer->graphicsPipelinesToDestroy);
|
||||
SDL_free(renderer->computePipelinesToDestroy);
|
||||
|
||||
SDL_DestroyProperties(renderer->debugProps);
|
||||
SDL_DestroyProperties(renderer->props);
|
||||
|
||||
// Tear down D3D12 objects
|
||||
if (renderer->indirectDrawCommandSignature) {
|
||||
@@ -1625,10 +1625,10 @@ static void D3D12_DestroyDevice(SDL_GPUDevice *device)
|
||||
SDL_free(device);
|
||||
}
|
||||
|
||||
static SDL_PropertiesID D3D12_GetDeviceDebugProperties(SDL_GPUDevice *device)
|
||||
static SDL_PropertiesID D3D12_GetDeviceProperties(SDL_GPUDevice *device)
|
||||
{
|
||||
D3D12Renderer *renderer = (D3D12Renderer *)device->driverData;
|
||||
return renderer->debugProps;
|
||||
return renderer->props;
|
||||
}
|
||||
|
||||
// Barriers
|
||||
@@ -8626,7 +8626,7 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
CHECK_D3D12_ERROR_AND_RETURN("Could not get adapter driver version", NULL);
|
||||
}
|
||||
|
||||
renderer->debugProps = SDL_CreateProperties();
|
||||
renderer->props = SDL_CreateProperties();
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "SDL_GPU Driver: D3D12");
|
||||
}
|
||||
@@ -8634,8 +8634,8 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
// Record device name
|
||||
char *deviceName = SDL_iconv_wchar_utf8(&adapterDesc.Description[0]);
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_NAME_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_NAME_STRING,
|
||||
deviceName);
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "D3D12 Adapter: %s", deviceName);
|
||||
@@ -8653,8 +8653,8 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
HIWORD(umdVersion.LowPart),
|
||||
LOWORD(umdVersion.LowPart));
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_DRIVER_VERSION_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING,
|
||||
driverVer);
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "D3D12 Driver: %s", driverVer);
|
||||
|
@@ -643,7 +643,7 @@ struct MetalRenderer
|
||||
id<MTLCommandQueue> queue;
|
||||
|
||||
bool debugMode;
|
||||
SDL_PropertiesID debugProps;
|
||||
SDL_PropertiesID props;
|
||||
Uint32 allowedFramesInFlight;
|
||||
|
||||
MetalWindowData **claimedWindows;
|
||||
@@ -766,18 +766,18 @@ static void METAL_DestroyDevice(SDL_GPUDevice *device)
|
||||
// Release the command queue
|
||||
renderer->queue = nil;
|
||||
|
||||
// Release debug properties
|
||||
SDL_DestroyProperties(renderer->debugProps);
|
||||
// Release properties
|
||||
SDL_DestroyProperties(renderer->props);
|
||||
|
||||
// Free the primary structures
|
||||
SDL_free(renderer);
|
||||
SDL_free(device);
|
||||
}
|
||||
|
||||
static SDL_PropertiesID METAL_GetDeviceDebugProperties(SDL_GPUDevice *device)
|
||||
static SDL_PropertiesID METAL_GetDeviceProperties(SDL_GPUDevice *device)
|
||||
{
|
||||
MetalRenderer *renderer = (MetalRenderer *)device->driverData;
|
||||
return renderer->debugProps;
|
||||
return renderer->props;
|
||||
}
|
||||
|
||||
// Resource tracking
|
||||
@@ -4512,7 +4512,7 @@ static SDL_GPUDevice *METAL_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
renderer->device = device;
|
||||
renderer->queue = [device newCommandQueue];
|
||||
|
||||
renderer->debugProps = SDL_CreateProperties();
|
||||
renderer->props = SDL_CreateProperties();
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "SDL_GPU Driver: Metal");
|
||||
}
|
||||
@@ -4520,8 +4520,8 @@ static SDL_GPUDevice *METAL_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
// Record device name
|
||||
const char *deviceName = [device.name UTF8String];
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_NAME_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_NAME_STRING,
|
||||
deviceName);
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "Metal Device: %s", deviceName);
|
||||
|
@@ -1096,7 +1096,7 @@ struct VulkanRenderer
|
||||
|
||||
bool debugMode;
|
||||
bool preferLowPower;
|
||||
SDL_PropertiesID debugProps;
|
||||
SDL_PropertiesID props;
|
||||
Uint32 allowedFramesInFlight;
|
||||
|
||||
VulkanExtensions supports;
|
||||
@@ -4918,18 +4918,18 @@ static void VULKAN_DestroyDevice(
|
||||
renderer->vkDestroyDevice(renderer->logicalDevice, NULL);
|
||||
renderer->vkDestroyInstance(renderer->instance, NULL);
|
||||
|
||||
SDL_DestroyProperties(renderer->debugProps);
|
||||
SDL_DestroyProperties(renderer->props);
|
||||
|
||||
SDL_free(renderer);
|
||||
SDL_free(device);
|
||||
SDL_Vulkan_UnloadLibrary();
|
||||
}
|
||||
|
||||
static SDL_PropertiesID VULKAN_GetDeviceDebugProperties(
|
||||
static SDL_PropertiesID VULKAN_GetDeviceProperties(
|
||||
SDL_GPUDevice *device)
|
||||
{
|
||||
VulkanRenderer *renderer = (VulkanRenderer *)device->driverData;
|
||||
return renderer->debugProps;
|
||||
return renderer->props;
|
||||
}
|
||||
|
||||
static DescriptorSetCache *VULKAN_INTERNAL_AcquireDescriptorSetCache(
|
||||
@@ -11600,7 +11600,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
|
||||
SET_STRING_ERROR_AND_RETURN("Failed to initialize Vulkan!", NULL);
|
||||
}
|
||||
|
||||
renderer->debugProps = SDL_CreateProperties();
|
||||
renderer->props = SDL_CreateProperties();
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "SDL_GPU Driver: Vulkan");
|
||||
}
|
||||
@@ -11608,8 +11608,8 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
|
||||
// Record device name
|
||||
const char *deviceName = renderer->physicalDeviceProperties.properties.deviceName;
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_NAME_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_NAME_STRING,
|
||||
deviceName);
|
||||
if (verboseLogs) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "Vulkan Device: %s", deviceName);
|
||||
@@ -11659,8 +11659,8 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
|
||||
rawDriverVer & 0xfff);
|
||||
}
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_DRIVER_VERSION_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING,
|
||||
driverVer);
|
||||
// Log this only if VK_KHR_driver_properties is not available.
|
||||
|
||||
@@ -11669,12 +11669,12 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
|
||||
const char *driverName = renderer->physicalDeviceDriverProperties.driverName;
|
||||
const char *driverInfo = renderer->physicalDeviceDriverProperties.driverInfo;
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_DRIVER_NAME_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING,
|
||||
driverName);
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_DRIVER_INFO_STRING,
|
||||
renderer->props,
|
||||
SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING,
|
||||
driverInfo);
|
||||
if (verboseLogs) {
|
||||
// FIXME: driverInfo can be a multiline string.
|
||||
@@ -11682,20 +11682,16 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
|
||||
}
|
||||
|
||||
// Record conformance level
|
||||
char conformance[64];
|
||||
(void)SDL_snprintf(
|
||||
conformance,
|
||||
SDL_arraysize(conformance),
|
||||
"%u.%u.%u.%u",
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.major,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.minor,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.subminor,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.patch);
|
||||
SDL_SetStringProperty(
|
||||
renderer->debugProps,
|
||||
SDL_PROP_GPU_DEVICE_DEBUG_VULKAN_CONFORMANCE_STRING,
|
||||
conformance);
|
||||
if (verboseLogs) {
|
||||
char conformance[64];
|
||||
(void)SDL_snprintf(
|
||||
conformance,
|
||||
SDL_arraysize(conformance),
|
||||
"%u.%u.%u.%u",
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.major,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.minor,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.subminor,
|
||||
renderer->physicalDeviceDriverProperties.conformanceVersion.patch);
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_GPU, "Vulkan Conformance: %s", conformance);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user