diff --git a/RenderSystems/Metal/src/OgreMetalProgram.mm b/RenderSystems/Metal/src/OgreMetalProgram.mm index dd68fcbe67f..727f3e1c1df 100644 --- a/RenderSystems/Metal/src/OgreMetalProgram.mm +++ b/RenderSystems/Metal/src/OgreMetalProgram.mm @@ -84,6 +84,7 @@ of this software and associated documentation files (the "Software"), to deal PT_STRING),&msCmdShaderReflectionPairHint); } mTargetBufferName = ""; + mEntryPoint = "mainfunc"; // 1.4.4: A Metal function cannot be called main. } //--------------------------------------------------------------------------- MetalProgram::~MetalProgram() @@ -284,6 +285,10 @@ of this software and associated documentation files (the "Software"), to deal "MetalProgram::analyzeRenderParameters" ); } shader->load(); + + if(shader->hasCompileError()) + return; + assert( dynamic_cast( shader->_getBindingDelegate() ) ); MetalProgram *vertexShader = static_cast( shader->_getBindingDelegate() ); autoFillDummyVertexAttributesForShader( vertexShader->getMetalFunction(), psd ); @@ -430,13 +435,11 @@ of this software and associated documentation files (the "Software"), to deal if( mType != GPT_COMPUTE_PROGRAM ) { - //You think this is a code smell? How about making BUILDconstantDefinitions const??? - //It's an oxymoron. - const_cast(this)->analyzeRenderParameters(); + analyzeRenderParameters(); } else { - const_cast(this)->analyzeComputeParameters(); + analyzeComputeParameters(); } mLogicalToPhysical.reset(); // disallow access by index for now