Jump to content

  • Log In with Google      Sign In   
  • Create Account

donguow

Member Since 10 Jan 2012
Offline Last Active Nov 11 2012 12:21 AM

Posts I've Made

In Topic: Disable pixel shader

26 June 2012 - 02:18 AM

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.

In Topic: Disable pixel shader

25 June 2012 - 08:18 PM


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.

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.

In Topic: Disable pixel shader

25 June 2012 - 08:29 AM

What are you trying to achieve? Occlusion culling?

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

In Topic: Disable pixel shader

25 June 2012 - 07:21 AM

glCullFace won't let the data get into the rasterization stage, but in my case, I still want primitives to be processed at rasterization stage.

In Topic: Processing time at vertex shader

20 June 2012 - 05:53 PM

I think the concept of Unified Shader Model is about the hardware design. That is, the shader "execution unit" is not specialized for vertex shading and fragment shading, which allows for more flexible usage.


Agree

PARTNERS