rsx: use more const ref

This commit is contained in:
Megamouse 2025-05-24 04:45:54 +02:00
parent da273761d1
commit 09ab5477e8
7 changed files with 12 additions and 12 deletions

View file

@ -569,7 +569,7 @@ void GLGSRender::emit_geometry(u32 sub_index)
if (vertex_state && !m_vertex_layout.validate()) if (vertex_state && !m_vertex_layout.validate())
{ {
// No vertex inputs enabled // No vertex inputs enabled
// Execute remainining pipeline barriers with NOP draw // Execute remaining pipeline barriers with NOP draw
do do
{ {
draw_call.execute_pipeline_dependencies(m_ctx); draw_call.execute_pipeline_dependencies(m_ctx);
@ -619,9 +619,9 @@ void GLGSRender::emit_geometry(u32 sub_index)
} }
else else
{ {
const auto subranges = draw_call.get_subranges(); const auto& subranges = draw_call.get_subranges();
const auto draw_count = subranges.size(); const auto draw_count = subranges.size();
const auto driver_caps = gl::get_driver_caps(); const auto& driver_caps = gl::get_driver_caps();
bool use_draw_arrays_fallback = false; bool use_draw_arrays_fallback = false;
m_scratch_buffer.resize(draw_count * 24); m_scratch_buffer.resize(draw_count * 24);
@ -631,7 +631,7 @@ void GLGSRender::emit_geometry(u32 sub_index)
u32 first = 0; u32 first = 0;
u32 dst_index = 0; u32 dst_index = 0;
for (const auto &range : subranges) for (const auto& range : subranges)
{ {
firsts[dst_index] = first; firsts[dst_index] = first;
counts[dst_index] = range.count; counts[dst_index] = range.count;

View file

@ -33,7 +33,7 @@ void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
if (device_props.has_native_half_support) if (device_props.has_native_half_support)
{ {
const auto driver_caps = gl::get_driver_caps(); const auto& driver_caps = gl::get_driver_caps();
if (driver_caps.NV_gpu_shader5_supported) if (driver_caps.NV_gpu_shader5_supported)
{ {
required_extensions.push_back("GL_NV_gpu_shader5"); required_extensions.push_back("GL_NV_gpu_shader5");
@ -47,7 +47,7 @@ void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
if (properties.multisampled_sampler_mask) if (properties.multisampled_sampler_mask)
{ {
// Requires this extension or GLSL 450 // Requires this extension or GLSL 450
const auto driver_caps = gl::get_driver_caps(); const auto& driver_caps = gl::get_driver_caps();
if (driver_caps.glsl_version.version >= 450) if (driver_caps.glsl_version.version >= 450)
{ {
gl_version = 450; gl_version = 450;
@ -366,7 +366,7 @@ void GLFragmentProgram::Decompile(const RSXFragmentProgram& prog)
if (g_cfg.video.shader_precision == gpu_preset_level::low) if (g_cfg.video.shader_precision == gpu_preset_level::low)
{ {
const auto driver_caps = gl::get_driver_caps(); const auto& driver_caps = gl::get_driver_caps();
decompiler.device_props.has_native_half_support = driver_caps.NV_gpu_shader5_supported || driver_caps.AMD_gpu_shader_half_float_supported; decompiler.device_props.has_native_half_support = driver_caps.NV_gpu_shader5_supported || driver_caps.AMD_gpu_shader_half_float_supported;
decompiler.device_props.has_low_precision_rounding = driver_caps.vendor_NVIDIA; decompiler.device_props.has_low_precision_rounding = driver_caps.vendor_NVIDIA;
} }

View file

@ -148,7 +148,7 @@ void GLGSRender::on_init_thread()
rsx_log.success("GL VERSION: %s", reinterpret_cast<const char*>(glGetString(GL_VERSION))); rsx_log.success("GL VERSION: %s", reinterpret_cast<const char*>(glGetString(GL_VERSION)));
rsx_log.success("GLSL VERSION: %s", reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION))); rsx_log.success("GLSL VERSION: %s", reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
auto& gl_caps = gl::get_driver_caps(); const auto& gl_caps = gl::get_driver_caps();
std::vector<std::string> exception_reasons; std::vector<std::string> exception_reasons;
if (!gl_caps.ARB_texture_buffer_object_supported) if (!gl_caps.ARB_texture_buffer_object_supported)

View file

@ -582,7 +582,7 @@ namespace gl
const std::vector<rsx::subresource_layout> &input_layouts, const std::vector<rsx::subresource_layout> &input_layouts,
bool is_swizzled, GLenum gl_format, GLenum gl_type, rsx::simple_array<std::byte>& staging_buffer) bool is_swizzled, GLenum gl_format, GLenum gl_type, rsx::simple_array<std::byte>& staging_buffer)
{ {
const auto driver_caps = gl::get_driver_caps(); const auto& driver_caps = gl::get_driver_caps();
rsx::texture_uploader_capabilities caps rsx::texture_uploader_capabilities caps
{ {
.supports_byteswap = true, .supports_byteswap = true,

View file

@ -565,7 +565,7 @@ VKGSRender::VKGSRender(utils::serial* ar) noexcept : GSRender(ar)
m_fragment_texture_params_buffer_info = { m_fragment_texture_params_ring_info.heap->value, 0, 16 }; m_fragment_texture_params_buffer_info = { m_fragment_texture_params_ring_info.heap->value, 0, 16 };
m_raster_env_buffer_info = { m_raster_env_ring_info.heap->value, 0, 128 }; m_raster_env_buffer_info = { m_raster_env_ring_info.heap->value, 0, 128 };
const auto limits = m_device->gpu().get_limits(); const auto& limits = m_device->gpu().get_limits();
m_texbuffer_view_size = std::min(limits.maxTexelBufferElements, VK_ATTRIB_RING_BUFFER_SIZE_M * 0x100000u); m_texbuffer_view_size = std::min(limits.maxTexelBufferElements, VK_ATTRIB_RING_BUFFER_SIZE_M * 0x100000u);
if (m_texbuffer_view_size < 0x800000) if (m_texbuffer_view_size < 0x800000)

View file

@ -50,7 +50,7 @@ namespace vk
{ {
// For any managed resources, try to keep the number of unused/idle resources as low as possible. // For any managed resources, try to keep the number of unused/idle resources as low as possible.
// Improves search times as well as keeping us below the hardware limit. // Improves search times as well as keeping us below the hardware limit.
const auto limits = get_current_renderer()->gpu().get_limits(); const auto& limits = get_current_renderer()->gpu().get_limits();
const auto allocated_sampler_count = vmm_get_application_pool_usage(VMM_ALLOCATION_POOL_SAMPLER); const auto allocated_sampler_count = vmm_get_application_pool_usage(VMM_ALLOCATION_POOL_SAMPLER);
const auto max_allowed_samplers = std::min((limits.maxSamplerAllocationCount * 3u) / 4u, 2048u); const auto max_allowed_samplers = std::min((limits.maxSamplerAllocationCount * 3u) / 4u, 2048u);

View file

@ -11,7 +11,7 @@ namespace vk
{ {
void image::validate(const vk::render_device& dev, const VkImageCreateInfo& info) const void image::validate(const vk::render_device& dev, const VkImageCreateInfo& info) const
{ {
const auto gpu_limits = dev.gpu().get_limits(); const auto& gpu_limits = dev.gpu().get_limits();
u32 longest_dim, dim_limit; u32 longest_dim, dim_limit;
switch (info.imageType) switch (info.imageType)