Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 1 | # Copyright 2015 Google Inc. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | headerLoc=../third_party/vulkan/vulkan.h |
| 6 | outFile=tempVkInterface |
| 7 | |
| 8 | if [ ! -e "$outFile" ] ; then |
| 9 | echo 'I AM HERE' |
| 10 | touch "$outFile" |
| 11 | fi |
| 12 | |
| 13 | chmod 700 $outFile |
| 14 | |
| 15 | echo '// *******************************************' > $outFile |
| 16 | echo '// Place these lines into GrVkInterface.cpp::validate' >> $outFile |
| 17 | echo '// *******************************************' >> $outFile |
| 18 | sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/NULL == fFunctions.f\2 ||/p' $headerLoc >> $outFile |
| 19 | sed -i '1,/NULL/ s/^NULL/if (NULL/' $outFile |
| 20 | sed -i '5,$ s/^/ /' $outFile |
| 21 | sed -i '$ s/ ||/) {/' $outFile |
| 22 | |
| 23 | echo '' >> $outFile |
| 24 | echo '// *******************************************' >> $outFile |
| 25 | echo '// Place these lines into GrVkInterface.h' >> $outFile |
| 26 | echo '// *******************************************' >> $outFile |
| 27 | sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/VkPtr<PFN_vk\2> f\2;/p' $headerLoc >> $outFile |
| 28 | |
| 29 | echo '' >> $outFile |
| 30 | echo '// *******************************************' >> $outFile |
| 31 | echo '// Place these lines into GrVkInterface.cpp::GrVKCreateInterface' >> $outFile |
| 32 | echo '// *******************************************' >> $outFile |
| 33 | sed -n 's/^VKAPI_ATTR \(VkResult\|void\) VKAPI_CALL vk\([a-zA-Z]*\).*/GET_PROC(\2);/p' $headerLoc >> $outFile |
| 34 | |