probe capture fixes

review of per and post bake protocols showed that the CAPTURING shader macro was not being properly recompiled in. as opengl was not playing nice with a simple batch shader recompilation for all effected shaders, a full lightmanager restart is at time of writing required. once we have a proper globally cached scene structure stored off GPU side, we'll want to change  GFXShader::addGlobalMacro("CAPTURING", String("1")); on over to dirtying that value in the cached buffer via setting a shader global uniform
review of prefilter examples shows a fixed sample count of 1024 across multiple implementations, so we'll use the standard barring further research into where that number is comming from for a scalar approach
review of gl shaders shows a doubleup in compiled state testing, so slimmed that down and added additional debugging reports
This commit is contained in:
AzaezelX 2023-12-05 13:32:03 -06:00
parent 97de2e6b60
commit 8c38448428
8 changed files with 104 additions and 30 deletions

View file

@ -1109,9 +1109,12 @@ bool GFXGLShader::initShader( const Torque::Path &file,
return false;
}
if ( !_loadShaderFromStream( activeShader, file, &stream, macros ) )
if (!_loadShaderFromStream(activeShader, file, &stream, macros))
{
if (smLogErrors)
Con::errorf("GFXGLShader::initShader - unable to load shader from stream: '%s'.", file.getFullPath().c_str());
return false;
}
GLint compile;
glGetShaderiv(activeShader, GL_COMPILE_STATUS, &compile);
@ -1119,17 +1122,13 @@ bool GFXGLShader::initShader( const Torque::Path &file,
U32 logLength = 0;
glGetShaderiv(activeShader, GL_INFO_LOG_LENGTH, (GLint*)&logLength);
GLint compileStatus = GL_TRUE;
if ( logLength )
{
FrameAllocatorMarker fam;
char* log = (char*)fam.alloc(logLength);
glGetShaderInfoLog(activeShader, logLength, NULL, log);
// Always print errors
glGetShaderiv( activeShader, GL_COMPILE_STATUS, &compileStatus );
if ( compileStatus == GL_FALSE )
if (compile == GL_FALSE )
{
if ( smLogErrors )
{
@ -1141,7 +1140,7 @@ bool GFXGLShader::initShader( const Torque::Path &file,
Con::warnf( "Program %s: %s", file.getFullPath().c_str(), log );
}
return compileStatus != GL_FALSE;
return compile != GL_FALSE;
}
/// Returns our list of shader constants, the material can get this and just set the constants it knows about