hi,i have a error when i run my code .
and here is my error
and this my code
---VS-----
#include"Base.hlsli"
VertexPosSize VS(VertexPosSize Vin)
{
return Vin;
}
---GS--
#include"Base.hlsli"
static const float2 g_Tex[4] = {{0.0f,0.0f}, {0.0f,1.0f}, {1.0f,0.0f}, {1.0f,1.0f}};
[maxvertexcount(4)]
void GS
(
point VertexPosSize Point[1],
uint primID : SV_PrimitiveID,
inout TriangleStream<BillboardVertex> output
)
{
float3 u = float3(0.0f, 1.0f, 0.0f);
float3 w = g_EyePosW - Point[0].Pos;
w.y = 0.0f;
float3 v = cross(u,w);
float4 V[4];
float3 center = Point[0].Pos;
float halfWidth = Point[0].Size.x * 0.5f;
float halfHeight = Point[0].Size.y * 0.5f;
V[0] = float4(center + halfWidth * v + halfHeight * u, 1.0f);
V[1] = float4(center + halfWidth * v - halfHeight * u, 1.0f);
V[2] = float4(center - halfWidth * v + halfHeight * u, 1.0f);
V[3] = float4(center - halfWidth * v - halfHeight * u, 1.0f);
BillboardVertex vertex;
matrix g = g_View * g_Proj;
for (int i = 0; i < 4; ++i)
{
vertex.PosW = V.xyz;
vertex.PosH = mul(float4(vertex.PosW,1.0f), g);
vertex.PrimID = primID;
vertex.Tex = g_Tex;
vertex.NormalW = w;
output.Append(vertex);
}
}
------ Base-- the struct that i defined
struct VertexPosSize
{
float3 Pos : POSITION;
float2 Size : SIZE;
};
struct BillboardVertex
{
float4 PosH : SV_POSITION;
float3 PosW : POSITION;
float3 NormalW : NORMAL;
float2 Tex : TEXCOORD;
uint PrimID : SV_PrimitiveID;
};
-------