mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Add support for non-square matrix uniforms in desktop GLSL. The notation is columns x rows, e.g. a mat4x2 has 4 columns and 2 rows.
Fixed the memory layout of matrices sent to shaders via Shader:send. Note that this is a breaking fix and will probably cause matrices designed to work with older versions of LÖVE to be transposed in shaders compared to what they were previously, if Shader:send or sendMatrix was used to put them in the shader. --HG-- branch : minor
This commit is contained in:
@@ -88,11 +88,21 @@ public:
|
||||
std::string pixel;
|
||||
};
|
||||
|
||||
struct MatrixSize
|
||||
{
|
||||
short columns;
|
||||
short rows;
|
||||
};
|
||||
|
||||
struct UniformInfo
|
||||
{
|
||||
int location;
|
||||
int count;
|
||||
int components;
|
||||
union
|
||||
{
|
||||
int components;
|
||||
MatrixSize matrix;
|
||||
};
|
||||
UniformType baseType;
|
||||
std::string name;
|
||||
};
|
||||
@@ -195,7 +205,8 @@ private:
|
||||
// Map active uniform names to their locations.
|
||||
void mapActiveUniforms();
|
||||
|
||||
int getUniformTypeSize(GLenum type) const;
|
||||
int getUniformTypeComponents(GLenum type) const;
|
||||
MatrixSize getMatrixSize(GLenum type) const;
|
||||
UniformType getUniformBaseType(GLenum type) const;
|
||||
|
||||
GLuint compileCode(ShaderStage stage, const std::string &code);
|
||||
|
||||
Reference in New Issue
Block a user