I use D3DX11CompileFromMemory without the effect framework to compile vertex and pixel shaders from HLSL code.
Now I need to compile geometry shaders but the files will usually do not have a geometry shader entry point because they are usually not needed and there should be no error message for not having a geometry shader.
Is there a safe way to check if the entry point GS exist in the string of HLSL code before calling D3DX11CompileFromMemory?
I could not find any HRESULT code that only specify this error.
The word "GS" might occur by accident without being an entry point and the user might cause any syntax error in the HLSL file.
Optional geometry shaders
Started by Dawoodoz, Dec 18 2012 05:47 AM
1 reply to this topic
#1 Members - Reputation: 280
Posted 18 December 2012 - 05:47 AM
My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz
"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."
Sponsor:
#2 Members - Reputation: 280
Posted 18 December 2012 - 08:31 AM
Checking if a line in the error message begins with "error X3501:" seems to work but it does not feel reliable.
My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz
"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."






