[Mesa-dev] [PATCH] anv: Fix a harmless overflow warning

Jason Ekstrand jason at jlekstrand.net
Wed Jun 15 19:18:52 UTC 2016


On Wed, Jun 15, 2016 at 12:16 PM, Jason Ekstrand <jason at jlekstrand.net>
wrote:

>
>
> On Wed, Jun 15, 2016 at 10:34 AM, Chad Versace <chad.versace at intel.com>
> wrote:
>
>> On Tue 14 Jun 2016, Jason Ekstrand wrote:
>> > On Jun 14, 2016 4:23 PM, "Chad Versace" <chad.versace at intel.com> wrote:
>> > >
>> > > anv_pipeline_binding::index is a uint8_t, but some code assigned to it
>> > > UINT16_MAX.
>> > > ---
>> > >  src/intel/vulkan/anv_pipeline.c | 2 +-
>> > >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > >
>> > > diff --git a/src/intel/vulkan/anv_pipeline.c
>> > b/src/intel/vulkan/anv_pipeline.c
>> > > index 60b7c6b..b41e11e 100644
>> > > --- a/src/intel/vulkan/anv_pipeline.c
>> > > +++ b/src/intel/vulkan/anv_pipeline.c
>> > > @@ -664,7 +664,7 @@ anv_pipeline_compile_fs(struct anv_pipeline
>> *pipeline,
>> > >           rt_bindings[0] = (struct anv_pipeline_binding) {
>> > >              .set = ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS,
>> > >              .binding = 0,
>> > > -            .index = UINT16_MAX,
>> > > +            .index = UINT8_MAX,
>> >
>> > I believe we have a descriptive #define specifically for render targets.
>> > Probably better to use that.
>>
>> What #define did you have in mind? The only relevant one I found was
>>
>>   #define MAX_RTS 8
>>
>
> ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS
>
> Sorry I didn't give it to you last night, I was looking at patches from my
> phone.
> --Jason
>

Wait... Never mind.  We need to add a new one probably.  Or UINT8_MAX works
too.  Really, it just needs to be a value that fails the binding->index <
subpass->color_count check in anv_cmd_buffer.c:815.  Sorry for the noise.
--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160615/d1f39808/attachment.html>


More information about the mesa-dev mailing list