layers: Updated layer names to be camelCase where name is contained in library file name as libXGLLayer<NAME>.so
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index d2285a2..e0cf9e5 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -1,12 +1,12 @@
cmake_minimum_required (VERSION 2.8.11)
add_custom_command(OUTPUT generic_layer.c xgl_enum_string_helper.h xgl_struct_string_helper.h api_dump.c api_dump_file.c object_track.c
- COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py generic-layer > generic_layer.c
+ COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py Generic > generic_layer.c
COMMAND ${PROJECT_SOURCE_DIR}/xgl-helper.py --gen_enum_string_helper ${PROJECT_SOURCE_DIR}/include/xgl.h --abs_out_dir ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PROJECT_SOURCE_DIR}/xgl-helper.py --gen_struct_wrappers ${PROJECT_SOURCE_DIR}/include/xgl.h --abs_out_dir ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py api-dump > api_dump.c
- COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py api-dump-file > api_dump_file.c
- COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py object-tracker > object_track.c
+ COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py ApiDump > api_dump.c
+ COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py ApiDumpFile > api_dump_file.c
+ COMMAND ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py ObjectTracker > object_track.c
DEPENDS ${PROJECT_SOURCE_DIR}/xgl-layer-generate.py
${PROJECT_SOURCE_DIR}/xgl-helper.py
${PROJECT_SOURCE_DIR}/xgl.py)
diff --git a/layers/draw_state.c b/layers/draw_state.c
index 4679850..b8d0fa1 100644
--- a/layers/draw_state.c
+++ b/layers/draw_state.c
@@ -942,7 +942,7 @@
return XGL_ERROR_INVALID_POINTER;
// This layer compatible with all GPUs
*pOutLayerCount = 1;
- strncpy(pOutLayers[0], "draw_state", maxStringSize);
+ strncpy(pOutLayers[0], "DrawState", maxStringSize);
return XGL_SUCCESS;
}
}
diff --git a/layers/mem_tracker.c b/layers/mem_tracker.c
index 19766f5..37e4026 100644
--- a/layers/mem_tracker.c
+++ b/layers/mem_tracker.c
@@ -1109,7 +1109,7 @@
return XGL_ERROR_INVALID_POINTER;
// This layer compatible with all GPUs
*pOutLayerCount = 1;
- strncpy(pOutLayers[0], "mem_tracker", maxStringSize);
+ strncpy(pOutLayers[0], "MemTracker", maxStringSize);
return XGL_SUCCESS;
}
}
diff --git a/xgl-layer-generate.py b/xgl-layer-generate.py
index 1fc9b2a..a28c6b6 100755
--- a/xgl-layer-generate.py
+++ b/xgl-layer-generate.py
@@ -138,14 +138,15 @@
%s;
};""" % ";\n ".join(entries)
- def _generate_dispatch_entrypoints(self, qual="", layer="generic"):
+ def _generate_dispatch_entrypoints(self, qual="", layer="Generic"):
if qual:
qual += " "
+ layer_name = layer
funcs = []
for proto in self.protos:
if proto.name != "GetProcAddr" and proto.name != "InitAndEnumerateGpus":
- if "generic" == layer:
+ if "Generic" == layer:
decl = proto.c_func(prefix="xgl", attr="XGLAPI")
param0_name = proto.params[0].name
ret_val = ''
@@ -194,7 +195,7 @@
' fflush(stdout);\n'
'%s'
'}' % (qual, decl, proto.params[0].name, proto.name, ret_val, c_call, proto.name, stmt))
- elif "apidump" in layer:
+ elif "APIDump" in layer:
decl = proto.c_func(prefix="xgl", attr="XGLAPI")
param0_name = proto.params[0].name
ret_val = ''
@@ -210,7 +211,7 @@
stmt = " return result;\n"
f_open = ''
f_close = ''
- if "file" in layer:
+ if "File" in layer:
file_mode = "a"
if 'CreateDevice' in proto.name:
file_mode = "w"
@@ -296,7 +297,7 @@
' %s%s%s\n'
'%s'
'}' % (qual, decl, proto.params[0].name, ret_val, c_call, f_open, log_func, f_close, stmt))
- elif "objecttracker" == layer:
+ elif "ObjectTracker" == layer:
obj_type_mapping = {"XGL_PHYSICAL_GPU" : "XGL_OBJECT_TYPE_PHYSICAL_GPU", "XGL_DEVICE" : "XGL_OBJECT_TYPE_DEVICE",
"XGL_QUEUE" : "XGL_OBJECT_TYPE_QUEUE", "XGL_QUEUE_SEMAPHORE" : "XGL_OBJECT_TYPE_QUEUE_SEMAPHORE",
"XGL_GPU_MEMORY" : "XGL_OBJECT_TYPE_GPU_MEMORY", "XGL_FENCE" : "XGL_OBJECT_TYPE_FENCE",
@@ -518,7 +519,7 @@
def generate_body(self):
body = [self._generate_layer_dispatch_table(),
- self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "generic"),
+ self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "Generic"),
self._generate_layer_gpa_function()]
return "\n\n".join(body)
@@ -548,7 +549,7 @@
def generate_body(self):
body = [self._generate_layer_dispatch_table(),
- self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "apidump"),
+ self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "APIDump"),
self._generate_layer_gpa_function()]
return "\n\n".join(body)
@@ -578,7 +579,7 @@
def generate_body(self):
body = [self._generate_layer_dispatch_table(),
- self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "apidump-file"),
+ self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "APIDumpFile"),
self._generate_layer_gpa_function()]
return "\n\n".join(body)
@@ -778,7 +779,7 @@
def generate_body(self):
body = [self._generate_layer_dispatch_table(),
- self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "objecttracker"),
+ self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "ObjectTracker"),
self._generate_extensions(),
self._generate_layer_gpa_function(extensions=['objTrackGetObjectCount', 'objTrackGetObjects'])]
@@ -788,10 +789,10 @@
subcommands = {
"layer-funcs" : LayerFuncsSubcommand,
"layer-dispatch" : LayerDispatchSubcommand,
- "generic-layer" : GenericLayerSubcommand,
- "api-dump" : ApiDumpSubcommand,
- "api-dump-file" : ApiDumpFileSubcommand,
- "object-tracker" : ObjectTrackerSubcommand,
+ "Generic" : GenericLayerSubcommand,
+ "ApiDump" : ApiDumpSubcommand,
+ "ApiDumpFile" : ApiDumpFileSubcommand,
+ "ObjectTracker" : ObjectTrackerSubcommand,
}
if len(sys.argv) < 2 or sys.argv[1] not in subcommands: