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:
parent
7c3194ea8b
commit
3ac7b9ce79
|
@ -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": "*"}
|
||||
]
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue