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
864e8f55
There was an error fetching the commit references. Please try again later.
Commit
864e8f55
authored
6 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
shader_ir: Add constant buffer getters
parent
5e639bfc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/video_core/shader/shader_ir.cpp
+21
-0
21 additions, 0 deletions
src/video_core/shader/shader_ir.cpp
src/video_core/shader/shader_ir.h
+4
-0
4 additions, 0 deletions
src/video_core/shader/shader_ir.h
with
25 additions
and
0 deletions
src/video_core/shader/shader_ir.cpp
+
21
−
0
View file @
864e8f55
...
...
@@ -54,6 +54,27 @@ Node ShaderIR::GetImmediate32(Instruction instr) {
return
Immediate
(
instr
.
alu
.
GetImm20_32
());
}
Node
ShaderIR
::
GetConstBuffer
(
u64
index_
,
u64
offset_
)
{
const
auto
index
=
static_cast
<
u32
>
(
index_
);
const
auto
offset
=
static_cast
<
u32
>
(
offset_
);
const
auto
[
entry
,
is_new
]
=
used_cbufs
.
try_emplace
(
index
);
entry
->
second
.
MarkAsUsed
(
offset
);
return
StoreNode
(
CbufNode
(
index
,
Immediate
(
offset
)));
}
Node
ShaderIR
::
GetConstBufferIndirect
(
u64
index_
,
u64
offset_
,
Node
node
)
{
const
auto
index
=
static_cast
<
u32
>
(
index_
);
const
auto
offset
=
static_cast
<
u32
>
(
offset_
);
const
auto
[
entry
,
is_new
]
=
used_cbufs
.
try_emplace
(
index
);
entry
->
second
.
MarkAsUsedIndirect
();
const
Node
final_offset
=
Operation
(
OperationCode
::
UAdd
,
NO_PRECISE
,
node
,
Immediate
(
offset
));
return
StoreNode
(
CbufNode
(
index
,
final_offset
));
}
Node
ShaderIR
::
GetPredicate
(
u64
pred_
,
bool
negated
)
{
const
auto
pred
=
static_cast
<
Pred
>
(
pred_
);
if
(
pred
!=
Pred
::
UnusedIndex
&&
pred
!=
Pred
::
NeverExecute
)
{
...
...
This diff is collapsed.
Click to expand it.
src/video_core/shader/shader_ir.h
+
4
−
0
View file @
864e8f55
...
...
@@ -616,6 +616,10 @@ private:
Node
GetImmediate19
(
Tegra
::
Shader
::
Instruction
instr
);
/// Generates a node representing a 32-bit immediate value
Node
GetImmediate32
(
Tegra
::
Shader
::
Instruction
instr
);
/// Generates a node representing a constant buffer
Node
GetConstBuffer
(
u64
index
,
u64
offset
);
/// Generates a node representing a constant buffer with a variadic offset
Node
GetConstBufferIndirect
(
u64
index
,
u64
offset
,
Node
node
);
/// Generates a node for a passed predicate. It can be optionally negated
Node
GetPredicate
(
u64
pred
,
bool
negated
=
false
);
/// Generates a predicate node for an immediate true or false value
...
...
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