summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* xlib: remove a ton of old xlib driver cruftBrian Paul2011-11-159-3409/+4
| | | | | | The days of 1-bpp, 8-bpp and dithering are long behind us. Reviewed-by: Eric Anholt <[email protected]>
* xlib: use MESA_FORMAT_XRGB8888 for pixmap surfacesBrian Paul2011-11-151-12/+1
| | | | | | | We no longer have software-allocated alpha buffers so we can forget about the alpha channel. Reviewed-by: Eric Anholt <[email protected]>
* xlib: remove software alpha buffer supportBrian Paul2011-11-154-26/+1
| | | | | | | Seldom used and this won't work when we move to using Map/UnmapRenderbuffer everywhere. This will let us remove a bunch of core Mesa code too. Reviewed-by: Eric Anholt <[email protected]>
* mesa: replace GLstencil with GLubyteBrian Paul2011-11-1513-149/+124
|
* intel: Fix intel_map_renderbuffer() for depthstencil buffers with separate ↵Chad Versace2011-11-151-1/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | stencil For a depthstencil buffer with separate stencil, intel_renderbuffer::region is null. (The regions are kept in hidden depth and stencil buffers). Since the region is null, intel_map_renderbuffer() assumed there was no data and returned a null map pointer, which in turn was dereferenced (!) by MapRenderbuffer's caller. This patch fixes intel_map_renderbuffer() to map the hidden depth buffer through the GTT and return that as the mapped pointer. Also, the stencil bits are scattered and gathered when needed. Fixes the following Piglit tests on gen7: fbo/fbo-readpixels-depth-formats hiz/hiz-depth-read-fbo-d24s8 hiz/hiz-stencil-read-fbo-d24s8 EXT_packed_depth_stencil/fbo-clear-formats EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-blit EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-drawpixels EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-readpixels EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8 EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Fix software detiling of system stencil buffersChad Versace2011-11-152-4/+6
| | | | | | | | | | | | | | | | | | | | If a window system stencil buffer had a region with odd height, then the calculated y offset needed for software detiling was off by one. The bug existed in intel_{map,unmap}_renderbuffer_s8() and in the intel_span.c accessors. Fixes the following Piglit tests on gen7: general/depthstencil-default_fb-readpixels-24_8 general/depthstencil-default_fb-readpixels-FLOAT-and-USHORT Fixes SIGABRT in the following Piglit tests on gen7: general/depthstencil-default_fb-blit general/depthstencil-default_fb-copypixels general/depthstencil-default_fb-drawpixels-24_8 general/depthstencil-default_fb-drawpixels-FLOAT-and-USHORT Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Fix intel_unmap_renderbuffer_s8()Chad Versace2011-11-151-2/+2
| | | | | | | | | | | | | | | | | | When gathering the temporary buffer's pixles into the gem buffer, we had the two buffers juxtaposed. Oops. Fixes the following Piglit tests on gen7: general/GL_SELECT - alpha-test enabled general/GL_SELECT - depth-test enabled general/GL_SELECT - no test function general/GL_SELECT - scissor-test enabled general/GL_SELECT - stencil-test enabled Fixes SIGABRT in Piglit tests EXT_framebuffer_object/fbo-stencil-* on gen7. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Refactor intel_map_renderbuffer()Chad Versace2011-11-151-134/+256
| | | | | | | | | | | The function already implements 3 cases (map through GTT, blit to a temporary, and detile stencil buffer to temporary), and a 4th will be added soon: scatter/gather for depthstencil buffers using separate stencil. For sanity's sake, this factors each case out into its own function. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* ir_to_mesa: don't init unfirom if link failedYuanhan Liu2011-11-151-1/+3
| | | | | | | | | Don't call set_unfiform_initializers if link failed, or it would trigger a GL_INVALID_OPERATION error. That's not an expected behavior of glLinkProgram function. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Remove resource count checks from ir_to_mesa and st_glsl_to_tgsiIan Romanick2011-11-142-106/+0
| | | | | | | These checks are now performed by the linker. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* linker: Count the number of uniform components used by a shader during linkingIan Romanick2011-11-141-0/+7
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* linker: Count the number of samplers used by a shader during linkingIan Romanick2011-11-141-0/+3
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Fix restoring of fixed function texture enables.Eric Anholt2011-11-141-27/+9
| | | | | | | | | | | | | If they were disabled on entry, and we enabled one (like for BlitFramebuffer), we wouldn't disable it on the way out. Retain the attempted optimization here (don't keep calling to set each bit for changes that won't matter) by just setting the bits directly with appropriate flushing. Fixes misrendering on the second draw of piglit fbo-blit. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: Don't forget to flag state when restoring texobjects.Eric Anholt2011-11-141-2/+5
| | | | | | | It's unlikely that we changed the object but no other texture parameter, but be correct anyway. Noticed by inspection. Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: fix system value to semantic mappingChristoph Bumiller2011-11-142-0/+2
| | | | | Broken by addition of SYSTEM_VALUE_VERTEX_ID in 919c53e87a1f6f5322bc1f1486bb3e6b954b00d5.
* radeon: further cleanup of shared codeFabio Pedretti2011-11-143-23/+6
| | | | Signed-off-by: Alex Deucher <[email protected]>
* radeon: add some missing FireMV pci idsAlex Deucher2011-11-141-0/+1
| | | | | | Note: this is a candidate for the stable branches. Signed-off-by: Alex Deucher <[email protected]>
* mesa/st: Flush stdout after pritingin the GLSL.José Fonseca2011-11-141-0/+1
| | | | Otherwise it gets all garbled with stderr.
* i965: Don't try to normalize cubemap coordinates for textureSize.Kenneth Graunke2011-11-121-0/+3
| | | | | | | | | | Although textureSize is represented as an ir_texture with op == ir_txs, it doesn't have a coordinate, so normalizing it doesn't make sense. Fixes crashes in oglconform glsl-bif-tex-size basic.samplerCube.* tests. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix glFramebufferTexture*() for depth and stencil attachmentsChad Versace2011-11-111-3/+55
| | | | | | | | | | | | | | | | | | | | | | | This patch solves three bugs. 1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point, Mesa attached the texture only to the depth attachment point gl_framebuffer::Attachment[BUFFER_DEPTH] and failed to attach it to the stencil attachment point gl_framebuffer::Attachment[BUFFER_STENCIL] 2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two separate renderbuffer wrappers. This caused a GL error in glGetFramebufferAttachmentParameteriv(). 3. Same as 2, but with depth and stencil juxtaposed. Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965: Expose GLSL 1.30 on gen6+.Eric Anholt2011-11-111-1/+4
| | | | | | | With the gl_VertexID support, everything required should now be supported. Reviewed-by: Ian Romanick <[email protected]>
* i965: Add support for gl_VertexID and gl_InstanceID.Eric Anholt2011-11-114-6/+63
| | | | | | | | | | | | | The compiler setup for these VF-uploaded attributes looks a little cheesy with mixing system values and real VBO-sourced attributes. It would be nice if we could just compute the ATTR[] map to GRF index up front and use it at visit time instead of using ir->location in the ATTR file. However, we don't know the reg_offset at visit(ir_variable *) time, so we can't do the mapping that early. Fixes piglit vertexid test. Reviewed-by: Ian Romanick <[email protected]>
* i965: Replace a should-never-happen fallback with asserts where it matters.Eric Anholt2011-11-112-13/+15
| | | | | | | | | | | | We only allow 16 vec4s of attributes in our GLSL/ARB_vp programs, and 1 more element will get used for gl_VertexID/gl_InstanceID. So it should never have been possible to hit this fallback, unless there was another bug. If you do hit this, you're probably using gl_VertexID and falling back to swrast won't work for you anyway. This also updates the limits for gen6+. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make gl_VertexID be a system value like gl_InstanceID.Eric Anholt2011-11-111-0/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* state_tracker: remove written but never used variable.Mathias Fröhlich2011-11-111-2/+0
|
* radeon: fix build.Dave Airlie2011-11-111-1/+1
| | | | | | I had a later patch remove this code, but cherry-picked across it. Signed-off-by: Dave Airlie <[email protected]>
* radeon: drop unused constant_cliprect fieldDave Airlie2011-11-112-2/+0
|
* radeon: disable texobj state for 3d textureDave Airlie2011-11-111-0/+1
| | | | | | for 3d texture fallback, disable the texobj state. Signed-off-by : Dave Airlie <[email protected]>
* radeon: use meta bitmapDave Airlie2011-11-111-0/+1
| | | | | | Now that the stride bug is fixed, enable Bitmap via meta mode. Signed-off-by: Dave Airlie <[email protected]>
* radeon: fix bug with wrong stride being used for rectangluar textures.Dave Airlie2011-11-114-6/+6
| | | | | | This broke the meta bitmap code when it was enabled. Signed-off-by: Dave Airlie <[email protected]>
* i965: remove #include of api_noop.hBrian Paul2011-11-111-1/+0
|
* xlib: set alpha to 0xff when mapping RGB pixmapsBrian Paul2011-11-111-0/+11
| | | | Fixes a bunch of conform regressions.
* swrast: avoid calling _mesa_get_srgb_format_linear() inside a loopBrian Paul2011-11-111-3/+3
|
* swrast: remove bogus assertionBrian Paul2011-11-111-1/+0
| | | | | It would fail for images that were never allocated (and wouldn't be used during rendering).
* st/mesa: fix OOM failure in bitmap codeBrian Paul2011-11-111-5/+10
|
* vbo: better handling of VBO allocation failuresBrian Paul2011-11-115-39/+125
| | | | | | | | | | | Previously, if we failed to allocate a VBO (either for display list compilation or immediate mode rendering) we'd eventually segfault when trying to map the non-existant buffer or in a glVertex/Color/etc call when we hit a null pointer. Now we don't try to map non-existant buffers and if we do fail to allocate a VBO we plug in no-op functions for glVertex/Color/etc so we don't segfault.
* mesa: replace api_noop.[ch] with vbo_noop.[ch]Brian Paul2011-11-115-1116/+530
| | | | | | None of the code in api_noop.c was used anymore. The new vbo_noop.c functions are true no-ops. They'll be used to no-op glBegin/End functions when we run out of VBO memory.
* vbo: pull some code from api_noop.c into vbo moduleBrian Paul2011-11-112-16/+208
| | | | | | Only a handful of functions from api_noop.c are actually used by the VBO module. Move them to the VBO module. With this change, none of the code in api_noop.c is actually used anymore.
* mesa: remove ancient, unused gl_free_control_points prototoypeBrian Paul2011-11-111-4/+0
|
* i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR.Kenneth Graunke2011-11-103-2/+12
| | | | | | | | | | NEW_COLOR is only needed on Gen4-5 as brw_update_renderbuffer_surfaces only uses ctx->Color when intel->gen < 6. This should reduce unnecessary state updates. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Reorder state atom lists so all the surface state is together.Kenneth Graunke2011-11-101-16/+19
| | | | | | | Not strictly necessary, but seems like a good idea. Suggested-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Put a proper sampler count in 3DSTATE_VS.Kenneth Graunke2011-11-102-3/+5
| | | | | | | See similar code for 3DSTATE_WM. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Upload SAMPLER_STATE pointers for the VS on Ivybridge.Kenneth Graunke2011-11-101-1/+7
| | | | | | | See similar code in gen7_wm_state.c. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Move and rename "wm sampler" fields to just "sampler".Kenneth Graunke2011-11-109-33/+37
| | | | | | | | | | | | | brw_wm_samplers actually enables any active samplers regardless of what pipeline stage is using them, so it doesn't make much sense for it to be WM-specific. So, rename it to "brw_samplers." To properly generalize it, move sampler_count and sampler_offset from brw_context::wm to a new brw_context::sampler that can be shared without looking strange. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Clean up code for VS pull constant surface creation.Kenneth Graunke2011-11-103-64/+20
| | | | | | | | | | Like for the WM pull constants, we can merge the former prepare/emit stages into one tracked state atom. Furthermore, the code that used to handle the binding table was removed in the last commit, leaving some rather silly looking short functions that can easily be folded in. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use a single binding table for all pipeline stages.Kenneth Graunke2011-11-109-85/+80
| | | | | | | | | | | | | | | | | | | | | | | Although the hardware supports separate binding tables for each pipeline stage, we don't see much advantage over a single shared table. Consider the contents of the binding table: - Textures (16) - Draw buffers (8) - Pull constant buffers (1 for VS, 1 for WM) OpenGL's texture bindings are global: the same set of textures is available to all shader targets. So our binding table entries for textures would be exactly the same in every table. There are only two pull constant buffers (not many), and although draw buffers aren't interesting to the VS, it shouldn't hurt to have them in the table. The hardware supports up to 254 binding table entries, and we currently only use 26. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Split brw_wm_surfaces state into renderbuffer and texture atoms.Kenneth Graunke2011-11-103-15/+35
| | | | | | | | | | | | | First, the texturing setup code is relevant for all pipeline stages, while renderbuffer surfaces are only used by the WM. Secondly, renderbuffer and texture setup depends on a different set of dirty bits. There's no reason to walk the array of textures when changing draw buffers, or vice-versa. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Combine the two WM pull constant tracked state atoms.Kenneth Graunke2011-11-104-59/+16
| | | | | | | | | | | | | | | | These were only split for historical reasons: brw_wm_constants used to be the "prepare" step, while brw_wm_constant_surface was "emit". Now that both happen at emit time, it makes sense to combine them. Call the newly combined state atom "brw_wm_pull_constants" to indicate help distinguish it from the Gen6+ atoms that handle push constants. Finally, remove the BRW_NEW_WM_CONSTBUF dirty bit entirely now that it's never flagged nor used. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Rename gen6_*_constants tracked state atoms to "push_constants".Kenneth Graunke2011-11-104-8/+8
| | | | | | | | | | | | | | | When reading the "brw_wm_constants" and "gen6_wm_constants" atoms side-by-side, I initially failed to notice the crucial difference: the Gen6 atoms are for Push Constants, while brw_wm_constants handles Pull Constants. (Gen4/5 Push Constants are handled by "brw_curbe.") Renaming these should clarify the code and save me from constant confusion over the fact that "gen6_wm_constants" isn't just a newer version of "brw_wm_constants." Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Remove nr_surfaces computation from brw_update_wm_surfaces.Kenneth Graunke2011-11-101-11/+1
| | | | | | | | | | | | This code is fairly fragile, as it depends on the ordering of the entries in the binding table, which will change soon. Also, stop listening on the BRW_NEW_WM_CONSTBUF dirty bit as it's no longer required. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>