Skip to content

Commit

Permalink
vkd3d: Fix multiple issues and inconsistencies in log message formats.
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Bogacki <[email protected]>
  • Loading branch information
Saancreed committed Jun 17, 2024
1 parent b4eb56b commit 911b334
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 73 deletions.
22 changes: 11 additions & 11 deletions libs/d3d12core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ static BOOL wait_vr_key(HKEY vr_key)
size = sizeof(value);
if ((status = RegQueryValueExA(vr_key, "state", NULL, &type, (BYTE *)&value, &size)))
{
ERR("OpenVR: could not query value, status %d", status);
ERR("OpenVR: could not query value, status %d.\n", status);
return false;
}
if (type != REG_DWORD)
{
ERR("OpenVR: unexpected value type %d", type);
ERR("OpenVR: unexpected value type %d.\n", type);
return false;
}

Expand All @@ -84,21 +84,21 @@ static BOOL wait_vr_key(HKEY vr_key)
event = CreateEventA(NULL, FALSE, FALSE, NULL);
if (event == NULL)
{
ERR("Cannot create event");
ERR("Cannot create event.\n");
return false;
}

while (max_retry)
{
if (RegNotifyChangeKeyValue(vr_key, FALSE, REG_NOTIFY_CHANGE_LAST_SET, event, TRUE))
{
ERR("Error registering registry change notification");
ERR("Error registering registry change notification.\n");
break;
}
size = sizeof(value);
if ((status = RegQueryValueExA(vr_key, "state", NULL, &type, (BYTE *)&value, &size)))
{
ERR("OpenVR: could not query value, status %d", status);
ERR("OpenVR: could not query value, status %d.\n", status);
break;
}
if (value)
Expand All @@ -107,13 +107,13 @@ static BOOL wait_vr_key(HKEY vr_key)

while ((wait_status = WaitForSingleObject(event, 1000)) == WAIT_TIMEOUT && max_retry)
{
WARN("VR state wait timeout (retries left %u)", max_retry);
WARN("VR state wait timeout (retries left %u).\n", max_retry);
max_retry--;
}

if (wait_status != WAIT_OBJECT_0 && wait_status != WAIT_TIMEOUT)
{
ERR("Got unexpected wait status ", wait_status);
ERR("Got unexpected wait status %u.\n", wait_status);
break;
}
}
Expand Down Expand Up @@ -225,20 +225,20 @@ static char *openxr_vulkan_extensions(bool device_extensions)
: p___wineopenxr_GetVulkanInstanceExtensions;
if (!get_extensions)
{
WARN("wineopenxr.dll is missing required symbols");
WARN("wineopenxr.dll is missing required symbols.\n");
return NULL;
}

if (get_extensions(0, &len, NULL))
{
WARN("Failed to get OpenXR extensions size from wineopenxr");
WARN("Failed to get OpenXR extensions size from wineopenxr.\n");
return NULL;
}

