C++ HLSL错误X3000:无法识别的标识符
我对hlsl没有任何经验,也不知道如何修复此错误。这是我的SimpleVertexShader.hlsl文件C++ HLSL错误X3000:无法识别的标识符,c++,directx,hlsl,vertex-shader,C++,Directx,Hlsl,Vertex Shader,我对hlsl没有任何经验,也不知道如何修复此错误。这是我的SimpleVertexShader.hlsl文件 cbuffer PerApplication : register (b0) { matrix projectionMatrix; } cbuffer PerFrame : register (b1) { matrix viewMatrix; } cbuffer PerObject : register (b2) { matrix worldMatrix; }
cbuffer PerApplication : register (b0)
{
matrix projectionMatrix;
}
cbuffer PerFrame : register (b1)
{
matrix viewMatrix;
}
cbuffer PerObject : register (b2)
{
matrix worldMatrix;
}
struct AppData
{
float3 position : POSITION;
float3 color : COLOR;
};
struct VertexShaderOuput
{
float4 color : COLOR;
float4 position : SV_POSITION;
};
VertexShaderOuput SimpleVertexShader(AppData IN)
{
VertexShaderOutput OUT;
matrix mvp = mul(projectionMatrix, mul(viewMatrix, worldMatrix));
OUT.position = mul(mvp, float4(IN.position, 1.0f));
OUT.color = float4(IN.color, 1.0f);
return OUT;
}
我收到一个错误X3000:无法识别的标识符“VertexShaderOutput”
以及无法识别的标识符“OUT”
。我正在使用Visual Studio 2013。在该文件的属性下,我有以下设置:
HLSL Compiler>Entrypoint Name: SimpleVertexShader
Shader Type: Vertex Shader (/vs)
Shader Model: Shader Model 4 (/4_0).
HLSL Compiler>Output Files>Header Variable Name: g_vs
Object File Name: $(OutDir)%(Filename)_d.cso.
(该_d仅在调试配置下。)是否有输入错误?VertexShaderOutput和VertexShaderOutput?哇,我看了好几遍,都没有发现打字错误。不过就是这样。谢谢