Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3611464

Browse files
committed
Use "get the entry point" algorithm where necessary.
Change references to `GPUProgrammableStage.entryPoint`, which is no longer required (gpuweb#4387), to uses of the "get the entry point" algorithm. Rather than talking about resources "statically used" by a GPUProgrammableStage, talk about resources "statically used" by a specific entry point. Use "get the entry point" as necessary to determine the relevant entry point.
1 parent febbc9c commit 3611464

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed

spec/index.bs

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7107,9 +7107,12 @@ run the following steps:
71077107

71087108
1. For each {{GPUProgrammableStage}} |stageDesc| in the descriptor used to create |pipeline|:
71097109

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|:
71137116

71147117
1. Let |group| be |resource|'s "group" decoration.
71157118
1. Let |binding| be |resource|'s "binding" decoration.
@@ -7270,6 +7273,11 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
72707273
The name of the function in {{GPUProgrammableStage/module}} that this stage will use to
72717274
perform its work.
72727275

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+
72737281
: <dfn>constants</dfn>
72747282
::
72757283
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,
73437351
To <dfn abstract-op>get the entry point</dfn>({{GPUShaderStage}} |stage|,
73447352
{{GPUProgrammableStage}} |descriptor|)
73457353

7346-
- If |descriptor|.{{GPUProgrammableStage/entryPoint}} is [=map/exists|provided=]:
7354+
- If |descriptor|.{{GPUProgrammableStage/entryPoint}} is [=map/exists|provided=]:
73477355

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.
73507360

7351-
Otherwise:
7361+
- Otherwise, return `null`.
7362+
7363+
- Otherwise:
73527364

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`.
73557369

73567370
</div>
73577371

@@ -7367,19 +7381,11 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
73677381
Return `true` if all of the following conditions are met, and `false` otherwise:
73687382

73697383
- |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|:
73817387
- [$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:
73837389
1. Let |texture| be the {{GPUBindGroupLayoutEntry}} corresponding to the sampled texture in the call.
73847390
1. Let |sampler| be the {{GPUBindGroupLayoutEntry}} corresponding to the used sampler in the call.
73857391
1. If |sampler|.{{GPUSamplerBindingLayout/type}} is {{GPUSamplerBindingType/"filtering"}},
@@ -7396,7 +7402,7 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
73967402
Let the type of that constant be |T|.
73977403
1. Converting the IDL value |value| [$to WGSL type$] |T| must not throw a {{TypeError}}.
73987404
- For each [=pipeline-overridable constant identifier string=] |key| which is
7399-
[=statically used=] by |descriptor|:
7405+
[=statically used=] by |entryPoint|:
74007406
- If the pipeline-overridable constant identified by |key|
74017407
[=pipeline-overridable constant default value|does not have a default value=],
74027408
|descriptor|.{{GPUProgrammableStage/constants}} must [=map/contain=] |key|.
@@ -7569,9 +7575,8 @@ typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32,
75697575
<div algorithm>
75707576
A resource binding, [=pipeline-overridable=] constant, shader stage input, or shader stage output
75717577
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.
75757580
</div>
75767581

75777582
<h3 id=gpucomputepipeline data-dfn-type=interface>`GPUComputePipeline`
@@ -7657,16 +7662,17 @@ dictionary GPUComputePipelineDescriptor
76577662
- |layout| must be [$valid to use with$] |this|.
76587663
- [$validating GPUProgrammableStage$]({{GPUShaderStage/COMPUTE}},
76597664
|descriptor|.{{GPUComputePipelineDescriptor/compute}}, |layout|) must succeed.
7665+
- Let |entryPoint| be [$get the entry point$]({{GPUShaderStage/COMPUTE}}, |descriptor|.{{GPUComputePipelineDescriptor/compute}}). [=Assert=] this is not `null`.
76607666
- Let |workgroupStorageUsed| be the sum of [=roundUp=](16, [$SizeOf$](|T|)) over each
76617667
type |T| of all variables with address space "[=address spaces/workgroup=]"
7662-
[=statically used=] by |descriptor|.{{GPUComputePipelineDescriptor/compute}}.
7668+
[=statically used=] by |entryPoint|.
76637669

76647670
|workgroupStorageUsed| must be &le;
76657671
|device|.limits.{{supported limits/maxComputeWorkgroupStorageSize}}.
7666-
- |descriptor|.{{GPUComputePipelineDescriptor/compute}} must use &le;
7672+
- |entryPoint| must use &le;
76677673
|device|.limits.{{supported limits/maxComputeInvocationsPerWorkgroup}} per
76687674
workgroup.
7669-
- Each component of |descriptor|.{{GPUComputePipelineDescriptor/compute}}'s
7675+
- Each component of |entryPoint|'s
76707676
`workgroup_size` attribute must be &le; the corresponding component in
76717677
[|device|.limits.{{supported limits/maxComputeWorkgroupSizeX}},
76727678
|device|.limits.{{supported limits/maxComputeWorkgroupSizeY}},
@@ -9302,7 +9308,8 @@ dictionary GPUVertexAttribute {
93029308
sizeof(|attrib|.{{GPUVertexAttribute/format}}).
93039309
- |attrib|.{{GPUVertexAttribute/shaderLocation}} is &lt;
93049310
|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|,
93069313
there is a corresponding |attrib| element of |descriptor|.{{GPUVertexBufferLayout/attributes}} for which
93079314
all of the following are true:
93089315
- The type |T| of |var| is compatible with |attrib|.{{GPUVertexAttribute/format}}'s [=vertex data type=]:

0 commit comments

Comments
 (0)