Skip to content
  • Oded Gabbay's avatar
    pbo-readpixels-small: make it endian-safe · c574c99e
    Oded Gabbay authored
    
    
    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
    v4: Changed some indentation
    
    Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    v2: Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
    c574c99e