1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[dxso] Track and prioritize co-issued CNDs above their parent ops

This commit is contained in:
Joshua Ashton 2019-12-22 17:46:57 +00:00
parent 4d6fbacd3a
commit 3ff9c4cc43
4 changed files with 18 additions and 2 deletions

View File

@ -10,6 +10,9 @@ namespace dxvk {
const DxsoInstructionContext& ctx) {
DxsoOpcode opcode = ctx.instruction.opcode;
if (opcode == DxsoOpcode::Cnd && ctx.instruction.coissue)
m_analysis->coissues.push_back(ctx);
if (opcode == DxsoOpcode::TexKill)
m_analysis->usesKill = true;

View File

@ -10,6 +10,8 @@ namespace dxvk {
bool usesDerivatives = false;
bool usesKill = false;
std::vector<DxsoInstructionContext> coissues;
};
class DxsoAnalyzer {

View File

@ -74,9 +74,19 @@ namespace dxvk {
void DxsoCompiler::processInstruction(
const DxsoInstructionContext& ctx) {
const DxsoInstructionContext& ctx,
uint32_t currentCoissueIdx) {
const DxsoOpcode opcode = ctx.instruction.opcode;
for (const auto& coissue : m_analysis->coissues) {
if (coissue.instructionIdx == ctx.instructionIdx &&
coissue.instructionIdx != currentCoissueIdx)
return;
if (coissue.instructionIdx == ctx.instructionIdx + 1)
processInstruction(coissue, coissue.instructionIdx);
}
switch (opcode) {
case DxsoOpcode::Nop:
return;

View File

@ -231,7 +231,8 @@ namespace dxvk {
* \param [in] ins The instruction
*/
void processInstruction(
const DxsoInstructionContext& ctx);
const DxsoInstructionContext& ctx,
uint32_t currentCoissueIdx = 0);
/**
* \brief Finalizes the shader