mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-12 13:13:43 +00:00
rsx: Fix AA coordinate transforms
- Requires native_pitch value to take samples into account
This commit is contained in:
parent
655eff29e8
commit
f6f3b40ecc
@ -701,7 +701,7 @@ namespace rsx
|
||||
info.base_address = this_address;
|
||||
info.is_depth = is_depth;
|
||||
|
||||
const auto normalized_surface_width = surface->get_native_pitch() / required_bpp;
|
||||
const auto normalized_surface_width = surface->get_surface_width(rsx::surface_metrics::bytes) / required_bpp;
|
||||
const auto normalized_surface_height = surface->get_surface_height(rsx::surface_metrics::samples);
|
||||
|
||||
if (LIKELY(this_address >= texaddr))
|
||||
|
@ -153,7 +153,7 @@ namespace rsx
|
||||
case rsx::surface_metrics::pixels:
|
||||
return surface_width;
|
||||
case rsx::surface_metrics::bytes:
|
||||
return rsx_pitch;
|
||||
return native_pitch;
|
||||
default:
|
||||
fmt::throw_exception("Unknown surface metric %d", u32(metrics));
|
||||
}
|
||||
@ -185,7 +185,7 @@ namespace rsx
|
||||
|
||||
u8 get_bpp() const
|
||||
{
|
||||
return u8(get_native_pitch() / get_surface_width());
|
||||
return u8(get_native_pitch() / get_surface_width(rsx::surface_metrics::samples));
|
||||
}
|
||||
|
||||
u8 get_spp() const
|
||||
|
@ -148,7 +148,7 @@ struct gl_render_target_traits
|
||||
|
||||
std::unique_ptr<gl::render_target> result(new gl::render_target(rsx::apply_resolution_scale((u16)width, true),
|
||||
rsx::apply_resolution_scale((u16)height, true), (GLenum)internal_fmt));
|
||||
result->set_native_pitch((u16)width * format.channel_count * format.channel_size);
|
||||
result->set_native_pitch((u16)width * format.channel_count * format.channel_size * get_format_sample_count(antialias));
|
||||
result->set_surface_dimensions((u16)width, (u16)height, (u16)pitch);
|
||||
result->set_format(surface_color_format);
|
||||
result->set_aa_mode(antialias);
|
||||
@ -175,7 +175,7 @@ struct gl_render_target_traits
|
||||
std::unique_ptr<gl::render_target> result(new gl::render_target(rsx::apply_resolution_scale((u16)width, true),
|
||||
rsx::apply_resolution_scale((u16)height, true), (GLenum)format.internal_format));
|
||||
|
||||
u16 native_pitch = (u16)width * 2;
|
||||
u16 native_pitch = (u16)width * 2 * get_format_sample_count(antialias);
|
||||
if (surface_depth_format == rsx::surface_depth_format::z24s8)
|
||||
native_pitch *= 2;
|
||||
|
||||
@ -213,7 +213,7 @@ struct gl_render_target_traits
|
||||
sink->format_info = ref->format_info;
|
||||
|
||||
sink->set_spp(ref->get_spp());
|
||||
sink->set_native_pitch(prev.width * ref->get_bpp());
|
||||
sink->set_native_pitch(prev.width * ref->get_bpp() * ref->get_spp());
|
||||
sink->set_surface_dimensions(prev.width, prev.height, ref->get_rsx_pitch());
|
||||
sink->set_native_component_layout(ref->get_native_component_layout());
|
||||
sink->queue_tag(address);
|
||||
|
@ -187,7 +187,7 @@ namespace rsx
|
||||
rtt->state_flags = rsx::surface_state_flags::erase_bkgnd;
|
||||
rtt->native_component_map = fmt.second;
|
||||
rtt->rsx_pitch = (u16)pitch;
|
||||
rtt->native_pitch = (u16)width * get_format_block_size_in_bytes(format);
|
||||
rtt->native_pitch = (u16)width * get_format_block_size_in_bytes(format) * get_format_sample_count(antialias);
|
||||
rtt->surface_width = (u16)width;
|
||||
rtt->surface_height = (u16)height;
|
||||
rtt->queue_tag(address);
|
||||
@ -232,7 +232,7 @@ namespace rsx
|
||||
|
||||
change_image_layout(cmd, ds.get(), VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, range);
|
||||
|
||||
ds->native_pitch = (u16)width * 2;
|
||||
ds->native_pitch = (u16)width * 2 * get_format_sample_count(antialias);
|
||||
if (format == rsx::surface_depth_format::z24s8)
|
||||
ds->native_pitch *= 2;
|
||||
|
||||
@ -273,7 +273,7 @@ namespace rsx
|
||||
sink->memory_usage_flags = rsx::surface_usage_flags::storage;
|
||||
sink->state_flags = rsx::surface_state_flags::erase_bkgnd;
|
||||
sink->native_component_map = ref->native_component_map;
|
||||
sink->native_pitch = u16(prev.width * ref->get_bpp());
|
||||
sink->native_pitch = u16(prev.width * ref->get_bpp() * ref->get_spp());
|
||||
sink->surface_width = prev.width;
|
||||
sink->surface_height = prev.height;
|
||||
sink->queue_tag(address);
|
||||
|
Loading…
x
Reference in New Issue
Block a user