---
title: "TS8041 TEXTURE_ARGUMENT: TypeShade 컴파일러가 진단에 붙이는 오류 코드 한 가지"
description: "TS8041 TEXTURE_ARGUMENT, TypeShade 컴파일러의 오류 코드입니다. 타깃에 오버로드가 없는 텍스처 읽기의 일반 인자입니다."
url: https://typeshade.dev/ko/reference/errors/ts8041/
language: ko
---

# `TS8041`

프런트엔드 코드 `TEXTURE_ARGUMENT`

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

레지스트리에는 이 상수에 대한 문서 주석이 없습니다. 그래서 위 설명은 컴파일러가 이 코드와 함께 내는 메시지를 보고 이 사이트가 쓴 것입니다.

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

## 예제

example.shade.ts

```ts
"use typeshade"

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

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

빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.

**TS8041** error, 8행: `textureSample` on a `texture_2d`<`f32`> takes a `vec2` coordinate; got `vec3`.

## 고치는 법

같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.

example.shade.ts

```ts
"use typeshade"

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

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

## 함께 보기

**[`SD0015`](https://typeshade.dev/ko/reference/errors/sd0015/)**

array-texture layer must be an integer

- [리소스](https://typeshade.dev/ko/guide/language/resources/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

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

- [`src/compiler/ts/lower/expression-call/args.ts:66`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call/args.ts#L66) (5곳)
