Skip to content

Commit e7f4037

Browse files
committed
Rename Feature/Limit to DeviceFeature/DeviceLimit
With aliases for the old names.
1 parent 504373d commit e7f4037

File tree

5 files changed

+414
-296
lines changed

5 files changed

+414
-296
lines changed

gen/cheader.tmpl

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
*
8282
* @{
8383
*/
84-
84+
{{ if eq .Name "webgpu"}}
8585
/**
8686
* 'True' value of @ref WGPUBool.
8787
*
@@ -96,13 +96,73 @@
9696
* `stdbool.h` or C++) casts to the same value.
9797
*/
9898
#define WGPU_FALSE (UINT32_C(0))
99-
{{- range .Constants}}
100-
{{- MComment .Doc 0}}
99+
{{- end }}
100+
{{- range .Constants}}
101+
{{- MComment .Doc 0}}
101102
#define WGPU_{{ConstantCaseName .Base}} ({{.Value | CValue}})
102-
{{- end}}
103+
{{- end}}
103104

104105
/** @} */
105106

107+
{{ if eq .Name "webgpu" -}}
108+
/**
109+
* \defgroup Aliases Aliases
110+
* \brief Deprecated aliases for other definitions.
111+
*
112+
* @{
113+
*/
114+
115+
/** @deprecated alias for the new, more specific enum name. */
116+
#define WGPUFeatureName WGPUDeviceFeatureName
117+
/** @deprecated alias for the new, more specific enum name. */
118+
#define WGPUFeatureName_DepthClipControl WGPUDeviceFeatureName_DepthClipControl
119+
/** @deprecated alias for the new, more specific enum name. */
120+
#define WGPUFeatureName_Depth32FloatStencil8 WGPUDeviceFeatureName_Depth32FloatStencil8
121+
/** @deprecated alias for the new, more specific enum name. */
122+
#define WGPUFeatureName_TimestampQuery WGPUDeviceFeatureName_TimestampQuery
123+
/** @deprecated alias for the new, more specific enum name. */
124+
#define WGPUFeatureName_TextureCompressionBC WGPUDeviceFeatureName_TextureCompressionBC
125+
/** @deprecated alias for the new, more specific enum name. */
126+
#define WGPUFeatureName_TextureCompressionBCSliced3D WGPUDeviceFeatureName_TextureCompressionBCSliced3D
127+
/** @deprecated alias for the new, more specific enum name. */
128+
#define WGPUFeatureName_TextureCompressionETC2 WGPUDeviceFeatureName_TextureCompressionETC2
129+
/** @deprecated alias for the new, more specific enum name. */
130+
#define WGPUFeatureName_TextureCompressionASTC WGPUDeviceFeatureName_TextureCompressionASTC
131+
/** @deprecated alias for the new, more specific enum name. */
132+
#define WGPUFeatureName_TextureCompressionASTCSliced3D WGPUDeviceFeatureName_TextureCompressionASTCSliced3D
133+
/** @deprecated alias for the new, more specific enum name. */
134+
#define WGPUFeatureName_IndirectFirstInstance WGPUDeviceFeatureName_IndirectFirstInstance
135+
/** @deprecated alias for the new, more specific enum name. */
136+
#define WGPUFeatureName_ShaderF16 WGPUDeviceFeatureName_ShaderF16
137+
/** @deprecated alias for the new, more specific enum name. */
138+
#define WGPUFeatureName_RG11B10UfloatRenderable WGPUDeviceFeatureName_RG11B10UfloatRenderable
139+
/** @deprecated alias for the new, more specific enum name. */
140+
#define WGPUFeatureName_BGRA8UnormStorage WGPUDeviceFeatureName_BGRA8UnormStorage
141+
/** @deprecated alias for the new, more specific enum name. */
142+
#define WGPUFeatureName_Float32Filterable WGPUDeviceFeatureName_Float32Filterable
143+
/** @deprecated alias for the new, more specific enum name. */
144+
#define WGPUFeatureName_Float32Blendable WGPUDeviceFeatureName_Float32Blendable
145+
/** @deprecated alias for the new, more specific enum name. */
146+
#define WGPUFeatureName_ClipDistances WGPUDeviceFeatureName_ClipDistances
147+
/** @deprecated alias for the new, more specific enum name. */
148+
#define WGPUFeatureName_DualSourceBlending WGPUDeviceFeatureName_DualSourceBlending
149+
/** @deprecated alias for the new, more specific enum name. */
150+
#define WGPUFeatureName_Subgroups WGPUDeviceFeatureName_Subgroups
151+
152+
/** @deprecated alias for the new, more specific struct name. */
153+
#define WGPULimits WGPUDeviceLimits
154+
/** @deprecated alias for the new, more specific struct init macro name. */
155+
#define WGPU_LIMITS_INIT WGPU_DEVICE_LIMITS_INIT
156+
157+
/** @deprecated alias for the new, more specific struct name. */
158+
#define WGPUSupportedFeatures WGPUSupportedDeviceFeatures
159+
/** @deprecated alias for the new, more specific struct init macro name. */
160+
#define WGPU_SUPPORTED_FEATURES_INIT WGPU_SUPPORTED_DEVICE_FEATURES_INIT
161+
162+
/** @} */
163+
164+
{{ end -}}
165+
106166
/**
107167
* \defgroup UtilityTypes Utility Types
108168
*

tests/compile/main.inl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ int main(void) {
3232
uint32_t x = a.maxTextureDimension2D = WGPU_LIMIT_U32_UNDEFINED;
3333
uint64_t y = a.maxBufferSize = WGPU_LIMIT_U64_UNDEFINED;
3434
}
35+
{
36+
WGPUDeviceLimits a;
37+
uint32_t x = a.maxTextureDimension2D = WGPU_LIMIT_U32_UNDEFINED;
38+
uint64_t y = a.maxBufferSize = WGPU_LIMIT_U64_UNDEFINED;
39+
}
3540
{
3641
WGPUPassTimestampWrites a;
3742
a.beginningOfPassWriteIndex = WGPU_QUERY_SET_INDEX_UNDEFINED;
@@ -75,6 +80,7 @@ int main(void) {
7580
{ WGPURequestAdapterCallbackInfo x = WGPU_REQUEST_ADAPTER_CALLBACK_INFO_INIT; }
7681
{ WGPURequestDeviceCallbackInfo x = WGPU_REQUEST_DEVICE_CALLBACK_INFO_INIT; }
7782
{ WGPUUncapturedErrorCallbackInfo x = WGPU_UNCAPTURED_ERROR_CALLBACK_INFO_INIT; }
83+
7884
{ WGPUAdapterInfo x = WGPU_ADAPTER_INFO_INIT; }
7985
{ WGPUBindGroupEntry x = WGPU_BIND_GROUP_ENTRY_INIT; }
8086
{ WGPUBlendComponent x = WGPU_BLEND_COMPONENT_INIT; }
@@ -85,6 +91,7 @@ int main(void) {
8591
{ WGPUCommandEncoderDescriptor x = WGPU_COMMAND_ENCODER_DESCRIPTOR_INIT; }
8692
{ WGPUCompilationMessage x = WGPU_COMPILATION_MESSAGE_INIT; }
8793
{ WGPUConstantEntry x = WGPU_CONSTANT_ENTRY_INIT; }
94+
{ WGPUDeviceLimits x = WGPU_DEVICE_LIMITS_INIT; }
8895
{ WGPUFuture x = WGPU_FUTURE_INIT; }
8996
{ WGPUInstanceLimits x = WGPU_INSTANCE_LIMITS_INIT; }
9097
{ WGPULimits x = WGPU_LIMITS_INIT; }
@@ -106,6 +113,7 @@ int main(void) {
106113
{ WGPUShaderSourceWGSL x = WGPU_SHADER_SOURCE_WGSL_INIT; }
107114
{ WGPUStencilFaceState x = WGPU_STENCIL_FACE_STATE_INIT; }
108115
{ WGPUStorageTextureBindingLayout x = WGPU_STORAGE_TEXTURE_BINDING_LAYOUT_INIT; }
116+
{ WGPUSupportedDeviceFeatures x = WGPU_SUPPORTED_DEVICE_FEATURES_INIT; }
109117
{ WGPUSupportedFeatures x = WGPU_SUPPORTED_FEATURES_INIT; }
110118
{ WGPUSupportedInstanceFeatures x = WGPU_SUPPORTED_INSTANCE_FEATURES_INIT; }
111119
{ WGPUSupportedWGSLLanguageFeatures x = WGPU_SUPPORTED_WGSL_LANGUAGE_FEATURES_INIT; }

tests/extensions/webgpu_extension.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@
3232
* @{
3333
*/
3434

35-
/**
36-
* 'True' value of @ref WGPUBool.
37-
*
38-
* @remark It's not usually necessary to use this, as `true` (from
39-
* `stdbool.h` or C++) casts to the same value.
40-
*/
41-
#define WGPU_TRUE (UINT32_C(1))
42-
/**
43-
* 'False' value of @ref WGPUBool.
44-
*
45-
* @remark It's not usually necessary to use this, as `false` (from
46-
* `stdbool.h` or C++) casts to the same value.
47-
*/
48-
#define WGPU_FALSE (UINT32_C(0))
4935
/**
5036
* New constant should have the namespace prefix in the name by default.
5137
*/

0 commit comments

Comments
 (0)