The compute commands should be submit before the graphic command. If not, there is a logical error that cause the first frame render error. Since the graphic rendering need to sample the compute shader 's output image.
There is a logical error that cause the first frame render error. Since the graphic rendering need to sample the compute shader 's output image, so the compute command need to run before the graphic rendering. If not, the graphic rendering will sample the gabage data (computer's output image) for the first frame and present on the display screen.This issue can be easy to be reproduced when the GPU device has a lower performance.
Pointer to a variable declared into a block statement is stored and used outside of the block by vkCreateInstance. This can lead to segmentation fault.
Move the declaration of validationExt/validationLayerName outside of the block to fix the crash.
Resolves the following clang-10 compiler warnings:
```
$ ninja
[65/177] Building CXX object examples/CMakeFiles/oit.dir/oit/oit.cpp.o
../examples/oit/oit.cpp:501:7: warning: 'buildCommandBuffers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
void buildCommandBuffers()
^
../base/vulkanexamplebase.h:351:15: note: overridden virtual function is here
virtual void buildCommandBuffers();
^
1 warning generated.
[78/177] Building CXX object examples/CMakeFiles/inlineuniformblocks.dir/inlineuniformblocks/inlineuniformblocks.cpp.o
../examples/inlineuniformblocks/inlineuniformblocks.cpp:19:27: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-int-float-conversion]
return ((float)rand() / (RAND_MAX));
~ ^~~~~~~~
/usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX'
^~~~~~~~~~
1 warning generated.
[84/177] Building CXX object examples/CMakeFiles/pushconstants.dir/pushconstants/pushconstants.cpp.o
../examples/pushconstants/pushconstants.cpp:24:28: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-int-float-conversion]
return ((float) rand() / (RAND_MAX));
~ ^~~~~~~~
/usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX'
^~~~~~~~~~
```