mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Rename BG[L]Binding to BG[L]Entry
This is to match the WebGPU API change. The only manual changes are in dawn.json and templates. The rest was created with the following commands: git grep -l BindGroupLayoutBinding | xargs sed -i "" -e "s/BindGroupLayoutBinding/BindGroupLayoutEntry/g" git grep -l BindGroupBinding | xargs sed -i "" -e "s/BindGroupBinding/BindGroupEntry/g" git cl format Bug: dawn:22 Change-Id: I1377eef9ea9816578441c91d167909dedc7f8e96 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18863 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
f526d777e0
commit
c3c6694d8f
@@ -92,7 +92,7 @@ TEST_F(BindGroupValidationTest, bindingCountMismatch) {
|
||||
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {}));
|
||||
}
|
||||
|
||||
// Check constraints on BindGroupBinding::binding
|
||||
// Check constraints on BindGroupEntry::binding
|
||||
TEST_F(BindGroupValidationTest, WrongBindings) {
|
||||
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::Sampler}});
|
||||
@@ -131,7 +131,7 @@ TEST_F(BindGroupValidationTest, SamplerBindingType) {
|
||||
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::Sampler}});
|
||||
|
||||
wgpu::BindGroupBinding binding;
|
||||
wgpu::BindGroupEntry binding;
|
||||
binding.binding = 0;
|
||||
binding.sampler = nullptr;
|
||||
binding.textureView = nullptr;
|
||||
@@ -180,7 +180,7 @@ TEST_F(BindGroupValidationTest, TextureBindingType) {
|
||||
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::SampledTexture}});
|
||||
|
||||
wgpu::BindGroupBinding binding;
|
||||
wgpu::BindGroupEntry binding;
|
||||
binding.binding = 0;
|
||||
binding.sampler = nullptr;
|
||||
binding.textureView = nullptr;
|
||||
@@ -234,7 +234,7 @@ TEST_F(BindGroupValidationTest, BufferBindingType) {
|
||||
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::UniformBuffer}});
|
||||
|
||||
wgpu::BindGroupBinding binding;
|
||||
wgpu::BindGroupEntry binding;
|
||||
binding.binding = 0;
|
||||
binding.sampler = nullptr;
|
||||
binding.textureView = nullptr;
|
||||
@@ -467,7 +467,7 @@ TEST_F(BindGroupValidationTest, ErrorLayout) {
|
||||
|
||||
class BindGroupLayoutValidationTest : public ValidationTest {
|
||||
public:
|
||||
void TestCreateBindGroupLayout(wgpu::BindGroupLayoutBinding* binding,
|
||||
void TestCreateBindGroupLayout(wgpu::BindGroupLayoutEntry* binding,
|
||||
uint32_t count,
|
||||
bool expected) {
|
||||
wgpu::BindGroupLayoutDescriptor descriptor;
|
||||
@@ -513,7 +513,7 @@ TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutStorageBindingsInVertexShad
|
||||
}
|
||||
|
||||
// Tests setting that bind group layout bindings numbers may be >= kMaxBindingsPerGroup.
|
||||
TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutBindingUnbounded) {
|
||||
TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutEntryUnbounded) {
|
||||
// Checks that kMaxBindingsPerGroup is valid.
|
||||
utils::MakeBindGroupLayout(device, {{kMaxBindingsPerGroup, wgpu::ShaderStage::Vertex,
|
||||
wgpu::BindingType::UniformBuffer}});
|
||||
@@ -525,7 +525,7 @@ TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutBindingUnbounded) {
|
||||
|
||||
// Test that there can't be more than kMaxBindingPerGroup bindings per group
|
||||
TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutMaxBindings) {
|
||||
wgpu::BindGroupLayoutBinding bindings[kMaxBindingsPerGroup + 1];
|
||||
wgpu::BindGroupLayoutEntry bindings[kMaxBindingsPerGroup + 1];
|
||||
|
||||
for (uint32_t i = 0; i < kMaxBindingsPerGroup + 1; i++) {
|
||||
bindings[i].type = wgpu::BindingType::UniformBuffer;
|
||||
@@ -547,7 +547,7 @@ TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutMaxBindings) {
|
||||
|
||||
// This test verifies that the BindGroupLayout bindings are correctly validated, even if the
|
||||
// binding ids are out-of-order.
|
||||
TEST_F(BindGroupLayoutValidationTest, BindGroupBinding) {
|
||||
TEST_F(BindGroupLayoutValidationTest, BindGroupEntry) {
|
||||
utils::MakeBindGroupLayout(device,
|
||||
{
|
||||
{1, wgpu::ShaderStage::Vertex, wgpu::BindingType::UniformBuffer},
|
||||
@@ -590,8 +590,8 @@ TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutVisibilityNone) {
|
||||
{0, wgpu::ShaderStage::Vertex, wgpu::BindingType::UniformBuffer},
|
||||
});
|
||||
|
||||
wgpu::BindGroupLayoutBinding binding = {0, wgpu::ShaderStage::None,
|
||||
wgpu::BindingType::UniformBuffer};
|
||||
wgpu::BindGroupLayoutEntry binding = {0, wgpu::ShaderStage::None,
|
||||
wgpu::BindingType::UniformBuffer};
|
||||
wgpu::BindGroupLayoutDescriptor descriptor;
|
||||
descriptor.bindingCount = 1;
|
||||
descriptor.bindings = &binding;
|
||||
@@ -601,9 +601,9 @@ TEST_F(BindGroupLayoutValidationTest, BindGroupLayoutVisibilityNone) {
|
||||
// Check that dynamic buffer numbers exceed maximum value in one bind group layout.
|
||||
TEST_F(BindGroupLayoutValidationTest, DynamicBufferNumberLimit) {
|
||||
wgpu::BindGroupLayout bgl[2];
|
||||
std::vector<wgpu::BindGroupLayoutBinding> maxUniformDB;
|
||||
std::vector<wgpu::BindGroupLayoutBinding> maxStorageDB;
|
||||
std::vector<wgpu::BindGroupLayoutBinding> maxReadonlyStorageDB;
|
||||
std::vector<wgpu::BindGroupLayoutEntry> maxUniformDB;
|
||||
std::vector<wgpu::BindGroupLayoutEntry> maxStorageDB;
|
||||
std::vector<wgpu::BindGroupLayoutEntry> maxReadonlyStorageDB;
|
||||
|
||||
for (uint32_t i = 0; i < kMaxDynamicUniformBufferCount; ++i) {
|
||||
maxUniformDB.push_back(
|
||||
@@ -620,7 +620,7 @@ TEST_F(BindGroupLayoutValidationTest, DynamicBufferNumberLimit) {
|
||||
{i, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageBuffer, true});
|
||||
}
|
||||
|
||||
auto MakeBindGroupLayout = [&](wgpu::BindGroupLayoutBinding* binding,
|
||||
auto MakeBindGroupLayout = [&](wgpu::BindGroupLayoutEntry* binding,
|
||||
uint32_t count) -> wgpu::BindGroupLayout {
|
||||
wgpu::BindGroupLayoutDescriptor descriptor;
|
||||
descriptor.bindingCount = count;
|
||||
@@ -1027,9 +1027,9 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
|
||||
// Iterate through the desired bind group layouts.
|
||||
for (uint32_t l = 0; l < layouts.size(); ++l) {
|
||||
const auto& layout = layouts[l];
|
||||
std::vector<wgpu::BindGroupLayoutBinding> bindings(layout.size());
|
||||
std::vector<wgpu::BindGroupLayoutEntry> bindings(layout.size());
|
||||
|
||||
// Iterate through binding types and populate a list of BindGroupLayoutBindings.
|
||||
// Iterate through binding types and populate a list of BindGroupLayoutEntrys.
|
||||
for (uint32_t b = 0; b < layout.size(); ++b) {
|
||||
bindings[b] = {b, wgpu::ShaderStage::Fragment, layout[b], false};
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) {
|
||||
void main() {
|
||||
})");
|
||||
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::UniformBuffer;
|
||||
binding.multisampled = false;
|
||||
@@ -150,7 +150,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
|
||||
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&descriptor);
|
||||
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::UniformBuffer;
|
||||
binding.visibility = kVisibilityAll;
|
||||
@@ -165,7 +165,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
|
||||
|
||||
// Test that the binding type matches the shader.
|
||||
TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.hasDynamicOffset = false;
|
||||
binding.multisampled = false;
|
||||
@@ -236,7 +236,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
|
||||
// Test that multisampling matches the shader.
|
||||
TEST_F(GetBindGroupLayoutTests, Multisampled) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::SampledTexture;
|
||||
binding.visibility = kVisibilityAll;
|
||||
@@ -273,7 +273,7 @@ TEST_F(GetBindGroupLayoutTests, Multisampled) {
|
||||
|
||||
// Test that texture view dimension matches the shader.
|
||||
TEST_F(GetBindGroupLayoutTests, TextureDimension) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::SampledTexture;
|
||||
binding.visibility = kVisibilityAll;
|
||||
@@ -347,7 +347,7 @@ TEST_F(GetBindGroupLayoutTests, TextureDimension) {
|
||||
|
||||
// Test that texture component type matches the shader.
|
||||
TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::SampledTexture;
|
||||
binding.visibility = kVisibilityAll;
|
||||
@@ -391,7 +391,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
|
||||
|
||||
// Test that binding= indices match.
|
||||
TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.type = wgpu::BindingType::UniformBuffer;
|
||||
binding.visibility = kVisibilityAll;
|
||||
binding.hasDynamicOffset = false;
|
||||
@@ -619,7 +619,7 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) {
|
||||
// Test that after explicitly creating a pipeline with a pipeline layout, calling
|
||||
// GetBindGroupLayout reflects the same bind group layouts.
|
||||
TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
wgpu::BindGroupLayoutBinding binding = {};
|
||||
wgpu::BindGroupLayoutEntry binding = {};
|
||||
binding.binding = 0;
|
||||
binding.type = wgpu::BindingType::UniformBuffer;
|
||||
binding.visibility = wgpu::ShaderStage::Vertex;
|
||||
|
||||
@@ -381,7 +381,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutWithStorageTextureBindingTy
|
||||
{wgpu::ShaderStage::Compute, wgpu::BindingType::StorageTexture, false}}};
|
||||
|
||||
for (const auto& testSpec : kTestSpecs) {
|
||||
wgpu::BindGroupLayoutBinding binding = {0, testSpec.stage, testSpec.type};
|
||||
wgpu::BindGroupLayoutEntry binding = {0, testSpec.stage, testSpec.type};
|
||||
binding.storageTextureFormat = wgpu::TextureFormat::R32Uint;
|
||||
wgpu::BindGroupLayoutDescriptor descriptor;
|
||||
descriptor.bindingCount = 1;
|
||||
@@ -462,7 +462,7 @@ TEST_F(StorageTextureValidationTests, UnsupportedSPIRVStorageTextureFormat) {
|
||||
// Verify when we create and use a bind group layout with storage textures in the creation of
|
||||
// render and compute pipeline, the binding type in the bind group layout must match the
|
||||
// declaration in the shader.
|
||||
TEST_F(StorageTextureValidationTests, BindGroupLayoutBindingTypeMatchesShaderDeclaration) {
|
||||
TEST_F(StorageTextureValidationTests, BindGroupLayoutEntryTypeMatchesShaderDeclaration) {
|
||||
constexpr std::array<wgpu::BindingType, 7> kSupportedBindingTypes = {
|
||||
wgpu::BindingType::UniformBuffer, wgpu::BindingType::StorageBuffer,
|
||||
wgpu::BindingType::ReadonlyStorageBuffer, wgpu::BindingType::Sampler,
|
||||
@@ -483,17 +483,17 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutBindingTypeMatchesShaderDec
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
|
||||
// Set common fileds of bind group layout binding.
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding;
|
||||
defaultBindGroupLayoutBinding.binding = 0;
|
||||
defaultBindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutBinding.storageTextureFormat = kStorageTextureFormat;
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry;
|
||||
defaultBindGroupLayoutEntry.binding = 0;
|
||||
defaultBindGroupLayoutEntry.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutEntry.storageTextureFormat = kStorageTextureFormat;
|
||||
|
||||
for (wgpu::BindingType bindingTypeInBindgroupLayout : kSupportedBindingTypes) {
|
||||
wgpu::ComputePipelineDescriptor computePipelineDescriptor =
|
||||
defaultComputePipelineDescriptor;
|
||||
|
||||
// Create bind group layout with different binding types.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.type = bindingTypeInBindgroupLayout;
|
||||
wgpu::BindGroupLayout bindGroupLayout =
|
||||
utils::MakeBindGroupLayout(device, {bindGroupLayoutBinding});
|
||||
@@ -514,27 +514,27 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutBindingTypeMatchesShaderDec
|
||||
// Verify it is invalid not to set a valid texture format in a bind group layout when the binding
|
||||
// type is read-only or write-only storage texture.
|
||||
TEST_F(StorageTextureValidationTests, UndefinedStorageTextureFormatInBindGroupLayout) {
|
||||
wgpu::BindGroupLayoutBinding errorBindGroupLayoutBinding;
|
||||
errorBindGroupLayoutBinding.binding = 0;
|
||||
errorBindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
errorBindGroupLayoutBinding.storageTextureFormat = wgpu::TextureFormat::Undefined;
|
||||
wgpu::BindGroupLayoutEntry errorBindGroupLayoutEntry;
|
||||
errorBindGroupLayoutEntry.binding = 0;
|
||||
errorBindGroupLayoutEntry.visibility = wgpu::ShaderStage::Compute;
|
||||
errorBindGroupLayoutEntry.storageTextureFormat = wgpu::TextureFormat::Undefined;
|
||||
|
||||
for (wgpu::BindingType bindingType : kSupportedStorageTextureBindingTypes) {
|
||||
errorBindGroupLayoutBinding.type = bindingType;
|
||||
ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout(device, {errorBindGroupLayoutBinding}));
|
||||
errorBindGroupLayoutEntry.type = bindingType;
|
||||
ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout(device, {errorBindGroupLayoutEntry}));
|
||||
}
|
||||
}
|
||||
|
||||
// Verify it is invalid to create a bind group layout with storage textures and an unsupported
|
||||
// storage texture format.
|
||||
TEST_F(StorageTextureValidationTests, StorageTextureFormatInBindGroupLayout) {
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding;
|
||||
defaultBindGroupLayoutBinding.binding = 0;
|
||||
defaultBindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry;
|
||||
defaultBindGroupLayoutEntry.binding = 0;
|
||||
defaultBindGroupLayoutEntry.visibility = wgpu::ShaderStage::Compute;
|
||||
|
||||
for (wgpu::BindingType bindingType : kSupportedStorageTextureBindingTypes) {
|
||||
for (wgpu::TextureFormat textureFormat : utils::kAllTextureFormats) {
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.type = bindingType;
|
||||
bindGroupLayoutBinding.storageTextureFormat = textureFormat;
|
||||
if (utils::TextureFormatSupportsStorageTexture(textureFormat)) {
|
||||
@@ -567,8 +567,8 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutStorageTextureFormatMatches
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
|
||||
// Set common fileds of bind group layout binding.
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding = {
|
||||
0, wgpu::ShaderStage::Compute, bindingType};
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry = {0, wgpu::ShaderStage::Compute,
|
||||
bindingType};
|
||||
|
||||
for (wgpu::TextureFormat storageTextureFormatInBindGroupLayout :
|
||||
utils::kAllTextureFormats) {
|
||||
@@ -578,7 +578,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutStorageTextureFormatMatches
|
||||
}
|
||||
|
||||
// Create the bind group layout with the given storage texture format.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.storageTextureFormat = storageTextureFormatInBindGroupLayout;
|
||||
wgpu::BindGroupLayout bindGroupLayout =
|
||||
utils::MakeBindGroupLayout(device, {bindGroupLayoutBinding});
|
||||
@@ -624,13 +624,13 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutTextureDimensionMatchesShad
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
|
||||
// Set common fileds of bind group layout binding.
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding = {
|
||||
0, wgpu::ShaderStage::Compute, bindingType};
|
||||
defaultBindGroupLayoutBinding.storageTextureFormat = kStorageTextureFormat;
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry = {0, wgpu::ShaderStage::Compute,
|
||||
bindingType};
|
||||
defaultBindGroupLayoutEntry.storageTextureFormat = kStorageTextureFormat;
|
||||
|
||||
for (wgpu::TextureViewDimension dimensionInBindGroupLayout : kAllDimensions) {
|
||||
// Create the bind group layout with the given texture view dimension.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.textureDimension = dimensionInBindGroupLayout;
|
||||
wgpu::BindGroupLayout bindGroupLayout =
|
||||
utils::MakeBindGroupLayout(device, {bindGroupLayoutBinding});
|
||||
@@ -657,7 +657,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutTextureDimensionMatchesShad
|
||||
// are allowed to have dynamic offsets.
|
||||
TEST_F(StorageTextureValidationTests, StorageTextureCannotHaveDynamicOffsets) {
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding;
|
||||
bindGroupLayoutBinding.binding = 0;
|
||||
bindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
bindGroupLayoutBinding.type = storageBindingType;
|
||||
@@ -674,7 +674,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureBindingTypeInBindGroup) {
|
||||
constexpr wgpu::TextureFormat kStorageTextureFormat = wgpu::TextureFormat::R32Float;
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
// Create a bind group layout.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding;
|
||||
bindGroupLayoutBinding.binding = 0;
|
||||
bindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
bindGroupLayoutBinding.type = storageBindingType;
|
||||
@@ -718,7 +718,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) {
|
||||
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
// Create a bind group layout.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding;
|
||||
bindGroupLayoutBinding.binding = 0;
|
||||
bindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
bindGroupLayoutBinding.type = storageBindingType;
|
||||
@@ -747,10 +747,10 @@ TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) {
|
||||
// group must match the corresponding bind group binding.
|
||||
TEST_F(StorageTextureValidationTests, StorageTextureFormatInBindGroup) {
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding;
|
||||
defaultBindGroupLayoutBinding.binding = 0;
|
||||
defaultBindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutBinding.type = storageBindingType;
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry;
|
||||
defaultBindGroupLayoutEntry.binding = 0;
|
||||
defaultBindGroupLayoutEntry.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutEntry.type = storageBindingType;
|
||||
|
||||
for (wgpu::TextureFormat formatInBindGroupLayout : utils::kAllTextureFormats) {
|
||||
if (!utils::TextureFormatSupportsStorageTexture(formatInBindGroupLayout)) {
|
||||
@@ -758,7 +758,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureFormatInBindGroup) {
|
||||
}
|
||||
|
||||
// Create a bind group layout with given storage texture format.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.storageTextureFormat = formatInBindGroupLayout;
|
||||
wgpu::BindGroupLayout bindGroupLayout =
|
||||
utils::MakeBindGroupLayout(device, {bindGroupLayoutBinding});
|
||||
@@ -808,15 +808,15 @@ TEST_F(StorageTextureValidationTests, StorageTextureViewDimensionInBindGroup) {
|
||||
kDefaultTextureViewDescriptor.baseArrayLayer = 0;
|
||||
|
||||
for (wgpu::BindingType storageBindingType : kSupportedStorageTextureBindingTypes) {
|
||||
wgpu::BindGroupLayoutBinding defaultBindGroupLayoutBinding;
|
||||
defaultBindGroupLayoutBinding.binding = 0;
|
||||
defaultBindGroupLayoutBinding.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutBinding.type = storageBindingType;
|
||||
defaultBindGroupLayoutBinding.storageTextureFormat = kStorageTextureFormat;
|
||||
wgpu::BindGroupLayoutEntry defaultBindGroupLayoutEntry;
|
||||
defaultBindGroupLayoutEntry.binding = 0;
|
||||
defaultBindGroupLayoutEntry.visibility = wgpu::ShaderStage::Compute;
|
||||
defaultBindGroupLayoutEntry.type = storageBindingType;
|
||||
defaultBindGroupLayoutEntry.storageTextureFormat = kStorageTextureFormat;
|
||||
|
||||
for (wgpu::TextureViewDimension dimensionInBindGroupLayout : kSupportedDimensions) {
|
||||
// Create a bind group layout with given texture view dimension.
|
||||
wgpu::BindGroupLayoutBinding bindGroupLayoutBinding = defaultBindGroupLayoutBinding;
|
||||
wgpu::BindGroupLayoutEntry bindGroupLayoutBinding = defaultBindGroupLayoutEntry;
|
||||
bindGroupLayoutBinding.textureDimension = dimensionInBindGroupLayout;
|
||||
wgpu::BindGroupLayout bindGroupLayout =
|
||||
utils::MakeBindGroupLayout(device, {bindGroupLayoutBinding});
|
||||
|
||||
Reference in New Issue
Block a user