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: Auto promotion of scalar types to vector does not work #441

Closed
dankbaker opened this issue Aug 7, 2016 · 4 comments
Closed

HLSL: Auto promotion of scalar types to vector does not work #441

dankbaker opened this issue Aug 7, 2016 · 4 comments

Comments

@dankbaker
Copy link
Contributor

in HLSL, though I believe it may warn you now, you can do things like

float V = 1;
float3 MyVal = V;

Which is equivalent to,

float V = 1;
float3 MyVal = V.xxx;

Not super high priority, as we can fix those auto promotion cases in our code, but this fairly common thing to see in HLSL code (at least the scalar promotion type).

@johnkslang
Copy link
Member

Auto-smearing scalar -> vector was recently added for assignment (maybe not initializers though? I'll check), and is now being added for <, <=, >, and >=. Will close this when those are done.

@johnkslang
Copy link
Member

Note this is also already captured in issue #362.

@johnkslang
Copy link
Member

@dankbaker the sample

float V = 1;
float3 MyVal = V;

works for me, so not sure what you saw not working.

Commit 4583b61 broadened this for relational comparisons, and includes your test.

Reopen with a test case that fails if you still see it.

@dankbaker
Copy link
Contributor Author

Seems like latest drop fixed the issue, no longer repros for me.

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