[Mesa-dev] [PATCH 13/18] anv/pass: Store subpass attachment reference list
Nanley Chery
nanleychery at gmail.com
Tue Feb 28 17:34:28 UTC 2017
On Tue, Feb 28, 2017 at 09:28:15AM -0800, Jason Ekstrand wrote:
> On Tue, Feb 28, 2017 at 8:48 AM, Nanley Chery <nanleychery at gmail.com> wrote:
>
> > On Mon, Feb 27, 2017 at 09:22:13PM -0800, Jason Ekstrand wrote:
> > > On Feb 27, 2017 5:21 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:
> > >
> > > We'll loop through this array when performing automatic layout
> > > transitions.
> > >
> > > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > > ---
> > > src/intel/vulkan/anv_pass.c | 6 +++++-
> > > src/intel/vulkan/anv_private.h | 7 +++++++
> > > 2 files changed, 12 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c
> > > index 5bd205d2f0..9d7fa7f83a 100644
> > > --- a/src/intel/vulkan/anv_pass.c
> > > +++ b/src/intel/vulkan/anv_pass.c
> > > @@ -86,9 +86,11 @@ VkResult anv_CreateRenderPass(
> > > const VkSubpassDescription *desc = &pCreateInfo->pSubpasses[i];
> > >
> > > subpass_attachment_count +=
> > > + pass->subpasses[i].attachment_count =
> > > desc->inputAttachmentCount +
> > > desc->colorAttachmentCount +
> > > - (desc->pResolveAttachments ? desc->colorAttachmentCount : 0);
> > > + (desc->pResolveAttachments ? desc->colorAttachmentCount : 0) +
> > > + (desc->pDepthStencilAttachment != NULL);
> > > }
> > >
> > > pass->subpass_attachments =
> > > @@ -108,6 +110,7 @@ VkResult anv_CreateRenderPass(
> > >
> > > subpass->input_count = desc->inputAttachmentCount;
> > > subpass->color_count = desc->colorAttachmentCount;
> > > + subpass->attachments = p;
> > >
> > > if (desc->inputAttachmentCount > 0) {
> > > subpass->input_attachments = p;
> > > @@ -169,6 +172,7 @@ VkResult anv_CreateRenderPass(
> > >
> > > if (desc->pDepthStencilAttachment) {
> > > uint32_t a = desc->pDepthStencilAttachment->attachment;
> > > + *p++ =
> > >
> > >
> > > Something looks funny about this line. I could easily believe its
> > correct
> > > but it should probably be indented differently or something.
> > >
> >
> > I could indent the line below it, or place it on the same line if you'd
> > like. I originally wanted to keep the patch diff small.
> >
>
> I get that but, as it is, it looks like a typo. Will it all fit on one
> line? If not, I think I'd rather have the two things being assigned on the
> same line and the thing being assigned on it's own if we have to wrap.
>
Yeah, it does look strange. I was wrong, it won't all fit on the same
line. I'll opt for your second option.
-Nanley
>
> >
> > -Nanley
> >
> > > subpass->depth_stencil_attachment = *desc->
> > > pDepthStencilAttachment;
> > > if (a != VK_ATTACHMENT_UNUSED) {
> > > pass->attachments[a].usage |=
> > > diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_
> > private.h
> > > index 6e274a5a3a..7fba4e92b8 100644
> > > --- a/src/intel/vulkan/anv_private.h
> > > +++ b/src/intel/vulkan/anv_private.h
> > > @@ -1825,6 +1825,13 @@ struct anv_framebuffer {
> > > };
> > >
> > > struct anv_subpass {
> > > + uint32_t attachment_count;
> > > +
> > > + /**
> > > + * A pointer to all attachment references used in this subpass.
> > > + * Only valid if ::attachment_count > 0.
> > > + */
> > > + VkAttachmentReference * attachments;
> > > uint32_t input_count;
> > > VkAttachmentReference * input_attachments;
> > > uint32_t color_count;
> > > --
> > > 2.11.1
> > >
> > > _______________________________________________
> > > mesa-dev mailing list
> > > mesa-dev at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
More information about the mesa-dev
mailing list