Shader Models vs Shader Profiles

1649 篇文章 12 订阅
1623 篇文章 23 订阅

The High Level Shading Language for DirectX implements a series of shader models. Using HLSL, you can create C-like programmable shaders for the Direct3D pipeline. Each shader model builds on the capabilites of the model before it, implementing more functionality with fewer restrictions.

Shader model 1 started with DirectX 8 and included assembly level and C-like instructions. This model has many limitations caused by early programmable shader hardware. Shader model 2 and 3 greatly expanded on the number of instructions, and constants shaders could use. They are much more powerful than shader model 1, but still carry some of the existing limitations of the first shader model.

Starting with Windows Vista, shader model 4 is a complete redesign. It allows unlimited instructions and constants (within hardware constraints of your machine), has templated objects to make texture sampling cleaner and more efficient, and has the fewest restrictions of any shader model. It does however require the Windows Driver Model which is only available on the Windows Vista (or later) operating system.

Shader Profiles

A shader profile is the target for compiling a shader; this table lists the shader profiles that are supported by each shader model.

Shader Model Shader Profiles
Shader Model 1 vs_1_1
Shader Model 2 ps_2_0, ps_2_x, vs_2_0, vs_2_x, ps_4_0_level_9_0, ps_4_0_level_9_1, ps_4_0_level_9_3, vs_4_0_level_9_0, vs_4_0_level_9_1, vs_4_0_level_9_3, lib_4_0_level_9_1, lib_4_0_level_9_3
Shader Model 3 ps_3_0, vs_3_0
Shader Model 4 cs_4_0, gs_4_0, ps_4_0, vs_4_0, cs_4_1, gs_4_1, ps_4_1, vs_4_1, lib_4_0, lib_4_1
Shader Model 5 cs_5_0, ds_5_0, gs_5_0, hs_5_0, ps_5_0, vs_5_0, lib_5_0

(Although gs_4_0, gs_4_1, ps_4_0, ps_4_1, vs_4_0, and vs_4_1 were introduced in shader model 4.0, shader model 5 adds support to these shader profiles for structured buffers and byte address buffers.)

 

Differences between Direct3D 9 and Direct3D 10:

Direct3D 9 introduced shader models 1, 2, and 3.

Direct3D 10 introduced shader model 4.

Direct3D 10.1 introduced shader model 4.1.

 

Effect Profiles

An effect profile is the target for compiling an effect/shader; this table lists the effect profiles that are supported by each version of Direct3D.

Differences between Direct3D 9 and Direct3D 10:

Direct3D 9 introduced effect-framework profiles fx_1_0 and fx_2_0.

Direct3D 10 introduced effect-framework profile fx_4_0.

Direct3D 10.1 introduced effect-framework profile fx_4_1.

Direct3D 11 introduced effect-framework profile fx_5_0.

 

Note  These legacy effects profiles are deprecated.

Related topics

Reference for HLSL

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值