Bug 88930

Summary: [osmesa] osbuffer->textures should be indexed by attachment type
Product: Mesa Reporter: Park, Jeongmin <pjm0616>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: All   
i915 platform: i915 features:
Attachments: Patch

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

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.