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
e3f1233c
There was an error fetching the commit references. Please try again later.
Commit
e3f1233c
authored
6 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
shader_decode: Implement LD_A
parent
ea358bd4
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
+39
-1
39 additions, 1 deletion
src/video_core/shader/decode/memory.cpp
with
39 additions
and
1 deletion
src/video_core/shader/decode/memory.cpp
+
39
−
1
View file @
e3f1233c
...
...
@@ -9,14 +9,52 @@
namespace
VideoCommon
::
Shader
{
using
Tegra
::
Shader
::
Attribute
;
using
Tegra
::
Shader
::
Instruction
;
using
Tegra
::
Shader
::
OpCode
;
using
Tegra
::
Shader
::
Register
;
u32
ShaderIR
::
DecodeMemory
(
BasicBlock
&
bb
,
u32
pc
)
{
const
Instruction
instr
=
{
program_code
[
pc
]};
const
auto
opcode
=
OpCode
::
Decode
(
instr
);
UNIMPLEMENTED
();
switch
(
opcode
->
get
().
GetId
())
{
case
OpCode
::
Id
::
LD_A
:
{
// Note: Shouldn't this be interp mode flat? As in no interpolation made.
UNIMPLEMENTED_IF_MSG
(
instr
.
gpr8
.
Value
()
!=
Register
::
ZeroIndex
,
"Indirect attribute loads are not supported"
);
UNIMPLEMENTED_IF_MSG
((
instr
.
attribute
.
fmt20
.
immediate
.
Value
()
%
sizeof
(
u32
))
!=
0
,
"Unaligned attribute loads are not supported"
);
Tegra
::
Shader
::
IpaMode
input_mode
{
Tegra
::
Shader
::
IpaInterpMode
::
Perspective
,
Tegra
::
Shader
::
IpaSampleMode
::
Default
};
u64
next_element
=
instr
.
attribute
.
fmt20
.
element
;
auto
next_index
=
static_cast
<
u64
>
(
instr
.
attribute
.
fmt20
.
index
.
Value
());
const
auto
LoadNextElement
=
[
&
](
u32
reg_offset
)
{
const
Node
buffer
=
GetRegister
(
instr
.
gpr39
);
const
Node
attribute
=
GetInputAttribute
(
static_cast
<
Attribute
::
Index
>
(
next_index
),
next_element
,
input_mode
,
buffer
);
SetRegister
(
bb
,
instr
.
gpr0
.
Value
()
+
reg_offset
,
attribute
);
// Load the next attribute element into the following register. If the element
// to load goes beyond the vec4 size, load the first element of the next
// attribute.
next_element
=
(
next_element
+
1
)
%
4
;
next_index
=
next_index
+
(
next_element
==
0
?
1
:
0
);
};
const
u32
num_words
=
static_cast
<
u32
>
(
instr
.
attribute
.
fmt20
.
size
.
Value
())
+
1
;
for
(
u32
reg_offset
=
0
;
reg_offset
<
num_words
;
++
reg_offset
)
{
LoadNextElement
(
reg_offset
);
}
break
;
}
default
:
UNIMPLEMENTED_MSG
(
"Unhandled memory instruction: {}"
,
opcode
->
get
().
GetName
());
}
return
pc
;
}
...
...
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