---
title: "isMat(): TypeShade 셰이더 API의 타입 분류 함수 참조 문서"
description: "isMat, TypeShade API의 타입 분류에 속하는 함수입니다. ShaderType을 { kind: 'mat' } 분기로 좁힙니다."
url: https://typeshade.dev/ko/api/ismat/
language: ko
---

# `isMat()`

함수, 타입 분류

ShaderType을 { kind: 'mat' } 분기로 좁힙니다.

`import { isMat } from 'typeshade'`
`import { isMat } from 'typeshade/core/ir'`

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

## 구문

```ts
const isMat: (t: ShaderType) => t is Extract<ShaderType, { kind: "mat"; }>
```

## 매개변수

**`t` `ShaderType`**

## 반환값

`t is Extract<ShaderType, { kind: 'mat' }>`

## 설명

`ShaderType`을 `{ kind: 'mat' }` 분기로 좁힙니다. `elem: 'f32'`(기본 `matNxN<f32>`)와 `elem: 'f64'`(에뮬레이션이며, double-double 열로 이루어진 구조체로 생성된다) 두 경우 모두에 맞습니다. 두 경우를 구별해야 할 때는 [`isMat64`](https://typeshade.dev/ko/api/ismat64/)를 씁니다. 이항 연산의 타입 결정은 행렬-벡터 곱이나 행렬-행렬 곱을 처리하기 전에 이 함수를 검사합니다.

## 예제

### 예제

```ts
import { isMat } from 'typeshade'
import { mat4x4fT, mat2f64T } from 'typeshade/core/ir'

isMat(mat4x4fT) // true
isMat(mat2f64T) // also true; use isMat64 to tell them apart
```

## 함께 보기

- [`isMat64`](https://typeshade.dev/ko/api/ismat64/)

## 소스

[`src/core/ir/types/predicates.ts`, 57행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/types/predicates.ts#L57), 커밋 af54ddad5 기준
