[Piglit] [PATCH v3 1/4] pbo-read-argb8888: make it endian-safe

Michel Dänzer michel at daenzer.net
Fri Apr 1 07:45:44 UTC 2016


On 01.04.2016 05:09, Oded Gabbay wrote:
> In this test we use GL_BGRA + GL_UNSIGNED_BYTE. However, the probe
> function receives two 4-byte values to compare, expected and
> observed. This is wrong as the correct way to compare
> array_of_bytes (GL_UNSIGNED_BYTE) in an endian-safe way is by comparing
> memory (and not values).
> 
> This patch fixes this bug by changing the function to receive two
> pointers instead of values. It also corrects the way the expected values
> are constructed to be in endian-safe way for array-of-bytes
> 
> This fixes the test in llvmpipe, softpipe and r600g in big-endian machine.
> 
> v2: Changed initialization of expected results to be more clear
> v3: Changed printing of results to display individual components
> 
> Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

As Ilia didn't review the v3 patch, it would have been more accurate to
append (v2) to this line.


> +	if (expected[0] != observed[0] ||
> +		 expected[1] != observed[1] ||
> +		 expected[2] != observed[2]) {
>  		printf("Probe color at (%i,%i)\n", x, y);
> -		printf("  Expected: 0x%08x\n", expected);
> -		printf("  Observed: 0x%08x\n", observed);
> +		printf("  Expected: b = 0x%02x  g = 0x%02x  r = 0x%02x  a = 0x%02x\n",
> +				expected[0], expected[1], expected[2], expected[3]);
> +		printf("  Observed: b = 0x%02x  g = 0x%02x  r = 0x%02x  a = 0x%02x\n",
> +				observed[0], observed[1], observed[2], observed[3]);

Some lines aren't indented properly to line up with the opening parens.
Same issue in the other patches. With that fixed, all patches are

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the Piglit mailing list