Commit 3ff9c4cc authored by Joshua Ashton's avatar Joshua Ashton 🐸

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

parent 4d6fbacd
Pipeline #974 passed with stage
in 4 minutes and 10 seconds
......@@ -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;
......
......@@ -10,6 +10,8 @@ namespace dxvk {
bool usesDerivatives = false;
bool usesKill = false;
std::vector<DxsoInstructionContext> coissues;
};
class DxsoAnalyzer {
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment