Disable pixel shader

Started by
14 comments, last by _the_phantom_ 11 years, 9 months ago
Nope. I just want to measure the processing time when pixel processing stage is disabled. [/quote]
gDEBugger does this, you can check the GL_GREMEDY_frame_terminator, GL_GREMEDY_string_marker and GL_ARB_debug_output extensions. Also you may want to check out the gDEBugger docs.
Advertisement

Nope. I just want to measure the processing time when pixel processing stage is disabled.


It sounds like you want to check whether your program is fragment shader bound.
In that case, just make ultra simple fragment shader and measure execution time.
Otherwise, glEnable(GL_RASTERIZER_DISCARD) is the way to disable fragment shaders execution.
Also, you could try to discard fragments in the fragment shader. It is, of course, meaningless, but maybe that will trigger some optimization in the drivers and totally eliminate FS.

[quote name='donguow' timestamp='1340634594' post='4952666']
Nope. I just want to measure the processing time when pixel processing stage is disabled.


It sounds like you want to check whether your program is fragment shader bound.
In that case, just make ultra simple fragment shader and measure execution time.
Otherwise, glEnable(GL_RASTERIZER_DISCARD) is the way to disable fragment shaders execution.
Also, you could try to discard fragments in the fragment shader. It is, of course, meaningless, but maybe that will trigger some optimization in the drivers and totally eliminate FS.
[/quote]
I did use this way. This happens before rasterization stage. I am now testing with discarding fragments. This way, of course, is not perfectly correct but giving pixel shader as little work as possible seems not a bad idea though.
I'm probably the worst GLSL programmer in the world , but why you don't try something like :


uniform int enabled;
void main ()
{
if (enabled)
{
RunMyPixelShaderTask();
}
}


? unsure.png


uniform int enabled;
void main ()
{
if (enabled)
{
RunMyPixelShaderTask();
}
}




It is possible to pass varying variables and attribute variables down to pixel shader but I don't think this works for functions. Anw, I still appreciate your idea
What I am doing now is as follows

void main ()
{
discard;
}

However, this, of course, can't give me accurate results.
As with your last thread on the subject the results are going to get are not going to be accurate; as I pointed out before ( http://www.gamedev.net/topic/626047-processing-time-at-vertex-shader/page__view__findpost__p__4947729 ) the only way you are going to get decent results is to the vendor supplied libraries or tools to time things.

More importantly; WHAT are you trying to do with this information?
Currently you are learning nothing useful what so ever...

This topic is closed to new replies.

Advertisement