[Mesa-dev] [PATCH] i965/vs: Fix DEBUG_SHADER_TIME when VS terminates with 2 URB writes.

Ian Romanick idr at freedesktop.org
Mon Apr 8 15:00:21 PDT 2013


On 04/08/2013 11:17 AM, Paul Berry wrote:
> On 8 April 2013 10:37, Ian Romanick <idr at freedesktop.org
> <mailto:idr at freedesktop.org>> wrote:
>
>     On 04/07/2013 06:42 AM, Paul Berry wrote:
>
>         The call to emit_shader_time_end() before the second URB write was
>         conditioned with "if (eot)", but eot is always false in this code
>         path, so emit_shader_time_end() was never being called for vertex
>         shaders that performed 2 URB writes.
>
>
>     I had to look at that code for way to long to convince myself that
>     your patch was correct.  I think it might be better to remove both
>     the conditional emit_shader_time_end calls and put this block of
>     code at the very bottom (unless emit_shader_time_end has some side
>     effect that I don't see):
>
>         if (inst->eot) {
>            if (INTEL_DEBUG & DEBUG_SHADER_TIME)
>               emit_shader_time_end();
>         }
>
>     Or does the last URB write have to be the last instruction?
>
>
> The last URB write has to be the last instruction, since it's actually
> the URB write that ends the thread ("eot" stands for "end of thread").

I suspected it was something like that.

> For GL 3.2 we're going to need to refactor this function to use a loop,
> since GL 3.2 doubles the number of varying components permitted for
> VS->GS linkage (so we'll need up to 4 URB writes instead of 2).  I think
> once that change is made the function is going to be a lot easier to
> follow.  Maybe I should just do that refactor now?

It's up to you.  I think the code in your patch is okay for now.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>



More information about the mesa-dev mailing list