From 1ff903f3a287634b19fd1be3f9fd62bbcf102591 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Sat, 30 Dec 2023 20:02:05 +0100 Subject: [PATCH] Main: Technique - try to catch user missing a program type early on --- OgreMain/src/OgreTechnique.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OgreMain/src/OgreTechnique.cpp b/OgreMain/src/OgreTechnique.cpp index 7536912053d..886f470f495 100644 --- a/OgreMain/src/OgreTechnique.cpp +++ b/OgreMain/src/OgreTechnique.cpp @@ -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))