Data Types (HLSL)

HLSL supports many different intrinsic data types. This table shows which types to use to define shader variables.

Use this intrinsic type To define this shader variable
Scalar One-component scalar
Vector, Matrix Multiple-component vector or matrix
Sampler, Texture or Buffer Sampler, texture, or buffer object
Struct, User Defined Custom structure or typedef
Array Literal scalar expressions declared containing most other types
State Object HLSL representations of state objects

 

To help you better understand how to use vectors and matrices in HLSL, you may want to read this background information on how HLSL uses per-component math.

Variables (DirectX HLSL)