Skip to content
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

[Enhancement] Add more options to ShaderGen.App to require shader compilations #93

Open
thargy opened this issue Jun 8, 2019 · 0 comments

Comments

@thargy
Copy link
Contributor

thargy commented Jun 8, 2019

When using ShaderGen as part of a task it tends to fail silently which is not a great experience for end users who can take time trying to figure out why their code isn't running correctly. I suggest adding options to ShaderGen.App for each backend type, to allow them to be specified as:

X | Exclude - Prevents the creation of the specific Shader - this allows for faster builds where certain Shaders are not required.
A | Auto - [Default] Build if possible, but fails silently if not (current behavior).
R | Require - Fail if the shader isn't successfully built.

The supported backends include hlsl, glsl330, glsles300, glsl450, metal and iOS (note this also requires some simple logic tweaks in the way metal currently builds both MacOS and iOS).

A suggested format could be:
--glsl330 X --glsles300 Exclude --hlsl Require --ios X

Which would fail if HLSL failed, would not attempt OpenGL 330, ES, or iOS metal and would build MacOS Metal and Vulkan (glsl450) if possible.

This would then be backed by new build properties such as $(ShaderGenHlslMode) which are imported in ShaderGen.targets, e.g.

<_SGArgs Condition="'$(ShaderGenHlslMode)' != ''">$(_SGArgs) --hlsl "$(ShaderGenHlslMode)"</_SGArgs>

Developers can then get the desired behaviour by adding the properties to their .csproj, e.g.

<ShaderGenHlslMode>Require</ShaderGenHlslMode>
<ShaderGenIosMode>Exclude</ShaderGenIosMode>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant