mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-23 07:10:23 +00:00
layers: simplify initLayerTable()
Generate xgl_dispatch_table_helper.h with $ ./xgl-generate.py dispatch-table-ops layer and make use of layer_initialize_dispatch_table() in initLayerTable(). There should be no functional difference with this change.
This commit is contained in:
parent
dc157d4c72
commit
8069bb503c
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,6 +14,7 @@ tests/xgl_image_tests
|
|||||||
tests/xgl_render_tests
|
tests/xgl_render_tests
|
||||||
tests/xglbase
|
tests/xglbase
|
||||||
tests/xglinfo
|
tests/xglinfo
|
||||||
|
layers/xgl_dispatch_table_helper.h
|
||||||
layers/xgl_enum_string_helper.h
|
layers/xgl_enum_string_helper.h
|
||||||
layers/xgl_struct_string_helper.h
|
layers/xgl_struct_string_helper.h
|
||||||
layers/xgl_struct_wrappers.cpp
|
layers/xgl_struct_wrappers.cpp
|
||||||
|
@ -585,17 +585,14 @@ class Subcommand(object):
|
|||||||
return "\n".join(func_body)
|
return "\n".join(func_body)
|
||||||
|
|
||||||
def _generate_layer_dispatch_table(self, prefix='xgl'):
|
def _generate_layer_dispatch_table(self, prefix='xgl'):
|
||||||
func_body = []
|
func_body = ["#include \"xgl_dispatch_table_helper.h\""]
|
||||||
func_body.append('static void initLayerTable()\n'
|
func_body.append('static void initLayerTable()\n'
|
||||||
'{\n'
|
'{\n'
|
||||||
' GetProcAddrType fpNextGPA;\n'
|
' GetProcAddrType fpNextGPA;\n'
|
||||||
' fpNextGPA = pCurObj->pGPA;\n'
|
' fpNextGPA = pCurObj->pGPA;\n'
|
||||||
' assert(fpNextGPA);\n');
|
' assert(fpNextGPA);\n');
|
||||||
|
|
||||||
for name in xgl.proto_names:
|
func_body.append(" layer_initialize_dispatch_table(&nextTable, fpNextGPA, (XGL_PHYSICAL_GPU) pCurObj->nextObject);")
|
||||||
func_body.append(' %sType fp%s = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "%s%s");\n'
|
|
||||||
' nextTable.%s = fp%s;' % (name, name, prefix, name, name, name))
|
|
||||||
|
|
||||||
func_body.append("}\n")
|
func_body.append("}\n")
|
||||||
return "\n".join(func_body)
|
return "\n".join(func_body)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user