0029810: Visualization - Tool for debugging shaders
authorasl <asl@opencascade.com>
Tue, 26 Feb 2019 10:56:03 +0000 (13:56 +0300)
committerapn <apn@opencascade.com>
Wed, 27 Feb 2019 16:54:26 +0000 (19:54 +0300)
commitd95f5ce102107487a3a7d17282cec8e9d5de54e0
tree87e70140ac73e724386e83ef4443fa563ad296f9
parent1e756cb9798b506d9f9cf6419e49a752764ce291
0029810: Visualization - Tool for debugging shaders

A new tool for debugging shaders has been introduced.
The new method OpenGl_ShaderProgram::UpdateDebugDump() allows dynamically
dumping/restoring certain shader program (vertex and fragment shaders) to/from external file.

The file name is generated from the program's name with suffix ".vs" or ".fs" for shader type.
The environment variable CSF_ShadersDirectoryDump specifies the folder for dumps.

If the file does not exist (first frame), then it is automatically saved.
When the file date/time is changed in comparison with recent cached date,
then the file will be automatically loaded from external file,
thus this file can be modified in any editor.

OpenGl_ShaderManager now generates a human-readable resource ids for standard GLSL programs.

Draw Harness command vshader has been extended with arguments -list,-dump and -reload
for debugging shaders within OpenGl_Context.
14 files changed:
src/Graphic3d/Graphic3d_ShaderProgram.hxx
src/OpenGl/OpenGl_ShaderManager.cxx
src/OpenGl/OpenGl_ShaderManager.hxx
src/OpenGl/OpenGl_ShaderObject.cxx
src/OpenGl/OpenGl_ShaderObject.hxx
src/OpenGl/OpenGl_ShaderProgram.cxx
src/OpenGl/OpenGl_ShaderProgram.hxx
src/OpenGl/OpenGl_View.hxx
src/OpenGl/OpenGl_View_Raytrace.cxx
src/Shaders/Declarations.glsl
src/Shaders/DeclarationsImpl.glsl
src/Shaders/Shaders_DeclarationsImpl_glsl.pxx
src/Shaders/Shaders_Declarations_glsl.pxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx