authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-02-24 18:39:06+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-02-24 19:48:34+02:00
logcbd5d6c704c03177be90a891fc8fd48e6966487b
treeee003f8eee14eddf58fbda75eff629e59825cad0
parentb034c45b2bcb3a28ad260037dfa34c40b6c9313b

spirv spec: do not align packed struct fields


2 files changed, 11 insertions(+), 15 deletions(-)

src/codegen/spirv/spec.zig+10-10
......@@ -1206,7 +1206,7 @@ pub const Opcode = enum(u16) {
12061206 }
12071207};
12081208pub const ImageOperands = packed struct {
1209 Bias: bool align(@alignOf(u32)) = false,
1209 Bias: bool = false,
12101210 Lod: bool = false,
12111211 Grad: bool = false,
12121212 ConstOffset: bool = false,
......@@ -1280,7 +1280,7 @@ pub const ImageOperands = packed struct {
12801280 };
12811281};
12821282pub const FPFastMathMode = packed struct {
1283 NotNaN: bool align(@alignOf(u32)) = false,
1283 NotNaN: bool = false,
12841284 NotInf: bool = false,
12851285 NSZ: bool = false,
12861286 AllowRecip: bool = false,
......@@ -1314,7 +1314,7 @@ pub const FPFastMathMode = packed struct {
13141314 _reserved_bit_31: bool = false,
13151315};
13161316pub const SelectionControl = packed struct {
1317 Flatten: bool align(@alignOf(u32)) = false,
1317 Flatten: bool = false,
13181318 DontFlatten: bool = false,
13191319 _reserved_bit_2: bool = false,
13201320 _reserved_bit_3: bool = false,
......@@ -1348,7 +1348,7 @@ pub const SelectionControl = packed struct {
13481348 _reserved_bit_31: bool = false,
13491349};
13501350pub const LoopControl = packed struct {
1351 Unroll: bool align(@alignOf(u32)) = false,
1351 Unroll: bool = false,
13521352 DontUnroll: bool = false,
13531353 DependencyInfinite: bool = false,
13541354 DependencyLength: bool = false,
......@@ -1417,7 +1417,7 @@ pub const LoopControl = packed struct {
14171417 };
14181418};
14191419pub const FunctionControl = packed struct {
1420 Inline: bool align(@alignOf(u32)) = false,
1420 Inline: bool = false,
14211421 DontInline: bool = false,
14221422 Pure: bool = false,
14231423 Const: bool = false,
......@@ -1451,7 +1451,7 @@ pub const FunctionControl = packed struct {
14511451 _reserved_bit_31: bool = false,
14521452};
14531453pub const MemorySemantics = packed struct {
1454 _reserved_bit_0: bool align(@alignOf(u32)) = false,
1454 _reserved_bit_0: bool = false,
14551455 Acquire: bool = false,
14561456 Release: bool = false,
14571457 AcquireRelease: bool = false,
......@@ -1489,7 +1489,7 @@ pub const MemorySemantics = packed struct {
14891489 pub const MakeVisibleKHR: MemorySemantics = .{ .MakeVisible = true };
14901490};
14911491pub const MemoryAccess = packed struct {
1492 Volatile: bool align(@alignOf(u32)) = false,
1492 Volatile: bool = false,
14931493 Aligned: bool = false,
14941494 Nontemporal: bool = false,
14951495 MakePointerAvailable: bool = false,
......@@ -1562,7 +1562,7 @@ pub const MemoryAccess = packed struct {
15621562 };
15631563};
15641564pub const KernelProfilingInfo = packed struct {
1565 CmdExecTime: bool align(@alignOf(u32)) = false,
1565 CmdExecTime: bool = false,
15661566 _reserved_bit_1: bool = false,
15671567 _reserved_bit_2: bool = false,
15681568 _reserved_bit_3: bool = false,
......@@ -1596,7 +1596,7 @@ pub const KernelProfilingInfo = packed struct {
15961596 _reserved_bit_31: bool = false,
15971597};
15981598pub const RayFlags = packed struct {
1599 OpaqueKHR: bool align(@alignOf(u32)) = false,
1599 OpaqueKHR: bool = false,
16001600 NoOpaqueKHR: bool = false,
16011601 TerminateOnFirstHitKHR: bool = false,
16021602 SkipClosestHitShaderKHR: bool = false,
......@@ -1630,7 +1630,7 @@ pub const RayFlags = packed struct {
16301630 _reserved_bit_31: bool = false,
16311631};
16321632pub const FragmentShadingRate = packed struct {
1633 Vertical2Pixels: bool align(@alignOf(u32)) = false,
1633 Vertical2Pixels: bool = false,
16341634 Vertical4Pixels: bool = false,
16351635 Horizontal2Pixels: bool = false,
16361636 Horizontal4Pixels: bool = false,
tools/gen_spirv_spec.zig+1-5
......@@ -329,11 +329,7 @@ fn renderBitEnum(
329329 try writer.print("_reserved_bit_{}", .{bitpos});
330330 }
331331
332 try writer.writeAll(": bool ");
333 if (bitpos == 0) { // Force alignment to integer boundaries
334 try writer.writeAll("align(@alignOf(u32)) ");
335 }
336 try writer.writeAll("= false,\n");
332 try writer.writeAll(": bool = false,\n");
337333 }
338334
339335 try writer.writeByte('\n');