Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1809,8 +1809,9 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep( const Rig

if ( !resultLoadingSuccess )
{
// Error logging
CAF_ASSERT( false );
// A result present in the meta data can still fail to load from file. This is a run-time condition, not a
// programming error, so report it instead of asserting.
RiaLogging::error( QString( "Failed to load result '%1' for time step %2" ).arg( resultName ).arg( timeStepIndex ).toStdString() );
}
}

Expand Down
8 changes: 8 additions & 0 deletions Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ void RenderStateTextureBindings::applyOpenGL(OpenGLContext* oglContext) const
const Sampler* sampler = m_bindings[i].sampler.p();
CVF_ASSERT(texture && sampler);

// Texture setup in setupTextures() can fail at run-time, leaving the texture without a valid OpenGL id.
// Skip the binding in that case, as Texture::bind() asserts on an invalid id.
if (texture->textureOglId() == 0)
{
CVF_LOG_RENDER_ERROR(oglContext, "Skipping texture binding, texture has not been set up.");
continue;
}

cvfGL->glActiveTexture(static_cast<GLenum>(GL_TEXTURE0 + i));

texture->bind(oglContext);
Expand Down