From a3ff9999d1a70e0152ac15910795774066a1a17c Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 6 Nov 2021 18:30:08 -0300 Subject: [PATCH] Disallow mat3 formats in shader storage buffers. GLSL's std430 layout rules make it really unintuitive for users to deal with. --- src/modules/graphics/Buffer.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/modules/graphics/Buffer.cpp b/src/modules/graphics/Buffer.cpp index a64e9654a..569bb1e8a 100644 --- a/src/modules/graphics/Buffer.cpp +++ b/src/modules/graphics/Buffer.cpp @@ -154,11 +154,19 @@ Buffer::Buffer(Graphics *gfx, const Settings &settings, const std::vector 0 || info.isMatrix)) + { + const char *fstr = "unknown"; + getConstant(decl.format, fstr); + throw love::Exception("Data format %s%s is not currently supported in shader storage buffers.", fstr, decl.arrayLength > 0 ? " array" : ""); + } // "If the member is a structure, the base alignment of the structure // is N, where N is the largest base alignment value of any of its