---
title: "texture(): TypeShade 셰이더 API의 런타임 분류 함수 참조 문서"
description: "texture, TypeShade API의 런타임 분류에 속하는 함수입니다. 블록의 기본 디바이스에 만드는 텍스처입니다. using _ = device.use()가 디바이스를 정하며…"
url: https://typeshade.dev/ko/api/texture/
language: ko
---

# `texture()`

함수, 런타임 분류

블록의 기본 디바이스에 만드는 텍스처입니다. using \_ = device.use()가 디바이스를 정하며, 텍스처는 device.texture(options)가 만드는 것과 같습니다.

`import { texture } from 'typeshade/runtime'`

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

```ts
function texture(options: {
  readonly size: readonly [number, number];
  readonly format: string;
  readonly storage?: boolean;
}): Texture
```

## 매개변수

**`options` `{ readonly size: readonly [number, number]; readonly format: string; readonly storage?: boolean; }`**

`size`와 `format`이며, `device.texture()`가 받는 것과 같습니다.

## 반환값

`Texture`

디바이스의 텍스처입니다.

## 예외

**`TypeError`**

사용 중인 디바이스가 없으면 `TypeError`가 발생하며, `device.texture()`가 던지는 경우에도 발생합니다.

## 설명

텍스처는 자신의 디바이스에만 있으므로 리전의 범위를 차지하지 않습니다(R17).

## 관련 가이드

- [함수와 진입점](https://typeshade.dev/ko/guide/internals/functions-and-entry-points/)
- [CPU 오라클 안내서](https://typeshade.dev/ko/guide/internals/the-cpu-oracle/)

## 함께 보기

- [`f64T`](https://typeshade.dev/ko/api/f64t/)
- [`storageBuffer`](https://typeshade.dev/ko/api/storagebuffer/)

## 소스

[`src/runtime/resource.ts`, 1129행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/resource.ts#L1129), 커밋 af54ddad5 기준
