#include "dawn/native/BindGroupLayoutInternal.h"
#include <algorithm>
#include <functional>
#include <limits>
#include <list>
#include <set>
#include <string>
#include <vector>
#include "dawn/common/BitSetIterator.h"
#include "dawn/common/Enumerator.h"
#include "dawn/common/MatchVariant.h"
#include "dawn/native/ChainUtils.h"
#include "dawn/native/Device.h"
#include "dawn/native/Instance.h"
#include "dawn/native/ObjectBase.h"
#include "dawn/native/ObjectContentHasher.h"
#include "dawn/native/ObjectType_autogen.h"
#include "dawn/native/PerStage.h"
#include "dawn/native/Sampler.h"
#include "dawn/native/ValidationUtils_autogen.h"
namespace dawn::native {
namespace {
MaybeError ValidateStorageTextureFormat(DeviceBase* device,
wgpu::TextureFormat storageTextureFormat,
wgpu::StorageTextureAccess access) { … }
MaybeError ValidateStorageTextureViewDimension(wgpu::TextureViewDimension dimension) { … }
MaybeError ValidateBindGroupLayoutEntry(DeviceBase* device,
const UnpackedPtr<BindGroupLayoutEntry>& entry,
bool allowInternalBinding) { … }
BindGroupLayoutEntry CreateSampledTextureBindingForExternalTexture(uint32_t binding,
wgpu::ShaderStage visibility) { … }
BindGroupLayoutEntry CreateUniformBindingForExternalTexture(uint32_t binding,
wgpu::ShaderStage visibility) { … }
struct UnpackedExpandedBglEntries { … };
UnpackedExpandedBglEntries ExtractAndExpandBglEntries(
const BindGroupLayoutDescriptor* descriptor,
BindingCounts* bindingCounts,
ExternalTextureBindingExpansionMap* externalTextureBindingExpansions) { … }
}
MaybeError ValidateBindGroupLayoutDescriptor(DeviceBase* device,
const BindGroupLayoutDescriptor* descriptor,
bool allowInternalBinding) { … }
namespace {
bool operator!=(const BindingInfo& a, const BindingInfo& b) { … }
bool IsBufferBinding(const UnpackedPtr<BindGroupLayoutEntry>& binding) { … }
bool BindingHasDynamicOffset(const UnpackedPtr<BindGroupLayoutEntry>& binding) { … }
BindingInfo CreateBindGroupLayoutInfo(const UnpackedPtr<BindGroupLayoutEntry>& binding) { … }
bool SortBindingsCompare(const UnpackedPtr<BindGroupLayoutEntry>& a,
const UnpackedPtr<BindGroupLayoutEntry>& b) { … }
bool CheckBufferBindingsFirst(ityp::span<BindingIndex, const BindingInfo> bindings) { … }
}
BindGroupLayoutInternalBase::BindGroupLayoutInternalBase(
DeviceBase* device,
const BindGroupLayoutDescriptor* descriptor,
ApiObjectBase::UntrackedByDeviceTag tag)
: … { … }
BindGroupLayoutInternalBase::BindGroupLayoutInternalBase(
DeviceBase* device,
const BindGroupLayoutDescriptor* descriptor)
: … { … }
BindGroupLayoutInternalBase::BindGroupLayoutInternalBase(DeviceBase* device,
ObjectBase::ErrorTag tag,
const char* label)
: … { … }
BindGroupLayoutInternalBase::~BindGroupLayoutInternalBase() = default;
void BindGroupLayoutInternalBase::DestroyImpl() { … }
ObjectType BindGroupLayoutInternalBase::GetType() const { … }
const BindingInfo& BindGroupLayoutInternalBase::GetBindingInfo(BindingIndex bindingIndex) const { … }
const BindGroupLayoutInternalBase::BindingMap& BindGroupLayoutInternalBase::GetBindingMap() const { … }
bool BindGroupLayoutInternalBase::HasBinding(BindingNumber bindingNumber) const { … }
BindingIndex BindGroupLayoutInternalBase::GetBindingIndex(BindingNumber bindingNumber) const { … }
size_t BindGroupLayoutInternalBase::ComputeContentHash() { … }
bool BindGroupLayoutInternalBase::EqualityFunc::operator()(
const BindGroupLayoutInternalBase* a,
const BindGroupLayoutInternalBase* b) const { … }
BindingIndex BindGroupLayoutInternalBase::GetBindingCount() const { … }
BindingIndex BindGroupLayoutInternalBase::GetBufferCount() const { … }
BindingIndex BindGroupLayoutInternalBase::GetDynamicBufferCount() const { … }
uint32_t BindGroupLayoutInternalBase::GetUnverifiedBufferCount() const { … }
uint32_t BindGroupLayoutInternalBase::GetStaticSamplerCount() const { … }
uint32_t BindGroupLayoutInternalBase::GetExternalTextureBindingCount() const { … }
const BindingCounts& BindGroupLayoutInternalBase::GetBindingCountInfo() const { … }
const ExternalTextureBindingExpansionMap&
BindGroupLayoutInternalBase::GetExternalTextureBindingExpansionMap() const { … }
uint32_t BindGroupLayoutInternalBase::GetUnexpandedBindingCount() const { … }
bool BindGroupLayoutInternalBase::IsLayoutEqual(const BindGroupLayoutInternalBase* other) const { … }
size_t BindGroupLayoutInternalBase::GetBindingDataSize() const { … }
BindGroupLayoutInternalBase::BindingDataPointers
BindGroupLayoutInternalBase::ComputeBindingDataPointers(void* dataStart) const { … }
bool BindGroupLayoutInternalBase::IsStorageBufferBinding(BindingIndex bindingIndex) const { … }
std::string BindGroupLayoutInternalBase::EntriesToString() const { … }
}