Do not abort on failed texture setup and failed result loading - #14548
Merged
Conversation
RenderStateTextureBindings::setupTextures() ignores the return value of Texture::setupTexture(). When setup fails, the texture is deleted and left without a valid OpenGL id, but applyOpenGL() still calls Texture::bind(), where CVF_ASSERT on the id aborts the application. Skip bindings without a valid texture id and log a render error instead.
findOrLoadKnownScalarResultForTimeStep asserted when the reader failed to load a result. A result listed in the meta data that cannot be read from file is a run-time condition, not a programming error, and aborted the application in builds with asserts enabled. Report the failing result name and time step through RiaLogging instead.
kriben
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two crashes from the crash telemetry registry, both caused by an assert firing on a run-time condition rather than a programming error.
Problem
cvf::Texture::bind—RenderStateTextureBindings::setupTextures()ignores theboolreturned byTexture::setupTexture(). When setup fails,setupTexture()deletes the texture and the OpenGL id stays 0.applyOpenGL()then callsTexture::bind()regardless, whereCVF_ASSERT(OglRc::safeOglId(...) != 0)aborts the application. VizFwk asserts are active in release builds, so a failed texture setup kills the running session.RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep— the function asserted when the reader failed to return a result. A result listed in the meta data that cannot be read from file is a legitimate run-time condition (bad or truncated data), not a programming error. The// Error loggingcomment shows logging was the intent.Fix
Skip texture bindings that have no valid OpenGL id and emit
CVF_LOG_RENDER_ERROR, matching how the same file already handles unsupported contexts. Rendering degrades instead of terminating.Replace the assert on failed result loading with a
RiaLogging::errornaming the result and time step. The three otherCAF_ASSERT( false )inRigCaseCellResultsDataguard genuinely unreachable branches and are unchanged.Both targets build clean. No unit tests: the texture path needs a live OpenGL context, and the result-loading path needs a reader stub that fails mid-load, where the change is error reporting rather than a behaviour fix.
Call stack
cvf::Texture::bind:RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep: