-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor parameters to info structs and add debug support #71
Refactor parameters to info structs and add debug support #71
Conversation
@@ -45,15 +45,15 @@ typedef enum SDL_ShaderCross_ShaderStage | |||
SDL_SHADERCROSS_SHADERSTAGE_COMPUTE | |||
} SDL_ShaderCross_ShaderStage; | |||
|
|||
typedef struct SDL_ShaderCross_GraphicsShaderInfo | |||
typedef struct SDL_ShaderCross_GraphicsShaderMetadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this type sufficiently future proof?
I mean, we'll never need more metadata of a shader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properties in an out struct is kind of awkward no? I guess this would be a problem if we extended SDL's CreateShaderInfo though
bool enableDebug; /**< Allows debug info to be emitted when relevant. Can be useful for graphics debuggers like RenderDoc. */ | ||
const char *name; /**< A UTF-8 name to associate with the shader. Optional, can be NULL. */ | ||
|
||
SDL_PropertiesID props; /**< A properties ID for extensions. Should be 0 if no extensions are needed. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows creation has an easy entry point (SDL_CreateWindow
) and an "advanced mode" (SDL_CreateWindowFromProperties
).
Can shadercross do the same? I'd like to avoid properties and struct member values to clash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but we'd be almost doubling the API surface which is pretty cumbersome.
For future-proofing the API now takes info structs with a SDL_PropertiesID for extensions.
This PR also adds shader debug info support and source debugging in HLSL -> SPIR-V debug workflows in RenderDoc should work out of the box now.
Resolves #64
Resolves #66
Supersedes #65