[Mesa-dev] [PATCH 1/3] i965: Use intel_get_image_dims in alloc_texture_storage
Jason Ekstrand
jason at jlekstrand.net
Tue Jul 19 15:26:09 UTC 2016
On Tue, Jul 19, 2016 at 7:20 AM, Jason Ekstrand <jason at jlekstrand.net>
wrote:
>
>
> On Tue, Jul 19, 2016 at 5:56 AM, Iago Toral <itoral at igalia.com> wrote:
>
>> On Mon, 2016-07-18 at 22:16 -0700, Jason Ekstrand wrote:
>> > The intel_get_image_dims helper function handles some image dimension
>> > sanitization for us for things such as 1-D array textures. We should
>> > probably be using it here.
>> >
>> > Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
>> > Cc: "12.0 11.2 11.1" <mesa-stable at lists.freedesktop.org>
>> > ---
>> > src/mesa/drivers/dri/i965/intel_tex.c | 2 ++
>> > 1 file changed, 2 insertions(+)
>> >
>> > diff --git a/src/mesa/drivers/dri/i965/intel_tex.c
>> > b/src/mesa/drivers/dri/i965/intel_tex.c
>> > index 8c32fe3..d3e24f4 100644
>> > --- a/src/mesa/drivers/dri/i965/intel_tex.c
>> > +++ b/src/mesa/drivers/dri/i965/intel_tex.c
>> > @@ -141,6 +141,8 @@ intel_alloc_texture_storage(struct gl_context
>> > *ctx,
>> > !intel_miptree_match_image(intel_texobj->mt, first_image) ||
>> > intel_texobj->mt->last_level != levels - 1) {
>> > intel_miptree_release(&intel_texobj->mt);
>> > +
>> > + intel_get_image_dims(first_image, &width, &height, &depth);
>>
>> I don't think we want this. This code calls intel_miptree_create below,
>> which then calls miptree_create and that
>> calls intel_miptree_create_layout, which has this code:
>>
>> if (target == GL_TEXTURE_1D_ARRAY) {
>> /* ... */
>> assert(height0 == 1 || depth0 == 1);
>> if (height0 > 1) {
>> depth0 = height0;
>> height0 = 1;
>> }
>> }
>>
>
> Are you serious????? "1-D Arrays are hard. Let's just make sure it works
> in either case". Wow...
>
> I'll see if I can't delete that code.
>
Ok, I just sent out a v2 that deletes that bit of magic and hackery.
>
> --Jason
>
>
>>
>> Maybe we should just call the function in intel_miptree_create_layout
>> instead?
>>
>> Iago
>>
>> > intel_texobj->mt = intel_miptree_create(brw, texobj->Target,
>> > first_image-
>> > >TexFormat,
>> > 0, levels - 1,
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160719/d8cf03f4/attachment.html>
More information about the mesa-dev
mailing list