I'm trying to compile this geometry shader with D3DCompile.
const std::string shaderSource =
"cbuffer ParticleSystemBuffer : register(b0)\n"
"{\n"
" float4x4 ;\n"
" Light lights[8];\n"
"}\n\n"
"struct VS_OUTPUT\n"
"{\n"
" float4 Pos : SV_POSITION;\n"
" float2 Tex : TEXCOORD;\n"
"};\n\n"
"struct GS_OUTPUT\n"
"{\n"
" float4 Pos : SV_POSITION;\n"
" float2 Tex : TEXCOORD;\n"
"};\n\n"
"cbuffer cbImmutable\n"
"{\n"
" float3 g_positions[4] =\n"
" {\n"
" float3( -1, 1, 0 ),\n"
" float3( 1, 1, 0 ),\n"
" float3( -1, -1, 0 ),\n"
" float3( 1, -1, 0 ),\n"
" };\n"
" float2 g_texcoords[4] =\n"
" {\n"
" float2(0,1),\n"
" float2(1,1),\n"
" float2(0,0),\n"
" float2(1,0),\n"
" };\n"
" float g_fParticleRadius = 5.0;\n"
"};\n\n"
"[maxvertexcount(4)]\n"
"void GS_main(point VS_OUTPUT input[1], inout TriangleStream<GS_OUTPUT> SpriteStream)\n"
"{\n"
" GS_OUTPUT output;\n"
" for(int i=0; i<4; i++)\n"
" {\n"
" float3 position = (g_positions[i]*g_fParticleRadius)+input[0].Pos;\n"
" output.Tex = g_texcoords[i];\n"
" SpriteStream.Append(output);\n"
" }\n"
" SpriteStream.RestartStrip();\n"
"}\n";
The problem is that I keep getting the X3501 error: Error: [geometry shader]error X3501: 'GS_main': entrypoint not found
I've used similar code to compile my vertex and pixel shaders before and it works great for them. Is there something I'm missing that should be added for geometry shaders?
ID3DBlob* GSblob;
ID3DBlob* errorBlob;
HRESULT hr = D3DCompile(&shaderSrc[0], shaderSrc.length(), m_path.toString().c_str(), NULL, NULL, "GS_main", "gs_5_0", D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_DEBUG, NULL, &GSblob, &errorBlob);
if ( FAILED(hr) )
{
std::string error = std::string((char*)errorBlob->GetBufferPointer());
core::Debug::log(core::ELL_ERROR, "geometry shader", error);
errorBlob->Release();
return;
}