rsx image_in: remove clip h and w hack

If clip region is empty, dont execute
This commit is contained in:
eladash 2018-11-30 21:06:48 -08:00 committed by kd-11
parent 4ddafc481e
commit 0a1da14a15
2 changed files with 18 additions and 23 deletions

View File

@ -273,8 +273,8 @@ namespace rsx
{ {
const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation(); const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation();
const u16 out_w = method_registers.blit_engine_output_width(); const u16 clip_w = std::min(method_registers.blit_engine_output_width(), method_registers.blit_engine_clip_width());
const u16 out_h = method_registers.blit_engine_output_height(); const u16 clip_h = std::min(method_registers.blit_engine_output_height(), method_registers.blit_engine_clip_height());
const u16 in_w = method_registers.blit_engine_input_width(); const u16 in_w = method_registers.blit_engine_input_width();
const u16 in_h = method_registers.blit_engine_input_height(); const u16 in_h = method_registers.blit_engine_input_height();
@ -288,7 +288,7 @@ namespace rsx
u16 in_pitch = method_registers.blit_engine_input_pitch(); u16 in_pitch = method_registers.blit_engine_input_pitch();
if (in_w == 0 || in_h == 0 || out_w == 0 || out_h == 0) if (in_w == 0 || in_h == 0 || clip_w == 0 || clip_h == 0)
{ {
return; return;
} }

View File

@ -811,36 +811,31 @@ namespace rsx
//Clipping //Clipping
//Validate that clipping rect will fit onto both src and dst regions //Validate that clipping rect will fit onto both src and dst regions
u16 clip_w = std::min(method_registers.blit_engine_clip_width(), out_w); const u16 clip_w = std::min(method_registers.blit_engine_clip_width(), out_w);
u16 clip_h = std::min(method_registers.blit_engine_clip_height(), out_h); const u16 clip_h = std::min(method_registers.blit_engine_clip_height(), out_h);
// Check both clip dimensions and dst dimensions
if (clip_w == 0 || clip_h == 0)
{
LOG_WARNING(RSX, "NV3089_IMAGE_IN: Operation NOPed out due to empty regions");
return;
}
if (in_w == 0 || in_h == 0)
{
LOG_ERROR(RSX, "NV3089_IMAGE_IN_SIZE: Invalid blit dimensions passed");
return;
}
u16 clip_x = method_registers.blit_engine_clip_x(); u16 clip_x = method_registers.blit_engine_clip_x();
u16 clip_y = method_registers.blit_engine_clip_y(); u16 clip_y = method_registers.blit_engine_clip_y();
if (clip_w == 0)
{
clip_x = 0;
clip_w = out_w;
}
if (clip_h == 0)
{
clip_y = 0;
clip_h = out_h;
}
//Fit onto dst //Fit onto dst
if (clip_x && (out_x + clip_x + clip_w) > out_w) clip_x = 0; if (clip_x && (out_x + clip_x + clip_w) > out_w) clip_x = 0;
if (clip_y && (out_y + clip_y + clip_h) > out_h) clip_y = 0; if (clip_y && (out_y + clip_y + clip_h) > out_h) clip_y = 0;
u16 in_pitch = method_registers.blit_engine_input_pitch(); u16 in_pitch = method_registers.blit_engine_input_pitch();
if (in_w == 0 || in_h == 0 || out_w == 0 || out_h == 0)
{
LOG_ERROR(RSX, "NV3089_IMAGE_IN_SIZE: Invalid blit dimensions passed");
return;
}
if (in_origin != blit_engine::transfer_origin::corner) if (in_origin != blit_engine::transfer_origin::corner)
{ {
// Probably refers to texel geometry which would affect clipping algorithm slightly when rounding texel addresses // Probably refers to texel geometry which would affect clipping algorithm slightly when rounding texel addresses