diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-08-13 19:09:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-13 19:09:07 -0400 |
| commit | aa45b7fe61c805f428c03bfaeba6e80bdb6b0e59 (patch) | |
| tree | 1ac46cc88a6ff0060e141d9ca0a516f536b91305 /Source/Core/VideoBackends/D3D/DXTexture.cpp | |
| parent | 72ef27c157e13075b656334657e46a3952ae2dff (diff) | |
| parent | 6b683517dc832312df82bf89a0b4cf129084b090 (diff) | |
Merge pull request #13867 from TryTwo/gfx_bug_fix
GFX: Fix bugs for AbstractStagingTextures that perform an Upload.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/DXTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/DXTexture.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/DXTexture.cpp b/Source/Core/VideoBackends/D3D/DXTexture.cpp index 9015ede81c..eac31fd64d 100644 --- a/Source/Core/VideoBackends/D3D/DXTexture.cpp +++ b/Source/Core/VideoBackends/D3D/DXTexture.cpp @@ -211,6 +211,7 @@ std::unique_ptr<DXStagingTexture> DXStagingTexture::Create(StagingTextureType ty { D3D11_USAGE usage; UINT cpu_flags; + UINT bind_flags = 0; if (type == StagingTextureType::Readback) { usage = D3D11_USAGE_STAGING; @@ -220,6 +221,7 @@ std::unique_ptr<DXStagingTexture> DXStagingTexture::Create(StagingTextureType ty { usage = D3D11_USAGE_DYNAMIC; cpu_flags = D3D11_CPU_ACCESS_WRITE; + bind_flags = D3D11_BIND_SHADER_RESOURCE; } else { @@ -228,7 +230,7 @@ std::unique_ptr<DXStagingTexture> DXStagingTexture::Create(StagingTextureType ty } CD3D11_TEXTURE2D_DESC desc(D3DCommon::GetDXGIFormatForAbstractFormat(config.format, false), - config.width, config.height, 1, 1, 0, usage, cpu_flags); + config.width, config.height, 1, 1, bind_flags, usage, cpu_flags); ComPtr<ID3D11Texture2D> texture; HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, texture.GetAddressOf()); @@ -317,7 +319,7 @@ bool DXStagingTexture::Map() if (m_type == StagingTextureType::Readback) map_type = D3D11_MAP_READ; else if (m_type == StagingTextureType::Upload) - map_type = D3D11_MAP_WRITE; + map_type = D3D11_MAP_WRITE_DISCARD; else map_type = D3D11_MAP_READ_WRITE; |
