[DXBC] Fix totally broken instruction when memexport is used in PS

This commit is contained in:
Triang3l 2020-03-28 00:23:02 +03:00
parent a10bd2a5c1
commit 7bdf59a8c7
1 changed files with 6 additions and 16 deletions

View File

@ -81,22 +81,12 @@ void DxbcShaderTranslator::ExportToMemory() {
if (edram_rov_used_) { if (edram_rov_used_) {
system_constants_used_ |= 1ull system_constants_used_ |= 1ull
<< kSysConst_EDRAMResolutionSquareScale_Index; << kSysConst_EDRAMResolutionSquareScale_Index;
shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_UGE) | DxbcOpULT(DxbcDest::R(control_temp, 0b0010),
ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(9)); DxbcSrc::CB(cbuffer_index_system_constants_,
shader_code_.push_back( uint32_t(CbufferRegister::kSystemConstants),
EncodeVectorMaskedOperand(D3D10_SB_OPERAND_TYPE_TEMP, 0b0010, 1)); kSysConst_EDRAMResolutionSquareScale_Vec)
shader_code_.push_back(control_temp); .Select(kSysConst_EDRAMResolutionSquareScale_Comp),
shader_code_.push_back(EncodeVectorSelectOperand( DxbcSrc::LU(2));
D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER,
kSysConst_EDRAMResolutionSquareScale_Comp, 3));
shader_code_.push_back(
EncodeScalarOperand(D3D10_SB_OPERAND_TYPE_IMMEDIATE32, 0));
shader_code_.push_back(1);
shader_code_.push_back(cbuffer_index_system_constants_);
shader_code_.push_back(uint32_t(CbufferRegister::kSystemConstants));
shader_code_.push_back(kSysConst_EDRAMResolutionSquareScale_Vec);
++stat_.instruction_count;
++stat_.uint_instruction_count;
shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_AND) | shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_AND) |
ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(7)); ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(7));