Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
802c23b8
There was an error fetching the commit references. Please try again later.
Commit
802c23b8
authored
6 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
shader_decode: Implement TMML
parent
2b90637f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/video_core/shader/decode/memory.cpp
+45
-3
45 additions, 3 deletions
src/video_core/shader/decode/memory.cpp
with
45 additions
and
3 deletions
src/video_core/shader/decode/memory.cpp
+
45
−
3
View file @
802c23b8
...
@@ -112,7 +112,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
...
@@ -112,7 +112,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
"AOFFI is not implemented"
);
"AOFFI is not implemented"
);
if
(
instr
.
tex
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
if
(
instr
.
tex
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
LOG_WARNING
(
HW_GPU
,
"TEX.NODEP i
s not i
mple
men
te
d
"
);
LOG_WARNING
(
HW_GPU
,
"TEX.NODEP i
mplementation is inco
mplete"
);
}
}
const
Node
texture
=
GetTexCode
(
instr
,
texture_type
,
process_mode
,
depth_compare
,
is_array
);
const
Node
texture
=
GetTexCode
(
instr
,
texture_type
,
process_mode
,
depth_compare
,
is_array
);
...
@@ -240,7 +240,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
...
@@ -240,7 +240,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
"AOFFI is not implemented"
);
"AOFFI is not implemented"
);
if
(
instr
.
tld4s
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
if
(
instr
.
tld4s
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
LOG_WARNING
(
HW_GPU
,
"TLD4S.NODEP i
s not i
mple
men
te
d
"
);
LOG_WARNING
(
HW_GPU
,
"TLD4S.NODEP i
mplementation is inco
mplete"
);
}
}
const
bool
depth_compare
=
instr
.
tld4s
.
UsesMiscMode
(
TextureMiscMode
::
DC
);
const
bool
depth_compare
=
instr
.
tld4s
.
UsesMiscMode
(
TextureMiscMode
::
DC
);
...
@@ -273,7 +273,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
...
@@ -273,7 +273,7 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
}
}
case
OpCode
::
Id
::
TXQ
:
{
case
OpCode
::
Id
::
TXQ
:
{
if
(
instr
.
txq
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
if
(
instr
.
txq
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
LOG_WARNING
(
HW_GPU
,
"TXQ.NODEP i
s not i
mple
men
te
d
"
);
LOG_WARNING
(
HW_GPU
,
"TXQ.NODEP i
mplementation is inco
mplete"
);
}
}
// TODO: The new commits on the texture refactor, change the way samplers work.
// TODO: The new commits on the texture refactor, change the way samplers work.
...
@@ -304,6 +304,48 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
...
@@ -304,6 +304,48 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) {
}
}
break
;
break
;
}
}
case
OpCode
::
Id
::
TMML
:
{
UNIMPLEMENTED_IF_MSG
(
instr
.
tmml
.
UsesMiscMode
(
Tegra
::
Shader
::
TextureMiscMode
::
NDV
),
"NDV is not implemented"
);
if
(
instr
.
tmml
.
UsesMiscMode
(
TextureMiscMode
::
NODEP
))
{
LOG_WARNING
(
HW_GPU
,
"TMML.NODEP implementation is incomplete"
);
}
auto
texture_type
=
instr
.
tmml
.
texture_type
.
Value
();
const
bool
is_array
=
instr
.
tmml
.
array
!=
0
;
const
auto
&
sampler
=
GetSampler
(
instr
.
sampler
,
texture_type
,
is_array
,
false
);
std
::
vector
<
Node
>
coords
;
// TODO: Add coordinates for different samplers once other texture types are implemented.
switch
(
texture_type
)
{
case
TextureType
::
Texture1D
:
coords
.
push_back
(
GetRegister
(
instr
.
gpr8
));
break
;
case
TextureType
::
Texture2D
:
coords
.
push_back
(
GetRegister
(
instr
.
gpr8
.
Value
()
+
0
));
coords
.
push_back
(
GetRegister
(
instr
.
gpr8
.
Value
()
+
1
));
break
;
default:
UNIMPLEMENTED_MSG
(
"Unhandled texture type {}"
,
static_cast
<
u32
>
(
texture_type
));
// Fallback to interpreting as a 2D texture for now
coords
.
push_back
(
GetRegister
(
instr
.
gpr8
.
Value
()
+
0
));
coords
.
push_back
(
GetRegister
(
instr
.
gpr8
.
Value
()
+
1
));
texture_type
=
TextureType
::
Texture2D
;
}
const
MetaTexture
meta_texture
{
sampler
,
static_cast
<
u32
>
(
coords
.
size
())};
const
Node
texture
=
Operation
(
OperationCode
::
F4TextureQueryLod
,
meta_texture
,
std
::
move
(
coords
));
const
MetaComponents
meta_composite
{{
0
,
1
,
2
,
3
}};
bb
.
push_back
(
Operation
(
OperationCode
::
AssignComposite
,
meta_composite
,
texture
,
GetRegister
(
instr
.
gpr0
),
GetRegister
(
instr
.
gpr0
.
Value
()
+
1
),
GetRegister
(
RZ
),
GetRegister
(
RZ
)));
break
;
}
default
:
default
:
UNIMPLEMENTED_MSG
(
"Unhandled memory instruction: {}"
,
opcode
->
get
().
GetName
());
UNIMPLEMENTED_MSG
(
"Unhandled memory instruction: {}"
,
opcode
->
get
().
GetName
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment