Skip to content

Commit

Permalink
Main: Technique - try to catch user missing a program type early on
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Dec 30, 2023
1 parent fb1cb29 commit 1ff903f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions OgreMain/src/OgreTechnique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,20 @@ namespace Ogre {
}
}


// try to catch user missing a program early on
if (!caps->hasCapability(RSC_FIXED_FUNCTION) && currPass->isProgrammable() &&
!currPass->hasGpuProgram(GPT_COMPUTE_PROGRAM))
{
if (!currPass->hasVertexProgram() ||
(!currPass->hasFragmentProgram() && !currPass->hasGeometryProgram()))
{
compileErrors << "Pass " << passNum << ": RenderSystem requires both vertex and fragment programs";
return false;
}
}

//Check compilation errors for all program types.
for (int t = 0; t < 6; t++)
for (int t = 0; t < GPT_COUNT; t++)
{
GpuProgramType programType = GpuProgramType(t);
if (currPass->hasGpuProgram(programType))
Expand Down

0 comments on commit 1ff903f

Please sign in to comment.