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
77bb58af
There was an error fetching the commit references. Please try again later.
Commit
77bb58af
authored
10 years ago
by
Tony Wasserka
Browse files
Options
Downloads
Patches
Plain Diff
Pica/Rasterizer: Further enhance Tev support.
parent
36291bc3
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/rasterizer.cpp
+19
-4
19 additions, 4 deletions
src/video_core/rasterizer.cpp
with
19 additions
and
4 deletions
src/video_core/rasterizer.cpp
+
19
−
4
View file @
77bb58af
...
...
@@ -279,12 +279,15 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
}
};
auto
GetColorModifier
=
[](
ColorModifier
factor
,
const
Math
::
Vec4
<
u8
>&
values
)
->
Math
::
Vec3
<
u8
>
{
static
auto
GetColorModifier
=
[](
ColorModifier
factor
,
const
Math
::
Vec4
<
u8
>&
values
)
->
Math
::
Vec3
<
u8
>
{
switch
(
factor
)
{
case
ColorModifier
::
SourceColor
:
return
values
.
rgb
();
case
ColorModifier
::
OneMinusSourceColor
:
return
(
Math
::
Vec3
<
u8
>
(
255
,
255
,
255
)
-
values
.
rgb
()).
Cast
<
u8
>
();
case
ColorModifier
::
SourceAlpha
:
return
{
values
.
a
(),
values
.
a
(),
values
.
a
()
};
...
...
@@ -295,7 +298,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
}
};
auto
GetAlphaModifier
=
[](
AlphaModifier
factor
,
u8
value
)
->
u8
{
static
auto
GetAlphaModifier
=
[](
AlphaModifier
factor
,
u8
value
)
->
u8
{
switch
(
factor
)
{
case
AlphaModifier
::
SourceAlpha
:
return
value
;
...
...
@@ -310,7 +313,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
}
};
auto
ColorCombine
=
[](
Operation
op
,
const
Math
::
Vec3
<
u8
>
input
[
3
])
->
Math
::
Vec3
<
u8
>
{
static
auto
ColorCombine
=
[](
Operation
op
,
const
Math
::
Vec3
<
u8
>
input
[
3
])
->
Math
::
Vec3
<
u8
>
{
switch
(
op
)
{
case
Operation
::
Replace
:
return
input
[
0
];
...
...
@@ -330,6 +333,15 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
case
Operation
::
Lerp
:
return
((
input
[
0
]
*
input
[
2
]
+
input
[
1
]
*
(
Math
::
MakeVec
<
u8
>
(
255
,
255
,
255
)
-
input
[
2
]).
Cast
<
u8
>
())
/
255
).
Cast
<
u8
>
();
case
Operation
::
Subtract
:
{
auto
result
=
input
[
0
].
Cast
<
int
>
()
-
input
[
1
].
Cast
<
int
>
();
result
.
r
()
=
std
::
max
(
0
,
result
.
r
());
result
.
g
()
=
std
::
max
(
0
,
result
.
g
());
result
.
b
()
=
std
::
max
(
0
,
result
.
b
());
return
result
.
Cast
<
u8
>
();
}
default
:
LOG_ERROR
(
HW_GPU
,
"Unknown color combiner operation %d
\n
"
,
(
int
)
op
);
_dbg_assert_
(
HW_GPU
,
0
);
...
...
@@ -337,7 +349,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
}
};
auto
AlphaCombine
=
[](
Operation
op
,
const
std
::
array
<
u8
,
3
>&
input
)
->
u8
{
static
auto
AlphaCombine
=
[](
Operation
op
,
const
std
::
array
<
u8
,
3
>&
input
)
->
u8
{
switch
(
op
)
{
case
Operation
::
Replace
:
return
input
[
0
];
...
...
@@ -351,6 +363,9 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
case
Operation
::
Lerp
:
return
(
input
[
0
]
*
input
[
2
]
+
input
[
1
]
*
(
255
-
input
[
2
]))
/
255
;
case
Operation
::
Subtract
:
return
std
::
max
(
0
,
(
int
)
input
[
0
]
-
(
int
)
input
[
1
]);
default:
LOG_ERROR
(
HW_GPU
,
"Unknown alpha combiner operation %d
\n
"
,
(
int
)
op
);
_dbg_assert_
(
HW_GPU
,
0
);
...
...
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