mirror of
https://github.com/ValveSoftware/Proton.git
synced 2024-12-27 23:25:50 +03:00
vrclient: Add field alignment to converted structs, too
This commit is contained in:
parent
1d2b72f307
commit
b32161679d
@ -879,16 +879,17 @@ def handle_struct(sdkver, struct):
|
||||
for m in struct.get_children():
|
||||
if m.kind == clang.cindex.CursorKind.FIELD_DECL:
|
||||
if m.type.get_canonical().kind == clang.cindex.TypeKind.CONSTANTARRAY:
|
||||
cppfile.write(" %s %s[%u];\n" % (m.type.element_type.spelling, m.displayname, m.type.element_count))
|
||||
cppfile.write(" %s %s[%u]" % (m.type.element_type.spelling, m.displayname, m.type.element_count))
|
||||
elif m.type.get_canonical().kind == clang.cindex.TypeKind.RECORD and \
|
||||
struct_needs_conversion(m.type.get_canonical()):
|
||||
cppfile.write(" win%s_%s %s;\n" % (strip_ns(m.type.spelling), display_sdkver(sdkver), m.displayname))
|
||||
cppfile.write(" win%s_%s %s" % (strip_ns(m.type.spelling), display_sdkver(sdkver), m.displayname))
|
||||
else:
|
||||
if m.type.get_canonical().kind == clang.cindex.TypeKind.POINTER and \
|
||||
m.type.get_pointee().kind == clang.cindex.TypeKind.FUNCTIONPROTO:
|
||||
cppfile.write(" void *%s; /*fn pointer*/\n" % m.displayname)
|
||||
cppfile.write(" void *%s /*fn pointer*/ " % m.displayname)
|
||||
else:
|
||||
cppfile.write(" %s %s%s;\n" % (m.type.spelling, m.displayname, get_field_attribute_str(m)))
|
||||
cppfile.write(" %s %s" % (m.type.spelling, m.displayname))
|
||||
cppfile.write(get_field_attribute_str(m) + ";\n")
|
||||
if WRAPPERS in which:
|
||||
cppfile.write("\n %s *linux_side;\n" % struct.displayname)
|
||||
cppfile.write("} __attribute__ ((ms_struct));\n")
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_090 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_090 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_090 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_091 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_091 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_091 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_0910 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_0910 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_0910 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_092 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_092 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_092 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_093 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_093 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_093 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_094 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_094 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_094 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_096 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_096 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_096 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_097 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_097 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_097 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_098 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_098 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_098 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
@ -59,7 +59,7 @@ struct winRenderModel_t_099 {
|
||||
uint32_t unVertexCount;
|
||||
const uint16_t * rIndexData;
|
||||
uint32_t unTriangleCount;
|
||||
winRenderModel_TextureMap_t_099 diffuseTexture;
|
||||
winRenderModel_TextureMap_t_099 diffuseTexture __attribute__((aligned(4)));
|
||||
|
||||
RenderModel_t *linux_side;
|
||||
} __attribute__ ((ms_struct));
|
||||
|
Loading…
Reference in New Issue
Block a user