Skip to content

Commit

Permalink
Treat X8R8G8B8 format as A8R8G8B8 in image_in, Fixes RPCS3#5510
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Mar 2, 2019
1 parent 33da924 commit ee35347
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rpcs3/Emu/RSX/rsx_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ namespace rsx

const blit_engine::transfer_origin in_origin = method_registers.blit_engine_input_origin();
const blit_engine::transfer_interpolator in_inter = method_registers.blit_engine_input_inter();
const rsx::blit_engine::transfer_source_format src_color_format = method_registers.blit_engine_src_color_format();
rsx::blit_engine::transfer_source_format src_color_format = method_registers.blit_engine_src_color_format();

const f32 in_x = std::ceil(method_registers.blit_engine_in_x());
const f32 in_y = std::ceil(method_registers.blit_engine_in_y());
Expand Down Expand Up @@ -924,7 +924,16 @@ namespace rsx
if (src_color_format != rsx::blit_engine::transfer_source_format::r5g6b5 &&
src_color_format != rsx::blit_engine::transfer_source_format::a8r8g8b8)
{
fmt::throw_exception("NV3089_IMAGE_IN_SIZE: unknown src_color_format (%d)" HERE, (u8)src_color_format);
// Alpha has no meaning in both formats
if (src_color_format == rsx::blit_engine::transfer_source_format::x8r8g8b8)
{
src_color_format = rsx::blit_engine::transfer_source_format::a8r8g8b8;
}
else
{
// TODO: Support more formats
fmt::throw_exception("NV3089_IMAGE_IN_SIZE: unknown src_color_format (%d)" HERE, (u8)src_color_format);
}
}

f32 scale_x = method_registers.blit_engine_ds_dx();
Expand Down

0 comments on commit ee35347

Please sign in to comment.