From 8fadd7a2425fc16d415e776eed5d6ebf42d41813 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Tue, 31 Jul 2018 19:57:12 +0300 Subject: [PATCH] [D3D12] Fix vertex address in fetch range usage --- src/xenia/gpu/d3d12/d3d12_command_processor.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/d3d12/d3d12_command_processor.cc b/src/xenia/gpu/d3d12/d3d12_command_processor.cc index e8be80d21..c80a62b1d 100644 --- a/src/xenia/gpu/d3d12/d3d12_command_processor.cc +++ b/src/xenia/gpu/d3d12/d3d12_command_processor.cc @@ -590,8 +590,12 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type, } uint32_t vfetch_constant_index = XE_GPU_REG_SHADER_CONSTANT_FETCH_00_0 + vfetch_index * 2; - uint32_t vfetch_address = regs[vfetch_constant_index].u32 << 2; - shared_memory_->UseRange(regs[vfetch_constant_index].u32 << 2, + if ((regs[vfetch_constant_index].u32 & 0x3) != 3) { + XELOGE("Vertex fetch type is not 3!"); + assert_always(); + return false; + } + shared_memory_->UseRange(regs[vfetch_constant_index].u32 & 0x1FFFFFFC, regs[vfetch_constant_index + 1].u32 & 0x3FFFFFC); vertex_buffers_resident[vfetch_index >> 6] |= 1ull << (vfetch_index & 63); }