View Full Version : debug fragment/vertex programs
03-25-2004, 11:40 AM
Does anyone know how to debug asm vertex or fragment programs? thanks!
03-25-2004, 01:16 PM
You can debug vertex programs on a Macintosh -- there is a tool called "OpenGL Shader Builder" which lets you step through the shader instruction-by-instruction.
The only way I've found to debug a fragment program is to stop it part-way through processing and output an intermediate result as the color. Then, based on the color, you can get some idea of what kinds of values you have. Very, very tedious, though.
03-26-2004, 03:41 PM
The only addition I have to OneSadCookie's post is that you may want to use floating point render targets(only pbuffers for now) while 'debugging' instead of your regular 32bit framebuffer. The reason for this is clamping. The floating point buffer doesn't clamp[0.0-1.0] color values, which can really help at times. However, if your intermediate values are always in the [0-1] range using an fp buffer wont help much.
When I debug shader code I usually use blocks like these:
// fp_pbuffer.disable()And just enable the fp pbuffer when I need to debug the shader.
03-29-2004, 02:28 AM
There's also some debugging capabaility in Mesa, see
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.