Bug 81649

Summary: Difference with software render and without (clipping vertex?)
Product: Mesa Reporter: Dorian Fevrier <fevrier.dorian>
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: RESOLVED MOVED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: 8.0   
Hardware: x86 (IA32)   
OS: Linux (All)   
i915 platform: i915 features:
Attachments: Without LIBGL_ALWAYS_SOFTWARE

Description Dorian Fevrier 2014-07-22 20:27:20 UTC
Created attachment 103299 [details]

Hi, I'm currently working on mupen64plus rice video plugin.

I have an intel chipset:

Tungsten Graphics, Inc - Mesa DRI Intel(R) 965GM x86/MMX/SSE2 : 2.1 Mesa 8.0.4

After moving the plugin from a fixed OpenGL pipeline to a GLSL one, I have some vertex clipping problems:


After some investigation, I realize I shoud try using this to help me to know if it's a programming problem or a driver problem:


And there is no more face clipped and everything work as except.

I've found this bug: https://bugs.freedesktop.org/show_bug.cgi?id=64668

Paul suggest to add this to the shader:

gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;

And I guess there is an important point: The vertex projection transform is done on the CPU side. The reason is that N64 apply "current matrix" (where "current" is a model matrix stack * projection matrix stack) at the moment where the vertex is provided. So you really have this "gl_ModelViewMatrix". Anyway, adding this to the vertex shader doesn't solve the problem so maybe this is not related at all. Same for the example code provided in the linked bug (64668) it clip what ever LIBGL_ALWAYS_SOFTWARE is set or not. So once again, it's maybe not related.

Anyway, the fact it works in software (LIBGL_ALWAYS_SOFTWARE) make me realize the current code is supposed to work but maybe just fail on the 965GM chipset.

FYI, whe I define LIBGL_ALWAYS_SOFTWARE I guet this OpenGL string:

VMware, Inc. - Gallium 0.4 on llvmpipe (LLVM 0x300) : 2.1 Mesa 8.0.4

It's hard to reproduce the bug but I probide the ".trace" for qapitrace: https://github.com/apitrace/apitrace. If you open it on 965GM without LIBGL_ALWAYS_SOFTWARE and trace the frame 4 you will see the bug (image 001). If you define LIBGL_ALWAYS_SOFTWARE, run qaptitrace and trace the frame 4 you will see what is expected (image 002).

If you have any workaround to share I would really love that. :)


Comment 1 Dorian Fevrier 2014-07-22 20:28:29 UTC
Created attachment 103300 [details]
Comment 2 GitLab Migration User 2019-09-25 18:51:53 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/1448.

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.