[PATCH] glretrace: Add a new --stub-fs to stub out fragment shaders

José Fonseca jose.r.fonseca at gmail.com
Tue Aug 7 06:42:29 PDT 2012


On Mon, Aug 6, 2012 at 8:02 PM, Carl Worth <cworth at cworth.org> wrote:
> Eric Anholt <eric at anholt.net> writes:
>> Yeah, the simplification of the VS kills this idea.
>
> That's too bad. Is something that we could potentially in our
> implementation so that we at least have useful numbers in the
> short-term, (if not a general solution)? Or do you have a recommendation
> for something else to do here to get the numbers you want?
>
> José, you previously said:
>
>>> Another solution would be to setup vertex stream output to skip FS.
>
> Can you give me some small pointers to what would be entailed here?

Essentially you would use
http://www.opengl.org/registry/specs/EXT/transform_feedback.txt and
RASTERIZER_DISCARD_EXT , and replace glDraw calls by
glDrawTransformFeedback . This would allow to skip the fragment shader
without touching the fragment shader.

You might need to also setup a feedback buffer, where the vertices
would be written, to ensure that the driver wouldn't simply optimize
everything away. Writing to a feedback buffer would have some
overheads, but it should be proportional to the number of vertices,
not fragments.

This is a lot of work. But there would be a side benefit beyond
profiling -- this sort of transform feedback injection would allow us
to visualize the mesh being draw in qapitrace:
https://github.com/apitrace/apitrace/issues/2 -- so it is something we
wanna do eventually anyway.

But if the most urgent concern is profiling, then it'd probably be
better to aim directly at implementing more fine-grained profile
counters.

Jose


More information about the apitrace mailing list