aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/generate_vk_interface.sh
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2016-02-22 09:56:40 -0500
committerGravatar Greg Daniel <egdaniel@google.com>2016-02-22 09:56:40 -0500
commit164a9f061c5186ae931cc23a3c73f32472e80ff5 (patch)
tree79929f22803c622a2e0c8dbc333717c275ca0405 /tools/generate_vk_interface.sh
parent129ed1cd6d792f3f6cf563aefa9756fc6308289d (diff)
Add vulkan files into skia repo. This is an incomplete backend with only partial functionality at this time.
Diffstat (limited to 'tools/generate_vk_interface.sh')
-rw-r--r--tools/generate_vk_interface.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/generate_vk_interface.sh b/tools/generate_vk_interface.sh
new file mode 100644
index 0000000000..84eaee3b8e
--- /dev/null
+++ b/tools/generate_vk_interface.sh
@@ -0,0 +1,34 @@
+# Copyright 2015 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+headerLoc=../third_party/vulkan/vulkan.h
+outFile=tempVkInterface
+
+if [ ! -e "$outFile" ] ; then
+ echo 'I AM HERE'
+ touch "$outFile"
+fi
+
+chmod 700 $outFile
+
+echo '// *******************************************' > $outFile
+echo '// Place these lines into GrVkInterface.cpp::validate' >> $outFile
+echo '// *******************************************' >> $outFile
+sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/NULL == fFunctions.f\2 ||/p' $headerLoc >> $outFile
+sed -i '1,/NULL/ s/^NULL/if (NULL/' $outFile
+sed -i '5,$ s/^/ /' $outFile
+sed -i '$ s/ ||/) {/' $outFile
+
+echo '' >> $outFile
+echo '// *******************************************' >> $outFile
+echo '// Place these lines into GrVkInterface.h' >> $outFile
+echo '// *******************************************' >> $outFile
+sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/VkPtr<PFN_vk\2> f\2;/p' $headerLoc >> $outFile
+
+echo '' >> $outFile
+echo '// *******************************************' >> $outFile
+echo '// Place these lines into GrVkInterface.cpp::GrVKCreateInterface' >> $outFile
+echo '// *******************************************' >> $outFile
+sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/GET_PROC(\2);/p' $headerLoc >> $outFile
+