[Mesa-dev] [PATCH 3/3] i965: Make INTEL_DEBUG=shader_time use the RAW surface format.
eric at anholt.net
Thu Feb 7 09:50:46 PST 2013
Kenneth Graunke <kenneth at whitecape.org> writes:
> Untyped Atomic Operation messages are illegal for non-RAW formats.
> I have no idea why it worked before; the documentation claims it
> shouldn't be allowed and the simulator enforces it.
> Some arithmetic sleight of hand happens in this patch:
> Previously, we allocated a R32G32B32A32 buffer. However, atomic
> operations only access the first DWord (the 'R' channel). Thus, we
> multiplied all of our offsets (measured in DWords) by 4 to skip over
> the other three channels.
> Now, we allocate a single component (effectively R32) buffer,
> eliminating the wasted space. Using the RAW format means that our
> offsets must be measured in bytes (and must be DWord-aligned). This
> means that the multiplication by 4 is still necessary. However, instead
> of skipping over the BGA components, it converts DWords to bytes.
> We ought to change the size of the buffer, but I'm pretty sure it was
> just wrong before: brw->shader_time.bo->size is measured in bytes, so
> we were allocating it too large in the past.
Hmm. Actually, since we're dealing with atomic ops here, we might be
able to reduce our overhead by separating each dword by a cacheline
(reducing traffic between, say, the VS and FS). Or possibly do even
better by using the TID and EUID out of sr0 to have unique locations per
shader per instantiated thread and skip atomic operations entirely.
Packing things tighter doesn't seem like a good idea to me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: not available
More information about the mesa-dev