Allow bind group layouts to be sparse in pipeline layout

Instead of initializing all of the bind group layouts in the pipeline
layout to default values, let them be nullptr and allow this elsewhere.

Follow-up on some changes in #206
This commit is contained in:
Kai Ninomiya
2018-06-29 18:22:02 -07:00
committed by Kai Ninomiya
parent 804fc749a0
commit 311e2a44b9
6 changed files with 10 additions and 14 deletions

View File

@@ -19,6 +19,7 @@
#include "backend/opengl/PersistentPipelineStateGL.h"
#include "backend/opengl/PipelineLayoutGL.h"
#include "backend/opengl/ShaderModuleGL.h"
#include "common/BitSetIterator.h"
#include <iostream>
#include <set>
@@ -125,7 +126,7 @@ namespace backend { namespace opengl {
const auto& layout = ToBackend(parent->GetLayout());
const auto& indices = layout->GetBindingIndexInfo();
for (uint32_t group = 0; group < kMaxBindGroups; ++group) {
for (uint32_t group : IterateBitSet(layout->GetBindGroupsLayoutMask())) {
const auto& groupInfo = layout->GetBindGroupLayout(group)->GetBindingInfo();
for (uint32_t binding = 0; binding < kMaxBindingsPerGroup; ++binding) {

View File

@@ -16,6 +16,7 @@
#include "backend/BindGroupLayout.h"
#include "backend/opengl/DeviceGL.h"
#include "common/BitSetIterator.h"
namespace backend { namespace opengl {
@@ -26,7 +27,7 @@ namespace backend { namespace opengl {
GLuint sampledTextureIndex = 0;
GLuint ssboIndex = 0;
for (size_t group = 0; group < kMaxBindGroups; ++group) {
for (uint32_t group : IterateBitSet(GetBindGroupsLayoutMask())) {
const auto& groupInfo = GetBindGroupLayout(group)->GetBindingInfo();
for (size_t binding = 0; binding < kMaxBindingsPerGroup; ++binding) {