ret = vkd3d_malloc(len);
if (get_extensions(len, &len, ret))
{
WARN("Failed to get OpenXR extensions from wineopenxr");
WARN("Failed to get OpenXR extensions from wineopenxr.\n");
return NULL;
}
return ret;
Expand Down Expand Up @@ -417,7 +417,7 @@ static VkPhysicalDevice d3d12_find_physical_device(struct vkd3d_instance *instan
/* Skip over physical devices below our minimum API version */
if (properties2.properties.apiVersion < VKD3D_MIN_API_VERSION)
{
WARN("Skipped adapter %s as it is below our minimum API version.", properties2.properties.deviceName);
WARN("Skipped adapter %s as it is below our minimum API version.\n", properties2.properties.deviceName);
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions libs/vkd3d/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ static HRESULT d3d12_shared_fence_set_native_sync_handle_on_completion_explicit(

if (!(waiting_event = vkd3d_malloc(sizeof(*waiting_event))))
{
ERR("Failed to register device singleton for adapter.");
ERR("Failed to register device singleton for adapter.\n");
return E_OUTOFMEMORY;
}

Expand Down Expand Up @@ -12940,7 +12940,7 @@ static char *decode_pix_blob(const void *data, size_t size)
String fromatting will overcomplicate things and skipped for now */
if ((type != ePIXEvent_BeginEvent_NoArgs) && (type != ePIXEvent_BeginEvent_VarArgs))
{
WARN("Unexpected/unsupported PIX3Event");
WARN("Unexpected/unsupported PIX3Event: %#"PRIx64".\n", type);
return NULL;
}

Expand Down Expand Up @@ -15517,7 +15517,7 @@ static void d3d12_command_list_flush_rtas_batch(struct d3d12_command_list *list)
if (!rtas_batch->build_info_count)
return;

TRACE("list %p, build_info_count %u.\n", list, rtas_batch->build_info_count);
TRACE("list %p, build_info_count %zu.\n", list, rtas_batch->build_info_count);

if (!vkd3d_array_reserve((void **)&rtas_batch->range_ptrs, &rtas_batch->range_ptr_size,
rtas_batch->build_info_count, sizeof(*rtas_batch->range_ptrs)))
Expand Down
2 changes: 1 addition & 1 deletion libs/vkd3d/command_list_vkd3d_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_vkd3d_ext_LaunchCubinShaderE
};

struct d3d12_command_list *command_list = d3d12_command_list_from_ID3D12GraphicsCommandListExt(iface);
TRACE("iface %p, handle %p, block_x %u, block_y %u, block_z %u, smem_size %u, params %p, param_size %u, raw_params %p, raw_params_count %u \n",
TRACE("iface %p, handle %p, block_x %u, block_y %u, block_z %u, smem_size %u, params %p, param_size %u, raw_params %p, raw_params_count %u\n",
iface, handle, block_x, block_y, block_z, smem_size, params, param_size, raw_params, raw_params_count);

if (!handle || !block_x || !block_y || !block_z || !params || !param_size)
Expand Down
50 changes: 25 additions & 25 deletions libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -3064,7 +3064,7 @@ static void d3d12_add_device_singleton(struct d3d12_device *device, LUID luid)

if (!(e = vkd3d_malloc(sizeof(*e))))
{
ERR("Failed to register device singleton for adapter.");
ERR("Failed to register device singleton for adapter.\n");
return;
}
e->adapter_luid = luid;
Expand Down Expand Up @@ -3175,7 +3175,7 @@ HRESULT d3d12_device_get_scratch_buffer(struct d3d12_device *device, enum vkd3d_

if (min_size > pool->block_size)
{
FIXME("Requesting scratch buffer kind %u larger than limit (%"PRIu64" > %u). Expect bad performance.\n",
FIXME("Requesting scratch buffer kind %u larger than limit (%"PRIu64" > %"PRIu64"). Expect bad performance.\n",
kind, min_size, pool->block_size);
return d3d12_device_create_scratch_buffer(device, kind, min_size, memory_types, scratch);
}
Expand Down Expand Up @@ -4223,7 +4223,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
}

data->Support = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE;
TRACE("Protected resource session support %#x.", data->Support);
TRACE("Protected resource session support %#x.\n", data->Support);
return S_OK;
}

Expand Down Expand Up @@ -4314,7 +4314,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE |
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE;

TRACE("Shader cache support flags %#x.", data->SupportFlags);
TRACE("Shader cache support flags %#x.\n", data->SupportFlags);
return S_OK;
}

Expand All @@ -4331,7 +4331,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
/* FIXME We ignore priorities since Vulkan queues are created up-front */
data->PriorityForTypeIsSupported = data->Priority <= D3D12_COMMAND_QUEUE_PRIORITY_HIGH;

TRACE("Command list type %u supports priority %u: %#x.",
TRACE("Command list type %u supports priority %u: %#x.\n",
data->CommandListType, data->Priority, data->PriorityForTypeIsSupported);
return S_OK;
}
Expand All @@ -4348,11 +4348,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i

*data = device->d3d12_caps.options3;

TRACE("Copy queue timestamp queries %#x.", data->CopyQueueTimestampQueriesSupported);
TRACE("Casting fully typed formats %#x.", data->CastingFullyTypedFormatSupported);
TRACE("Write buffer immediate support flags %#x.", data->WriteBufferImmediateSupportFlags);
TRACE("View instancing tier %u.", data->ViewInstancingTier);
TRACE("Barycentrics %#x.", data->BarycentricsSupported);
TRACE("Copy queue timestamp queries %#x.\n", data->CopyQueueTimestampQueriesSupported);
TRACE("Casting fully typed formats %#x.\n", data->CastingFullyTypedFormatSupported);
TRACE("Write buffer immediate support flags %#x.\n", data->WriteBufferImmediateSupportFlags);
TRACE("View instancing tier %u.\n", data->ViewInstancingTier);
TRACE("Barycentrics %#x.\n", data->BarycentricsSupported);
return S_OK;
}

Expand All @@ -4370,7 +4370,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
* interop to support file handles */
data->Supported = FALSE;

TRACE("Existing heaps %#x.", data->Supported);
TRACE("Existing heaps %#x.\n", data->Supported);
return S_OK;
}

Expand Down Expand Up @@ -4587,8 +4587,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i

*data = device->d3d12_caps.options13;

