Allow plain arrays of a base type as shader buffer block declarations.

This commit is contained in:
Alex Szpakowski
2021-11-06 16:42:41 -03:00
parent 68977ec311
commit fb77e64f61
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -891,14 +891,14 @@ bool Shader::validateInternal(StrongRef<ShaderStage> stages[], std::string &err,
const glslang::TTypeList *structure = type->getStruct();
if (structure == nullptr || structure->size() != 1)
{
err = "Shader validation error:\nStorage Buffer block '" + info.name + "' must contain a single unsized array of structs.";
err = "Shader validation error:\nStorage Buffer block '" + info.name + "' must contain a single unsized array of base types or structs.";
return false;
}
const glslang::TType* structtype = (*structure)[0].type;
if (structtype == nullptr || structtype->getBasicType() != glslang::EbtStruct || !structtype->isUnsizedArray())
const glslang::TType* elementtype = (*structure)[0].type;
if (elementtype == nullptr || !elementtype->isUnsizedArray())
{
err = "Shader validation error:\nStorage Buffer block '" + info.name + "' must contain a single unsized array of structs.";
err = "Shader validation error:\nStorage Buffer block '" + info.name + "' must contain a single unsized array of base types or structs.";
return false;
}
+1 -1
View File
@@ -45,7 +45,7 @@ public:
struct StorageTextureBinding
{
Texture *texture = nullptr;
love::graphics::Texture *texture = nullptr;
GLuint gltexture = 0;
TextureType type = TEXTURE_2D;
GLenum access = GL_READ_ONLY;