---
title: "SD0015: array-texture layer must be an integer in TypeShade"
description: "SD0015, an error code of the TypeShade compiler. array-texture layer must be an integer"
url: https://typeshade.dev/reference/errors/sd0015/
language: en
---

# `SD0015`

Core code

array-texture layer must be an integer

The registry text and every compiler message on these pages are the compiler's own English.

## In the front end

A `"use typeshade"` file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

example.shade.ts

```ts
"use typeshade"

declare const tex: texture_2d_array<f32>
declare const smp: sampler

@fragment
export function main(uv: location<0, vec2>): vec4 {
  return textureSample(tex, smp, uv, 1.5)
}
```

**[TS8041](https://typeshade.dev/reference/errors/ts8041/)** error, line 8: A texture layer must be a whole number of 0 or more, got 1.5. WGSL rejects a fractional or negative one and GLSL ES 3.00 silently rounds it, so the two targets would disagree.

## How to fix it

The registry's hint: a fractional layer literal is a naga compile error in WGSL but silently rounds in GLSL (layer = `floor(z + 0.5)`, so 1.5 reads layer 2) — the backends would diverge; pass an integer, or an `i32`/`u32` node

## See also

**[`TS8041`](https://typeshade.dev/reference/errors/ts8041/) `TEXTURE_ARGUMENT`**

A plain argument of a texture read that the target has no overload for: a coordinate or gradient of the wrong width for the texture's dimension or of an element kind that the read does not take, a layer, mip level or sample index that is not a whole number of 0 or more, or a `level`, `bias` or `depth_ref` that is not an `f32`. A texture that is wrong for the call, such as a sampled texture handed to `textureStore`, is `TYPE_MISMATCH`.

- [Types](https://typeshade.dev/guide/language/types/)
- [`TypeShadeError`](https://typeshade.dev/api/typeshadeerror/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

Where the compiler raises this code at commit af54ddad5, one line per file:

- [`src/core/ir/node.ts:1728`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1728) (2 sites)
