Data Types

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
Buffer Buffer, which contains one or more scalars
Scalar One-component scalar
Vector, Matrix Multiple-component vector or matrix
Sampler, Shader, Texture Sampler, shader, or texture object
Struct, User Defined Custom structure or typedef


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)