[Mesa-dev] [Bug 102218] Nier:Automata (through wine) - Bloom too bright

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 20 16:15:19 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=102218

--- Comment #5 from Matias N. Goldberg <dark_sylinc at yahoo.com.ar> ---
I'm just passing by:

I'm 90% sure this is just a missing barrier before/after compute (which would
indicate a Wine bug).

If you're able to modify wine's source code, try inserting
glMemoryBarrier( GL_ALL_BARRIER_BITS ); before and after the glDispatch calls.
Alternatively, you could modify Mesa's source code so a barrier is performed at
the beginning and end of each glDispatch call.

I faced a similar situation in my own programs, where the compute shader would
be launched before rendering; and this happened because I needed to unbind the
FBO before launching the compute shader, otherwise Mesa will put them
asynchronously, running in parallel. As a result the compute shader will read
mostly flickering garbage as input.
A workaround is to use a barrier with all bits, which in radeonsi has a similar
effect as unbinding the FBO.

Most GL drivers (actually all GL drivers I've seen except Mesa) just play safe
by serializing everything, which would explain why it works fine on NVIDIA.

Just go to src/mesa/main/compute.c
and modify:
void GLAPIENTRY
_mesa_DispatchCompute(GLuint num_groups_x,
                      GLuint num_groups_y,
                      GLuint num_groups_z)
{
   dispatch_compute(num_groups_x, num_groups_y, num_groups_z, false);
}


so that it reads:
void GLAPIENTRY
_mesa_DispatchCompute(GLuint num_groups_x,
                      GLuint num_groups_y,
                      GLuint num_groups_z)
{
   _mesa_MemoryBarrier( 0xFFFFFFFF );
   dispatch_compute(num_groups_x, num_groups_y, num_groups_z, false);
   _mesa_MemoryBarrier( 0xFFFFFFFF );
}

If that fixes the problem, then this is very likely a Wine bug (wine needs to
unbind the target as an FBO before using it as input for the compute shader).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171120/bb53e4b2/attachment-0001.html>


More information about the mesa-dev mailing list