Xna errorX3013:顶点着色器不接受0个参数
我开始使用Shader Model 4.0,并尝试设置一个基本的示例项目。(基本上渲染并照亮立方体) 但是自动取款机。我完全被困在最基本的部分。“我的顶点着色器”无法编译,并显示以下错误消息: 错误1编译时出错…\x.fx: …\x.fx(32,43):错误X3013:“VertexShaderFunction”:函数不接受0个参数 我的代码到现在为止:Xna errorX3013:顶点着色器不接受0个参数,xna,hlsl,Xna,Hlsl,我开始使用Shader Model 4.0,并尝试设置一个基本的示例项目。(基本上渲染并照亮立方体) 但是自动取款机。我完全被困在最基本的部分。“我的顶点着色器”无法编译,并显示以下错误消息: 错误1编译时出错…\x.fx: …\x.fx(32,43):错误X3013:“VertexShaderFunction”:函数不接受0个参数 我的代码到现在为止: float4x4 World; float4x4 View; float4x4 Projection; struct VS_INPUT {
float4x4 World;
float4x4 View;
float4x4 Projection;
struct VS_INPUT
{
float4 Position : POSITION;
};
struct VS_OUTPUT
{
float4 Position : POSITION;
};
VS_OUTPUT VertexShaderFunction(in VS_INPUT input)
{
VS_OUTPUT output;
float4 worldPosition = mul(input.Position, World);
float4 viewPosition = mul(worldPosition, View);
output.Position = mul(viewPosition, Projection);
return output;
}
technique Technique1
{
pass Pass1
{
SetVertexShader( Compile( vs_4_1, VertexShaderFunction() ) );
SetGeometryShader(NULL);
SetPixelShader( NULL );
}
}
VS_输入参数清楚地标记为输入,而不是统一的。结构为每个成员(以及唯一的成员)分配一个输入语义。有人知道为什么编译不正确吗
我正在使用Win7 Ultimate+DirectX11+XNA GameStudio 4.0,
我的图形卡是英特尔GMA 4500MHD(因此它应该支持shader model 4.0)我去回答我自己的问题-多么愚蠢的错误(而且很难找到): 它是CompileShader()而不是Compile()