---
title: "SD0015: array-texture layer must be an integer"
description: "SD0015, TypeShade 컴파일러의 오류 코드입니다. array-texture layer must be an integer"
url: https://typeshade.dev/ko/reference/errors/sd0015/
language: ko
---

# `SD0015`

코어 코드

array-texture layer must be an integer

레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

## 프런트엔드에서

같은 실수를 한 `"use typeshade"` 파일은 이 검사까지 오지 않습니다. 프런트엔드가 자기 코드로 먼저 거부하기 때문입니다. 빌드할 때 컴파일한 아래 프로그램에는 다음 진단이 나옵니다.

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/ko/reference/errors/ts8041/)** error, 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.

## 고치는 법

레지스트리의 힌트: 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

## 함께 보기

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

타깃에 오버로드가 없는 텍스처 읽기의 일반 인자입니다. 텍스처 차원에 비해 너비가 틀렸거나 읽기가 받지 않는 요소 종류인 좌표나 기울기, 0 이상의 정수가 아닌 레이어, 밉 레벨, 샘플 인덱스, `f32`가 아닌 `level`, `bias`, `depth_ref`가 그렇습니다. 호출에 맞지 않는 텍스처 자체, 예를 들어 `textureStore`에 넘긴 샘플링용 텍스처는 `TYPE_MISMATCH`입니다.

- [타입](https://typeshade.dev/ko/guide/language/types/)
- [`TypeShadeError`](https://typeshade.dev/ko/api/typeshadeerror/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

커밋 af54ddad5에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.

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