1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 12:12:50 +01:00

Fix build

This commit is contained in:
kd-11 2022-08-23 17:53:46 +03:00 committed by kd-11
parent 1f9e04f72d
commit 1fc0191311
3 changed files with 17 additions and 16 deletions

View File

@ -21,6 +21,7 @@ namespace rsx
using buffer_object_storage_type = typename Traits::buffer_object_storage_type;
using buffer_object_type = typename Traits::buffer_object_type;
using command_list_type = typename Traits::command_list_type;
struct memory_buffer_entry_t
{
@ -48,7 +49,7 @@ namespace rsx
}
}
surface_cache_dma& with_range(Traits::command_list_type cmd, const utils::address_range& range)
surface_cache_dma& with_range(command_list_type cmd, const utils::address_range& range)
{
// Prepare underlying memory so that the range specified is provisioned and contiguous
// 1. Check if we have a pre-existing bo layer

View File

@ -180,20 +180,20 @@ namespace rsx
virtual bool is_depth_surface() const = 0;
virtual void release_ref(image_storage_type) const = 0;
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels>
u32 get_surface_width() const
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels, typename T = u32>
T get_surface_width() const
{
if constexpr (Metrics == rsx::surface_metrics::samples)
{
return surface_width * samples_x;
return static_cast<T>(surface_width * samples_x);
}
else if constexpr (Metrics == rsx::surface_metrics::pixels)
{
return surface_width;
return static_cast<T>(surface_width);
}
else if constexpr (Metrics == rsx::surface_metrics::bytes)
{
return native_pitch;
return static_cast<T>(native_pitch);
}
else
{
@ -201,20 +201,20 @@ namespace rsx
}
}
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels>
u32 get_surface_height() const
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels, typename T = u32>
T get_surface_height() const
{
if constexpr (Metrics == rsx::surface_metrics::samples)
{
return surface_height * samples_y;
return static_cast<T>(surface_height * samples_y);
}
else if constexpr (Metrics == rsx::surface_metrics::pixels)
{
return surface_height;
return static_cast<T>(surface_height);
}
else if constexpr (Metrics == rsx::surface_metrics::bytes)
{
return surface_height * samples_y;
return static_cast<T>(surface_height * samples_y);
}
else
{

View File

@ -481,8 +481,8 @@ namespace vk
const bool is_scaled = surface->width() != surface->surface_width;
if (is_scaled)
{
const areai src_rect = { 0, 0, source->width(), source->height() };
const areai dst_rect = { 0, 0, surface->get_surface_width<rsx::surface_metrics::samples>(), surface->get_surface_height<rsx::surface_metrics::samples>() };
const areai src_rect = { 0, 0, static_cast<int>(source->width()), static_cast<int>(source->height()) };
const areai dst_rect = { 0, 0, surface->get_surface_width<rsx::surface_metrics::samples, int>(), surface->get_surface_height<rsx::surface_metrics::samples, int>() };
auto scratch = vk::get_typeless_helper(source->format(), source->format_class(), dst_rect.x2, dst_rect.y2);
vk::copy_scaled_image(cmd, source, scratch, src_rect, dst_rect, 1, true, VK_FILTER_NEAREST);
@ -540,10 +540,10 @@ namespace vk
}
// Create dst
auto pdev = cmd.get_command_pool().owner;
auto dst = new vk::buffer(*pdev,
auto& dev = cmd.get_command_pool().get_owner();
auto dst = new vk::buffer(dev,
required_bo_size,
pdev->get_memory_mapping().device_local, 0,
dev.get_memory_mapping().device_local, 0,
VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
0, VMM_ALLOCATION_POOL_SURFACE_CACHE);