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] Layout compatible type casting #100619

Open
llvm-beanz opened this issue Jul 25, 2024 · 0 comments · May be fixed by #118842 or #118992
Open

[HLSL] Layout compatible type casting #100619

llvm-beanz opened this issue Jul 25, 2024 · 0 comments · May be fixed by #118842 or #118992
Assignees
Labels
HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Jul 25, 2024

HLSL allows explicit casting between layout compatible types. For example:

struct XYZ {
  float X, Y, Z;
};

XYZ xyz = ...;
float3 f3 = (float3)xyz;
xyz = (XYZ)f3;

struct S {
int i;
float f;
};

struct OtherS {
int i;
float f;
};

S s =...;
OtherS o = (OtherS)s;

Related: #100614

@llvm-beanz llvm-beanz converted this from a draft issue Jul 25, 2024
@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label Jul 25, 2024
@damyanp damyanp moved this to Ready in HLSL Support Oct 9, 2024
@damyanp damyanp moved this from Ready to Active in HLSL Support Nov 18, 2024
@damyanp damyanp moved this from Active to Needs Review in HLSL Support Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HLSL HLSL Language Support
Projects
Status: Needs Review
2 participants