mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxbc] Removed <optional> dependency
This commit is contained in:
parent
0558955388
commit
0f26d1c627
@ -547,13 +547,10 @@ namespace dxvk {
|
|||||||
result = this->selectOperandComponents(token, result, dstMask);
|
result = this->selectOperandComponents(token, result, dstMask);
|
||||||
|
|
||||||
// Apply source operand modifiers, if any
|
// Apply source operand modifiers, if any
|
||||||
auto operandModifiers = operand.queryOperandExt(
|
DxbcOperandTokenExt token;
|
||||||
DxbcOperandExt::OperandModifier);
|
|
||||||
|
|
||||||
if (operandModifiers) {
|
if (operand.queryOperandExt(DxbcOperandExt::OperandModifier, token))
|
||||||
result = this->applyOperandModifiers(
|
result = this->applyOperandModifiers(result, token.data());
|
||||||
result, operandModifiers->data());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -136,9 +136,9 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::optional<DxbcOperandTokenExt> DxbcOperand::queryOperandExt(DxbcOperandExt ext) const {
|
bool DxbcOperand::queryOperandExt(DxbcOperandExt ext, DxbcOperandTokenExt& token) const {
|
||||||
if (!this->token().isExtended())
|
if (!this->token().isExtended())
|
||||||
return { };
|
return false;
|
||||||
|
|
||||||
uint32_t extTokenId = 1;
|
uint32_t extTokenId = 1;
|
||||||
DxbcOperandTokenExt extToken;
|
DxbcOperandTokenExt extToken;
|
||||||
@ -146,11 +146,13 @@ namespace dxvk {
|
|||||||
do {
|
do {
|
||||||
extToken = m_info.getWord(extTokenId++);
|
extToken = m_info.getWord(extTokenId++);
|
||||||
|
|
||||||
if (extToken.type() == ext)
|
if (extToken.type() == ext) {
|
||||||
return extToken;
|
token = extToken;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} while (extToken.isExtended());
|
} while (extToken.isExtended());
|
||||||
|
|
||||||
return { };
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -185,9 +187,9 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::optional<DxbcOpcodeTokenExt> DxbcInstruction::queryOpcodeExt(DxbcExtOpcode extOpcode) const {
|
bool DxbcInstruction::queryOpcodeExt(DxbcExtOpcode extOpcode, DxbcOpcodeTokenExt& token) const {
|
||||||
if (!this->token().isExtended())
|
if (!this->token().isExtended())
|
||||||
return { };
|
return false;
|
||||||
|
|
||||||
uint32_t extTokenId = 1;
|
uint32_t extTokenId = 1;
|
||||||
DxbcOpcodeTokenExt extToken;
|
DxbcOpcodeTokenExt extToken;
|
||||||
@ -195,11 +197,13 @@ namespace dxvk {
|
|||||||
do {
|
do {
|
||||||
extToken = m_op.getWord(extTokenId++);
|
extToken = m_op.getWord(extTokenId++);
|
||||||
|
|
||||||
if (extToken.opcode() == extOpcode)
|
if (extToken.opcode() == extOpcode) {
|
||||||
return extToken;
|
token = extToken;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} while (extToken.isExtended());
|
} while (extToken.isExtended());
|
||||||
|
|
||||||
return { };
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <optional>
|
|
||||||
|
|
||||||
#include "dxbc_enums.h"
|
#include "dxbc_enums.h"
|
||||||
#include "dxbc_names.h"
|
#include "dxbc_names.h"
|
||||||
@ -508,10 +507,12 @@ namespace dxvk {
|
|||||||
* If an extended operand token with the given
|
* If an extended operand token with the given
|
||||||
* operand extension exists, return that token.
|
* operand extension exists, return that token.
|
||||||
* \param [in] ext The operand extension
|
* \param [in] ext The operand extension
|
||||||
* \returns The extended operand token
|
* \param [out] token The extended token
|
||||||
|
* \returns \c true if the token was defined
|
||||||
*/
|
*/
|
||||||
std::optional<DxbcOperandTokenExt> queryOperandExt(
|
bool queryOperandExt(
|
||||||
DxbcOperandExt ext) const;
|
DxbcOperandExt ext,
|
||||||
|
DxbcOperandTokenExt& token) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Reads 32-bit immediate integer
|
* \brief Reads 32-bit immediate integer
|
||||||
@ -579,11 +580,13 @@ namespace dxvk {
|
|||||||
*
|
*
|
||||||
* If an extended opcode token with the given
|
* If an extended opcode token with the given
|
||||||
* opcode exists, the token will be returned.
|
* opcode exists, the token will be returned.
|
||||||
* \param extOpcode Extended opcode
|
* \param [in] extOpcode Extended opcode
|
||||||
* \returns Extended opcode token
|
* \param [out] token The extended token
|
||||||
|
* \returns \c true if the token was defined
|
||||||
*/
|
*/
|
||||||
std::optional<DxbcOpcodeTokenExt> queryOpcodeExt(
|
bool queryOpcodeExt(
|
||||||
DxbcExtOpcode extOpcode) const;
|
DxbcExtOpcode extOpcode,
|
||||||
|
DxbcOpcodeTokenExt& token) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retrieves argument word
|
* \brief Retrieves argument word
|
||||||
|
Loading…
x
Reference in New Issue
Block a user