1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[spirv] Implement opInverse, opNormalize and opLength

This commit is contained in:
Joshua Ashton 2019-08-04 00:01:46 +01:00 committed by Philip Rebohle
parent edf0661994
commit fdbfb2c92d
2 changed files with 57 additions and 0 deletions

View File

@ -1974,6 +1974,21 @@ namespace dxvk {
}
uint32_t SpirvModule::opInverse(
uint32_t resultType,
uint32_t matrix) {
uint32_t resultId = this->allocateId();
m_code.putIns(spv::OpExtInst, 6);
m_code.putWord(resultType);
m_code.putWord(resultId);
m_code.putWord(m_instExtGlsl450);
m_code.putWord(spv::GLSLstd450MatrixInverse);
m_code.putWord(matrix);
return resultId;
}
uint32_t SpirvModule::opFFma(
uint32_t resultType,
uint32_t a,
@ -2555,6 +2570,36 @@ namespace dxvk {
}
uint32_t SpirvModule::opNormalize(
uint32_t resultType,
uint32_t operand) {
uint32_t resultId = this->allocateId();
m_code.putIns (spv::OpExtInst, 6);
m_code.putWord(resultType);
m_code.putWord(resultId);
m_code.putWord(m_instExtGlsl450);
m_code.putWord(spv::GLSLstd450Normalize);
m_code.putWord(operand);
return resultId;
}
uint32_t SpirvModule::opLength(
uint32_t resultType,
uint32_t operand) {
uint32_t resultId = this->allocateId();
m_code.putIns (spv::OpExtInst, 6);
m_code.putWord(resultType);
m_code.putWord(resultId);
m_code.putWord(m_instExtGlsl450);
m_code.putWord(spv::GLSLstd450Length);
m_code.putWord(operand);
return resultId;
}
uint32_t SpirvModule::opExp2(
uint32_t resultType,
uint32_t operand) {

View File

@ -712,6 +712,10 @@ namespace dxvk {
uint32_t resultType,
uint32_t matrix);
uint32_t opInverse(
uint32_t resultType,
uint32_t matrix);
uint32_t opFFma(
uint32_t resultType,
uint32_t a,
@ -895,6 +899,14 @@ namespace dxvk {
uint32_t resultType,
uint32_t operand);
uint32_t opNormalize(
uint32_t resultType,
uint32_t operand);
uint32_t opLength(
uint32_t resultType,
uint32_t operand);
uint32_t opExp2(
uint32_t resultType,
uint32_t operand);