[D3D12] ROV: Fix depth testing

This commit is contained in:
Triang3l 2018-10-15 23:16:34 +03:00
parent e455467c32
commit 6e9964b43e
2 changed files with 10 additions and 10 deletions

View File

@ -1646,16 +1646,16 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
if (render_target_cache_->IsROVUsedForEDRAM()) {
uint32_t rb_depthcontrol = regs[XE_GPU_REG_RB_DEPTHCONTROL].u32;
if (rb_depthcontrol & 0x2) {
if (DepthRenderTargetFormat(rb_depth_info) ==
DepthRenderTargetFormat::kD24FS8) {
flags |= DxbcShaderTranslator::kSysFlag_DepthFloat24;
}
// Read depth/stencil if depth comparison function is not "always".
uint32_t depth_comparison = (rb_depthcontrol >> 4) & 0x7;
flags |= depth_comparison
<< DxbcShaderTranslator::kSysFlag_DepthPassIfLess_Shift;
if (depth_comparison != 0x7) {
flags |= DxbcShaderTranslator::kSysFlag_DepthStencilRead;
if (DepthRenderTargetFormat(rb_depth_info) ==
DepthRenderTargetFormat::kD24FS8) {
flags |= DxbcShaderTranslator::kSysFlag_DepthFloat24;
}
}
if (rb_depthcontrol & 0x4) {
flags |= DxbcShaderTranslator::kSysFlag_DepthStencilWrite;

View File

@ -1750,8 +1750,8 @@ void DxbcShaderTranslator::CompletePixelShader_WriteToROV_LoadColor(
shader_code_.push_back(
EncodeVectorReplicatedOperand(D3D10_SB_OPERAND_TYPE_TEMP, rt_index, 1));
shader_code_.push_back(edram_dword_offset_low_temp);
shader_code_.push_back(EncodeVectorSwizzledOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, kSwizzleXYZW, 2));
shader_code_.push_back(EncodeVectorReplicatedOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, 0, 2));
shader_code_.push_back(0);
shader_code_.push_back(0);
++stat_.instruction_count;
@ -1806,8 +1806,8 @@ void DxbcShaderTranslator::CompletePixelShader_WriteToROV_LoadColor(
shader_code_.push_back(
EncodeVectorReplicatedOperand(D3D10_SB_OPERAND_TYPE_TEMP, rt_index, 1));
shader_code_.push_back(edram_dword_offset_high_temp);
shader_code_.push_back(EncodeVectorSwizzledOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, kSwizzleXYZW, 2));
shader_code_.push_back(EncodeVectorReplicatedOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, 0, 2));
shader_code_.push_back(0);
shader_code_.push_back(0);
++stat_.instruction_count;
@ -3529,8 +3529,8 @@ void DxbcShaderTranslator::CompletePixelShader_WriteToROV() {
shader_code_.push_back(
EncodeVectorReplicatedOperand(D3D10_SB_OPERAND_TYPE_TEMP, 3, 1));
shader_code_.push_back(system_temp_depth_);
shader_code_.push_back(EncodeVectorSwizzledOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, kSwizzleXYZW, 2));
shader_code_.push_back(EncodeVectorReplicatedOperand(
D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW, 0, 2));
shader_code_.push_back(0);
shader_code_.push_back(0);
++stat_.instruction_count;