【发布时间】:2021-12-27 22:08:21
【问题描述】:
我正在尝试在 C++ 中将几何着色器添加到我的 DirectX 11 项目
我看到的任何地方没有这样的例子。有数百万关于 OpenGL 的教程,但没有关于 DirectX 中的几何着色器的教程
我刚刚在下面写了一个基本的着色器,但是在尝试构建它时出现以下错误
error X3514: 'LightGeometryShader' must have a max vertex count
谁能告诉我这个着色器缺少什么才能编译?
////////////////////////////////////////////////////////////////////////////////
// Filename: light.gs
////////////////////////////////////////////////////////////////////////////////
//////////////
// TYPEDEFS //
//////////////
struct GeometryInputType
{
float4 position : POSITION;
float2 tex : TEXCOORD0;
float3 normal : NORMAL;
};
struct PixelInputType
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
float3 normal : NORMAL;
};
////////////////////////////////////////////////////////////////////////////////
// Geometry Shader
////////////////////////////////////////////////////////////////////////////////
PixelInputType LightGeometryShader(GeometryInputType input)
{
PixelInputType output;
output = input;
return output;
}
【问题讨论】:
标签: c++ windows directx directx-11