Open rg3igalia opened 1 year ago
The parser in amber treats all colour values as [0..1]
floating point values. So, when it parses the EQ_RGBA 0 1 0 0
it divides each value by 255.f
which is why the expected value ends up being 0.003922
.
You'll either need to EXPECT
on each index that the values are correct, or create a second buffer with the result values and EXPECT
with an EQ_BUFFER
.
We could potentially add a EQ_URGBA
(or some better name) to specify the the RGBA values are [0-255]
instead of [0..1]
if this comes up a lot.
Understood, thanks! Reading that, my main complaint is that this is poorly documented. If I'm using UNORM framebuffers and store a 1.0 from the shader, I understand how that ends up being a 255 value in memory, so I can reason why EQ_RGBA may want me to say 255 by reading the documentation. However, it's not evident at all that I cannot apply this operation to UINT framebuffers (the expected value undergoes a floating point division, but the actual value does not), nor is it evident that we need to apply the workarounds you mention. So I ended up being quite lost. :sweat_smile:
I'm not sure if this is more of a bug report or a question.
When using UNORM color buffers, everything works as expected and storing 1.0 in a component value works with a subsequent EQ_RGB(A) check with value 255.
For example, this works:
But if we switch the framebuffer to UINT, this does not work. Note we're storing a 1 in the frag shader and expecting a 1 in the EQ_RGBA statement.
I get the following: