gl: Use the GPU to scale textures; use ARB_sampler_object

Improve scaling and separate sampler state from texture state

gl: Unify all texture cache objects under one structure separate by use case
gl: Texture cache fixes

- Acquire lock when finding matching textures
- Account for swizzled surfaces when deciding whether to cpu memcpy
- Handle swizzled images on the GPU
This commit is contained in:
kd-11 2017-03-29 22:27:29 +03:00
parent d94986ff0d
commit 6d6d0e4e36
11 changed files with 880 additions and 370 deletions

View file

@ -573,29 +573,41 @@ namespace rsx
}
}
blit_src_info src_info;
blit_dst_info dst_info;
if (dst_dma == CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER)
{
//For now, only use this for actual scaled images, there are use cases that should not go through 3d engine, e.g program ucode transfer
//TODO: Figure out more instances where we can use this without problems
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;
blit_src_info src_info;
blit_dst_info dst_info;
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);
src_info.format = src_color_format;
src_info.width = in_w;
src_info.height = in_h;
src_info.pitch = in_pitch;
src_info.slice_h = slice_h;
src_info.offset_x = in_x;
src_info.offset_y = in_y;
src_info.pixels = pixels_src;
src_info.rsx_address = get_address(src_offset, src_dma);
if (rsx->scaled_image_from_memory(src_info, dst_info, in_inter == blit_engine::transfer_interpolator::foh))
return;
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.offset_x = out_x;
dst_info.offset_y = out_y;
dst_info.pitch = out_pitch;
dst_info.pixels = pixels_dst;
dst_info.rsx_address = get_address(dst_offset, dst_dma);
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)
{