diff --git a/OgreMain/include/OgreGpuProgram.h b/OgreMain/include/OgreGpuProgram.h index b9a4cb0e05bd..6a7c23b0b9d6 100644 --- a/OgreMain/include/OgreGpuProgram.h +++ b/OgreMain/include/OgreGpuProgram.h @@ -55,9 +55,7 @@ namespace Ogre { GPT_COMPUTE_PROGRAM }; enum { - GPT_COUNT = GPT_COMPUTE_PROGRAM + 1, - /// max programs that can be active in a pipeline (e.g compute is separate) - GPT_PIPELINE_COUNT = GPT_HULL_PROGRAM + 1 + GPT_COUNT = GPT_COMPUTE_PROGRAM + 1 }; /** Defines a program which runs on the GPU such as a vertex or fragment program. diff --git a/OgreMain/include/OgrePass.h b/OgreMain/include/OgrePass.h index 2f1e3c378ae4..d9a2d48aaf57 100644 --- a/OgreMain/include/OgrePass.h +++ b/OgreMain/include/OgrePass.h @@ -220,7 +220,8 @@ namespace Ogre { typedef std::vector ContentTypeLookup; mutable ContentTypeLookup mShadowContentTypeLookup; - std::unique_ptr mProgramUsage[GPT_PIPELINE_COUNT]; + /// Vertex program details + std::unique_ptr mProgramUsage[GPT_COUNT]; /// Number of pass iterations to perform size_t mPassIterationCount; /// Point size, applies when not using per-vertex point size diff --git a/OgreMain/src/OgrePass.cpp b/OgreMain/src/OgrePass.cpp index 9bf98e35b2a6..d83c3d12883b 100644 --- a/OgreMain/src/OgrePass.cpp +++ b/OgreMain/src/OgrePass.cpp @@ -249,7 +249,7 @@ namespace Ogre { mIlluminationStage = oth.mIlluminationStage; mLightMask = oth.mLightMask; - for(int i = 0; i < GPT_PIPELINE_COUNT; i++) + for(int i = 0; i < GPT_COUNT; i++) { auto& programUsage = mProgramUsage[i]; auto& othUsage = oth.mProgramUsage[i]; @@ -882,12 +882,12 @@ namespace Ogre { } std::unique_ptr& Pass::getProgramUsage(GpuProgramType programType) { - return mProgramUsage[programType % GPT_PIPELINE_COUNT]; + return mProgramUsage[programType]; } const std::unique_ptr& Pass::getProgramUsage(GpuProgramType programType) const { - return mProgramUsage[programType % GPT_PIPELINE_COUNT]; + return mProgramUsage[programType]; } bool Pass::hasGpuProgram(GpuProgramType programType) const { @@ -896,9 +896,8 @@ namespace Ogre { const GpuProgramPtr& Pass::getGpuProgram(GpuProgramType programType) const { OGRE_LOCK_MUTEX(mGpuProgramChangeMutex); - auto programType_ = programType % GPT_PIPELINE_COUNT; - OgreAssert(mProgramUsage[programType_], "check whether program is available using hasGpuProgram()"); - return mProgramUsage[programType_]->getProgram(); + OgreAssert(mProgramUsage[programType], "check whether program is available using hasGpuProgram()"); + return mProgramUsage[programType]->getProgram(); } //----------------------------------------------------------------------- const String& Pass::getGpuProgramName(GpuProgramType type) const