Vulkan: Apply a half-pixel offset where necessary.
This commit is contained in:
parent
082c767fba
commit
bea607b454
|
@ -957,13 +957,15 @@ bool VulkanCommandProcessor::IssueCopy() {
|
||||||
const uint8_t* vertex_addr = memory_->TranslatePhysical(fetch->address << 2);
|
const uint8_t* vertex_addr = memory_->TranslatePhysical(fetch->address << 2);
|
||||||
trace_writer_.WriteMemoryRead(fetch->address << 2, fetch->size * 4);
|
trace_writer_.WriteMemoryRead(fetch->address << 2, fetch->size * 4);
|
||||||
|
|
||||||
|
// Most vertices have a negative half pixel offset applied, which we reverse.
|
||||||
|
auto& vtx_cntl = *(reg::PA_SU_VTX_CNTL*)®s[XE_GPU_REG_PA_SU_VTX_CNTL].u32;
|
||||||
|
float vtx_offset = vtx_cntl.pix_center == 0 ? 0.5f : 0.f;
|
||||||
|
|
||||||
float dest_points[6];
|
float dest_points[6];
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
// TODO(DrChat): I believe there is a register dictating whether this
|
|
||||||
// half-pixel offset needs to be applied.
|
|
||||||
dest_points[i] =
|
dest_points[i] =
|
||||||
GpuSwap(xe::load<float>(vertex_addr + i * 4), Endian(fetch->endian)) +
|
GpuSwap(xe::load<float>(vertex_addr + i * 4), Endian(fetch->endian)) +
|
||||||
0.5f;
|
vtx_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: The xenos only supports rectangle copies (luckily)
|
// Note: The xenos only supports rectangle copies (luckily)
|
||||||
|
|
Loading…
Reference in New Issue