forked from doitsujin/dxvk
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdxso_analysis.cpp
57 lines (47 loc) · 1.67 KB
/
dxso_analysis.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "dxso_analysis.h"
namespace dxvk {
DxsoAnalyzer::DxsoAnalyzer(
DxsoAnalysisInfo& analysis)
: m_analysis(&analysis) { }
void DxsoAnalyzer::processInstruction(
const DxsoInstructionContext& ctx) {
DxsoOpcode opcode = ctx.instruction.opcode;
// Co-issued CNDs are issued before their parents,
// except when the parent is a CND.
if (opcode == DxsoOpcode::Cnd &&
m_parentOpcode != DxsoOpcode::Cnd &&
ctx.instruction.coissue) {
m_analysis->coissues.push_back(ctx);
}
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;
m_parentOpcode = ctx.instruction.opcode;
}
void DxsoAnalyzer::finalize(size_t tokenCount) {
m_analysis->bytecodeByteLength = tokenCount * sizeof(uint32_t);
}
}