mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
Implement new defaults for Texture::CreateView
https://github.com/gpuweb/gpuweb/pull/389 except for removing createDefaultView https://github.com/gpuweb/gpuweb/pull/407 This will need to slightly change again when https://github.com/gpuweb/gpuweb/pull/424 lands. Bug: dawn:214 Change-Id: Id904b55cea6d77fcf7d971bd743468c7d82a9aa8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10440 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
f19c328b5b
commit
93196db8ef
@@ -61,11 +61,11 @@ class Type:
|
||||
self.name = Name(name, native=native)
|
||||
self.category = json_data['category']
|
||||
|
||||
EnumValue = namedtuple('EnumValue', ['name', 'value'])
|
||||
EnumValue = namedtuple('EnumValue', ['name', 'value', 'valid'])
|
||||
class EnumType(Type):
|
||||
def __init__(self, name, json_data):
|
||||
Type.__init__(self, name, json_data)
|
||||
self.values = [EnumValue(Name(m['name']), m['value']) for m in self.json_data['values']]
|
||||
self.values = [EnumValue(Name(m['name']), m['value'], m.get('valid', True)) for m in self.json_data['values']]
|
||||
|
||||
# Assert that all values are unique in enums
|
||||
all_values = set()
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace dawn_native {
|
||||
{% for type in by_category["enum"] %}
|
||||
MaybeError Validate{{type.name.CamelCase()}}(dawn::{{as_cppType(type.name)}} value) {
|
||||
switch (value) {
|
||||
{% for value in type.values %}
|
||||
{% for value in type.values if value.valid %}
|
||||
case dawn::{{as_cppType(type.name)}}::{{as_cppEnum(value.name)}}:
|
||||
return {};
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user