1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/src/dxso/dxso_analysis.cpp
Joshie 54ed8f0bb0 [d3d9] Implement Direct3D9 Frontend (#1275)
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Co-authored-by: Robin Kertels <robin.kertels@gmail.com>
Co-authored-by: pchome <pchome@users.noreply.github.com>
Co-authored-by: Christopher Egert <cme3000@gmail.com>
Co-authored-by: Derek Lesho <dereklesho52@Gmail.com>
Co-authored-by: Luis Cáceres <lacaceres97@gmail.com>
Co-authored-by: Nelson Chen <crazysim@gmail.com>
Co-authored-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Co-authored-by: Riesi <riesi@opentrash.com>
Co-authored-by: gbMichelle <gbmichelle.dev@gmail.com>
2019-12-16 04:28:01 +01:00

47 lines
1.4 KiB
C++

#include "dxso_analysis.h"
namespace dxvk {
DxsoAnalyzer::DxsoAnalyzer(
DxsoAnalysisInfo& analysis)
: m_analysis(&analysis) { }
void DxsoAnalyzer::processInstruction(
const DxsoInstructionContext& ctx) {
DxsoOpcode opcode = ctx.instruction.opcode;
if (opcode == DxsoOpcode::TexKill)
m_analysis->usesKill = true;
if (opcode == DxsoOpcode::DsX
|| opcode == DxsoOpcode::DsY
|| opcode == DxsoOpcode::Tex
|| opcode == DxsoOpcode::TexCoord
|| opcode == DxsoOpcode::TexBem
|| opcode == DxsoOpcode::TexBemL
|| opcode == DxsoOpcode::TexReg2Ar
|| opcode == DxsoOpcode::TexReg2Gb
|| opcode == DxsoOpcode::TexM3x2Pad
|| opcode == DxsoOpcode::TexM3x2Tex
|| opcode == DxsoOpcode::TexM3x3Pad
|| opcode == DxsoOpcode::TexM3x3Tex
|| opcode == DxsoOpcode::TexM3x3Spec
|| opcode == DxsoOpcode::TexM3x3VSpec
|| opcode == DxsoOpcode::TexReg2Rgb
|| opcode == DxsoOpcode::TexDp3Tex
|| opcode == DxsoOpcode::TexM3x2Depth
|| opcode == DxsoOpcode::TexDp3
|| opcode == DxsoOpcode::TexM3x3
// Explicit LOD.
//|| opcode == DxsoOpcode::TexLdd
//|| opcode == DxsoOpcode::TexLdl
|| opcode == DxsoOpcode::TexDepth)
m_analysis->usesDerivatives = true;
}
void DxsoAnalyzer::finalize(size_t tokenCount) {
m_analysis->bytecodeByteLength = tokenCount * sizeof(uint32_t);
}
}