Change uint32_t -> size_t in *Enumerate functions

Follows https://github.com/webgpu-native/webgpu-headers/pull/142

Bug: dawn:160
Change-Id: Ic8aa5868bf1a68ae5ff80ce6e5fc0e8d687c34bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75481
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2022-01-06 22:11:28 +00:00 committed by Dawn LUCI CQ
parent 7c3194ea8b
commit 3ac7b9ce79
17 changed files with 20 additions and 20 deletions

View File

@ -101,7 +101,7 @@
{
"tags": ["dawn"],
"name": "enumerate features",
"returns": "uint32_t",
"returns": "size_t",
"args": [
{"name": "features", "type": "feature name", "annotation": "*"}
]
@ -1084,7 +1084,7 @@
{
"tags": ["dawn"],
"name": "enumerate features",
"returns": "uint32_t",
"returns": "size_t",
"args": [
{"name": "features", "type": "feature name", "annotation": "*"}
]

View File

@ -89,7 +89,7 @@ namespace dawn_native {
return mSupportedFeatures.IsEnabled(feature);
}
uint32_t AdapterBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
size_t AdapterBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
return mSupportedFeatures.EnumerateFeatures(features);
}

View File

@ -41,7 +41,7 @@ namespace dawn_native {
bool APIGetLimits(SupportedLimits* limits) const;
void APIGetProperties(AdapterProperties* properties) const;
bool APIHasFeature(wgpu::FeatureName feature) const;
uint32_t APIEnumerateFeatures(wgpu::FeatureName* features) const;
size_t APIEnumerateFeatures(wgpu::FeatureName* features) const;
void APIRequestDevice(const DeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);

View File

@ -1213,7 +1213,7 @@ namespace dawn_native {
return mEnabledFeatures.IsEnabled(feature);
}
uint32_t DeviceBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
size_t DeviceBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
return mEnabledFeatures.EnumerateFeatures(features);
}

View File

@ -259,7 +259,7 @@ namespace dawn_native {
bool APIGetLimits(SupportedLimits* limits) const;
bool APIHasFeature(wgpu::FeatureName feature) const;
uint32_t APIEnumerateFeatures(wgpu::FeatureName* features) const;
size_t APIEnumerateFeatures(wgpu::FeatureName* features) const;
void APIInjectError(wgpu::ErrorType type, const char* message);
bool APITick();

View File

@ -181,7 +181,7 @@ namespace dawn_native {
return f != Feature::InvalidEnum && IsEnabled(f);
}
uint32_t FeaturesSet::EnumerateFeatures(wgpu::FeatureName* features) const {
size_t FeaturesSet::EnumerateFeatures(wgpu::FeatureName* features) const {
for (uint32_t i : IterateBitSet(featuresBitSet)) {
wgpu::FeatureName feature = ToAPIFeature(static_cast<Feature>(i));
if (features != nullptr) {

View File

@ -57,7 +57,7 @@ namespace dawn_native {
bool IsEnabled(wgpu::FeatureName feature) const;
// Returns |count|, the number of features. Writes out all |count| values if |features| is
// non-null.
uint32_t EnumerateFeatures(wgpu::FeatureName* features) const;
size_t EnumerateFeatures(wgpu::FeatureName* features) const;
std::vector<const char*> GetEnabledFeatureNames() const;
void InitializeDeviceProperties(WGPUDeviceProperties* properties) const;
};

View File

@ -41,7 +41,7 @@ namespace dawn_wire::client {
return mLimitsAndFeatures.HasFeature(feature);
}
uint32_t Adapter::EnumerateFeatures(WGPUFeatureName* features) const {
size_t Adapter::EnumerateFeatures(WGPUFeatureName* features) const {
return mLimitsAndFeatures.EnumerateFeatures(features);
}

View File

@ -34,7 +34,7 @@ namespace dawn_wire::client {
bool GetLimits(WGPUSupportedLimits* limits) const;
bool HasFeature(WGPUFeatureName feature) const;
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
size_t EnumerateFeatures(WGPUFeatureName* features) const;
void SetLimits(const WGPUSupportedLimits* limits);
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
void SetProperties(const WGPUAdapterProperties* properties);

View File

@ -75,7 +75,7 @@ namespace dawn_wire::client {
return mLimitsAndFeatures.HasFeature(feature);
}
uint32_t Device::EnumerateFeatures(WGPUFeatureName* features) const {
size_t Device::EnumerateFeatures(WGPUFeatureName* features) const {
return mLimitsAndFeatures.EnumerateFeatures(features);
}

View File

@ -67,7 +67,7 @@ namespace dawn_wire::client {
bool GetLimits(WGPUSupportedLimits* limits) const;
bool HasFeature(WGPUFeatureName feature) const;
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
size_t EnumerateFeatures(WGPUFeatureName* features) const;
void SetLimits(const WGPUSupportedLimits* limits);
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);

View File

@ -32,7 +32,7 @@ namespace dawn_wire::client {
return mFeatures.count(feature) != 0;
}
uint32_t LimitsAndFeatures::EnumerateFeatures(WGPUFeatureName* features) const {
size_t LimitsAndFeatures::EnumerateFeatures(WGPUFeatureName* features) const {
if (features != nullptr) {
for (WGPUFeatureName f : mFeatures) {
*features = f;

View File

@ -25,7 +25,7 @@ namespace dawn_wire::client {
public:
bool GetLimits(WGPUSupportedLimits* limits) const;
bool HasFeature(WGPUFeatureName feature) const;
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
size_t EnumerateFeatures(WGPUFeatureName* features) const;
void SetLimits(const WGPUSupportedLimits* limits);
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);

View File

@ -70,7 +70,7 @@ namespace dawn_wire::server {
std::vector<WGPUFeatureName> features;
uint32_t featuresCount = mProcs.deviceEnumerateFeatures(device, nullptr);
size_t featuresCount = mProcs.deviceEnumerateFeatures(device, nullptr);
features.resize(featuresCount);
mProcs.deviceEnumerateFeatures(device, features.data());

View File

@ -79,7 +79,7 @@ namespace dawn_wire::server {
adapterObject->state = AllocationState::Allocated;
adapterObject->handle = adapter;
uint32_t featuresCount = mProcs.adapterEnumerateFeatures(adapter, nullptr);
size_t featuresCount = mProcs.adapterEnumerateFeatures(adapter, nullptr);
features.resize(featuresCount);
mProcs.adapterEnumerateFeatures(adapter, features.data());

View File

@ -193,7 +193,7 @@ namespace {
for (wgpu::FeatureName feature : fakeFeatures) {
*(features++) = static_cast<WGPUFeatureName>(feature);
}
return static_cast<uint32_t>(fakeFeatures.size());
return fakeFeatures.size();
})));
api.CallAdapterRequestDeviceCallback(apiAdapter, WGPURequestDeviceStatus_Success,
@ -259,7 +259,7 @@ namespace {
for (wgpu::FeatureName feature : fakeFeatures) {
*(features++) = static_cast<WGPUFeatureName>(feature);
}
return static_cast<uint32_t>(fakeFeatures.size());
return fakeFeatures.size();
})));
// The device was actually created, but the wire didn't support its features.

View File

@ -138,7 +138,7 @@ namespace {
for (wgpu::FeatureName feature : fakeFeatures) {
*(features++) = static_cast<WGPUFeatureName>(feature);
}
return static_cast<uint32_t>(fakeFeatures.size());
return fakeFeatures.size();
})));
api.CallInstanceRequestAdapterCallback(
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);
@ -217,7 +217,7 @@ namespace {
for (wgpu::FeatureName feature : fakeFeatures) {
*(features++) = static_cast<WGPUFeatureName>(feature);
}
return static_cast<uint32_t>(fakeFeatures.size());
return fakeFeatures.size();
})));
api.CallInstanceRequestAdapterCallback(
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);