[Mesa-dev] [PATCH] radeonsi: add flexible shader descriptor management and use it for sampler views
Christian König
deathsimple at vodafone.de
Thu Aug 15 05:25:13 PDT 2013
Am 15.08.2013 12:54, schrieb Marek Olšák:
> On Thu, Aug 15, 2013 at 10:27 AM, Christian König
> <deathsimple at vodafone.de> wrote:
>> Am 15.08.2013 05:25, schrieb Marek Olšák:
>>
>>> (This should be applied before MSAA, which will need to be rebased.)
>>>
>>> It moves all sampler view descriptors to a buffer.
>>> It supports partial resource updates and it can also unbind resources
>>> (required for FMASK texturing).
>>>
>>> The buffer contains all sampler view descriptors for one shader stage,
>>> represented as an array. On top of that, there are N arrays in the buffer,
>>> which are used to emulate context registers as implemented by the previous
>>> ASICs (each array is a context).
>>>
>>> This uses the RCU synchronization approach to avoid read-after-write
>>> hazards
>>> as discussed in the thread:
>>> "radeonsi: add FMASK texture binding slots and resource setup"
>>>
>>> CP DMA is used to clear the descriptors at context initialization and to
>>> copy
>>> the descriptors from one context to the next.
>>>
>>> IMPORTANT:
>>> 128 resource contexts are needed, 64 doesn't work. If I set
>>> SH_KCACHE_ACTION_ENA before every draw call, only 2 contexts are
>>> needed.
>>> I don't have an explanation for this.
>>> ---
>>
>> The idea itself looks really good to me, but we should probably also move
>> the all resources and samplers to the new model and then rip out the code
>> that stores them directly into the IB.
> I'd like MSAA to land first, but yes, the plan is to eventually move
> all resources and samplers to the new model.
Sounds good.
>>
>>
>> Can we use some kind of macro or inline function instead of
>> "cs->buf[cs->cdw++] " ? That should help of we need to port that over to a
>> different CS mechanism.
> How about this?
>
> static INLINE void
> r600_write_value(struct radeon_winsys_cs *cs, unsigned value)
> {
> cs->buf[cs->cdw++] = value;
> }
I would name it more like radeon_emit(cs, value) and put it in
radeon_winsys.h, but yeah that's the general idea.
Christian.
More information about the mesa-dev
mailing list