From 9d6cf8d5f9cb48f2119399d33517fc43d80f9d57 Mon Sep 17 00:00:00 2001 From: Colin Cornaby Date: Sun, 17 Nov 2024 22:57:03 -0800 Subject: [PATCH] Code style fixes --- .../FeatureLib/pfMetalPipeline/plMetalPipeline.cpp | 12 ++++-------- .../pfMetalPipeline/plMetalPipelineState.cpp | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp index 52294dbd90..daf1883458 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp @@ -1694,23 +1694,19 @@ void plMetalPipeline::IBindLights() size_t lightSize = offsetof(plMetalLights, lampSources) + (sizeof(plMetalShaderLightSource) * fLights.count); // FIXME: These states should support dirtying instead of expense memcmps - if ( !(fState.fBoundLights.has_value() && fState.fBoundLights == fLights) ) - { + if ( !(fState.fBoundLights.has_value() && fState.fBoundLights == fLights) ) { fState.fBoundLights = fLights; - if (fLightingPerPixel) - { + if (fLightingPerPixel) { fDevice.CurrentRenderCommandEncoder()->setFragmentBytes(&fLights, sizeof(plMetalLights), FragmentShaderArgumentLights); } else { fDevice.CurrentRenderCommandEncoder()->setVertexBytes(&fLights, sizeof(plMetalLights), VertexShaderArgumentLights); } } - if ( !(fState.fBoundMaterialProperties.has_value() && fState.fBoundMaterialProperties == fCurrentRenderPassMaterialLighting) ) - { + if ( !(fState.fBoundMaterialProperties.has_value() && fState.fBoundMaterialProperties == fCurrentRenderPassMaterialLighting) ) { fState.fBoundMaterialProperties = fCurrentRenderPassMaterialLighting; fDevice.CurrentRenderCommandEncoder()->setVertexBytes(&fDevice.fPipeline->fCurrentRenderPassMaterialLighting, sizeof(plMaterialLightingDescriptor), VertexShaderArgumentMaterialLighting); - if (fLightingPerPixel) - { + if (fLightingPerPixel) { fDevice.CurrentRenderCommandEncoder()->setFragmentBytes(&fDevice.fPipeline->fCurrentRenderPassMaterialLighting, sizeof(plMaterialLightingDescriptor), FragmentShaderArgumentMaterialLighting); } } diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipelineState.cpp b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipelineState.cpp index db58b1cf77..037a50ff66 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipelineState.cpp +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipelineState.cpp @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMetalPipelineState.h" +#include "HeadSpin.h" #include "plDrawable/plGBufferGroup.h" #include "plGImage/plCubicEnvironmap.h" #include "plGImage/plMipmap.h" @@ -271,7 +272,7 @@ MTL::Function* plMetalMaterialPassPipelineState::GetVertexFunction(MTL::Library* MTL::Function* function = library->newFunction(NS::String::string("pipelineVertexShader", NS::ASCIIStringEncoding), MakeFunctionConstants(), &error); - assert(!error); + hsAssert(!error, "Could not find vertex function"); return function->autorelease(); } @@ -281,7 +282,7 @@ MTL::Function* plMetalMaterialPassPipelineState::GetFragmentFunction(MTL::Librar MTL::Function* function = library->newFunction(NS::String::string("pipelineFragmentShader", NS::ASCIIStringEncoding), MakeFunctionConstants(), &error); - assert(!error); + hsAssert(!error, "Could not find fragment function"); return function->autorelease(); }