Remove kMaxBindingsPerGroup limit

kMaxBindingsPerGroup is not a real WebGPU limit. Code in Dawn that
uses it now uses dynamically sized vectors, optimistic stack_vecs or
a different limit like kMaxDynamicBuffersPerPipelineLayout.

The CL introduces kMaxOptimalBindingsPerGroup=32 which is used to size
the static portion of stack_vecs, but the value is tentative.

Bug: dawn:443
Change-Id: I08e06bed6531bed8b4365f36cf2fc0579ac5f180
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23502
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Austin Eng
2020-07-14 22:20:35 +00:00
committed by Commit Bot service account
parent 8b441db771
commit b31f5e717e
25 changed files with 257 additions and 106 deletions

View File

@@ -36,10 +36,6 @@ namespace dawn_native { namespace opengl {
const PipelineLayout* layout,
const PerStage<const ShaderModule*>& modules);
using BindingLocations = ityp::array<BindGroupIndex,
ityp::array<BindingIndex, GLint, kMaxBindingsPerGroup>,
kMaxBindGroups>;
// For each unit a sampler is bound to we need to know if we should use filtering or not
// because int and uint texture are only complete without filtering.
struct SamplerUnit {

View File

@@ -30,6 +30,7 @@ namespace dawn_native { namespace opengl {
for (BindGroupIndex group : IterateBitSet(GetBindGroupLayoutsMask())) {
const BindGroupLayoutBase* bgl = GetBindGroupLayout(group);
mIndexInfo[group].resize(bgl->GetBindingCount());
for (BindingIndex bindingIndex{0}; bindingIndex < bgl->GetBindingCount();
++bindingIndex) {

View File

@@ -18,6 +18,7 @@
#include "dawn_native/PipelineLayout.h"
#include "common/ityp_array.h"
#include "common/ityp_vector.h"
#include "dawn_native/BindingInfo.h"
#include "dawn_native/opengl/opengl_platform.h"
@@ -30,9 +31,7 @@ namespace dawn_native { namespace opengl {
PipelineLayout(Device* device, const PipelineLayoutDescriptor* descriptor);
using BindingIndexInfo =
ityp::array<BindGroupIndex,
ityp::array<BindingIndex, GLuint, kMaxBindingsPerGroup>,
kMaxBindGroups>;
ityp::array<BindGroupIndex, ityp::vector<BindingIndex, GLuint>, kMaxBindGroups>;
const BindingIndexInfo& GetBindingIndexInfo() const;
GLuint GetTextureUnitsUsed() const;