---
title: "GLSL ES 3.00 types and their TypeShade spelling"
description: "The GLSL ES 3.00 type surface with the TypeShade spelling of each one: scalars, vectors, matrices, arrays, samplers, and the types this target refuses."
url: https://typeshade.dev/guide/language/from-glsl/types/
language: en
---

# Types

The scalar and vector names are WGSL's, since one source has to serve both targets, and the GLSL writer spells each one in this target's terms. A declaration therefore says `f32` where the emitted shader says `float`.

## Scalars

GLSL ES 3.00 TypeShade

```glsl
float
```

```ts
f32
```

```glsl
int
```

```ts
i32
```

```glsl
uint
```

```ts
u32
```

```glsl
bool
```

```ts
bool
```

## Vectors

GLSL ES 3.00 TypeShade

```glsl
vec3
```

```ts
vec3
```

```glsl
ivec3
```

```ts
vec3i
```

```glsl
uvec3
```

```ts
vec3u
```

```glsl
bvec3
```

```ts
vec3b
```

`vec2` and `vec4` read the same way, and so do the integer, unsigned and boolean forms of each. A vector of doubles has no form on either target and is rewritten into `f32` lanes before the writer runs.

## Matrices and arrays

GLSL ES 3.00 TypeShade

```glsl
mat4
```

```ts
mat4
```

```glsl
mat3
```

```ts
mat3
```

```glsl
mat2x3
```

```ts
mat2x3
```

A square matrix keeps the short name every driver's error messages use, and the other six shapes are written `matCxR`, columns then rows, the same way this target writes them.

GLSL ES 3.00 TypeShade

```glsl
float[4]
```

```ts
array<f32, 4>
```

```glsl
float[2]
```

```ts
[f32, f32]
```

A tuple is a list of a length the type fixes, so `[f32, f32]` and `array<f32, 2>` reach the same type. An array whose length is not known until the program runs is a storage buffer, which this target has no form for, so a module with one is rewritten to read from a data texture instead.

## Samplers

This target fuses the texture and the sampler into one combined sampler, and WebGPU keeps them apart. A TypeShade file declares the two the WebGPU way and the GLSL writer fuses them, so the sampler argument disappears from every read and the binding it stood in is dropped from the layout the host binds.

GLSL ES 3.00 TypeShade

```glsl
sampler2D
```

```ts
texture_2d<f32>
```

```glsl
usampler2D
```

```ts
texture_2d<u32>
```

```glsl
isampler2D
```

```ts
texture_2d<i32>
```

```glsl
sampler2DArray
```

```ts
texture_2d_array<f32>
```

```glsl
samplerCube
```

```ts
texture_cube<f32>
```

```glsl
sampler3D
```

```ts
texture_3d<f32>
```

```glsl
sampler2DShadow
```

```ts
texture_depth_2d
```

standalone sampler — fused into the combined sampler2D

```ts
sampler
```

standalone comparison sampler — fused into the combined sampler2DShadow

```ts
sampler_comparison
```

A depth texture is the exception that proves the fusing: its combined type depends on how the module reads it, so the binding emit decides it. Every read of one this surface admits is a comparison, which makes it the shadow form.

## Types with no GLSL form

Each of these is refused by the writer, and the cell beside it is the sentence the writer throws. A module carrying one still emits its WGSL, so these are the lines that make a shader WebGPU only.

TypeShade What the compiler says

```ts
texture_1d<f32>
```

`texture_1d`<`f32`> is not supported yet by the GLSL backend ([Rule 10.5](https://typeshade.dev/reference/rules/10-5/)); GLSL ES 3.00 has no 1d or cube-array samplers

```ts
texture_cube_array<f32>
```

`texture_cube_array`<`f32`> is not supported yet by the GLSL backend (Rule 10.5); GLSL ES 3.00 has no 1d or cube-array samplers

```ts
texture_multisampled_2d<f32>
```

multisampled texture load — sampler2DMS is ES 3.10 (msaaTextureLoad fails the module closed first)

```ts
texture_storage_2d<"rgba8unorm", "write">
```

`texture_storage_2d`<rgba8unorm, write> is not supported yet by the GLSL backend (Rule 10.5); GLSL ES 3.00 has no image load/store (it is ES 3.10)

```ts
atomic<u32>
```

`atomic<u32>` is not supported yet in a GLSL ES 3.00 stage (Rule 10.5); a `@compute` entry that reaches no texture runs it on WebGL2 as its pass program ([Rule 11.8](https://typeshade.dev/reference/rules/11-8/))
