Skip to content

Commit

Permalink
Revert "Main: Pass - alias compute shader to vertex shader storage"
Browse files Browse the repository at this point in the history
This reverts commit 4c22255.
  • Loading branch information
paroj committed Jan 7, 2024
1 parent 5bb5870 commit cac884c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions OgreMain/include/OgreGpuProgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion OgreMain/include/OgrePass.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ namespace Ogre {
typedef std::vector<unsigned short> ContentTypeLookup;
mutable ContentTypeLookup mShadowContentTypeLookup;

std::unique_ptr<GpuProgramUsage> mProgramUsage[GPT_PIPELINE_COUNT];
/// Vertex program details
std::unique_ptr<GpuProgramUsage> mProgramUsage[GPT_COUNT];
/// Number of pass iterations to perform
size_t mPassIterationCount;
/// Point size, applies when not using per-vertex point size
Expand Down
11 changes: 5 additions & 6 deletions OgreMain/src/OgrePass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -882,12 +882,12 @@ namespace Ogre {
}

std::unique_ptr<GpuProgramUsage>& Pass::getProgramUsage(GpuProgramType programType) {
return mProgramUsage[programType % GPT_PIPELINE_COUNT];
return mProgramUsage[programType];
}

const std::unique_ptr<GpuProgramUsage>& Pass::getProgramUsage(GpuProgramType programType) const
{
return mProgramUsage[programType % GPT_PIPELINE_COUNT];
return mProgramUsage[programType];
}

bool Pass::hasGpuProgram(GpuProgramType programType) const {
Expand All @@ -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
Expand Down

0 comments on commit cac884c

Please sign in to comment.