From dc945d757a7c5c52ab9ad431503a189b22626631 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Mon, 1 Apr 2024 23:01:00 -0300 Subject: [PATCH] tests: add a graphics test for uniform vec3 array alignment --- .../expected/love.test.graphics.Shader-2.png | Bin 0 -> 84 bytes testing/tests/graphics.lua | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 testing/output/expected/love.test.graphics.Shader-2.png diff --git a/testing/output/expected/love.test.graphics.Shader-2.png b/testing/output/expected/love.test.graphics.Shader-2.png new file mode 100644 index 0000000000000000000000000000000000000000..acc6f693255144e16ce567085660a80f5dc8180b GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5XE5m;VlehybfLtC=7srr_ dImrnMyg;4-1EW~ytcySvgQu&X%Q~loCICv#5Q6{! literal 0 HcmV?d00001 diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 4cdf28251..7cc564f3c 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -929,6 +929,25 @@ love.test.graphics.Shader = function(test) shader6:send("data[1].boolValue", true) shader6:send("data[0].tex", canvas2) + local shader7 = love.graphics.newShader[[ + uniform vec3 vec3s[3]; + + vec4 effect(vec4 vcolor, Image tex, vec2 tc, vec2 pc) { + return vec4(vec3s[1], 1.0); + } + ]] + + shader7:send("vec3s", {0, 0, 1}, {0, 1, 0}, {1, 0, 0}) + + local canvas3 = love.graphics.newCanvas(16, 16) + love.graphics.push("all") + love.graphics.setCanvas(canvas3) + love.graphics.setShader(shader7) + love.graphics.rectangle("fill", 0, 0, 16, 16) + love.graphics.pop() + local imgdata2 = love.graphics.readbackTexture(canvas3) + test:compareImg(imgdata2) + end