d3dx9: Rework color key handling.
3 unresolved threads
3 unresolved threads
Merge request reports
Activity
requested review from @Mystral
- Resolved by Connor McAdams
Apparently 64-bit supports color keying on compressed formats but 32-bit does not, very odd :)
- Resolved by Connor McAdams
- Resolved by Connor McAdams
2208 { 2209 const uint8_t *dst_expected_row = ((uint8_t *)tests[i].expected_dst_data) + (16 * y); 2210 const uint8_t *dst_row = ((uint8_t *)lock_rect.pBits) + (lock_rect.Pitch * y); 2211 2212 for (x = 0; x < 4; ++x) 2213 { 2214 const uint8_t *dst_expected_pixel = dst_expected_row + (4 * x); 2215 const uint8_t *dst_pixel = dst_row + (4 * x); 2216 2217 if (memcmp(dst_pixel, dst_expected_pixel, 4)) 2218 mismatch_count++; 2219 } 2220 } 2221 IDirect3DSurface9_UnlockRect(surf); 2222 2223 todo_wine_if(tests[i].todo) ok(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); - Resolved by Connor McAdams
2144 2145 const void *expected_dst_data; 2146 D3DCOLOR color_key; 2147 BOOL todo; 2148 } tests[] = 2149 { 2150 /* Color key with alpha channel unset. */ 2151 { 2152 D3DFMT_R8G8B8, NULL, { 0, 0, 4, 4 }, r8g8b8_4_4, r8g8b8_4_4_expected, 0x00008080, 2153 .todo = TRUE 2154 }, 2155 /* Same color key as before except the alpha channel is set. */ 2156 { 2157 D3DFMT_R8G8B8, NULL, { 0, 0, 4, 4 }, r8g8b8_4_4, r8g8b8_4_4_expected, 0xff008080, 2158 .todo = TRUE 2159 }, - Resolved by Connor McAdams
- Resolved by Connor McAdams
While reviewing this I did explore the idea of fixing the color key check without moving it to the source format. I'm attaching the result of that here, for reference.
It's a bunch of debug stuff, test changes, fixes to the color key checks which kinda required splitting up the rgb_range into individual per-component ranges. It's not exactly beautiful or thought out (e.g. I more or less blindly replaced rgb_range with r_range all over the place, which isn't necessarily correct), but I guess it might be somewhat useful.
This was on top of commit 3/6
Edited by Matteo Bruni
added 6 commits
- 78ce92de - d3dx9: Make functions for pixel copying/conversion/filtering static.
- d9c4f4e0 - d3dx9: Move code for format conversion of a single pixel into a common helper function.
- 621d1d66 - d3dx9/tests: Add some color key tests.
- 4691a6f8 - d3dx9: Set all color channels to zero when color keying.
- 3768002d - d3dx9: Fixup color key value in d3dx_load_pixels_from_pixels() if necessary.
- f5378395 - d3dx9: Don't color key compressed pixel formats on 32-bit d3dx9.
Toggle commit list
Please register or sign in to reply