Jump to content
  • Advertisement
Sign in to follow this  
lomateron

how do you check your code

This topic is 1669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

when you are going to write code to use the GPU mostly to calculate values that are not related to rendering images

And you have various different steps that depend on each other

what are ways that you have developed to check that every step works correctly

Share this post


Link to post
Share on other sites
Advertisement

Standard debugging applies to any code on the CPU.

To check parts of the GPU return the values you want to check as the final output color, take a screenshot, and check the RGBA values.

Be aware that negative number get clamped to black so you may want to add an offset to the outputs if negative values are possible.  Typically, OUT = VAL * 0.5 + 0.5.

 

 

L. Spiro

Share this post


Link to post
Share on other sites

I use pixwin. You can single step shaders.

 

The only problem with pixwin is that it emulates the GPU, so things that work in pixwin might not work in the real world.

 

However the things that tend to be emulated incorrectly are things like texture format compatibility rather than bugs in the emulation.

 

So you still need to know which texture formats are valid at any time, but for debugging it's great.

Share this post


Link to post
Share on other sites


when you are going to write code to use the GPU mostly to calculate values that are not related to rendering images

 

I think our friend is not using GPU to render images... so.. no shader related.

 

I am researching ( in my college end course ) some techniques about scientific calculations with GPU... 

 

I dont know which language/api are you using in your calculations, but, if you must audit the results, I mean, reproduce each step, the logic way is to generate some kind of log to audit it later...

 

Of course, there is some shader and GPU debug tools... I head something about AMD GPU PerfStudio ( http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio-2/ ) and AMD CodeXL for OpenCL ( http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/codexl/ )

 

I have never tested it... maybe it can help you...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!