TRACE("Inverted viewport height flips Y supported %u.", data->InvertedViewportHeightFlipsYSupported);
TRACE("Inverted viewport deps flips Z supported %u.", data->InvertedViewportDepthFlipsZSupported);
TRACE("Inverted viewport height flips Y supported %u.\n", data->InvertedViewportHeightFlipsYSupported);
TRACE("Inverted viewport deps flips Z supported %u.\n", data->InvertedViewportDepthFlipsZSupported);
return S_OK;
}

Expand Down Expand Up @@ -4755,7 +4755,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
return E_INVALIDARG;
}

TRACE("input_data_size = %u, input_data = %p, output_data_size = %u, output_data = %p.\n",
TRACE("input_data_size = %zu, input_data = %p, output_data_size = %zu, output_data = %p.\n",
data->QueryInputDataSizeInBytes, data->pQueryInputData, data->QueryOutputDataSizeInBytes,
data->pQueryOutputData);

Expand All @@ -4774,7 +4774,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(d3d12_device_i
* is allowed but any excess bytes are not written. */
if (data->QueryInputDataSizeInBytes < sizeof(*in_args) || data->QueryOutputDataSizeInBytes < sizeof(*out_args))
{
FIXME("Unexpected input/output sizes for DirectStorage meta command: %u, %u.\n",
FIXME("Unexpected input/output sizes for DirectStorage meta command: %zu, %zu.\n",
data->QueryInputDataSizeInBytes, data->QueryOutputDataSizeInBytes);
return E_INVALIDARG;
}
Expand Down Expand Up @@ -5629,7 +5629,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(d3d12_devi
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
{
TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
"optimized_clear_value %p, iid %s, resource %p.\n",
iface, heap_properties, heap_flags, desc, initial_state,
optimized_clear_value, debugstr_guid(iid), resource);
Expand Down Expand Up @@ -7004,7 +7004,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource2(d3d12_dev
struct d3d12_resource *object;
HRESULT hr;

TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
"optimized_clear_value %p, protected_session %p, iid %s, resource %p.\n",
iface, heap_properties, heap_flags, desc, initial_state,
optimized_clear_value, protected_session, debugstr_guid(iid), resource);
Expand Down Expand Up @@ -7787,7 +7787,7 @@ static void d3d12_device_caps_init_feature_options1(struct d3d12_device *device)
else
{
options1->TotalLaneCount = 32 * device->device_info.vulkan_1_1_properties.subgroupSize;
WARN("No device info available for TotalLaneCount = .\n");
WARN("No device info available for TotalLaneCount = %u.\n", options1->TotalLaneCount);
}

options1->ExpandedComputeResourceStates = TRUE;
Expand Down Expand Up @@ -8931,19 +8931,19 @@ bool d3d12_device_validate_shader_meta(struct d3d12_device *device, const struct
if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_NATIVE_16BIT_OPERATIONS) &&
!device->d3d12_caps.options4.Native16BitShaderOpsSupported)
{
WARN("Attempting to use 16-bit operations in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use 16-bit operations in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_FP64) && !device->d3d12_caps.options.DoublePrecisionFloatShaderOps)
{
WARN("Attempting to use FP64 operations in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use FP64 operations in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_INT64) && !device->d3d12_caps.options1.Int64ShaderOps)
{
WARN("Attempting to use Int64 operations in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use Int64 operations in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

Expand All @@ -8954,28 +8954,28 @@ bool d3d12_device_validate_shader_meta(struct d3d12_device *device, const struct
!device->d3d12_caps.options11.AtomicInt64OnDescriptorHeapResourceSupported &&
!device->d3d12_caps.options9.AtomicInt64OnTypedResourceSupported)
{
WARN("Attempting to use Int64Atomic operations in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use Int64Atomic operations in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_INT64_ATOMICS_IMAGE) &&
!device->device_info.shader_image_atomic_int64_features.shaderImageInt64Atomics)
{
WARN("Attempting to use typed Int64Atomic operations in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use typed Int64Atomic operations in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_FRAGMENT_BARYCENTRIC) &&
!device->d3d12_caps.options3.BarycentricsSupported)
{
WARN("Attempting to use barycentrics in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use barycentrics in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

if ((meta->flags & VKD3D_SHADER_META_FLAG_USES_STENCIL_EXPORT) &&
!device->d3d12_caps.options.PSSpecifiedStencilRefSupported)
{
WARN("Attempting to use stencil reference in shader %016"PRIx64", but this is not supported.", meta->hash);
WARN("Attempting to use stencil reference in shader %016"PRIx64", but this is not supported.\n", meta->hash);
return false;
}

Expand Down
20 changes: 10 additions & 10 deletions libs/vkd3d/device_vkd3d_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_vkd3d_ext_QueryInterface(d3d12_dev
static HRESULT STDMETHODCALLTYPE d3d12_device_vkd3d_ext_GetVulkanHandles(d3d12_device_vkd3d_ext_iface *iface, VkInstance *vk_instance, VkPhysicalDevice *vk_physical_device, VkDevice *vk_device)
{
struct d3d12_device *device = d3d12_device_from_ID3D12DeviceExt(iface);
TRACE("iface %p, vk_instance %p, vk_physical_device %p, vk_device %p \n", iface, vk_instance, vk_physical_device, vk_device);
TRACE("iface %p, vk_instance %p, vk_physical_device %p, vk_device %p\n", iface, vk_instance, vk_physical_device, vk_device);
if (!vk_device || !vk_instance || !vk_physical_device)
return E_INVALIDARG;

Expand All @@ -66,7 +66,7 @@ static BOOL STDMETHODCALLTYPE d3d12_device_vkd3d_ext_GetExtensionSupport(d3d12_d
const struct d3d12_device *device = d3d12_device_from_ID3D12DeviceExt(iface);
bool ret_val = false;

TRACE("iface %p, extension %u \n", iface, extension);
TRACE("iface %p, extension %u\n", iface, extension);
switch (extension)
{
case D3D12_VK_NVX_BINARY_IMPORT:
Expand All @@ -79,7 +79,7 @@ static BOOL STDMETHODCALLTYPE d3d12_device_vkd3d_ext_GetExtensionSupport(d3d12_d
ret_val = device->vk_info.NV_low_latency2;
break;
default:
WARN("Invalid extension %x\n", extension);
WARN("Invalid extension %x.\n", extension);
}

return ret_val;
Expand All @@ -96,7 +96,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_vkd3d_ext_CreateCubinComputeShader
VkDevice vk_device;
VkResult vr;

TRACE("iface %p, cubin_data %p, cubin_size %u, shader_name %s \n", iface, cubin_data, cubin_size, shader_name);
TRACE("iface %p, cubin_data %p, cubin_size %u, shader_name %s\n", iface, cubin_data, cubin_size, shader_name);
if (!cubin_data || !cubin_size || !shader_name)
return E_INVALIDARG;

Expand Down Expand Up @@ -138,7 +138,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_vkd3d_ext_DestroyCubinComputeShade
struct d3d12_device *device;
VkDevice vk_device;

TRACE("iface %p, handle %p \n", iface, handle);
TRACE("iface %p, handle %p\n", iface, handle);
if (!iface || !handle)
return E_INVALIDARG;

Expand Down Expand Up @@ -309,7 +309,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_dxvk_interop_device_GetVulkanHandles(ID3D
VkInstance *vk_instance, VkPhysicalDevice *vk_physical_device, VkDevice *vk_device)
{
struct d3d12_device *device = d3d12_device_from_ID3D12DXVKInteropDevice(iface);
TRACE("iface %p, vk_instance %p, vk_physical_device %p, vk_device %p \n", iface, vk_instance, vk_physical_device, vk_device);
TRACE("iface %p, vk_instance %p, vk_physical_device %p, vk_device %p\n", iface, vk_instance, vk_physical_device, vk_device);
if (!vk_device || !vk_instance || !vk_physical_device)
return E_INVALIDARG;

Expand All @@ -324,9 +324,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_dxvk_interop_device_GetInstanceExtensions
struct d3d12_device *device = d3d12_device_from_ID3D12DXVKInteropDevice(iface);
struct vkd3d_instance *instance = device->vkd3d_instance;

TRACE("iface %p, extension_count %u, extensions %p.\n", iface, extension_count, extensions);
TRACE("iface %p, extension_count %p, extensions %p.\n", iface, extension_count, extensions);

if (extensions && (*extension_count < instance->vk_info.extension_count))
if (!extension_count || (extensions && (*extension_count < instance->vk_info.extension_count)))
return E_INVALIDARG;

*extension_count = instance->vk_info.extension_count;
Expand All @@ -343,9 +343,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_dxvk_interop_device_GetDeviceExtensions(I
{
struct d3d12_device *device = d3d12_device_from_ID3D12DXVKInteropDevice(iface);

TRACE("iface %p, extension_count %u, extensions %p.\n", iface, extension_count, extensions);
TRACE("iface %p, extension_count %p, extensions %p.\n", iface, extension_count, extensions);

if (extensions && (*extension_count < device->vk_info.extension_count))
if (!extension_count || (extensions && (*extension_count < device->vk_info.extension_count)))
return E_INVALIDARG;

*extension_count = device->vk_info.extension_count;
Expand Down
Loading

0 comments on commit 911b334

Please sign in to comment.