mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 20:15:27 +00:00
rsx: Set up hw accelerated blit
This commit is contained in:
parent
b3cb827526
commit
d94986ff0d
3 changed files with 53 additions and 1 deletions
|
@ -348,6 +348,8 @@ namespace rsx
|
|||
|
||||
virtual std::pair<std::string, std::string> get_programs() const { return std::make_pair("", ""); };
|
||||
|
||||
virtual bool scaled_image_from_memory(blit_src_info& src_info, blit_dst_info& dst_info, bool interpolate){ return false; }
|
||||
|
||||
struct raw_program get_raw_program() const;
|
||||
public:
|
||||
void reset();
|
||||
|
|
|
@ -30,6 +30,32 @@ namespace rsx
|
|||
void(*remove_shader)(void *ptr);
|
||||
};
|
||||
|
||||
struct blit_src_info
|
||||
{
|
||||
blit_engine::transfer_source_format format;
|
||||
u16 offset_x;
|
||||
u16 offset_y;
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 slice;
|
||||
u16 pitch;
|
||||
void *pixels;
|
||||
};
|
||||
|
||||
struct blit_dst_info
|
||||
{
|
||||
blit_engine::transfer_destination_format format;
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 pitch;
|
||||
u16 clip_x;
|
||||
u16 clip_y;
|
||||
u16 clip_width;
|
||||
u16 clip_height;
|
||||
bool swizzled;
|
||||
void *pixels;
|
||||
};
|
||||
|
||||
class shaders_cache
|
||||
{
|
||||
struct entry_t
|
||||
|
|
|
@ -573,10 +573,34 @@ namespace rsx
|
|||
}
|
||||
}
|
||||
|
||||
blit_src_info src_info;
|
||||
blit_dst_info dst_info;
|
||||
|
||||
src_info.format = src_color_format;
|
||||
src_info.width = in_w;
|
||||
src_info.height = in_h;
|
||||
src_info.pitch = in_pitch;
|
||||
src_info.slice = slice_h;
|
||||
src_info.pixels = pixels_src;
|
||||
|
||||
dst_info.format = dst_color_format;
|
||||
dst_info.width = convert_w;
|
||||
dst_info.height = convert_h;
|
||||
dst_info.clip_x = clip_x;
|
||||
dst_info.clip_y = clip_y;
|
||||
dst_info.clip_width = clip_w;
|
||||
dst_info.clip_height = clip_h;
|
||||
dst_info.pitch = in_pitch;
|
||||
dst_info.pixels = pixels_dst;
|
||||
dst_info.swizzled = (method_registers.blit_engine_context_surface() == blit_engine::context_surface::swizzle2d);
|
||||
|
||||
if (rsx->scaled_image_from_memory(src_info, dst_info, in_inter == blit_engine::transfer_interpolator::foh))
|
||||
return;
|
||||
|
||||
if (method_registers.blit_engine_context_surface() != blit_engine::context_surface::swizzle2d)
|
||||
{
|
||||
if (need_convert || need_clip)
|
||||
{
|
||||
{
|
||||
if (need_clip)
|
||||
{
|
||||
if (need_convert)
|
||||
|
|
Loading…
Add table
Reference in a new issue