summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2021-03-07 00:21:11 -0500
committerGitHub <noreply@github.com>2021-03-07 00:21:11 -0500
commit089250fde65c2e225681c0ef6917d28fa187e8de (patch)
treebcbb6db025c6003bd681e0028f0bc3b7b223bd07 /Source/Core/VideoCommon/VertexShaderManager.cpp
parent5f7d935b0a40f5cece7341927bd92b6a8d5debbe (diff)
parentdf81210e96c6603d3aeb6c76f51b030d06cd06ac (diff)
Merge pull request #9497 from Pokechu22/better-fifo-analyzer
Graphics refactoring + add names and descriptions in FIFO analyzer
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 9c82d9b431..8047714f61 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -353,7 +353,7 @@ void VertexShaderManager::SetConstants()
switch (xfmem.projection.type)
{
- case GX_PERSPECTIVE:
+ case ProjectionType::Perspective:
{
const Common::Vec2 fov =
g_freelook_camera.IsActive() ? g_freelook_camera.GetFieldOfView() : Common::Vec2{1, 1};
@@ -382,7 +382,7 @@ void VertexShaderManager::SetConstants()
}
break;
- case GX_ORTHOGRAPHIC:
+ case ProjectionType::Orthographic:
{
g_fProjectionMatrix[0] = rawProjection[0];
g_fProjectionMatrix[1] = 0.0f;
@@ -419,7 +419,7 @@ void VertexShaderManager::SetConstants()
auto corrected_matrix = s_viewportCorrection * Common::Matrix44::FromArray(g_fProjectionMatrix);
- if (g_freelook_camera.IsActive() && xfmem.projection.type == GX_PERSPECTIVE)
+ if (g_freelook_camera.IsActive() && xfmem.projection.type == ProjectionType::Perspective)
corrected_matrix *= g_freelook_camera.GetView();
memcpy(constants.projection.data(), corrected_matrix.data.data(), 4 * sizeof(float4));
@@ -618,9 +618,9 @@ void VertexShaderManager::SetVertexFormat(u32 components)
// The default alpha channel seems to depend on the number of components in the vertex format.
// If the vertex attribute has an alpha channel, zero is used, otherwise one.
- const u32 color_chan_alpha =
- (g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0.Color0Elements ^ 1) |
- ((g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0.Color1Elements ^ 1) << 1);
+ const auto g0 = g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0;
+ const u32 color_chan_alpha = (g0.Color0Elements == ColorComponentCount::RGB ? 1 : 0) |
+ (g0.Color1Elements == ColorComponentCount::RGB ? 2 : 0);
if (color_chan_alpha != constants.color_chan_alpha)
{
constants.color_chan_alpha = color_chan_alpha;