@@ -7107,9 +7107,12 @@ run the following steps:
7107
7107
7108
7108
1. For each {{GPUProgrammableStage}} |stageDesc| in the descriptor used to create |pipeline|:
7109
7109
7110
- 1. Let |shaderStage| be the {{GPUShaderStageFlags}} for |stageDesc|.{{GPUProgrammableStage/entryPoint}}
7111
- in |stageDesc|.{{GPUProgrammableStage/module}}.
7112
- 1. For each resource |resource| [=statically used=] by |stageDesc|:
7110
+ 1. Let |shaderStage| be the {{GPUShaderStageFlags}} for the shader stage
7111
+ at which |stageDesc| is used in |pipeline|.
7112
+
7113
+ 1. Let |entryPoint| be [$get the entry point$](|shaderStage|, |stageDesc|). [=Assert=] this is not `null`.
7114
+
7115
+ 1. For each resource |resource| [=statically used=] by |entryPoint|:
7113
7116
7114
7117
1. Let |group| be |resource|'s "group" decoration.
7115
7118
1. Let |binding| be |resource|'s "binding" decoration.
@@ -7270,6 +7273,11 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
7270
7273
The name of the function in {{GPUProgrammableStage/module}} that this stage will use to
7271
7274
perform its work.
7272
7275
7276
+ NOTE: Since the {{GPUProgrammableStage/entryPoint}} dictionary member is
7277
+ not required, the consumer of a {{GPUProgrammableStage}} must use the
7278
+ "[$get the entry point$]" algorithm to determine which entry point
7279
+ it refers to.
7280
+
7273
7281
: <dfn>constants</dfn>
7274
7282
::
7275
7283
Specifies the values of [=pipeline-overridable=] constants in the shader module
@@ -7343,15 +7351,21 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
7343
7351
To <dfn abstract-op>get the entry point</dfn>({{GPUShaderStage}} |stage|,
7344
7352
{{GPUProgrammableStage}} |descriptor|)
7345
7353
7346
- - If |descriptor|.{{GPUProgrammableStage/entryPoint}} is [=map/exists|provided=]:
7354
+ - If |descriptor|.{{GPUProgrammableStage/entryPoint}} is [=map/exists|provided=]:
7347
7355
7348
- - Return the single entry point in |descriptor|.{{GPUProgrammableStage/module}}
7349
- with a name equalling |descriptor|.{{GPUProgrammableStage/entryPoint}}.
7356
+ - If |descriptor|.{{GPUProgrammableStage/module}} contains an entry point
7357
+ whose name equals |descriptor|.{{GPUProgrammableStage/entryPoint}},
7358
+ and whose shader stage equals |stage|,
7359
+ return that entry point.
7350
7360
7351
- Otherwise:
7361
+ - Otherwise, return `null`.
7362
+
7363
+ - Otherwise:
7352
7364
7353
- - Return the single entry point in |descriptor|.{{GPUProgrammableStage/module}}
7354
- with a shader stage equalling |stage|.
7365
+ - If there is exactly one entry point in |descriptor|.{{GPUProgrammableStage/module}}
7366
+ whose shader stage equals |stage|, return that entry point.
7367
+
7368
+ - Otherwise, return `null`.
7355
7369
7356
7370
</div>
7357
7371
@@ -7367,19 +7381,11 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
7367
7381
Return `true` if all of the following conditions are met, and `false` otherwise:
7368
7382
7369
7383
- |descriptor|.{{GPUProgrammableStage/module}} must be a [=valid=] {{GPUShaderModule}}.
7370
- - If |descriptor|.{{GPUProgrammableStage/entryPoint}} is [=map/exists|provided=]:
7371
-
7372
- - |descriptor|.{{GPUProgrammableStage/module}} must contain exactly one
7373
- entry point with a name equalling |descriptor|.{{GPUProgrammableStage/entryPoint}},
7374
- and its shader stage must equal |stage|.
7375
-
7376
- Otherwise:
7377
-
7378
- - |descriptor|.{{GPUProgrammableStage/module}} must contain exactly one
7379
- entry point for shader stage |stage|.
7380
- - For each |binding| that is [=statically used=] by |descriptor|:
7384
+ - Let |entryPoint| be [$get the entry point$](|stage|, |descriptor|).
7385
+ - |entryPoint| must not be `null`.
7386
+ - For each |binding| that is [=statically used=] by |entryPoint|:
7381
7387
- [$validating shader binding$](|binding|, |layout|) must return `true`.
7382
- - For each texture and sampler [=statically used=] together in texture sampling call in |descriptor| :
7388
+ - For each texture and sampler [=statically used=] together by |entryPoint| in texture sampling calls :
7383
7389
1. Let |texture| be the {{GPUBindGroupLayoutEntry}} corresponding to the sampled texture in the call.
7384
7390
1. Let |sampler| be the {{GPUBindGroupLayoutEntry}} corresponding to the used sampler in the call.
7385
7391
1. If |sampler|.{{GPUSamplerBindingLayout/type}} is {{GPUSamplerBindingType/"filtering"}},
@@ -7396,7 +7402,7 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
7396
7402
Let the type of that constant be |T|.
7397
7403
1. Converting the IDL value |value| [$to WGSL type$] |T| must not throw a {{TypeError}}.
7398
7404
- For each [=pipeline-overridable constant identifier string=] |key| which is
7399
- [=statically used=] by |descriptor |:
7405
+ [=statically used=] by |entryPoint |:
7400
7406
- If the pipeline-overridable constant identified by |key|
7401
7407
[=pipeline-overridable constant default value|does not have a default value=],
7402
7408
|descriptor|.{{GPUProgrammableStage/constants}} must [=map/contain=] |key|.
@@ -7569,9 +7575,8 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
7569
7575
<div algorithm>
7570
7576
A resource binding, [=pipeline-overridable=] constant, shader stage input, or shader stage output
7571
7577
is considered to be <dfn dfn lt="statically used|static use">statically used</dfn>
7572
- by a {{GPUProgrammableStage}} if it is present in the
7573
- [=interface of a shader stage|interface of the shader stage=] of the specified
7574
- {{GPUProgrammableStage/entryPoint}}, in the specified shader {{GPUProgrammableStage/module}}.
7578
+ by an entry point if it is present in the [=interface of a shader
7579
+ stage|interface of the shader stage=] for that entry point.
7575
7580
</div>
7576
7581
7577
7582
<h3 id=gpucomputepipeline data-dfn-type=interface>`GPUComputePipeline`
@@ -7657,16 +7662,17 @@ dictionary GPUComputePipelineDescriptor
7657
7662
- |layout| must be [$valid to use with$] |this|.
7658
7663
- [$validating GPUProgrammableStage$]({{GPUShaderStage/COMPUTE}},
7659
7664
|descriptor|.{{GPUComputePipelineDescriptor/compute}}, |layout|) must succeed.
7665
+ - Let |entryPoint| be [$get the entry point$]({{GPUShaderStage/COMPUTE}}, |descriptor|.{{GPUComputePipelineDescriptor/compute}}). [=Assert=] this is not `null`.
7660
7666
- Let |workgroupStorageUsed| be the sum of [=roundUp=](16, [$SizeOf$](|T|)) over each
7661
7667
type |T| of all variables with address space "[=address spaces/workgroup=]"
7662
- [=statically used=] by |descriptor|.{{GPUComputePipelineDescriptor/compute}} .
7668
+ [=statically used=] by |entryPoint| .
7663
7669
7664
7670
|workgroupStorageUsed| must be ≤
7665
7671
|device|.limits.{{supported limits/maxComputeWorkgroupStorageSize}}.
7666
- - |descriptor|.{{GPUComputePipelineDescriptor/compute}} must use ≤
7672
+ - |entryPoint| must use ≤
7667
7673
|device|.limits.{{supported limits/maxComputeInvocationsPerWorkgroup}} per
7668
7674
workgroup.
7669
- - Each component of |descriptor|.{{GPUComputePipelineDescriptor/compute}} 's
7675
+ - Each component of |entryPoint| 's
7670
7676
`workgroup_size` attribute must be ≤ the corresponding component in
7671
7677
[|device|.limits.{{supported limits/maxComputeWorkgroupSizeX}},
7672
7678
|device|.limits.{{supported limits/maxComputeWorkgroupSizeY}},
@@ -9302,7 +9308,8 @@ dictionary GPUVertexAttribute {
9302
9308
sizeof(|attrib|.{{GPUVertexAttribute/format}}).
9303
9309
- |attrib|.{{GPUVertexAttribute/shaderLocation}} is <
9304
9310
|device|.{{GPUObjectBase/[[device]]}}.{{device/[[limits]]}}.{{supported limits/maxVertexAttributes}}.
9305
- - For every vertex attribute |var| [=statically used=] by |vertexStage|,
9311
+ - Let |entryPoint| be [$get the entry point$]({{GPUShaderStage/VERTEX}}, |vertexStage|). [=Assert=] this is not `null`.
9312
+ - For every vertex attribute |var| [=statically used=] by |entryPoint|,
9306
9313
there is a corresponding |attrib| element of |descriptor|.{{GPUVertexBufferLayout/attributes}} for which
9307
9314
all of the following are true:
9308
9315
- The type |T| of |var| is compatible with |attrib|.{{GPUVertexAttribute/format}}'s [=vertex data type=]:
0 commit comments