Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
colincornaby committed Nov 27, 2024
1 parent 8ed728a commit b13fba8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 4 additions & 8 deletions Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand Down

0 comments on commit b13fba8

Please sign in to comment.