## A.3. Validation Rules within a Module

A SPIR-V module passed to `vkCreateShaderModule` must conform to the following rules:

- Every entry point must have no return value and accept no arguments.
- Recursion: The static function-call graph for an entry point must not contain cycles.
- The Logical addressing model must be selected.

- Scope for execution must be limited to:

  - Workgroup
  - Subgroup

- Scope for memory must be limited to:

  - Device
  - Workgroup
  - Invocation
- The `OriginLowerLeft` execution mode must not be used; fragment entry points must declare `OriginUpperLeft`.
- The `PixelCenterInteger` execution mode must not be used. Pixels are always centered at half-integer coordinates.

- Images

  - `OpTypeImage` must declare a scalar 32-bit float or 32-bit integer type for the “Sampled Type”. (`RelaxedPrecision` can be applied to a sampling instruction and to the variable holding the result of a sampling instruction.)
  - `OpSampledImage` must only consume an “Image” operand whose type has its “Sampled” operand set to 1.
  - The (u,v) coordinates used for a `SubpassData` must be the <id> of a constant vector (0,0), or if a layer coordinate is used, must be a vector that was formed with constant 0 for the u and v components.
  - The “Depth” operand of `OpTypeImage` is ignored.

- Decorations

  - The `GLSLShared` and `GLSLPacked` decorations must not be used.
  - The `Flat`, `NoPerspective`, `Sample`, and `Centroid` decorations must not be used on variables with storage class other than `Input` or on variables used in the interface of non-fragment shader entry points.
  - The `Patch` decoration must not be used on variables in the interface of a vertex, geometry, or fragment shader stage’s entry point.
- `OpTypeRuntimeArray` must only be used for the last member of an `OpTypeStruct` in the `Uniform` storage class.
- Linkage: See Shader Interfaces for additional linking and validation rules.

- Compute Shaders

  - For each compute shader entry point, either a `LocalSize` execution mode or an object decorated with the `WorkgroupSize` decoration must be specified.