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

HLSL : cbuffer default value not supported #700

Closed
Sypher64 opened this issue Jan 25, 2017 · 4 comments
Closed

HLSL : cbuffer default value not supported #700

Sypher64 opened this issue Jan 25, 2017 · 4 comments

Comments

@Sypher64
Copy link

A constant buffer declaration with default values will not compile.
/////////////////////
cbuffer Constants
{
float a,b,c;
float d = 1.0f;
};

/* main */
////////////////////

example of error message produced :

ERROR: 0:23: ',' : Expected
ERROR: 0:23: 'struct member declarations' : Expected
(null)(23): error at column 17, HLSL parsing failed.
ERROR: 3 compilation errors. No code generated.

@johnkslang
Copy link
Member

Do you just need this to compile, or do you also need the initialization to happen? That is, can you use the API to set up the values yourself, and then just want the shader to compile, ignoring the values?

@Sypher64
Copy link
Author

Compiling would be nice for a start. For the initialization a trick would be to use dx11 reflection to get the values and then manually set them at vulkan runtime, but it require some extra work.

Thank you

@johnkslang
Copy link
Member

One interesting new thing to do is design a sideband mechanism, where an HLL -> SPIR-V emits two outputs. This aspect is transferred to issue #701.

Leaving this open to make the parsing not fail.

@johnkslang
Copy link
Member

Parsing struct members with initializers is fixed by 18adbdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants