RĂ©mi Bernon reports an unspecified issue with gcc 11 related to compute_sphere_visibility() expecting 12 input planes, but d3d_device3_ComputeSphereVisibility() only providing 6. The actual number of planes required depends on the "enabled_planes" mask. This patch should make the code better reflect that, but I do not have a gcc 11 setup to verify it resolves the issue there.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ddraw/device.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 8afbab0e58d..6e8f109173b 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -4638,17 +4638,20 @@ static void prepare_clip_space_planes(struct d3d_device *device, struct wined3d_ plane[5].w = m._44 - m._43; }
-static void compute_sphere_visibility(struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality, - D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD *return_values) +static void compute_sphere_visibility(const struct wined3d_vec4 *planes, DWORD enabled_planes, BOOL equality, + const D3DVECTOR *centres, const D3DVALUE *radii, unsigned int sphere_count, DWORD *return_values) { - UINT i, j; + unsigned int mask, i, j;
+ memset(return_values, 0, sphere_count * sizeof(*return_values)); for (i = 0; i < sphere_count; ++i) { - return_values[i] = 0; - for (j = 0; j < 12; ++j) - if (enabled_planes & 1u << j) - return_values[i] |= in_plane(j, plane[j], centers[i], radii[i], equality); + mask = enabled_planes; + while (mask) + { + j = wined3d_bit_scan(&mask); + return_values[i] |= in_plane(j, planes[j], centres[i], radii[i], equality); + } } }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=101637
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
Report validation errors: ddraw7: Timeout
=== debiant2 (build log) ===
WineRunWineTest.pl:error: The task timed out