1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Support R11G11B10 format in ClearUnorderedAccessViewUint

Silences an error message in Shadow of the Tomb Raider. Does not have
any consequences for this game because it initializes the view to 0.
This commit is contained in:
Philip Rebohle 2018-11-10 18:48:44 +01:00
parent 05856e836b
commit 0cfa5b16d3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 8 additions and 2 deletions

View File

@ -686,7 +686,6 @@ namespace dxvk {
VkFormat uavFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_ANY).Format; VkFormat uavFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_ANY).Format;
VkFormat rawFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_RAW).Format; VkFormat rawFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_RAW).Format;
// FIXME support packed formats
if (uavFormat != rawFormat && rawFormat == VK_FORMAT_UNDEFINED) { if (uavFormat != rawFormat && rawFormat == VK_FORMAT_UNDEFINED) {
Logger::err(str::format("D3D11: ClearUnorderedAccessViewUint: No raw format found for ", uavFormat)); Logger::err(str::format("D3D11: ClearUnorderedAccessViewUint: No raw format found for ", uavFormat));
return; return;
@ -698,6 +697,13 @@ namespace dxvk {
clearValue.color.uint32[1] = Values[1]; clearValue.color.uint32[1] = Values[1];
clearValue.color.uint32[2] = Values[2]; clearValue.color.uint32[2] = Values[2];
clearValue.color.uint32[3] = Values[3]; clearValue.color.uint32[3] = Values[3];
// This is the only packed format that has UAV support
if (uavFormat == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
clearValue.color.uint32[0] = ((Values[0] & 0x7FF) << 0)
| ((Values[1] & 0x7FF) << 11)
| ((Values[2] & 0x3FF) << 22);
}
if (uav->GetResourceType() == D3D11_RESOURCE_DIMENSION_BUFFER) { if (uav->GetResourceType() == D3D11_RESOURCE_DIMENSION_BUFFER) {
// In case of raw and structured buffers as well as typed // In case of raw and structured buffers as well as typed

View File

@ -129,7 +129,7 @@ namespace dxvk {
// DXGI_FORMAT_R11G11B10_FLOAT // DXGI_FORMAT_R11G11B10_FLOAT
{ VK_FORMAT_B10G11R11_UFLOAT_PACK32, { VK_FORMAT_B10G11R11_UFLOAT_PACK32,
VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED,
VK_FORMAT_UNDEFINED, VK_FORMAT_R32_UINT,
VK_IMAGE_ASPECT_COLOR_BIT }, VK_IMAGE_ASPECT_COLOR_BIT },
// DXGI_FORMAT_R8G8B8A8_TYPELESS // DXGI_FORMAT_R8G8B8A8_TYPELESS
{ VK_FORMAT_R8G8B8A8_UNORM, { VK_FORMAT_R8G8B8A8_UNORM,