[Mesa-dev] [PATCH 1/2] nvc0: clear out surfaces bufctx before rebinding everything
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu May 19 19:44:12 UTC 2016
On 05/19/2016 12:02 PM, Pierre Moreau wrote:
> On 09:28 PM - May 18 2016, Ilia Mirkin wrote:
>> Otherwise we can end up in a situation where that bin just grows and
>> grows.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>> src/gallium/drivers/nouveau/nvc0/nvc0_tex.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
>> index cc5ea5e..2523c20 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
>> @@ -963,6 +963,11 @@ nvc0_validate_suf(struct nvc0_context *nvc0, int s)
>> struct nouveau_pushbuf *push = nvc0->base.pushbuf;
>> struct nvc0_screen *screen = nvc0->screen;
>>
>> + if (s == 5)
>
> This is not specific to this patch, but after seeing various patches with a
> special case for `s == 5`, wouldn’t it make sense to have a define for that
> index, both to make it a bit clearer to the reader why it is handled
> differently, and to avoid typos? Same with having a define for the number of
> surfaces (both 3D and CP) and another one for the number of 3D surfaces (or any
> other method to avoid looping too many or too few times due to a typo)?
Yep, we should replace those magic numbers with
nvc0_shader_stage(PIPE_SHADER_COMPUTE) or something.
I plan to do that after images (to avoid conflicts).
>
>> + nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_SUF);
>> + else
>> + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_SUF);
>> +
>> for (int i = 0; i < NVC0_MAX_IMAGES; ++i) {
>> struct pipe_image_view *view = &nvc0->images[s][i];
>> int width, height, depth;
>> --
>> 2.7.3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list