[Mesa-dev] [PATCH 2/2] anv/pipeline: Set the correct binding count for compute shaders

Kenneth Graunke kenneth at whitecape.org
Wed Feb 14 18:07:28 UTC 2018


On Wednesday, February 14, 2018 8:28:54 AM PST Jason Ekstrand wrote:
> On Tue, Feb 13, 2018 at 11:06 PM, Kenneth Graunke <kenneth at whitecape.org>
> wrote:
> 
> > On Monday, February 12, 2018 7:35:05 PM PST Jason Ekstrand wrote:
> > > ---
> > >  src/intel/vulkan/genX_pipeline.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_
> > pipeline.c
> > > index 45ebe31..4aee9ec 100644
> > > --- a/src/intel/vulkan/genX_pipeline.c
> > > +++ b/src/intel/vulkan/genX_pipeline.c
> > > @@ -1836,7 +1836,7 @@ compute_pipeline_create(
> > >        .KernelStartPointer     = cs_bin->kernel.offset,
> > >
> > >        .SamplerCount           = get_sampler_count(cs_bin),
> > > -      .BindingTableEntryCount = get_binding_table_entry_count(cs_bin),
> > > +      .BindingTableEntryCount = 1 + MIN2(cs_bin->bind_map.surface_count,
> > 30),
> > >        .BarrierEnable          = cs_prog_data->uses_barrier,
> > >        .SharedLocalMemorySize  =
> > >           encode_slm_size(GEN_GEN, cs_prog_data->base.total_shared),
> > >
> >
> > Shouldn't this be MIN2(cs_bin->bind_map.surface_count, 31)?  It's simply
> > a U5 value, not a U5-1 value...and says there are a maximum of 31 things
> > that can be prefetched.
> >
> 
> I'm adding 1 for the indirect parameters buffer.

Ah.  A comment would be nice.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

> > While we're here, I don't understand why get_binding_table_entry_count
> > is DIV_ROUND_UP(bin->bind_map.surface_count, 32)...the docs for
> > 3DSTATE_VS indicate that it's simply a 0..255 value.
> >
> 
> Uh... I'm not sure.  I know I had a reason but maybe it's now bogus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180214/f984b276/attachment.sig>


More information about the mesa-dev mailing list