Cg Toolkit Cg 3.1 Toolkit Documentation
Cg / Profiles / hs_5_0

Name

hs_5_0 - Translation profile to DirectX 11's High Level Shader Language for hull shaders.

Synopsis

  vs_5_0

Description

This Direct3D profile translates Cg into DirectX 11's High Level Shader Language (HLSL11) for hull shaders.

The compiler output for this profile conforms to the textual high-level language defined by DirectX 11's High Level Shading Language.

The limitations of the vs_5_0 profile depend on what HLSL profile to which the translated HLSL code is compiled.

3D Api Dependencies

Requires Direct3D 11 support.

  http://msdn.microsoft.com/en-us/library/ff476340.aspx
  http://msdn.microsoft.com/en-us/library/ff471356.aspx

Profile Options

-po pad16 This will add padding variables to the cbuffer declarations to match the 16 byte padding the GP4 OpenGL profiles use. This makes sure each variable in the cbuffer uses an entire float4 constant instead of the tight packing HLSL11 normally uses.

Data Types

In general, the Cg data types translate to the HLSL11 data types with the same name.

float, half, fixed
These numeric data types all correspond to standard IEEE 754 single-precision floating-point encoding with a sign bit, 23 mantissa bits, and 8 exponent bits (biased by 128), sometimes called s10e5.
int
This integral data type operates like an integer over the -2^24 to 2^24 range. The result of int by int division is an integer (rounding down) to match C.

Semantics

Input Semantics

The varying input semantics in the hs_5_0 profile correspond to the respectively named varying output semantics of the vs_5_0 profile.

Binding Semantics Name           Corresponding Data

POSITION                         Object-space position (SV_Position)

NORMAL                           Object-space normal

COLOR                            Primary color (float4) (SV_Target)
COLOR0
DIFFUSE

COLOR1                           Secondary color (float4)
SPECULAR

FOGCOORD                         Fog coordinate

TEXCOORD#                        Texture coordinate set #

Uniform Input Semantics

Output Semantics

Binding Semantics Name         Corresponding Data

POSITION                       Clip-space position (SV_Position)
HPOS

COLOR                          Front primary color (SV_Target)
COLOR0
COL0
COL

COLOR1                         Front secondary color
COL1

TEXCOORD#                      Texture coordinate set #
TEX#                           TEX# is translated to TEXCOORD#

FOGC                           Fog coordinate
FOG

PSIZE                          Point size
PSIZ

Standard Library Issues

This profile is limited to standard library support available in HLSL11 for hull shaders. In general, the Cg and HLSL11 standard libraries are very similar.

See Also

ps_5_0, vs_5_0, gs_5_0, ds_5_0


Cg Toolkit | Cg Toolkit | Download | Release Archive | Profiles | Reference | Books | Discussions |


Cg Profiles

arbfp1
arbvp1
ds_5_0
fp20
fp30
fp40
glslf
glslg
glsl
glslv
gp4fp
gp4gp
gp4
gp4vp
gp5fp
gp5gp
gp5
gp5tcp
gp5tep
gp5vp
gs_4_0
gs_5_0
hlsl10
hlsl11
hlslf
hlslv
hs_5_0
ps_1_1
ps_1_2
ps_1_3
ps_2_0
ps_2_sw
ps_2_x
ps_3_0
ps_4_0
ps_5_0
vp20
vp30
vp40
vs_1_1
vs_2_0
vs_2_sw
vs_2_x
vs_3_0
vs_4_0
vs_5_0