[Mesa-dev] [PATCH] r600g: track whether we need to update the shaders

Jakob Bornecrantz wallbraker at gmail.com
Wed Oct 6 09:56:22 PDT 2010


On Wed, Oct 6, 2010 at 6:22 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> The shaders only depend on the shader itself and the vertex_elements state and we don't need to emit the registers again if these are not changed. Tracking is also faster than the
> memcmp in r600_shader_update, so in some cases that expensive check doesn't have to be performed. I also optimized that expensive check by only looping through the first count
> elements, as the other elements don't matter.

Instead of having separate bools for the dirty tracking why not use a
bitfield? Like so:

dirty |= R600_DIRTY_VS;
if (dirty & R600_DIRTY_VS)

then again if you only have two things to keep track of you might as
well use bools. Also bitfields doesn't seem to be used that much in
the radeon driver, they are more common in the svga and i915 drivers.

Cheers Jakob.


More information about the mesa-dev mailing list