mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
VideoBackendBase: Convert EFBAccessType into an enum class
This commit is contained in:
@ -860,9 +860,19 @@ void DrawEFBPokeQuads(EFBAccessType type, const EfbPokeData* points, size_t num_
|
||||
float y1 = -float(point->y) * 2.0f / EFB_HEIGHT + 1.0f;
|
||||
float x2 = float(point->x + 1) * 2.0f / EFB_WIDTH - 1.0f;
|
||||
float y2 = -float(point->y + 1) * 2.0f / EFB_HEIGHT + 1.0f;
|
||||
float z = (type == POKE_Z) ? (1.0f - float(point->data & 0xFFFFFF) / 16777216.0f) : 0.0f;
|
||||
u32 col = (type == POKE_Z) ? 0 : ((point->data & 0xFF00FF00) | ((point->data >> 16) & 0xFF) |
|
||||
((point->data << 16) & 0xFF0000));
|
||||
float z = 0.0f;
|
||||
u32 col = 0;
|
||||
|
||||
if (type == EFBAccessType::PokeZ)
|
||||
{
|
||||
z = 1.0f - static_cast<float>(point->data & 0xFFFFFF) / 16777216.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
col = ((point->data & 0xFF00FF00) | ((point->data >> 16) & 0xFF) |
|
||||
((point->data << 16) & 0xFF0000));
|
||||
}
|
||||
|
||||
current_point_index++;
|
||||
|
||||
// quad -> triangles
|
||||
@ -874,9 +884,9 @@ void DrawEFBPokeQuads(EFBAccessType type, const EfbPokeData* points, size_t num_
|
||||
InitColVertex(&vertex[4], x2, y1, z, col);
|
||||
InitColVertex(&vertex[5], x2, y2, z, col);
|
||||
|
||||
if (type == POKE_COLOR)
|
||||
if (type == EFBAccessType::PokeColor)
|
||||
FramebufferManager::UpdateEFBColorAccessCopy(point->x, point->y, col);
|
||||
else if (type == POKE_Z)
|
||||
else if (type == EFBAccessType::PokeZ)
|
||||
FramebufferManager::UpdateEFBDepthAccessCopy(point->x, point->y, z);
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ void Renderer::SetColorMask()
|
||||
// - GX_PokeZMode (TODO)
|
||||
u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||
{
|
||||
if (type == PEEK_COLOR)
|
||||
if (type == EFBAccessType::PeekColor)
|
||||
{
|
||||
u32 color = FramebufferManager::ReadEFBColorAccessCopy(x, y);
|
||||
|
||||
@ -399,7 +399,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||
return (color & 0x00FFFFFF); // GX_READ_00
|
||||
}
|
||||
}
|
||||
else // if (type == PEEK_Z)
|
||||
else // if (type == EFBAccessType::PeekZ)
|
||||
{
|
||||
// depth buffer is inverted in the d3d backend
|
||||
float depth = 1.0f - FramebufferManager::ReadEFBDepthAccessCopy(x, y);
|
||||
@ -423,14 +423,14 @@ void Renderer::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num
|
||||
{
|
||||
D3D::SetViewportAndScissor(0, 0, GetTargetWidth(), GetTargetHeight());
|
||||
|
||||
if (type == POKE_COLOR)
|
||||
if (type == EFBAccessType::PokeColor)
|
||||
{
|
||||
// In the D3D12 backend, the rt/db/viewport is passed into DrawEFBPokeQuads, and set there.
|
||||
D3D::DrawEFBPokeQuads(type, points, num_points, &g_reset_blend_desc, &g_reset_depth_desc,
|
||||
&FramebufferManager::GetEFBColorTexture()->GetRTV12(), nullptr,
|
||||
FramebufferManager::GetEFBColorTexture()->GetMultisampled());
|
||||
}
|
||||
else // if (type == POKE_Z)
|
||||
else // if (type == EFBAccessType::PokeZ)
|
||||
{
|
||||
D3D::DrawEFBPokeQuads(type, points, num_points,
|
||||
&s_clear_blend_descs[CLEAR_BLEND_DESC_ALL_CHANNELS_DISABLED],
|
||||
|
Reference in New Issue
Block a user