test: Only compute the masked pixel value if depth!=32
Minor saving for when we use a8r8g8b8. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
961139f587
commit
3dac734bb0
14
test/test.h
14
test/test.h
|
|
@ -52,15 +52,11 @@ int pixel_difference(uint32_t a, uint32_t b);
|
|||
|
||||
static inline int pixel_equal(int depth, uint32_t a, uint32_t b)
|
||||
{
|
||||
uint32_t mask;
|
||||
|
||||
if (depth == 32)
|
||||
mask = 0xffffffff;
|
||||
else
|
||||
mask = (1 << depth) - 1;
|
||||
|
||||
a &= mask;
|
||||
b &= mask;
|
||||
if (depth != 32) {
|
||||
uint32_t mask = (1 << depth) - 1;
|
||||
a &= mask;
|
||||
b &= mask;
|
||||
}
|
||||
|
||||
if (a == b)
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue