From df8f52a71b73c1d098174b017f9fcd552a70a355 Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 12 Oct 2022 10:57:43 -0700 Subject: [PATCH] Fix gcc warnings; --- src/core/spv.c | 1 + src/modules/graphics/graphics.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/spv.c b/src/core/spv.c index 8d945bf0..f1cd18d3 100644 --- a/src/core/spv.c +++ b/src/core/spv.c @@ -107,6 +107,7 @@ spv_result spv_parse(const void* source, size_t size, spv_info* info) { break; case 16: // OpExecutionMode result = spv_parse_execution_mode(&spv, op, info); + break; case 5: // OpName result = spv_parse_name(&spv, op, info); break; diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 11d5918a..63cb421d 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -3501,29 +3501,29 @@ void lovrPassGetClear(Pass* pass, float color[4][4], float* depth, uint8_t* sten void lovrPassReset(Pass* pass) { } -void lovrPassGetViewMatrix(Pass* pass, uint32_t index, float* viewMatrix) { +void lovrPassGetViewMatrix(Pass* pass, uint32_t index, float viewMatrix[16]) { lovrCheck(index < pass->viewCount, "Trying to use view '%d', but Pass view count is %d", index + 1, pass->viewCount); mat4_init(viewMatrix, pass->cameras[index].view); } -void lovrPassSetViewMatrix(Pass* pass, uint32_t index, float* viewMatrix) { +void lovrPassSetViewMatrix(Pass* pass, uint32_t index, float viewMatrix[16]) { lovrCheck(index < pass->viewCount, "Trying to use view '%d', but Pass view count is %d", index + 1, pass->viewCount); mat4_init(pass->cameras[index].view, viewMatrix); pass->cameraDirty = true; } -void lovrPassGetProjection(Pass* pass, uint32_t index, float* projection) { +void lovrPassGetProjection(Pass* pass, uint32_t index, float projection[16]) { lovrCheck(index < pass->viewCount, "Trying to use view '%d', but Pass view count is %d", index + 1, pass->viewCount); mat4_init(projection, pass->cameras[index].projection); } -void lovrPassSetProjection(Pass* pass, uint32_t index, float* projection) { +void lovrPassSetProjection(Pass* pass, uint32_t index, float projection[16]) { lovrCheck(index < pass->viewCount, "Trying to use view '%d', but Pass view count is %d", index + 1, pass->viewCount); mat4_init(pass->cameras[index].projection, projection); pass->cameraDirty = true; // If the handedness of the projection changes, flip the winding - if (index == 0 && (projection[5] > 0.f != pass->cameras[0].projection[5] > 0.f)) { + if (index == 0 && ((projection[5] > 0.f) != (pass->cameras[0].projection[5] > 0.f))) { pass->pipeline->info.rasterizer.winding = !pass->pipeline->info.rasterizer.winding; pass->pipeline->dirty = true; } @@ -5266,7 +5266,7 @@ void lovrPassCopyTallyToBuffer(Pass* pass, Tally* tally, Buffer* buffer, uint32_ } } -void lovrPassCopyImageToTexture(Pass* pass, Image* image, Texture* texture, uint32_t srcOffset[4], uint32_t dstOffset[4], uint32_t extent[4]) { +void lovrPassCopyImageToTexture(Pass* pass, Image* image, Texture* texture, uint32_t srcOffset[4], uint32_t dstOffset[4], uint32_t extent[3]) { if (extent[0] == ~0u) extent[0] = MIN(texture->info.width - dstOffset[0], lovrImageGetWidth(image, srcOffset[3]) - srcOffset[0]); if (extent[1] == ~0u) extent[1] = MIN(texture->info.height - dstOffset[1], lovrImageGetHeight(image, srcOffset[3]) - srcOffset[1]); if (extent[2] == ~0u) extent[2] = MIN(texture->info.layers - dstOffset[2], lovrImageGetLayerCount(image) - srcOffset[2]);