File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2144,12 +2144,21 @@ ID3D12Resource* D3D12TextureCache::D3D12Texture::GetOrCreate3DAs2DResource(
21442144 d3d12_cache.command_processor_ .GetD3D12Provider ();
21452145 ID3D12Device* device = provider.GetDevice ();
21462146
2147- D3D12_RESOURCE_DESC source_desc = resource_->GetDesc ();
2148- D3D12_RESOURCE_DESC desc = source_desc;
2147+ // Build the 2D resource desc from scratch rather than copying from the 3D
2148+ // resource's GetDesc(), as inherited internal state can cause issues with
2149+ // VKD3D (D3D12 over Vulkan translation used by Wine).
2150+ D3D12_RESOURCE_DESC desc = {};
21492151 desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
2152+ desc.Width = key ().GetWidth ();
2153+ desc.Height = key ().GetHeight ();
21502154 desc.DepthOrArraySize = 1 ;
21512155 desc.MipLevels = 1 ;
2152- desc.Alignment = 0 ;
2156+ desc.Format = d3d12_cache.GetDXGIResourceFormat (key ());
2157+ if (desc.Format == DXGI_FORMAT_UNKNOWN) {
2158+ return nullptr ;
2159+ }
2160+ desc.SampleDesc .Count = 1 ;
2161+ desc.SampleDesc .Quality = 0 ;
21532162 desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
21542163 desc.Flags = D3D12_RESOURCE_FLAG_NONE;
21552164
You can’t perform that action at this time.
0 commit comments