gl: Minor wcb tweaks
This commit is contained in:
@@ -354,7 +354,8 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk
|
|||||||
{
|
{
|
||||||
if (!m_surface_info[i].address || !m_surface_info[i].pitch) continue;
|
if (!m_surface_info[i].address || !m_surface_info[i].pitch) continue;
|
||||||
|
|
||||||
const u32 range = m_surface_info[i].pitch * m_surface_info[i].height;
|
const u32 aa_factor = (aa_mode == rsx::surface_antialiasing::center_1_sample || aa_mode == rsx::surface_antialiasing::diagonal_centered_2_samples) ? 1 : 2;
|
||||||
|
const u32 range = m_surface_info[i].pitch * m_surface_info[i].height * aa_factor;
|
||||||
m_gl_texture_cache.lock_memory_region(std::get<1>(m_rtts.m_bound_render_targets[i]), m_surface_info[i].address, range, m_surface_info[i].width, m_surface_info[i].height, m_surface_info[i].pitch,
|
m_gl_texture_cache.lock_memory_region(std::get<1>(m_rtts.m_bound_render_targets[i]), m_surface_info[i].address, range, m_surface_info[i].width, m_surface_info[i].height, m_surface_info[i].pitch,
|
||||||
color_format.format, color_format.type, color_format.swap_bytes);
|
color_format.format, color_format.type, color_format.swap_bytes);
|
||||||
}
|
}
|
||||||
@@ -369,7 +370,8 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk
|
|||||||
u32 pitch = m_depth_surface_info.width * 2;
|
u32 pitch = m_depth_surface_info.width * 2;
|
||||||
if (m_depth_surface_info.depth_format != rsx::surface_depth_format::z16) pitch *= 2;
|
if (m_depth_surface_info.depth_format != rsx::surface_depth_format::z16) pitch *= 2;
|
||||||
|
|
||||||
const u32 range = pitch * m_depth_surface_info.height;
|
const u32 aa_factor = (aa_mode == rsx::surface_antialiasing::center_1_sample || aa_mode == rsx::surface_antialiasing::diagonal_centered_2_samples) ? 1 : 2;
|
||||||
|
const u32 range = pitch * m_depth_surface_info.height * aa_factor;
|
||||||
m_gl_texture_cache.lock_memory_region(std::get<1>(m_rtts.m_bound_depth_stencil), m_depth_surface_info.address, range, m_depth_surface_info.width, m_depth_surface_info.height, pitch,
|
m_gl_texture_cache.lock_memory_region(std::get<1>(m_rtts.m_bound_depth_stencil), m_depth_surface_info.address, range, m_depth_surface_info.width, m_depth_surface_info.height, pitch,
|
||||||
depth_format_gl.format, depth_format_gl.type, true);
|
depth_format_gl.format, depth_format_gl.type, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ namespace gl
|
|||||||
texture::format format = texture::format::rgba;
|
texture::format format = texture::format::rgba;
|
||||||
texture::type type = texture::type::ubyte;
|
texture::type type = texture::type::ubyte;
|
||||||
bool pack_unpack_swap_bytes = false;
|
bool pack_unpack_swap_bytes = false;
|
||||||
|
rsx::surface_antialiasing aa_mode = rsx::surface_antialiasing::center_1_sample;
|
||||||
|
|
||||||
u8 get_pixel_size(texture::format fmt_, texture::type type_)
|
u8 get_pixel_size(texture::format fmt_, texture::type type_)
|
||||||
{
|
{
|
||||||
@@ -212,8 +213,17 @@ namespace gl
|
|||||||
gl::texture* image, const u32 rsx_pitch, bool read_only,
|
gl::texture* image, const u32 rsx_pitch, bool read_only,
|
||||||
gl::texture::format gl_format, gl::texture::type gl_type, bool swap_bytes)
|
gl::texture::format gl_format, gl::texture::type gl_type, bool swap_bytes)
|
||||||
{
|
{
|
||||||
if (!read_only && pbo_id == 0)
|
if (read_only)
|
||||||
init_buffer();
|
{
|
||||||
|
aa_mode = rsx::surface_antialiasing::center_1_sample;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pbo_id == 0)
|
||||||
|
init_buffer();
|
||||||
|
|
||||||
|
aa_mode = static_cast<gl::render_target*>(image)->aa_mode;
|
||||||
|
}
|
||||||
|
|
||||||
flushed = false;
|
flushed = false;
|
||||||
copied = false;
|
copied = false;
|
||||||
@@ -280,9 +290,21 @@ namespace gl
|
|||||||
u32 target_texture = vram_texture;
|
u32 target_texture = vram_texture;
|
||||||
if (real_pitch != rsx_pitch || rsx::get_resolution_scale_percent() != 100)
|
if (real_pitch != rsx_pitch || rsx::get_resolution_scale_percent() != 100)
|
||||||
{
|
{
|
||||||
//Disabled - doesnt work properly yet
|
u32 real_width = width;
|
||||||
const u32 real_width = (rsx_pitch * width) / real_pitch;
|
u32 real_height = height;
|
||||||
const u32 real_height = cpu_address_range / rsx_pitch;
|
|
||||||
|
switch (aa_mode)
|
||||||
|
{
|
||||||
|
case rsx::surface_antialiasing::center_1_sample:
|
||||||
|
break;
|
||||||
|
case rsx::surface_antialiasing::diagonal_centered_2_samples:
|
||||||
|
real_width *= 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
real_width *= 2;
|
||||||
|
real_height *= 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
areai src_area = { 0, 0, 0, 0 };
|
areai src_area = { 0, 0, 0, 0 };
|
||||||
const areai dst_area = { 0, 0, (s32)real_width, (s32)real_height };
|
const areai dst_area = { 0, 0, (s32)real_width, (s32)real_height };
|
||||||
@@ -329,6 +351,7 @@ namespace gl
|
|||||||
|
|
||||||
glPixelStorei(GL_PACK_SWAP_BYTES, pack_unpack_swap_bytes);
|
glPixelStorei(GL_PACK_SWAP_BYTES, pack_unpack_swap_bytes);
|
||||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
|
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id);
|
glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id);
|
||||||
|
|
||||||
glGetError();
|
glGetError();
|
||||||
|
|||||||
Reference in New Issue
Block a user