mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 14:09:10 +00:00
testautomation: don't validate alpha values on XRGB formats
The results are not defined, and some renderers set 0xFF always and other renderers set the alpha to blend results, even though it won't be used when rendering. Fixes --filter render_testBlendModes with D3D renderers
This commit is contained in:
parent
c698c61f03
commit
759e01bd64
1 changed files with 6 additions and 1 deletions
|
@ -897,7 +897,12 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo
|
||||||
deltaR = SDL_abs((int)actualR - expectedR);
|
deltaR = SDL_abs((int)actualR - expectedR);
|
||||||
deltaG = SDL_abs((int)actualG - expectedG);
|
deltaG = SDL_abs((int)actualG - expectedG);
|
||||||
deltaB = SDL_abs((int)actualB - expectedB);
|
deltaB = SDL_abs((int)actualB - expectedB);
|
||||||
|
if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) {
|
||||||
deltaA = SDL_abs((int)actualA - expectedA);
|
deltaA = SDL_abs((int)actualA - expectedA);
|
||||||
|
} else {
|
||||||
|
// The alpha channel is ignored in non-alpha formats, so don't validate it
|
||||||
|
deltaA = 0;
|
||||||
|
}
|
||||||
SDLTest_AssertCheck(
|
SDLTest_AssertCheck(
|
||||||
deltaR <= MAXIMUM_ERROR &&
|
deltaR <= MAXIMUM_ERROR &&
|
||||||
deltaG <= MAXIMUM_ERROR &&
|
deltaG <= MAXIMUM_ERROR &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue