From d214c62c783cde42ed70510e374dc29ef013446b Mon Sep 17 00:00:00 2001 From: Triang3l Date: Thu, 18 Oct 2018 20:59:24 +0300 Subject: [PATCH] [D3D12] ROV: Fix write mask source --- src/xenia/gpu/dxbc_shader_translator.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/xenia/gpu/dxbc_shader_translator.cc b/src/xenia/gpu/dxbc_shader_translator.cc index 3b23751d7..1f058aa75 100644 --- a/src/xenia/gpu/dxbc_shader_translator.cc +++ b/src/xenia/gpu/dxbc_shader_translator.cc @@ -4204,21 +4204,19 @@ void DxbcShaderTranslator::CompletePixelShader_WriteToROV() { // Mask the components to overwrite. uint32_t write_mask_temp = PushSystemTemp(); shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_AND) | - ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(12)); + ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(10)); shader_code_.push_back( EncodeVectorMaskedOperand(D3D10_SB_OPERAND_TYPE_TEMP, 0b1111, 1)); shader_code_.push_back(write_mask_temp); - shader_code_.push_back(EncodeVectorReplicatedOperand( - D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER, i, 3)); - shader_code_.push_back(cbuffer_index_system_constants_); - shader_code_.push_back(uint32_t(CbufferRegister::kSystemConstants)); - shader_code_.push_back(kSysConst_EDRAMRTFlags_Vec); + shader_code_.push_back( + EncodeVectorReplicatedOperand(D3D10_SB_OPERAND_TYPE_TEMP, i, 1)); + shader_code_.push_back(system_temp_color_written_); shader_code_.push_back(EncodeVectorSwizzledOperand( D3D10_SB_OPERAND_TYPE_IMMEDIATE32, kSwizzleXYZW, 0)); - shader_code_.push_back(kRTFlag_WriteR); - shader_code_.push_back(kRTFlag_WriteG); - shader_code_.push_back(kRTFlag_WriteB); - shader_code_.push_back(kRTFlag_WriteA); + shader_code_.push_back(1 << 0); + shader_code_.push_back(1 << 1); + shader_code_.push_back(1 << 2); + shader_code_.push_back(1 << 3); ++stat_.instruction_count; ++stat_.uint_instruction_count; shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_MOVC) |