mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-10-02 06:10:00 +00:00
gl/vk: Minor cleanup
This commit is contained in:
parent
ec9aa74008
commit
63f9b8e0c6
3 changed files with 3 additions and 27 deletions
|
@ -1639,9 +1639,7 @@ void GLGSRender::flip(int buffer, bool emu_flip)
|
||||||
aspect_ratio.size = new_size;
|
aspect_ratio.size = new_size;
|
||||||
|
|
||||||
// Find the source image
|
// Find the source image
|
||||||
rsx::tiled_region buffer_region = get_tiled_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL);
|
const u32 absolute_address = rsx::get_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL);
|
||||||
u32 absolute_address = buffer_region.address + buffer_region.base;
|
|
||||||
|
|
||||||
GLuint image = GL_NONE;
|
GLuint image = GL_NONE;
|
||||||
|
|
||||||
if (auto render_target_texture = m_rtts.get_texture_from_render_target_if_applicable(absolute_address))
|
if (auto render_target_texture = m_rtts.get_texture_from_render_target_if_applicable(absolute_address))
|
||||||
|
@ -1700,16 +1698,7 @@ void GLGSRender::flip(int buffer, bool emu_flip)
|
||||||
m_flip_tex_color.reset(new gl::texture(GL_TEXTURE_2D, buffer_width, buffer_height, 1, 1, GL_RGBA8));
|
m_flip_tex_color.reset(new gl::texture(GL_TEXTURE_2D, buffer_width, buffer_height, 1, 1, GL_RGBA8));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer_region.tile)
|
m_flip_tex_color->copy_from(vm::base(absolute_address), gl::texture::format::bgra, gl::texture::type::uint_8_8_8_8, unpack_settings);
|
||||||
{
|
|
||||||
std::unique_ptr<u8[]> temp(new u8[buffer_height * buffer_pitch]);
|
|
||||||
buffer_region.read(temp.get(), buffer_width, buffer_height, buffer_pitch);
|
|
||||||
m_flip_tex_color->copy_from(temp.get(), gl::texture::format::bgra, gl::texture::type::uint_8_8_8_8, unpack_settings);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_flip_tex_color->copy_from(buffer_region.ptr, gl::texture::format::bgra, gl::texture::type::uint_8_8_8_8, unpack_settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
image = m_flip_tex_color->id();
|
image = m_flip_tex_color->id();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1004,18 +1004,6 @@ namespace gl
|
||||||
{
|
{
|
||||||
if (result.real_dst_size)
|
if (result.real_dst_size)
|
||||||
{
|
{
|
||||||
gl::texture::format fmt;
|
|
||||||
if (!result.is_depth)
|
|
||||||
{
|
|
||||||
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
|
|
||||||
gl::texture::format::bgra : gl::texture::format::rgba;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fmt = dst.format == rsx::blit_engine::transfer_destination_format::a8r8g8b8 ?
|
|
||||||
gl::texture::format::depth_stencil : gl::texture::format::depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
flush_if_cache_miss_likely(cmd, result.to_address_range());
|
flush_if_cache_miss_likely(cmd, result.to_address_range());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3389,8 +3389,7 @@ void VKGSRender::flip(int buffer, bool emu_flip)
|
||||||
|
|
||||||
if ((u32)buffer < display_buffers_count && buffer_width && buffer_height)
|
if ((u32)buffer < display_buffers_count && buffer_width && buffer_height)
|
||||||
{
|
{
|
||||||
rsx::tiled_region buffer_region = get_tiled_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL);
|
const u32 absolute_address = rsx::get_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL);
|
||||||
u32 absolute_address = buffer_region.address + buffer_region.base;
|
|
||||||
|
|
||||||
if (auto render_target_texture = m_rtts.get_texture_from_render_target_if_applicable(absolute_address))
|
if (auto render_target_texture = m_rtts.get_texture_from_render_target_if_applicable(absolute_address))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue