mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +00:00
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:
committed by
Kai Ninomiya
parent
804fc749a0
commit
311e2a44b9
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user