[Mesa-dev] [PATCH] clover: fix image resource depth and array_size

Zoltán Gilián zoltan.gilian at gmail.com
Mon Aug 3 04:36:03 PDT 2015


> Any reason you didn't fix this other branch to do the same?  Or maybe
> just init it to one after the if?

I've only observed problems with images if that line is missing (the
surface is rejected because of 0 buffer size), but it makes sense to
set the array_size outside the if.


On Mon, Aug 3, 2015 at 1:31 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> Zoltan Gilian <zoltan.gilian at gmail.com> writes:
>
>> ---
>>  src/gallium/state_trackers/clover/core/memory.cpp   | 2 +-
>>  src/gallium/state_trackers/clover/core/resource.cpp | 1 +
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp
>> index 055336a..b852e68 100644
>> --- a/src/gallium/state_trackers/clover/core/memory.cpp
>> +++ b/src/gallium/state_trackers/clover/core/memory.cpp
>> @@ -189,7 +189,7 @@ image2d::image2d(clover::context &ctx, cl_mem_flags flags,
>>                   const cl_image_format *format, size_t width,
>>                   size_t height, size_t row_pitch,
>>                   void *host_ptr) :
>> -   image(ctx, flags, format, width, height, 0,
>> +   image(ctx, flags, format, width, height, 1,
>>           row_pitch, 0, height * row_pitch, host_ptr) {
>>  }
>>
>> diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
>> index 78ebafb..9e2bffe 100644
>> --- a/src/gallium/state_trackers/clover/core/resource.cpp
>> +++ b/src/gallium/state_trackers/clover/core/resource.cpp
>> @@ -126,6 +126,7 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj,
>>        info.width0 = img->width();
>>        info.height0 = img->height();
>>        info.depth0 = img->depth();
>> +      info.array_size = 1;
>>     } else {
>>        info.width0 = obj.size();
>>        info.height0 = 1;
>
> Any reason you didn't fix this other branch to do the same?  Or maybe
> just init it to one after the if?  With that fixed:
>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
>
>> --
>> 2.4.6


More information about the mesa-dev mailing list