From 40563fdd03e80e9ede4777f9d66a16d3381b457a Mon Sep 17 00:00:00 2001 From: Colin Cornaby Date: Sat, 2 Dec 2023 19:32:19 -0800 Subject: [PATCH] Making the command buffer getters const --- Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp | 2 +- Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp index 1166cefc4e..dbe9889835 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp @@ -1198,7 +1198,7 @@ bool plMetalDevice::plMetalPipelineRecord::operator==(const plMetalPipelineRecor state->operator==(*p.state); } -MTL::CommandBuffer* plMetalDevice::GetCurrentCommandBuffer() +MTL::CommandBuffer* plMetalDevice::GetCurrentCommandBuffer() const { if (fCurrentOffscreenCommandBuffer) { return fCurrentOffscreenCommandBuffer; diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h index 939ed94616..c5f3cfd89a 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h @@ -161,8 +161,8 @@ class plMetalDevice /// Create a new command buffer to encode all the operations needed to draw a frame // Currently requires a CA drawable and not a Metal drawable. In since CA drawable is only abstract implementation I know about, not sure where we would find others? void CreateNewCommandBuffer(CA::MetalDrawable* drawable); - MTL::CommandBuffer* GetCurrentCommandBuffer(); - MTL::CommandBuffer* GetCurrentDrawableCommandBuffer() { return fCurrentCommandBuffer; } + MTL::CommandBuffer* GetCurrentCommandBuffer() const; + MTL::CommandBuffer* GetCurrentDrawableCommandBuffer() const { return fCurrentCommandBuffer; } CA::MetalDrawable* GetCurrentDrawable() const; /// Submit the command buffer to the GPU and draws all the render passes. Clears the current command buffer. void SubmitCommandBuffer();