--- /dev/null
+#!/bin/bash
+
+# Copyright 2015 The Android Open Source Project
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rm -rf generated
+mkdir -p generated
+python ../vk-generate.py dispatch-table-ops layer > generated/vk_dispatch_table_helper.h
+
+python ../vk_helper.py --gen_enum_string_helper ../include/vulkan.h --abs_out_dir generated
+python ../vk_helper.py --gen_struct_wrappers ../include/vulkan.h --abs_out_dir generated
+
+python ../vk-layer-generate.py Generic ../include/vulkan.h > generated/generic_layer.cpp
+python ../vk-layer-generate.py APIDump ../include/vulkan.h > generated/api_dump.cpp
+python ../vk-layer-generate.py ObjectTracker ../include/vulkan.h > generated/object_track.cpp
+python ../vk-layer-generate.py Threading ../include/vulkan.h > generated/threading.cpp
+
--- /dev/null
+# Copyright 2015 The Android Open Source Project\r
+\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+LOCAL_PATH := $(abspath $(call my-dir))\r
+MY_PATH := $(LOCAL_PATH)\r
+SRC_DIR := $(LOCAL_PATH)/../../\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := layer_utils\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_config.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_extension_utils.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerBasic\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/basic.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerDrawState\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/draw_state.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_debug_marker_table.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerMemTracker\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/mem_tracker.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerShaderCheker\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/shader_checker.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerImage\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/image.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerParamChecker\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/param_checker.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_debug_marker_table.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerGeneric\r
+LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/generic_layer.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/layers \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerAPIDump\r
+LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/api_dump.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/layers \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerObjectTracker\r
+LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/object_track.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/layers \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
+\r
+include $(CLEAR_VARS)\r
+LOCAL_MODULE := VKLayerThreading\r
+LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/threading.cpp\r
+LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp\r
+LOCAL_C_INCLUDES += $(SRC_DIR)/include \\r
+ $(SRC_DIR)/layers \\r
+ $(SRC_DIR)/buildAndroid/generated \\r
+ $(SRC_DIR)/loader\r
+LOCAL_SHARED_LIBRARIES += layer_utils\r
+LOCAL_LDLIBS := -llog\r
+include $(BUILD_SHARED_LIBRARY)\r
--- /dev/null
+# Copyright 2015 The Android Open Source Project\r
+\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+APP_ABI := all\r
+APP_PLATFORM := android-22\r
+APP_STL := gnustl_static\r
+APP_MODULES := layer_utils VKLayerBasic VKLayerDrawState VKLayerMemTracker VKLayerShaderCheker VKLayerImage VKLayerParamChecker VKLayerGeneric VKLayerAPIDump VKLayerObjectTracker VKLayerThreading\r
+APP_CPPFLAGS += -std=c++11 -DVK_PROTOTYPES\r
+NDK_TOOLCHAIN_VERSION := 4.8\r
* Vulkan
*
* Copyright (C) 2014 LunarG, Inc.
+ * Copyright (C) 2015 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include <string.h>
#include <stdlib.h>
#include <assert.h>
-#include "vk_loader_platform.h"
#include "vk_dispatch_table_helper.h"
#include "vk_layer.h"
#include "vk_layer_table.h"
#include "vk_layer_extension_utils.h"
-// The following is #included again to catch certain OS-specific functions
-// being used:
-#include "vk_loader_platform.h"
static const VkLayerProperties globalLayerProps[] = {
{
/**************************************************************************
*
* Copyright 2014 Lunarg, Inc.
+ * Copyright 2015 Google Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
#include <string.h>
#include <vk_layer.h>
#include <iostream>
-#include "vk_loader_platform.h"
#include "vk_layer_config.h"
-// The following is #included again to catch certain OS-specific functions
-// being used:
#include "vk_loader_platform.h"
#define MAX_CHARS_PER_LINE 4096
* Vulkan
*
* Copyright (C) 2014 LunarG, Inc.
+ * Copyright (C) 2015 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
#pragma once
+#include <cassert>
#include <unordered_map>
extern std::unordered_map<void *, VkLayerDebugMarkerDispatchTable *> tableDebugMarkerMap;
*
* Copyright (C) 2015 LunarG, Inc.
* Copyright 2014 Valve Software
+ * Copyright (C) 2015 Google Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
#include <pthread.h>
#include <assert.h>
#include <stdbool.h>
+#include <stdlib.h>
#include <libgen.h>
// VK Library Filenames, Paths, etc.:
{
return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL);
}
-static inline char * loader_platform_open_library_error(const char* libPath)
+static inline const char * loader_platform_open_library_error(const char* libPath)
{
return dlerror();
}
assert(name);
return dlsym(library, name);
}
-static inline char * loader_platform_get_proc_address_error(const char *name)
+static inline const char * loader_platform_get_proc_address_error(const char *name)
{
return dlerror();
}
pthread_once_t var = PTHREAD_ONCE_INIT;
#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) \
pthread_once_t var;
-static inline void loader_platform_thread_once(void *ctl, void (* func) (void))
+static inline void loader_platform_thread_once(pthread_once_t *ctl, void (* func) (void))
{
assert(func != NULL);
assert(ctl != NULL);
- pthread_once((pthread_once_t *) ctl, func);
+ pthread_once(ctl, func);
}
// Thread IDs:
}
#define loader_stack_alloc(size) alloca(size)
-static inline void *loader_aligned_alloc(size_t alignment, size_t size) { return aligned_alloc(alignment, size); }
+static inline void *loader_aligned_alloc(size_t alignment, size_t size) { void *ptr; posix_memalign(&ptr, alignment, size); return ptr; }
#elif defined(_WIN32) // defined(__linux__)
/* Windows-specific common code: */
* Ian Elliott <ian@lunarg.com>
*/
-#define _ISOC11_SOURCE /* for aligned_alloc() */
+//#define _ISOC11_SOURCE /* for aligned_alloc() */
+#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include "vk_loader_platform.h"
# VK
#
# Copyright (C) 2014 LunarG, Inc.
+# Copyright (C) 2015 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
return
self.prefix = self.argv[0]
- super().run()
+ super(DispatchTableOpsSubcommand, self).run()
def generate_header(self):
return "\n".join(["#include <vulkan.h>",