Rename GetBindGroupLayout's argument group->groupIndex

This is to follow upstream webgpu.h changes.

Bug: dawn:22
Change-Id: I976d1394a31a47870a73ed834137ce99047675bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-04-01 18:22:36 +00:00 committed by Commit Bot service account
parent a0afd31585
commit 373a3ff26e
3 changed files with 9 additions and 9 deletions

View File

@ -480,7 +480,7 @@
"name": "get bind group layout", "name": "get bind group layout",
"returns": "bind group layout", "returns": "bind group layout",
"args": [ "args": [
{"name": "group", "type": "uint32_t"} {"name": "group index", "type": "uint32_t"}
] ]
} }
] ]
@ -1213,7 +1213,7 @@
"name": "get bind group layout", "name": "get bind group layout",
"returns": "bind group layout", "returns": "bind group layout",
"args": [ "args": [
{"name": "group", "type": "uint32_t"} {"name": "group index", "type": "uint32_t"}
] ]
} }
] ]

View File

@ -66,22 +66,22 @@ namespace dawn_native {
return mLayout.Get(); return mLayout.Get();
} }
MaybeError PipelineBase::ValidateGetBindGroupLayout(uint32_t group) { MaybeError PipelineBase::ValidateGetBindGroupLayout(uint32_t groupIndex) {
DAWN_TRY(GetDevice()->ValidateIsAlive()); DAWN_TRY(GetDevice()->ValidateIsAlive());
DAWN_TRY(GetDevice()->ValidateObject(this)); DAWN_TRY(GetDevice()->ValidateObject(this));
DAWN_TRY(GetDevice()->ValidateObject(mLayout.Get())); DAWN_TRY(GetDevice()->ValidateObject(mLayout.Get()));
if (group >= kMaxBindGroups) { if (groupIndex >= kMaxBindGroups) {
return DAWN_VALIDATION_ERROR("Bind group layout index out of bounds"); return DAWN_VALIDATION_ERROR("Bind group layout index out of bounds");
} }
return {}; return {};
} }
BindGroupLayoutBase* PipelineBase::GetBindGroupLayout(uint32_t group) { BindGroupLayoutBase* PipelineBase::GetBindGroupLayout(uint32_t groupIndex) {
if (GetDevice()->ConsumedError(ValidateGetBindGroupLayout(group))) { if (GetDevice()->ConsumedError(ValidateGetBindGroupLayout(groupIndex))) {
return BindGroupLayoutBase::MakeError(GetDevice()); return BindGroupLayoutBase::MakeError(GetDevice());
} }
if (!mLayout->GetBindGroupLayoutsMask()[group]) { if (!mLayout->GetBindGroupLayoutsMask()[groupIndex]) {
// Get or create an empty bind group layout. // Get or create an empty bind group layout.
// TODO(enga): Consider caching this object on the Device and reusing it. // TODO(enga): Consider caching this object on the Device and reusing it.
// Today, this can't be done correctly because of the order of Device destruction. // Today, this can't be done correctly because of the order of Device destruction.
@ -99,7 +99,7 @@ namespace dawn_native {
return bgl; return bgl;
} }
BindGroupLayoutBase* bgl = mLayout->GetBindGroupLayout(group); BindGroupLayoutBase* bgl = mLayout->GetBindGroupLayout(groupIndex);
bgl->Reference(); bgl->Reference();
return bgl; return bgl;
} }

View File

@ -38,7 +38,7 @@ namespace dawn_native {
wgpu::ShaderStage GetStageMask() const; wgpu::ShaderStage GetStageMask() const;
PipelineLayoutBase* GetLayout(); PipelineLayoutBase* GetLayout();
const PipelineLayoutBase* GetLayout() const; const PipelineLayoutBase* GetLayout() const;
BindGroupLayoutBase* GetBindGroupLayout(uint32_t group); BindGroupLayoutBase* GetBindGroupLayout(uint32_t groupIndex);
protected: protected:
PipelineBase(DeviceBase* device, PipelineLayoutBase* layout, wgpu::ShaderStage stages); PipelineBase(DeviceBase* device, PipelineLayoutBase* layout, wgpu::ShaderStage stages);