Bug 91170

Summary: [NV50/Gallium] World of Zoo (in Wine) has rendering issues
Product: Mesa Reporter: Béla Gyebrószki <gyebro69>
Component: Drivers/DRI/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED MOVED QA Contact: Nouveau Project <nouveau>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
URL: http://store.steampowered.com/app/43100/
Whiteboard:
i915 platform: i915 features:
Attachments: bs fix
another bs fix

Description Béla Gyebrószki 2015-07-01 04:16:36 UTC
When the game loads to the menu the screen is scrambled with flashing polygons.
This doesn't occur with the binary drivers (340.76) or when starting the game with the software renderer.Disabling shader optimization doesn't resolve the problem.

Screenshot:
http://imgur.com/xro8Ixr

Trace file:
https://drive.google.com/open?id=0B-tTbLKBl-tOdTJxT1o0c2dZMmc
The problem is first visible in frame #152, when the second splash screen is displayed.

Demo version is available on Steam (needs Wine to run):
http://store.steampowered.com/app/43100/

Fedora 22 32-bit
Mesa 10.6-branchpoint-773-g1de93f9
Kernel 4.0.6-300.fc22.i686+PAE
Xorg 1.17.2
libdrm-2.4.61-3.fc22.i686
Comment 1 Béla Gyebrószki 2015-07-01 04:21:30 UTC
Sorry, I missed to specify my video card:

VGA compatible controller: NVIDIA Corporation G92 [GeForce GTS 250] (rev a2) (prog-if 00 [VGA controller])
Comment 2 Ilia Mirkin 2015-07-02 21:11:21 UTC
Reproduced on GT215. Does not happen on GF108.

Geometry seems off as soon as the first or second title screen... will have to double-check old versions, hopefully it's a regression we can bisect.
Comment 3 Ilia Mirkin 2015-07-02 23:59:26 UTC
OK, so forcing the inline vertex path rather than the stick-bo-into-pushbuf path seems to help. Will try to track down what's different. Probably something dumb around alignment.
Comment 4 Ilia Mirkin 2015-07-03 00:15:20 UTC
Created attachment 116899 [details] [review]
bs fix

Ugh, the buffer-update-is-in-progress issue strikes again! I fixed this ages ago, but it's back. [The first hunk of this patch is unrelated, but it also won't hurt.]

So now to figure out why it's not fencing properly.
Comment 5 Béla Gyebrószki 2015-07-03 03:04:22 UTC
(In reply to Ilia Mirkin from comment #4)
> Created attachment 116899 [details] [review] [review]
> bs fix
> 
> Ugh, the buffer-update-is-in-progress issue strikes again! I fixed this ages
> ago, but it's back. [The first hunk of this patch is unrelated, but it also
> won't hurt.]
> 
> So now to figure out why it's not fencing properly.

The patch fixes the problem here as well.
Comment 6 Ilia Mirkin 2015-07-03 16:06:15 UTC
Created attachment 116925 [details] [review]
another bs fix

This is very worrying... emitting more fences seems to fix it. Another place where it helped was in nouveau_transfer_write. The joke of it is that emitting a fence doesn't even kick the pushbuf, just writes the commands.

But since I'm not actually changing *which* fences are attached, I really don't see how this changes anything. Waiting on fence instead of fence_wr doesn't seem to affect it either.

What this game does is totally NUTS btw. It has a 512KB vertex buffer, and every time it maps it is with GL_MAP_INVALIDATE_BUFFER_BIT and writes all 512KB each time. Which is fine, just... inefficient (probably).

It also has a 128KB index buffer, of which it maps the whole range with  GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT. And then draws, immediately maps it again, draws, etc. This is like the definition of how not to use these buffers. Anyways, this forces the creation of a staging bo (in GART), which receives a copy of the old 128KB of data, and returns a pointer to that. Then the program updates the 12 or whatever bytes of data, and flushes them, so *just* those 12 bytes get written. [I'm not kidding, it literally updates 12 bytes a lot of the time.]

I tried adding kicks in copy_data & co, but that (expectedly) didn't help.
Comment 7 GitLab Migration User 2019-09-18 20:40:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1075.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.