aboutsummaryrefslogtreecommitdiff
path: root/demos/cube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/cube.cpp')
-rw-r--r--demos/cube.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/demos/cube.cpp b/demos/cube.cpp
index e5fa6ae2..096bf0b0 100644
--- a/demos/cube.cpp
+++ b/demos/cube.cpp
@@ -64,7 +64,7 @@
#else
#define ERR_EXIT(err_msg, err_class) \
do { \
- printf(err_msg); \
+ printf("%s\n", err_msg); \
fflush(stdout); \
exit(1); \
} while (0)
@@ -1555,6 +1555,9 @@ struct Demo {
vk::ShaderModule prepare_fs() {
size_t size = 0;
void *fragShaderCode = read_spv("cube-frag.spv", &size);
+ if (!fragShaderCode) {
+ ERR_EXIT("Failed to load cube-frag.spv", "Load Shader Failure");
+ }
frag_shader_module = prepare_shader_module(fragShaderCode, size);
@@ -1861,6 +1864,9 @@ struct Demo {
vk::ShaderModule prepare_vs() {
size_t size = 0;
void *vertShaderCode = read_spv("cube-vert.spv", &size);
+ if (!vertShaderCode) {
+ ERR_EXIT("Failed to load cube-vert.spv", "Load Shader Failure");
+ }
vert_shader_module = prepare_shader_module(vertShaderCode, size);