forked from LPGhatguy/crevice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use longer names instead of mod for alignment calculators.
This works around rust-lang/rust#83583 by avoiding generating a mod block. This code previously worked everywhere, but tripped this deprecation lint if Crevice's derives were used on a struct inside a function. In order to have consistent name resolution, we instead blast all the generated functions into the main scope. This is... not great, but there is no other way to let code inside a mod inside a fn refer to other items inside the fn.
- Loading branch information
Showing
10 changed files
with
63 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
--- | ||
source: tests/std140.rs | ||
expression: "<<MoreThan16Alignment as AsStd140>::Std140Type as TypeLayout>::type_layout()" | ||
|
||
--- | ||
name: Std140MoreThan16Alignment | ||
size: 32 | ||
alignment: 8 | ||
fields: | ||
- Field: | ||
name: _doubles_align | ||
ty: "[u8 ; Std140MoreThan16AlignmentAlignment :: _doubles_align()]" | ||
name: _MoreThan16Alignment__doubles__Std140__align | ||
ty: "[u8 ; _MoreThan16Alignment__doubles__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: doubles | ||
ty: "< DVec4 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 32 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,42 @@ | ||
--- | ||
source: tests/std140.rs | ||
expression: "<<PointLight as AsStd140>::Std140Type as TypeLayout>::type_layout()" | ||
|
||
--- | ||
name: Std140PointLight | ||
size: 48 | ||
alignment: 4 | ||
fields: | ||
- Field: | ||
name: _position_align | ||
ty: "[u8 ; Std140PointLightAlignment :: _position_align()]" | ||
name: _PointLight__position__Std140__align | ||
ty: "[u8 ; _PointLight__position__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: position | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
- Field: | ||
name: _diffuse_align | ||
ty: "[u8 ; Std140PointLightAlignment :: _diffuse_align()]" | ||
name: _PointLight__diffuse__Std140__align | ||
ty: "[u8 ; _PointLight__diffuse__Std140__align()]" | ||
size: 4 | ||
- Field: | ||
name: diffuse | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
- Field: | ||
name: _specular_align | ||
ty: "[u8 ; Std140PointLightAlignment :: _specular_align()]" | ||
name: _PointLight__specular__Std140__align | ||
ty: "[u8 ; _PointLight__specular__Std140__align()]" | ||
size: 4 | ||
- Field: | ||
name: specular | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
- Field: | ||
name: _brightness_align | ||
ty: "[u8 ; Std140PointLightAlignment :: _brightness_align()]" | ||
name: _PointLight__brightness__Std140__align | ||
ty: "[u8 ; _PointLight__brightness__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: brightness | ||
ty: "< f32 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
--- | ||
source: tests/std140.rs | ||
expression: "<<PrimitiveF32 as AsStd140>::Std140Type as TypeLayout>::layout()" | ||
expression: "<<PrimitiveF32 as AsStd140>::Std140Type as TypeLayout>::type_layout()" | ||
|
||
--- | ||
name: Std140PrimitiveF32 | ||
size: 8 | ||
alignment: 4 | ||
fields: | ||
- Field: | ||
name: _x_align | ||
ty: "[u8 ; Std140PrimitiveF32Alignment :: _x_align()]" | ||
name: _PrimitiveF32__x__Std140__align | ||
ty: "[u8 ; _PrimitiveF32__x__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: x | ||
ty: "< f32 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 4 | ||
- Field: | ||
name: _y_align | ||
ty: "[u8 ; Std140PrimitiveF32Alignment :: _y_align()]" | ||
name: _PrimitiveF32__y__Std140__align | ||
ty: "[u8 ; _PrimitiveF32__y__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: y | ||
ty: "< f32 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
--- | ||
source: tests/std140.rs | ||
expression: "<<UsingVec3Padding as AsStd140>::Std140Type as TypeLayout>::layout()" | ||
expression: "<<UsingVec3Padding as AsStd140>::Std140Type as TypeLayout>::type_layout()" | ||
|
||
--- | ||
name: Std140UsingVec3Padding | ||
size: 16 | ||
alignment: 4 | ||
fields: | ||
- Field: | ||
name: _pos_align | ||
ty: "[u8 ; Std140UsingVec3PaddingAlignment :: _pos_align()]" | ||
name: _UsingVec3Padding__pos__Std140__align | ||
ty: "[u8 ; _UsingVec3Padding__pos__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: pos | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
- Field: | ||
name: _brightness_align | ||
ty: "[u8 ; Std140UsingVec3PaddingAlignment :: _brightness_align()]" | ||
name: _UsingVec3Padding__brightness__Std140__align | ||
ty: "[u8 ; _UsingVec3Padding__brightness__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: brightness | ||
ty: "< f32 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
--- | ||
source: tests/std140.rs | ||
expression: "<<TestVec3 as AsStd140>::Std140Type as TypeLayout>::layout()" | ||
expression: "<<TestVec3 as AsStd140>::Std140Type as TypeLayout>::type_layout()" | ||
|
||
--- | ||
name: Std140TestVec3 | ||
size: 28 | ||
alignment: 4 | ||
fields: | ||
- Field: | ||
name: _pos_align | ||
ty: "[u8 ; Std140TestVec3Alignment :: _pos_align()]" | ||
name: _TestVec3__pos__Std140__align | ||
ty: "[u8 ; _TestVec3__pos__Std140__align()]" | ||
size: 0 | ||
- Field: | ||
name: pos | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
- Field: | ||
name: _velocity_align | ||
ty: "[u8 ; Std140TestVec3Alignment :: _velocity_align()]" | ||
name: _TestVec3__velocity__Std140__align | ||
ty: "[u8 ; _TestVec3__velocity__Std140__align()]" | ||
size: 4 | ||
- Field: | ||
name: velocity | ||
ty: "< Vec3 as :: crevice :: std140 :: AsStd140 > :: Std140Type" | ||
size: 12 | ||
|