Skip to content

Commit

Permalink
Prevent potential operator precedence confusion
Browse files Browse the repository at this point in the history
The following are not the same:
bMemoryLess && (allowMemoryless() ? TextureFlags::TilerMemoryless : 0)
vs
(bMemoryLess && allowMemoryless()) ? TextureFlags::TilerMemoryless : 0

Regardless of C++ operator rules, mark intent very explicit.
  • Loading branch information
darksylinc committed Nov 26, 2024
1 parent 139037f commit c6443e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ of this software and associated documentation files (the "Software"), to deal
return OGRE_NEW MetalTextureGpuRenderTarget(
GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow DepthBuffer",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
( bMemoryLess && allowMemoryless() ? TextureFlags::TilerMemoryless : 0 ) |
( ( bMemoryLess && allowMemoryless() ) ? TextureFlags::TilerMemoryless : 0 ) |
TextureFlags::RenderWindowSpecific | TextureFlags::DiscardableContent,
TextureTypes::Type2D, this );
}
Expand Down

0 comments on commit c6443e0

Please sign in to comment.