From d263d508cd27c5954ab0a9b84e79149f9b0123f1 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Tue, 5 Jul 2022 20:47:53 +0300 Subject: [PATCH] [GPU] Make operator< const --- src/xenia/gpu/d3d12/d3d12_render_target_cache.h | 4 ++-- src/xenia/gpu/vulkan/vulkan_render_target_cache.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xenia/gpu/d3d12/d3d12_render_target_cache.h b/src/xenia/gpu/d3d12/d3d12_render_target_cache.h index 6f823d34e..7e111480b 100644 --- a/src/xenia/gpu/d3d12/d3d12_render_target_cache.h +++ b/src/xenia/gpu/d3d12/d3d12_render_target_cache.h @@ -497,7 +497,7 @@ class D3D12RenderTargetCache final : public RenderTargetCache { TransferInvocation(const Transfer& transfer, const TransferShaderKey& shader_key) : transfer(transfer), shader_key(shader_key) {} - bool operator<(const TransferInvocation& other_invocation) { + bool operator<(const TransferInvocation& other_invocation) const { // TODO(Triang3l): See if it may be better to sort by the source in the // first place, especially when reading the same data multiple times (like // to write the stencil bits after depth) for better read locality. @@ -639,7 +639,7 @@ class D3D12RenderTargetCache final : public RenderTargetCache { DumpInvocation(const ResolveCopyDumpRectangle& rectangle, const DumpPipelineKey& pipeline_key) : rectangle(rectangle), pipeline_key(pipeline_key) {} - bool operator<(const DumpInvocation& other_invocation) { + bool operator<(const DumpInvocation& other_invocation) const { // Sort by the pipeline key primarily to reduce pipeline state (context) // switches. if (pipeline_key != other_invocation.pipeline_key) { diff --git a/src/xenia/gpu/vulkan/vulkan_render_target_cache.h b/src/xenia/gpu/vulkan/vulkan_render_target_cache.h index d15ba2abc..5c789acdb 100644 --- a/src/xenia/gpu/vulkan/vulkan_render_target_cache.h +++ b/src/xenia/gpu/vulkan/vulkan_render_target_cache.h @@ -647,7 +647,7 @@ class VulkanRenderTargetCache final : public RenderTargetCache { TransferInvocation(const Transfer& transfer, const TransferShaderKey& shader_key) : transfer(transfer), shader_key(shader_key) {} - bool operator<(const TransferInvocation& other_invocation) { + bool operator<(const TransferInvocation& other_invocation) const { // TODO(Triang3l): See if it may be better to sort by the source in the // first place, especially when reading the same data multiple times (like // to write the stencil bits after depth) for better read locality. @@ -784,7 +784,7 @@ class VulkanRenderTargetCache final : public RenderTargetCache { DumpInvocation(const ResolveCopyDumpRectangle& rectangle, const DumpPipelineKey& pipeline_key) : rectangle(rectangle), pipeline_key(pipeline_key) {} - bool operator<(const DumpInvocation& other_invocation) { + bool operator<(const DumpInvocation& other_invocation) const { // Sort by the pipeline key primarily to reduce pipeline state (context) // switches. if (pipeline_key != other_invocation.pipeline_key) {