|
|
我在一pixelshader文件编写如下代码:
// Pixel shader input structure
struct PS_INPUT
{
float4 Position : POSITION;
float4 Color : COLOR0;
float2 Texture : TEXCOORD0;
};
// Pixel shader output structure
struct PS_OUTPUT
{
float4 Color : COLOR0;
};
// Global variables
sampler2D Tex0;
float4 floattest = 0.0f;
PS_OUTPUT main( in PS_INPUT In )
{
PS_OUTPUT Out;
Out.Color = tex2D(Tex0, In.Texture); //do a texture lookup
Out.Color *= In.Color;
return Out;
}
然后使用fxc编译成ps_2_0,结果显示只有Tex0注册成全局变量,floattest却没有:
//
// Parameters:
//
// sampler2D Tex0;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// Tex0 s0 1
//
在程序中compile,使用consttable也找不到floattest,实在郁闷,请高手指点!:( [em4] |
|