[D3D12] DXBC: Vfetch exponent bias

This commit is contained in:
Triang3l 2018-09-07 09:17:36 +03:00
parent 64fe2d8600
commit 8ecedbb20a
1 changed files with 22 additions and 0 deletions

View File

@ -2106,6 +2106,28 @@ void DxbcShaderTranslator::ProcessVertexFetchInstruction(
++stat_.mov_instruction_count;
}
// Apply the exponent bias.
if (instr.attributes.exp_adjust != 0) {
shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_MUL) |
ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(10));
shader_code_.push_back(EncodeVectorMaskedOperand(
D3D10_SB_OPERAND_TYPE_TEMP, result_write_mask, 1));
shader_code_.push_back(system_temp_pv_);
shader_code_.push_back(EncodeVectorSwizzledOperand(
D3D10_SB_OPERAND_TYPE_TEMP, kSwizzleXYZW, 1));
shader_code_.push_back(system_temp_pv_);
shader_code_.push_back(EncodeVectorSwizzledOperand(
D3D10_SB_OPERAND_TYPE_IMMEDIATE32, kSwizzleXYZW, 0));
uint32_t exp_adjust_scale =
uint32_t(0x3F800000 + (instr.attributes.exp_adjust << 23));
shader_code_.push_back(exp_adjust_scale);
shader_code_.push_back(exp_adjust_scale);
shader_code_.push_back(exp_adjust_scale);
shader_code_.push_back(exp_adjust_scale);
++stat_.instruction_count;
++stat_.float_instruction_count;
}
StoreResult(instr.result, system_temp_pv_, false);
}