mojira.dev
MC-234657

Using a Matrix3x3 or Matrix2x2 as a Shader Uniform fails to parse

adding this line to the uniforms section of the shader json causes my custom shader to fail to parse:

{ "name": "NormalMat", "type": "matrix3x3", "count": 9, "values": [ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ]}

This is caused because the size of the array used to set the uniform has a minimum size of 16:

[media]

This float array is then passed into Uniform#set(float[] values), which assumes that the array is the right size for the FloatBuffer used to store the values.

[media]

This can be fixed by either changing the default size of the array, or limiting the number of copied values into the buffer. The simplest change is to change line 255 in the image above to the following:

floatBuffer.put(src, 0, count);

Attachments

Comments 4

@unknown 1.17 is an outdated version please test in 1.17.1

Can confirm on 1.17.1

Thank you for your report!
After consideration, the issue is being closed as Invalid.

This report does not describe a bug.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

OroArmor

(Unassigned)

Community Consensus

(Unassigned)

rendering

1.17.1

Retrieved