Bug 46311 - Missing support of point size in Mesa core
Missing support of point size in Mesa core
Status: VERIFIED FIXED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
x86 (IA32) Linux (All)
: medium normal
Assigned To: Yuanhan Liu
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-19 18:26 UTC by zhao jian
Modified: 2012-03-05 19:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhao jian 2012-02-19 18:26:02 UTC
System Environment:
--------------------------
Mesa:        (master)26de5273acf1ebe6730b5e72b55b3bcceba167c6

Bug detailed description:
-------------------------
When run some shaders involving setting point size, it fails with software rendering on all platforms(Pinetrail, Piketon, HuronRiver). 

Reproduce steps:
-------------------------
1. xinit
2. LIBGL_ALWAYS_SOFTWARE=1 ./glsl-vs-point-size
Comment 1 Kenneth Graunke 2012-02-20 11:13:16 UTC
Those can't be the steps to reproduce the bug.  Setting LIBGL_ALWAYS_SOFTWARE=1 forces *everything* to done in software...our driver wouldn't even be loaded!

That said, glsl-vs-point-size does seem to be hitting some swrast fallbacks in glReadPixels on Sandybridge/HuronRiver.
Comment 2 Yuanhan Liu 2012-02-20 18:07:05 UTC
(In reply to comment #1)
> Those can't be the steps to reproduce the bug.  Setting LIBGL_ALWAYS_SOFTWARE=1
> forces *everything* to done in software...our driver wouldn't even be loaded!

Yes, you are right; our driver will not be loaded. But that's our purpose, since it's a swrast bug. Here is a little background: i915 driver doesn't handle vs itself, instead tnl will handle it. Thus i915 can't handle the point size specified in vertex shader by gl_PointSize builtin variable. So, what we can do is only to fix the issue in tnl and it's a swrast issue.

I sent out a patch to fix this issue, would you mind please review it?
http://lists.freedesktop.org/archives/mesa-dev/2012-February/019231.html

> 
> That said, glsl-vs-point-size does seem to be hitting some swrast fallbacks in
> glReadPixels on Sandybridge/HuronRiver.
Comment 3 Kenneth Graunke 2012-02-20 20:15:49 UTC
Ah!  I misunderstood, sorry.  I thought that the report was saying there was a software fallback.  But you're right, it is broken in swrast.  Sure, I'll take a look at your patch.
Comment 4 zhao jian 2012-02-24 00:26:25 UTC
Yuanhan, thanks for your help for the explanation. And it is exactly why I file this bug. Hope you guys can fix it soon. Thanks.
Comment 5 Yuanhan Liu 2012-03-04 18:50:30 UTC
Fixed by the following commit:

---
commit 9962280c332aba4b945b73ae19862041a7053a71
Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Date:   Thu Feb 23 14:19:18 2012 +0800

    tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
    
    We may specify the point size in a glsl vertex shader.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
    piglit: glsl-vs-point-size
    
    NOTE: This is a candidate for stable release branches.
    
    Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
Comment 6 zhao jian 2012-03-05 19:02:33 UTC
(In reply to comment #5)
> Fixed by the following commit:
> 
> ---
> commit 9962280c332aba4b945b73ae19862041a7053a71
> Author: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> Date:   Thu Feb 23 14:19:18 2012 +0800
> 
>     tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
> 
>     We may specify the point size in a glsl vertex shader.
> 
>     Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
>     piglit: glsl-vs-point-size
> 
>     NOTE: This is a candidate for stable release branches.
> 
>     Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
>     Reviewed-by: Brian Paul <brianp@vmware.com>

Verified on Piketon with newest code on mesa master(058fc6521e3b....).