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"],
|
"tags": ["dawn"],
|
||||||
"name": "enumerate features",
|
"name": "enumerate features",
|
||||||
"returns": "uint32_t",
|
"returns": "size_t",
|
||||||
"args": [
|
"args": [
|
||||||
{"name": "features", "type": "feature name", "annotation": "*"}
|
{"name": "features", "type": "feature name", "annotation": "*"}
|
||||||
]
|
]
|
||||||
|
@ -1084,7 +1084,7 @@
|
||||||
{
|
{
|
||||||
"tags": ["dawn"],
|
"tags": ["dawn"],
|
||||||
"name": "enumerate features",
|
"name": "enumerate features",
|
||||||
"returns": "uint32_t",
|
"returns": "size_t",
|
||||||
"args": [
|
"args": [
|
||||||
{"name": "features", "type": "feature name", "annotation": "*"}
|
{"name": "features", "type": "feature name", "annotation": "*"}
|
||||||
]
|
]
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace dawn_native {
|
||||||
return mSupportedFeatures.IsEnabled(feature);
|
return mSupportedFeatures.IsEnabled(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t AdapterBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
|
size_t AdapterBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
|
||||||
return mSupportedFeatures.EnumerateFeatures(features);
|
return mSupportedFeatures.EnumerateFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace dawn_native {
|
||||||
bool APIGetLimits(SupportedLimits* limits) const;
|
bool APIGetLimits(SupportedLimits* limits) const;
|
||||||
void APIGetProperties(AdapterProperties* properties) const;
|
void APIGetProperties(AdapterProperties* properties) const;
|
||||||
bool APIHasFeature(wgpu::FeatureName feature) 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,
|
void APIRequestDevice(const DeviceDescriptor* descriptor,
|
||||||
WGPURequestDeviceCallback callback,
|
WGPURequestDeviceCallback callback,
|
||||||
void* userdata);
|
void* userdata);
|
||||||
|
|
|
@ -1213,7 +1213,7 @@ namespace dawn_native {
|
||||||
return mEnabledFeatures.IsEnabled(feature);
|
return mEnabledFeatures.IsEnabled(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t DeviceBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
|
size_t DeviceBase::APIEnumerateFeatures(wgpu::FeatureName* features) const {
|
||||||
return mEnabledFeatures.EnumerateFeatures(features);
|
return mEnabledFeatures.EnumerateFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ namespace dawn_native {
|
||||||
|
|
||||||
bool APIGetLimits(SupportedLimits* limits) const;
|
bool APIGetLimits(SupportedLimits* limits) const;
|
||||||
bool APIHasFeature(wgpu::FeatureName feature) 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);
|
void APIInjectError(wgpu::ErrorType type, const char* message);
|
||||||
bool APITick();
|
bool APITick();
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ namespace dawn_native {
|
||||||
return f != Feature::InvalidEnum && IsEnabled(f);
|
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)) {
|
for (uint32_t i : IterateBitSet(featuresBitSet)) {
|
||||||
wgpu::FeatureName feature = ToAPIFeature(static_cast<Feature>(i));
|
wgpu::FeatureName feature = ToAPIFeature(static_cast<Feature>(i));
|
||||||
if (features != nullptr) {
|
if (features != nullptr) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace dawn_native {
|
||||||
bool IsEnabled(wgpu::FeatureName feature) const;
|
bool IsEnabled(wgpu::FeatureName feature) const;
|
||||||
// Returns |count|, the number of features. Writes out all |count| values if |features| is
|
// Returns |count|, the number of features. Writes out all |count| values if |features| is
|
||||||
// non-null.
|
// non-null.
|
||||||
uint32_t EnumerateFeatures(wgpu::FeatureName* features) const;
|
size_t EnumerateFeatures(wgpu::FeatureName* features) const;
|
||||||
std::vector<const char*> GetEnabledFeatureNames() const;
|
std::vector<const char*> GetEnabledFeatureNames() const;
|
||||||
void InitializeDeviceProperties(WGPUDeviceProperties* properties) const;
|
void InitializeDeviceProperties(WGPUDeviceProperties* properties) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace dawn_wire::client {
|
||||||
return mLimitsAndFeatures.HasFeature(feature);
|
return mLimitsAndFeatures.HasFeature(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Adapter::EnumerateFeatures(WGPUFeatureName* features) const {
|
size_t Adapter::EnumerateFeatures(WGPUFeatureName* features) const {
|
||||||
return mLimitsAndFeatures.EnumerateFeatures(features);
|
return mLimitsAndFeatures.EnumerateFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace dawn_wire::client {
|
||||||
|
|
||||||
bool GetLimits(WGPUSupportedLimits* limits) const;
|
bool GetLimits(WGPUSupportedLimits* limits) const;
|
||||||
bool HasFeature(WGPUFeatureName feature) const;
|
bool HasFeature(WGPUFeatureName feature) const;
|
||||||
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
|
size_t EnumerateFeatures(WGPUFeatureName* features) const;
|
||||||
void SetLimits(const WGPUSupportedLimits* limits);
|
void SetLimits(const WGPUSupportedLimits* limits);
|
||||||
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
||||||
void SetProperties(const WGPUAdapterProperties* properties);
|
void SetProperties(const WGPUAdapterProperties* properties);
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace dawn_wire::client {
|
||||||
return mLimitsAndFeatures.HasFeature(feature);
|
return mLimitsAndFeatures.HasFeature(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Device::EnumerateFeatures(WGPUFeatureName* features) const {
|
size_t Device::EnumerateFeatures(WGPUFeatureName* features) const {
|
||||||
return mLimitsAndFeatures.EnumerateFeatures(features);
|
return mLimitsAndFeatures.EnumerateFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace dawn_wire::client {
|
||||||
|
|
||||||
bool GetLimits(WGPUSupportedLimits* limits) const;
|
bool GetLimits(WGPUSupportedLimits* limits) const;
|
||||||
bool HasFeature(WGPUFeatureName feature) const;
|
bool HasFeature(WGPUFeatureName feature) const;
|
||||||
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
|
size_t EnumerateFeatures(WGPUFeatureName* features) const;
|
||||||
void SetLimits(const WGPUSupportedLimits* limits);
|
void SetLimits(const WGPUSupportedLimits* limits);
|
||||||
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace dawn_wire::client {
|
||||||
return mFeatures.count(feature) != 0;
|
return mFeatures.count(feature) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t LimitsAndFeatures::EnumerateFeatures(WGPUFeatureName* features) const {
|
size_t LimitsAndFeatures::EnumerateFeatures(WGPUFeatureName* features) const {
|
||||||
if (features != nullptr) {
|
if (features != nullptr) {
|
||||||
for (WGPUFeatureName f : mFeatures) {
|
for (WGPUFeatureName f : mFeatures) {
|
||||||
*features = f;
|
*features = f;
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace dawn_wire::client {
|
||||||
public:
|
public:
|
||||||
bool GetLimits(WGPUSupportedLimits* limits) const;
|
bool GetLimits(WGPUSupportedLimits* limits) const;
|
||||||
bool HasFeature(WGPUFeatureName feature) const;
|
bool HasFeature(WGPUFeatureName feature) const;
|
||||||
uint32_t EnumerateFeatures(WGPUFeatureName* features) const;
|
size_t EnumerateFeatures(WGPUFeatureName* features) const;
|
||||||
|
|
||||||
void SetLimits(const WGPUSupportedLimits* limits);
|
void SetLimits(const WGPUSupportedLimits* limits);
|
||||||
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
void SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount);
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace dawn_wire::server {
|
||||||
|
|
||||||
std::vector<WGPUFeatureName> features;
|
std::vector<WGPUFeatureName> features;
|
||||||
|
|
||||||
uint32_t featuresCount = mProcs.deviceEnumerateFeatures(device, nullptr);
|
size_t featuresCount = mProcs.deviceEnumerateFeatures(device, nullptr);
|
||||||
features.resize(featuresCount);
|
features.resize(featuresCount);
|
||||||
mProcs.deviceEnumerateFeatures(device, features.data());
|
mProcs.deviceEnumerateFeatures(device, features.data());
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace dawn_wire::server {
|
||||||
adapterObject->state = AllocationState::Allocated;
|
adapterObject->state = AllocationState::Allocated;
|
||||||
adapterObject->handle = adapter;
|
adapterObject->handle = adapter;
|
||||||
|
|
||||||
uint32_t featuresCount = mProcs.adapterEnumerateFeatures(adapter, nullptr);
|
size_t featuresCount = mProcs.adapterEnumerateFeatures(adapter, nullptr);
|
||||||
features.resize(featuresCount);
|
features.resize(featuresCount);
|
||||||
mProcs.adapterEnumerateFeatures(adapter, features.data());
|
mProcs.adapterEnumerateFeatures(adapter, features.data());
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ namespace {
|
||||||
for (wgpu::FeatureName feature : fakeFeatures) {
|
for (wgpu::FeatureName feature : fakeFeatures) {
|
||||||
*(features++) = static_cast<WGPUFeatureName>(feature);
|
*(features++) = static_cast<WGPUFeatureName>(feature);
|
||||||
}
|
}
|
||||||
return static_cast<uint32_t>(fakeFeatures.size());
|
return fakeFeatures.size();
|
||||||
})));
|
})));
|
||||||
|
|
||||||
api.CallAdapterRequestDeviceCallback(apiAdapter, WGPURequestDeviceStatus_Success,
|
api.CallAdapterRequestDeviceCallback(apiAdapter, WGPURequestDeviceStatus_Success,
|
||||||
|
@ -259,7 +259,7 @@ namespace {
|
||||||
for (wgpu::FeatureName feature : fakeFeatures) {
|
for (wgpu::FeatureName feature : fakeFeatures) {
|
||||||
*(features++) = static_cast<WGPUFeatureName>(feature);
|
*(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.
|
// The device was actually created, but the wire didn't support its features.
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace {
|
||||||
for (wgpu::FeatureName feature : fakeFeatures) {
|
for (wgpu::FeatureName feature : fakeFeatures) {
|
||||||
*(features++) = static_cast<WGPUFeatureName>(feature);
|
*(features++) = static_cast<WGPUFeatureName>(feature);
|
||||||
}
|
}
|
||||||
return static_cast<uint32_t>(fakeFeatures.size());
|
return fakeFeatures.size();
|
||||||
})));
|
})));
|
||||||
api.CallInstanceRequestAdapterCallback(
|
api.CallInstanceRequestAdapterCallback(
|
||||||
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);
|
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);
|
||||||
|
@ -217,7 +217,7 @@ namespace {
|
||||||
for (wgpu::FeatureName feature : fakeFeatures) {
|
for (wgpu::FeatureName feature : fakeFeatures) {
|
||||||
*(features++) = static_cast<WGPUFeatureName>(feature);
|
*(features++) = static_cast<WGPUFeatureName>(feature);
|
||||||
}
|
}
|
||||||
return static_cast<uint32_t>(fakeFeatures.size());
|
return fakeFeatures.size();
|
||||||
})));
|
})));
|
||||||
api.CallInstanceRequestAdapterCallback(
|
api.CallInstanceRequestAdapterCallback(
|
||||||
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);
|
apiInstance, WGPURequestAdapterStatus_Success, apiAdapter, nullptr);
|
||||||
|
|
Loading…
Reference in New Issue