MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / getAlignment

Method getAlignment

tools/vulkan/gen/src/boxedwine/org/data/VkType.java:47–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 public int getAlignment() {
48 if (sizeof > 0) {
49 return Math.min(sizeof, 4);
50 }
51 if (members != null && members.size() > 0) {
52 int maxAlignment = 0;
53
54 for (VkParam param : members) {
55 int alignment = param.getAlignment();
56 if (alignment > maxAlignment) {
57 maxAlignment = alignment;
58 }
59 }
60 return maxAlignment;
61 }
62 if (getType().equals("VkFlags") || getType().equals("uint32_t") || getType().equals("VK_DEFINE_HANDLE")) {
63 sizeof = 4;
64 return sizeof;
65 }
66 if (getType().equals("uint64_t") || getType().equals("VK_DEFINE_NON_DISPATCHABLE_HANDLE") || getType().equals("VkFlags64")) {
67 return 4; // win32 the alignment is 8, but 32-bit linux it is 4
68 }
69 System.out.println("VkParam.getAlignment failed");
70 System.exit(1);
71 return 0;
72 }
73
74 // xml data
75 public String name;

Callers 2

marshalInMethod · 0.45
marshalOutMethod · 0.45

Calls 5

getTypeMethod · 0.95
minMethod · 0.80
sizeMethod · 0.45
equalsMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected