1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 22:24:15 +01:00

[dxbc] Implemented BfRev instruction

This commit is contained in:
Philip Rebohle 2018-02-15 09:41:48 +01:00
parent 0c2058e8c4
commit 563d4582ab
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 26 additions and 1 deletions

View File

@ -1324,6 +1324,11 @@ namespace dxvk {
typeId, src.at(0).id); typeId, src.at(0).id);
break; break;
case DxbcOpcode::BfRev:
dst.id = m_module.opBitReverse(
typeId, src.at(0).id);
break;
/////////////////////////// ///////////////////////////
// Conversion instructions // Conversion instructions
case DxbcOpcode::ItoF: case DxbcOpcode::ItoF:

View File

@ -693,7 +693,10 @@ namespace dxvk {
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 }, { DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} }, } },
/* BfRev */ /* BfRev */
{ }, { 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* Swapc */ /* Swapc */
{ 5, DxbcInstClass::VectorCmov, { { 5, DxbcInstClass::VectorCmov, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 }, { DxbcOperandKind::DstReg, DxbcScalarType::Float32 },

View File

@ -946,6 +946,19 @@ namespace dxvk {
} }
uint32_t SpirvModule::opBitReverse(
uint32_t resultType,
uint32_t operand) {
uint32_t resultId = this->allocateId();
m_code.putIns (spv::OpBitReverse, 4);
m_code.putWord(resultType);
m_code.putWord(resultId);
m_code.putWord(operand);
return resultId;
}
uint32_t SpirvModule::opFindILsb( uint32_t SpirvModule::opFindILsb(
uint32_t resultType, uint32_t resultType,
uint32_t operand) { uint32_t operand) {

View File

@ -381,6 +381,10 @@ namespace dxvk {
uint32_t resultType, uint32_t resultType,
uint32_t operand); uint32_t operand);
uint32_t opBitReverse(
uint32_t resultType,
uint32_t operand);
uint32_t opFindILsb( uint32_t opFindILsb(
uint32_t resultType, uint32_t resultType,
uint32_t operand); uint32_t operand);