Opened 10 years ago

Last modified 10 years ago

#99 new defect

Provide way to have glValidateProgram called when activating a shader

Reported by: allenb Owned by: unassigned
Priority: major Milestone: 2.0 Beta
Component: System Version: 2.0
Keywords: Cc:

Description

glValidateProgram can provide additional debugging information when a shader fails to work. It would be nice if OpenSG provided a way to call this method immediately before shader activation so developers could use this for debugging.

We can't just add this into the code right now because it has a performance hit and should not be used at all times. It should only be used when in "debugging" mode or something like that. This type of thing may make sense in other contexts as well to aid in debugging. Maybe we could add a system-wide debug-mode flag that when enabled would tell OpenSG to collect as much debugging information as possible while rendering. ex: collecting GL errors more frequently, checking for valid input to rendering methods, etc...

Change History (2)

comment:1 follow-up: Changed 10 years ago by dirk

That's already happening. If OSG_DEBUG is set there are a lot more glGetError's being called. We could add glValidateProgram to that and just pipe it through FDEBUG.

Have you actually run it to see what the typical output is?

comment:2 in reply to: ↑ 1 Changed 10 years ago by allenb

Replying to dirk:

That's already happening. If OSG_DEBUG is set there are a lot more glGetError's being called. We could add glValidateProgram to that and just pipe it through FDEBUG.

Have you actually run it to see what the typical output is?

The documentation for it suggests that you may not want to do this by default when OSG_DEBUG is defined because it could impact performance quite a bit. I guess what I am proposing is something beyond OSG_DEBUG that allows developers to dynamically enable a "paranoid" mode or something that will perform checks well beyond the norm that could have significant impact on performance. I know I for one would like the debug libraries to still perform reasonably well during standard development and I don't want to do heavy weight checking at all times.

I have not run it to see the typical output.

Note: See TracTickets for help on using tickets.