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
0465adf2
There was an error fetching the commit references. Please try again later.
Commit
0465adf2
authored
10 years ago
by
Tony Wasserka
Browse files
Options
Downloads
Patches
Plain Diff
Pica/CommandProcessor: Implement parameter masking.
parent
f37e39de
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/command_processor.cpp
+13
-5
13 additions, 5 deletions
src/video_core/command_processor.cpp
src/video_core/command_processor.h
+12
-1
12 additions, 1 deletion
src/video_core/command_processor.h
with
25 additions
and
6 deletions
src/video_core/command_processor.cpp
+
13
−
5
View file @
0465adf2
...
...
@@ -24,9 +24,14 @@ static u32 uniform_write_buffer[4];
static
u32
vs_binary_write_offset
=
0
;
static
u32
vs_swizzle_write_offset
=
0
;
static
inline
void
WritePicaReg
(
u32
id
,
u32
value
)
{
static
inline
void
WritePicaReg
(
u32
id
,
u32
value
,
u32
mask
)
{
if
(
id
>=
registers
.
NumIds
())
return
;
// TODO: Figure out how register masking acts on e.g. vs_uniform_setup.set_value
u32
old_value
=
registers
[
id
];
registers
[
id
]
=
value
;
registers
[
id
]
=
(
old_value
&
~
mask
)
|
(
value
&
mask
)
;
switch
(
id
)
{
// It seems like these trigger vertex rendering
...
...
@@ -215,14 +220,17 @@ static std::ptrdiff_t ExecuteCommandBlock(const u32* first_command_word) {
u32
*
read_pointer
=
(
u32
*
)
first_command_word
;
// TODO: Take parameter mask into consideration!
const
u32
write_mask
=
((
header
.
parameter_mask
&
0x1
)
?
(
0xFFu
<<
0
)
:
0u
)
|
((
header
.
parameter_mask
&
0x2
)
?
(
0xFFu
<<
8
)
:
0u
)
|
((
header
.
parameter_mask
&
0x4
)
?
(
0xFFu
<<
16
)
:
0u
)
|
((
header
.
parameter_mask
&
0x8
)
?
(
0xFFu
<<
24
)
:
0u
);
WritePicaReg
(
header
.
cmd_id
,
*
read_pointer
);
WritePicaReg
(
header
.
cmd_id
,
*
read_pointer
,
write_mask
);
read_pointer
+=
2
;
for
(
int
i
=
1
;
i
<
1
+
header
.
extra_data_length
;
++
i
)
{
u32
cmd
=
header
.
cmd_id
+
((
header
.
group_commands
)
?
i
:
0
);
WritePicaReg
(
cmd
,
*
read_pointer
);
WritePicaReg
(
cmd
,
*
read_pointer
,
write_mask
);
++
read_pointer
;
}
...
...
This diff is collapsed.
Click to expand it.
src/video_core/command_processor.h
+
12
−
1
View file @
0465adf2
...
...
@@ -17,11 +17,22 @@ union CommandHeader {
u32
hex
;
BitField
<
0
,
16
,
u32
>
cmd_id
;
// parameter_mask:
// Mask applied to the input value to make it possible to update
// parts of a register without overwriting its other fields.
// first bit: 0x000000FF
// second bit: 0x0000FF00
// third bit: 0x00FF0000
// fourth bit: 0xFF000000
BitField
<
16
,
4
,
u32
>
parameter_mask
;
BitField
<
20
,
11
,
u32
>
extra_data_length
;
BitField
<
31
,
1
,
u32
>
group_commands
;
};
static_assert
(
std
::
is_standard_layout
<
CommandHeader
>::
value
==
true
,
"CommandHeader does not use standard layout"
);
static_assert
(
std
::
is_standard_layout
<
CommandHeader
>::
value
==
true
,
"CommandHeader does not use standard layout"
);
static_assert
(
sizeof
(
CommandHeader
)
==
sizeof
(
u32
),
"CommandHeader has incorrect size!"
);
void
ProcessCommandList
(
const
u32
*
list
,
u32
size
);
...
...
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