[Mesa-dev] [PATCH] gallium/u_transfer_helper: do not call resource_create(..) directly

Eric Anholt eric at anholt.net
Thu Mar 14 22:24:27 UTC 2019


Rob Clark <robdclark at gmail.com> writes:

> On Thu, Mar 14, 2019 at 3:35 PM Eric Anholt <eric at anholt.net> wrote:
>>
>> Rob Clark <robdclark at gmail.com> writes:
>>
>> > On Fri, Mar 1, 2019 at 10:54 AM Christian Gmeiner
>> > <christian.gmeiner at gmail.com> wrote:
>> >>
>> >> Use u_transfer_helper_resource_create(..) instead which uses the
>> >> resource_create(..) function specified in u_transfer_vtbl.
>> >>
>> >> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
>> >> ---
>> >>  src/gallium/auxiliary/util/u_transfer_helper.c | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c b/src/gallium/auxiliary/util/u_transfer_helper.c
>> >> index 14c4d56392d..a5c3c026e71 100644
>> >> --- a/src/gallium/auxiliary/util/u_transfer_helper.c
>> >> +++ b/src/gallium/auxiliary/util/u_transfer_helper.c
>> >> @@ -182,7 +182,7 @@ transfer_map_msaa(struct pipe_context *pctx,
>> >>           .depth0 = 1,
>> >>           .array_size = 1,
>> >>     };
>> >> -   trans->ss = pscreen->resource_create(pscreen, &tmpl);
>> >> +   trans->ss = u_transfer_helper_resource_create(pscreen, &tmpl);
>> >
>> >
>> > So I *think* the thinking here was to use pscreen->resource_create()
>> > in case there are multiple things the transfer-helper has to deal
>> > with, like MSAA+RGTC..
>> >
>> > (I can't guarantee that actually works.. but that was the reasoning..)
>>
>> So, I believe that pscreen->resource_create should be set to
>> u_transfer_helper_resource_create if you're using u_transfer_helper.
>> freedreno, v3d, iris, panfrost all do this.  vc4 doesn't but that's just
>> a bug that doesn't matter becuase it doesn't do rgtc or z32fs8.
>>
>> If you've wrapped something around pscreen->resource_create's call of
>> u_transfer_helper_resource_create for some reason, then I think you'd
>> still want to have that called from the MSAA map path.
>
> Ahh, good point.. so I guess this change should be fine.  Although
> also not entirely clear about what it is fixing?

What I'm saying is I think the unpatched code is actually best, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190314/f85d4f4f/attachment.sig>


More information about the mesa-dev mailing list