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_storage_type = typename Traits::buffer_object_storage_type;
using buffer_object_type = typename Traits::buffer_object_type; using buffer_object_type = typename Traits::buffer_object_type;
using command_list_type = typename Traits::command_list_type;
struct memory_buffer_entry_t 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 // Prepare underlying memory so that the range specified is provisioned and contiguous
// 1. Check if we have a pre-existing bo layer // 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 bool is_depth_surface() const = 0;
virtual void release_ref(image_storage_type) const = 0; virtual void release_ref(image_storage_type) const = 0;
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels> template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels, typename T = u32>
u32 get_surface_width() const T get_surface_width() const
{ {
if constexpr (Metrics == rsx::surface_metrics::samples) 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) 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) else if constexpr (Metrics == rsx::surface_metrics::bytes)
{ {
return native_pitch; return static_cast<T>(native_pitch);
} }
else else
{ {
@ -201,20 +201,20 @@ namespace rsx
} }
} }
template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels> template<rsx::surface_metrics Metrics = rsx::surface_metrics::pixels, typename T = u32>
u32 get_surface_height() const T get_surface_height() const
{ {
if constexpr (Metrics == rsx::surface_metrics::samples) 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) 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) else if constexpr (Metrics == rsx::surface_metrics::bytes)
{ {
return surface_height * samples_y; return static_cast<T>(surface_height * samples_y);
} }
else else
{ {

View file

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