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: structure cast with zero #412

Closed
xen2 opened this issue Jul 26, 2016 · 4 comments
Closed

HLSL: structure cast with zero #412

xen2 opened this issue Jul 26, 2016 · 4 comments

Comments

@xen2
Copy link

xen2 commented Jul 26, 2016

I have been following development of HLSL and are happy to see that since cbuffer have been added, our HLSL can mostly be converter to SPIR-V as is, good work!

There is still one small thing that fails (that we could easily workaround on our side, but still letting you know because it is valid HLSL):

struct PS_OUTPUT 
{
    float4 ColorTarget_id1 : SV_Target0;
};
void myfunc()
{
    PS_OUTPUT __output__ = (PS_OUTPUT)0;
}

works with FXC compiler, but fails with glslang:

ERROR: 0:572: 'constructor' : not enough data provided for construction
ERROR: 0:572: '=' :  cannot convert from 'const float' to 'temp structure{temp 4-component vector of float ColorTarget_id1}'
@xen2 xen2 changed the title HLSL: structure initializer cast HLSL: structure zero initializer Jul 26, 2016
@xen2 xen2 changed the title HLSL: structure zero initializer HLSL: structure cast with zero Jul 26, 2016
@xen2
Copy link
Author

xen2 commented Jul 26, 2016

Note: Probably low priority (this is not a blocker for us, and not sure how much it is used)

@johnkslang
Copy link
Member

Thanks for posting this, will add it to the list.

@dankbaker
Copy link
Contributor

This is used quite a bit by us, but can work around for now. needs to get fixed though. It's not an uncommon pattern in HLSL, often used for VSs because HLSL enforces that all parameters have something by default.

@johnkslang
Copy link
Member

Note this is also already captured in issue #362.

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

3 participants