mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 22:41:25 +12:00
vk: Rename rsx::vk_render_targets to vk::surface_cache
- Makes some changes much easier going forward to pull in vk-specific stuff into vk namespace. - TODO: The same thing needs to happen with GL
This commit is contained in:
parent
53c9fb3e00
commit
2ffa8f4623
3 changed files with 14 additions and 17 deletions
|
@ -374,7 +374,7 @@ private:
|
||||||
vk::pipeline_props m_pipeline_properties;
|
vk::pipeline_props m_pipeline_properties;
|
||||||
|
|
||||||
vk::texture_cache m_texture_cache;
|
vk::texture_cache m_texture_cache;
|
||||||
rsx::vk_render_targets m_rtts;
|
vk::surface_cache m_rtts;
|
||||||
|
|
||||||
std::unique_ptr<vk::buffer> null_buffer;
|
std::unique_ptr<vk::buffer> null_buffer;
|
||||||
std::unique_ptr<vk::buffer_view> null_buffer_view;
|
std::unique_ptr<vk::buffer_view> null_buffer_view;
|
||||||
|
|
|
@ -64,11 +64,8 @@ namespace vk
|
||||||
{
|
{
|
||||||
return ensure(dynamic_cast<vk::render_target*>(t));
|
return ensure(dynamic_cast<vk::render_target*>(t));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
namespace rsx
|
struct surface_cache_traits
|
||||||
{
|
|
||||||
struct vk_render_target_traits
|
|
||||||
{
|
{
|
||||||
using surface_storage_type = std::unique_ptr<vk::render_target>;
|
using surface_storage_type = std::unique_ptr<vk::render_target>;
|
||||||
using surface_type = vk::render_target*;
|
using surface_type = vk::render_target*;
|
||||||
|
@ -78,7 +75,7 @@ namespace rsx
|
||||||
|
|
||||||
static std::unique_ptr<vk::render_target> create_new_surface(
|
static std::unique_ptr<vk::render_target> create_new_surface(
|
||||||
u32 address,
|
u32 address,
|
||||||
surface_color_format format,
|
rsx::surface_color_format format,
|
||||||
usz width, usz height, usz pitch,
|
usz width, usz height, usz pitch,
|
||||||
rsx::surface_antialiasing antialias,
|
rsx::surface_antialiasing antialias,
|
||||||
vk::render_device &device, vk::command_buffer& cmd)
|
vk::render_device &device, vk::command_buffer& cmd)
|
||||||
|
@ -87,16 +84,16 @@ namespace rsx
|
||||||
VkFormat requested_format = fmt.first;
|
VkFormat requested_format = fmt.first;
|
||||||
|
|
||||||
u8 samples;
|
u8 samples;
|
||||||
surface_sample_layout sample_layout;
|
rsx::surface_sample_layout sample_layout;
|
||||||
if (g_cfg.video.antialiasing_level == msaa_level::_auto)
|
if (g_cfg.video.antialiasing_level == msaa_level::_auto)
|
||||||
{
|
{
|
||||||
samples = get_format_sample_count(antialias);
|
samples = get_format_sample_count(antialias);
|
||||||
sample_layout = surface_sample_layout::ps3;
|
sample_layout = rsx::surface_sample_layout::ps3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
samples = 1;
|
samples = 1;
|
||||||
sample_layout = surface_sample_layout::null;
|
sample_layout = rsx::surface_sample_layout::null;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkImageUsageFlags usage_flags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
VkImageUsageFlags usage_flags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||||
|
@ -144,7 +141,7 @@ namespace rsx
|
||||||
|
|
||||||
static std::unique_ptr<vk::render_target> create_new_surface(
|
static std::unique_ptr<vk::render_target> create_new_surface(
|
||||||
u32 address,
|
u32 address,
|
||||||
surface_depth_format2 format,
|
rsx::surface_depth_format2 format,
|
||||||
usz width, usz height, usz pitch,
|
usz width, usz height, usz pitch,
|
||||||
rsx::surface_antialiasing antialias,
|
rsx::surface_antialiasing antialias,
|
||||||
vk::render_device &device, vk::command_buffer& cmd)
|
vk::render_device &device, vk::command_buffer& cmd)
|
||||||
|
@ -153,16 +150,16 @@ namespace rsx
|
||||||
VkImageUsageFlags usage_flags = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
|
VkImageUsageFlags usage_flags = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||||
|
|
||||||
u8 samples;
|
u8 samples;
|
||||||
surface_sample_layout sample_layout;
|
rsx::surface_sample_layout sample_layout;
|
||||||
if (g_cfg.video.antialiasing_level == msaa_level::_auto)
|
if (g_cfg.video.antialiasing_level == msaa_level::_auto)
|
||||||
{
|
{
|
||||||
samples = get_format_sample_count(antialias);
|
samples = get_format_sample_count(antialias);
|
||||||
sample_layout = surface_sample_layout::ps3;
|
sample_layout = rsx::surface_sample_layout::ps3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
samples = 1;
|
samples = 1;
|
||||||
sample_layout = surface_sample_layout::null;
|
sample_layout = rsx::surface_sample_layout::null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (samples == 1) [[likely]]
|
if (samples == 1) [[likely]]
|
||||||
|
@ -353,7 +350,7 @@ namespace rsx
|
||||||
|
|
||||||
static bool surface_matches_properties(
|
static bool surface_matches_properties(
|
||||||
const std::unique_ptr<vk::render_target> &surface,
|
const std::unique_ptr<vk::render_target> &surface,
|
||||||
surface_color_format format,
|
rsx::surface_color_format format,
|
||||||
usz width, usz height,
|
usz width, usz height,
|
||||||
rsx::surface_antialiasing antialias,
|
rsx::surface_antialiasing antialias,
|
||||||
bool check_refs = false)
|
bool check_refs = false)
|
||||||
|
@ -364,7 +361,7 @@ namespace rsx
|
||||||
|
|
||||||
static bool surface_matches_properties(
|
static bool surface_matches_properties(
|
||||||
const std::unique_ptr<vk::render_target> &surface,
|
const std::unique_ptr<vk::render_target> &surface,
|
||||||
surface_depth_format2 format,
|
rsx::surface_depth_format2 format,
|
||||||
usz width, usz height,
|
usz width, usz height,
|
||||||
rsx::surface_antialiasing antialias,
|
rsx::surface_antialiasing antialias,
|
||||||
bool check_refs = false)
|
bool check_refs = false)
|
||||||
|
@ -380,7 +377,7 @@ namespace rsx
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vk_render_targets : public rsx::surface_store<vk_render_target_traits>
|
struct surface_cache : public rsx::surface_store<vk::surface_cache_traits>
|
||||||
{
|
{
|
||||||
void destroy()
|
void destroy()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1260,7 +1260,7 @@ namespace vk
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool blit(rsx::blit_src_info& src, rsx::blit_dst_info& dst, bool interpolate, rsx::vk_render_targets& m_rtts, vk::command_buffer& cmd)
|
bool blit(rsx::blit_src_info& src, rsx::blit_dst_info& dst, bool interpolate, vk::surface_cache& m_rtts, vk::command_buffer& cmd)
|
||||||
{
|
{
|
||||||
blitter helper;
|
blitter helper;
|
||||||
auto reply = upload_scaled_image(src, dst, interpolate, cmd, m_rtts, helper);
|
auto reply = upload_scaled_image(src, dst, interpolate, cmd, m_rtts, helper);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue