mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Remove extraneous ::narrow<int>() calls
GSL’s gsl::span didn’t use the correct type for its index_type, which is why they were needed.
This commit is contained in:
parent
72cdf0b04c
commit
f76720ceb0
@ -44,13 +44,13 @@ namespace
|
||||
template <typename T>
|
||||
gsl::span<T> as_span_workaround(gsl::span<std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
gsl::span<T> as_const_span(gsl::span<const std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,13 +30,13 @@ namespace
|
||||
template <typename T>
|
||||
gsl::span<T> as_span_workaround(gsl::span<std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
gsl::span<T> as_const_span(gsl::span<const std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
|
||||
// TODO: Make this function part of GSL
|
||||
@ -1042,4 +1042,4 @@ std::pair<u32, bool> get_compatible_gcm_format(rsx::surface_depth_format format)
|
||||
default:
|
||||
ASSUME(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace
|
||||
template <typename T>
|
||||
gsl::span<T> as_const_span(gsl::span<const std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2405,7 +2405,7 @@ namespace rsx
|
||||
subres.height_in_block = subres.height_in_texel = image_height;
|
||||
subres.pitch_in_block = full_width;
|
||||
subres.depth = 1;
|
||||
subres.data = { vm::_ptr<const std::byte>(image_base), src.pitch * image_height };
|
||||
subres.data = { vm::_ptr<const std::byte>(image_base), static_cast<gsl::span<const std::byte>::index_type>(src.pitch * image_height) };
|
||||
subresource_layout.push_back(subres);
|
||||
|
||||
vram_texture = upload_image_from_cpu(cmd, rsx_range, image_width, image_height, 1, 1, src.pitch, gcm_format, texture_upload_context::blit_engine_src,
|
||||
@ -2537,7 +2537,7 @@ namespace rsx
|
||||
subres.height_in_block = subres.height_in_texel = dst_dimensions.height;
|
||||
subres.pitch_in_block = pitch_in_block;
|
||||
subres.depth = 1;
|
||||
subres.data = { vm::get_super_ptr<const std::byte>(dst.rsx_address), dst.pitch * dst_dimensions.height };
|
||||
subres.data = { vm::get_super_ptr<const std::byte>(dst.rsx_address), static_cast<gsl::span<const std::byte>::index_type>(dst.pitch * dst_dimensions.height) };
|
||||
subresource_layout.push_back(subres);
|
||||
|
||||
cached_dest = upload_image_from_cpu(cmd, rsx_range, dst_dimensions.width, dst_dimensions.height, 1, 1, dst.pitch,
|
||||
|
@ -1372,7 +1372,7 @@ void GLGSRender::load_program_env()
|
||||
auto mapping = m_fragment_constants_buffer->alloc_from_heap(fragment_constants_size, m_uniform_buffer_offset_align);
|
||||
auto buf = static_cast<u8*>(mapping.first);
|
||||
|
||||
m_prog_buffer.fill_fragment_constants_buffer({ reinterpret_cast<float*>(buf), gsl::narrow<int>(fragment_constants_size) },
|
||||
m_prog_buffer.fill_fragment_constants_buffer({ reinterpret_cast<float*>(buf), fragment_constants_size },
|
||||
current_fragment_program, gl::get_driver_caps().vendor_NVIDIA);
|
||||
|
||||
m_fragment_constants_buffer->bind_range(GL_FRAGMENT_CONSTANT_BUFFERS_BIND_SLOT, mapping.second, fragment_constants_size);
|
||||
|
@ -2735,7 +2735,7 @@ void VKGSRender::load_program_env()
|
||||
auto mem = m_fragment_constants_ring_info.alloc<256>(fragment_constants_size);
|
||||
auto buf = m_fragment_constants_ring_info.map(mem, fragment_constants_size);
|
||||
|
||||
m_prog_buffer->fill_fragment_constants_buffer({ reinterpret_cast<float*>(buf), ::narrow<int>(fragment_constants_size) },
|
||||
m_prog_buffer->fill_fragment_constants_buffer({ reinterpret_cast<float*>(buf), fragment_constants_size },
|
||||
current_fragment_program, vk::sanitize_fp_values());
|
||||
|
||||
m_fragment_constants_ring_info.unmap();
|
||||
|
@ -245,7 +245,7 @@ namespace vk
|
||||
subres.height_in_block = subres.height_in_texel = surface_height * samples_y;
|
||||
subres.pitch_in_block = rsx_pitch / get_bpp();
|
||||
subres.depth = 1;
|
||||
subres.data = { (const std::byte*)vm::get_super_ptr(base_addr), s32(rsx_pitch * surface_height * samples_y) };
|
||||
subres.data = { (const std::byte*)vm::get_super_ptr(base_addr), static_cast<gsl::span<const std::byte>::index_type>(rsx_pitch * surface_height * samples_y) };
|
||||
|
||||
if (LIKELY(g_cfg.video.resolution_scale_percent == 100 && samples() == 1))
|
||||
{
|
||||
|
@ -722,7 +722,7 @@ namespace vk
|
||||
check_caps = false;
|
||||
}
|
||||
|
||||
gsl::span<std::byte> mapped{ (std::byte*)mapped_buffer, ::narrow<int>(image_linear_size) };
|
||||
gsl::span<std::byte> mapped{ (std::byte*)mapped_buffer, image_linear_size };
|
||||
opt = upload_texture_subresource(mapped, layout, format, is_swizzled, caps);
|
||||
upload_heap.unmap();
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace
|
||||
template <typename T>
|
||||
gsl::span<T> as_const_span(gsl::span<const std::byte> unformated_span)
|
||||
{
|
||||
return{ (T*)unformated_span.data(), ::narrow<int>(unformated_span.size_bytes() / sizeof(T)) };
|
||||
return{ (T*)unformated_span.data(), unformated_span.size_bytes() / sizeof(T) };
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user