summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTriang3l <triang3l@yandex.ru>2019-12-01 21:39:48 +0300
committerTriang3l <triang3l@yandex.ru>2019-12-01 21:39:48 +0300
commit6a3a56b3b95f291c083f23bf5dba398723e202dc (patch)
tree1fd10118dca84d9fb54ffc685236c4db6f11fd09
parentc5db959154d1e9db014fb646bc0b9c1b660a3587 (diff)
[D3D12] Workaround for texture flickering on Nvidia - don't use sampler 2047
-rw-r--r--src/xenia/gpu/d3d12/d3d12_command_processor.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/xenia/gpu/d3d12/d3d12_command_processor.cc b/src/xenia/gpu/d3d12/d3d12_command_processor.cc
index 2be359787..39aa3961e 100644
--- a/src/xenia/gpu/d3d12/d3d12_command_processor.cc
+++ b/src/xenia/gpu/d3d12/d3d12_command_processor.cc
@@ -770,9 +770,15 @@ bool D3D12CommandProcessor::SetupContext() {
std::make_unique<ui::d3d12::UploadBufferPool>(device, 1024 * 1024);
view_heap_pool_ = std::make_unique<ui::d3d12::DescriptorHeapPool>(
device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 32768);
- // Can't create a shader-visible heap with more than 2048 samplers.
+ // Direct3D 12 only allows shader-visible heaps with no more than 2048
+ // samplers (due to Nvidia addressing). However, there's also possibly a weird
+ // bug in the Nvidia driver (tested on 440.97 and earlier on Windows 10 1803)
+ // that caused the sampler with index 2047 not to work if a heap with 8 or
+ // less samplers also exists - in case of Xenia, it's the immediate drawer's
+ // sampler heap.
+ // FIXME(Triang3l): Investigate the issue with the sampler 2047 on Nvidia.
sampler_heap_pool_ = std::make_unique<ui::d3d12::DescriptorHeapPool>(
- device, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, 2048);
+ device, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, 2000);
shared_memory_ =
std::make_unique<SharedMemory>(this, memory_, &trace_writer_);