原文链接:http://www.cnblogs.com/cg_ghost/archive/2011/11/30/2268734.html
经过试验,在VS2012有效。
1. 创建或编辑usertype.dat文件(此文件在VS安装目录下的Common7\IDE下面,比如我的就在D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\usertype.dat),添加如下的关键字列表,每个单词占一行,如果你想添加你自己的关键字,也可以按照这种方式添加在usertype.dat文件中
2. 在vs中打开Tools->Options...->TextEditor->File Extension
填写你想使用的着色器文件扩展名,如fx, hlsl, vs, ps等等,然后Editor选择Microsoft Visual C++
3. 重新启动VS2005
关键字列表:
__global__
__host__
__device__
__constant__
__shared__
gridDim
blockIdx
blockDim
threadIdx
int1
uint1
int2
uint2
int3
uint3
int4
uint4
float1
float2
float3
float4
char1
char2
char3
char4
uchar1
uchar2
uchar3
uchar4
short1
short2
short3
short4
dim1
dim2
dim3
dim4
int2float
float2int
asm
asm_fragment
BINORMAL
BLENDINDICES0
BLENDWEIGHT0
COLOR0
COLOR1
COLOR2
COLOR3
column_major
compile
compile_fragment
discard
decl1
float2
float3
float3x3
float3x4
float4
float4x4
float4x3
half
half2
half3
half4
in
inout
int
int2
int3
int4
matrix
out
pass1
pixelfragment
row_major
sampler
sampler1D
sampler2D
sampler3D
samplerCUBE
sampler_state
shared
stateblock
stateblock_state
TANGENT
technique
texture
texture1D
texture2D
texture3D
textureCUBE
TEXCOORD0
TEXCOORD1
TEXCOORD2
TEXCOORD3
TEXCOORD4
TEXCOORD5
TEXCOORD6
TEXCOORD7
uniform
vector
vertexfragment
VPOS