Skip to content

Commit 0cfa5b1

Browse files
committed
[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.
1 parent 05856e8 commit 0cfa5b1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/d3d11/d3d11_context.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ namespace dxvk {
686686
VkFormat uavFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_ANY).Format;
687687
VkFormat rawFormat = m_parent->LookupFormat(uavDesc.Format, DXGI_VK_FORMAT_MODE_RAW).Format;
688688

689-
// FIXME support packed formats
690689
if (uavFormat != rawFormat && rawFormat == VK_FORMAT_UNDEFINED) {
691690
Logger::err(str::format("D3D11: ClearUnorderedAccessViewUint: No raw format found for ", uavFormat));
692691
return;
@@ -698,6 +697,13 @@ namespace dxvk {
698697
clearValue.color.uint32[1] = Values[1];
699698
clearValue.color.uint32[2] = Values[2];
700699
clearValue.color.uint32[3] = Values[3];
700+
701+
// This is the only packed format that has UAV support
702+
if (uavFormat == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
703+
clearValue.color.uint32[0] = ((Values[0] & 0x7FF) << 0)
704+
| ((Values[1] & 0x7FF) << 11)
705+
| ((Values[2] & 0x3FF) << 22);
706+
}
701707

702708
if (uav->GetResourceType() == D3D11_RESOURCE_DIMENSION_BUFFER) {
703709
// In case of raw and structured buffers as well as typed

src/dxgi/dxgi_format.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ namespace dxvk {
129129
// DXGI_FORMAT_R11G11B10_FLOAT
130130
{ VK_FORMAT_B10G11R11_UFLOAT_PACK32,
131131
VK_FORMAT_UNDEFINED,
132-
VK_FORMAT_UNDEFINED,
132+
VK_FORMAT_R32_UINT,
133133
VK_IMAGE_ASPECT_COLOR_BIT },
134134
// DXGI_FORMAT_R8G8B8A8_TYPELESS
135135
{ VK_FORMAT_R8G8B8A8_UNORM,

0 commit comments

Comments
 (0)