On Tue, Jan 24, 2017 at 12:56 AM, Iago Toral <ito...@igalia.com> wrote:

> On Mon, 2017-01-23 at 14:12 -0800, Jason Ekstrand wrote:
> > As of VK_KHR_maintenance1, these are supposed to be reported for any
> > formats on which we support transfer operations.  For us, this is
> > anything that we can texture from.
> > ---
> >  src/intel/vulkan/anv_formats.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/intel/vulkan/anv_formats.c
> > b/src/intel/vulkan/anv_formats.c
> > index a5d783e..39001d6 100644
> > --- a/src/intel/vulkan/anv_formats.c
> > +++ b/src/intel/vulkan/anv_formats.c
> > @@ -348,6 +348,11 @@ get_image_format_properties(const struct
> > gen_device_info *devinfo,
> >     if (base == ISL_FORMAT_R32_SINT || base == ISL_FORMAT_R32_UINT)
> >        flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
> >
> > +   if (flags) {
> > +      flags |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
> > +               VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
> > +   }
> > +
>
> I guess it does not matter, but just in case: if we want to report
> these flags only for formats we can texture from, shouldn't we add this
> hunk right after the block that starts with:
>
> if (isl_format_supports_sampling(...)) {
> ...
> }
>
> In other words, I suppose the checks we have below that can't possibly
> set flags for any formats we can't texture from, right?
>

Yes, texturing should be a strict superset of all of the other checks so
putting it there would be equivalent.  I chose to do it this way because
the idea is that if we support any image operations at all on the format,
then we support blitting.

That said... This reminds me that we should also return
TRANSFER_SRC/DST_BIT for buffer formats.


> >     return flags;
> >  }
> >
> > @@ -393,7 +398,9 @@ anv_physical_device_get_format_properties(struct
> > anv_physical_device *physical_d
> >           tiled |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
> >
> >        tiled |= VK_FORMAT_FEATURE_BLIT_SRC_BIT |
> > -               VK_FORMAT_FEATURE_BLIT_DST_BIT;
> > +               VK_FORMAT_FEATURE_BLIT_DST_BIT |
> > +               VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
> > +               VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
> >     } else {
> >        struct anv_format linear_fmt, tiled_fmt;
> >        linear_fmt = anv_get_format(&physical_device->info, format,
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to