Bug 88930 - [osmesa] osbuffer->textures should be indexed by attachment type
Summary: [osmesa] osbuffer->textures should be indexed by attachment type
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-03 03:21 UTC by Park, Jeongmin
Modified: 2015-02-03 22:51 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch (846 bytes, text/plain)
2015-02-03 03:21 UTC, Park, Jeongmin
Details

Description Park, Jeongmin 2015-02-03 03:21:38 UTC
Created attachment 113080 [details]
Patch

In osmesa_st_framebuffer_validate(), osbuffer is indexed by i:
>      out[i] = osbuffer->textures[i] =
>         screen->resource_create(screen, &templat);

This caused a crash in OSMesaGetDepthBuffer() at:
>   struct pipe_resource *res = osbuffer->textures[ST_ATTACHMENT_DEPTH_STENCIL];

This has been present since (at least) Mesa 10.1.3 but somehow it worked OK in 10.1.3.
Comment 1 Brian Paul 2015-02-03 22:39:41 UTC
Thanks.  Your patch looks correct.  I believe we can also simply some code in osmesa_st_framebuffer_flush_front() as a follow-on.

I'll apply your patch to master and the 10.4 branch.
Comment 2 Brian Paul 2015-02-03 22:51:00 UTC
Patch pushed.


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.