summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove unused gl_shared_state::DriverData fieldBrian Paul2012-02-101-2/+0
|
* mesa: fix proxy texture target initializationBrian Paul2012-02-101-7/+12
| | | | | | | | | | | The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in alloc_proxy_textures() because the elements in the targets[] array were in the wrong order. This didn't actually cause any failures since we never really use the proxy texture's Target field. But let's get it right. NOTE: This is a candidate for the 8.0 branch.
* mesa: remove unused gl_pixelmap::Map8[] arrayBrian Paul2012-02-102-3/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: stop using Map8[] tables in load_color_map_texture()Brian Paul2012-02-101-5/+6
| | | | | | | | Use the float tables instead. Pixel maps are seldom used so this shouldn't be a big deal. Next, we can get rid of the gl_pixelmap::Map8 array. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove unused _mesa_map_ci8_to_rgba8()Brian Paul2012-02-102-32/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix error handling in get_tex_rgba_compressed()Brian Paul2012-02-101-0/+2
|
* mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy()Brian Paul2012-02-101-41/+6
|
* mesa: push row stride adjustment down into _mesa_decompress_image()Brian Paul2012-02-102-12/+11
| | | | | | | There's a mismatch in row strides for compressed textures between what Driver.MapTextureImage() returns and what the software fetch-texel functions use. Move it down a layer. The next step would be to fix this in the fetch-texel functions.
* mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline functionBrian Paul2012-02-103-37/+25
|
* mesa: make _mesa_invalidate_shine_table() staticBrian Paul2012-02-102-6/+9
|
* mesa: remove gl_light::_SpotExpTable fieldBrian Paul2012-02-106-68/+4
| | | | | | | Just use pow() instead. Spot lights aren't too common and fixed-function lighting isn't as important as it used to me. This saves 32KB per context. Each table was 4KB and there's 8 lights.
* meta: replace abort() with _mesa_problem()Brian Paul2012-02-101-1/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: fix comment typoBrian Paul2012-02-101-1/+1
|
* i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.Eric Anholt2012-02-091-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/gen7: Fix the length of the DS state packet in the HiZ op.Eric Anholt2012-02-091-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/gen7: Fix GPU hangs from the HiZ op.Eric Anholt2012-02-091-2/+3
| | | | | | The wm max threads is in the same dword as the dispatch enable. The hardware gets super angry if you set max threads to 0, even if you aren't dispatching threads.
* mesa: fix maximum allowed proxy texture size conditionAnuj Phogat2012-02-091-11/+11
| | | | | | | | | | | | | | | | | | | | | width, height parameter in glTexImage2D() includes: texture image width + 2 * border (if any). So when doing the texture size check in _mesa_test_proxy_teximage() width and height should not exceed maximum supported size for target texture type + 2 * border. i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border Texture border is anyway stripped out before it is given to intel or gallium drivers. This patch fixes Intel oglconform test case: max_values negative.textureSize.textureCube Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970 Note: This is a candidate for mesa 8.0 branch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: exit the update fragment samplers/textures loops early.Dave Airlie2012-02-092-12/+23
| | | | | | | | | | If we have no more enabled samplers and we've reset all the previously used ones, no need to keep going around this loop. (just moved some stuff around to clean it up a bit). Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.Dave Airlie2012-02-091-3/+3
| | | | | | | From what I can see we were taking the debug path all the time, when we probably only want it for enable debug path. Signed-off-by: Dave Airlie <[email protected]>
* vbo: unmap vertex store before executing listsBrian Paul2012-02-093-12/+40
| | | | | | | | | We don't want our VBOs mapped when we're drawing. This change checks if the vertex store VBO is mapped before we execute a list, unmaps it, then remaps it after drawing. This situation pops up when building a nested display list in GL_COMPILE_AND_EXECUTE mode. Reviewed-by: Eric Anholt <[email protected]>
* gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTIONChristoph Bumiller2012-02-091-2/+2
| | | | | | | Just let the hardware do it if it can and avoid drivers having to check for the special case on each draw call. v2: update the draw module
* i965: Remove file i965/junk, accidentally added in 7b36c68Chad Versace2012-02-081-0/+0
|
* st/mesa: avoid vertex texture and sampler updates for 0 caseDave Airlie2012-02-082-0/+5
| | | | | | | | | | | If we had no vertex textures or samplers previously and we have none now, don't bother doing the enables dance. I was profiling nexuiz on noop and noticed these two functions in the profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03% for texture and samplers. Signed-off-by: Dave Airlie <[email protected]>
* i965: Remove broken symlink to intel_decode.c.Kenneth Graunke2012-02-071-1/+0
| | | | Eric removed intel_decode.c in 61b9ccd9e298ca1d3db55aee0cb2ff78662d6fa6.
* i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.Eric Anholt2012-02-071-5/+49
| | | | | | | | | | | We were doing saturate-based clamping on the [0,width] or [0,height] coordinate, which meant only the first pixel was addressable. Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor NOTE: This is a candidate for the 8.0 release branch. Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Move GL_CLAMP handling to coordinate setup.Eric Anholt2012-02-071-29/+21
| | | | | | | | | We should be able to merge self-move instruction into the MRF move anyway, and this simplifies things for the next commit. NOTE: This is a candidate for the 8.0 release branch. Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix HiZ change compiler warning.Eric Anholt2012-02-071-1/+0
|
* i965: Rewrite the HiZ opChad Versace2012-02-0719-517/+1146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HiZ op was implemented as a meta-op. This patch reimplements it by emitting a special HiZ batch. This fixes several known bugs, and likely a lot of undiscovered ones too. ==== Why the HiZ meta-op needed to die ==== The HiZ op was implemented as a meta-op, which caused lots of trouble. All other meta-ops occur as a result of some GL call (for example, glClear and glGenerateMipmap), but the HiZ meta-op was special. It was called in places that Mesa (in particular, the vbo and swrast modules) did not expect---and were not prepared for---state changes to occur (for example: glDraw; glCallList; within glBegin/End blocks; and within swrast_prepare_render as a result of intel_miptree_map). In an attempt to work around these unexpected state changes, I added two hooks in i965: - A hook for glDraw, located in brw_predraw_resolve_buffers (which is called in the glDraw path). This hook detected if a predraw resolve meta-op had occurred, and would hackishly repropagate some GL state if necessary. This ensured that the meta-op state changes would not intefere with the vbo module's subsequent execution of glDraw. - A hook for glBegin, implemented by brwPrepareExecBegin. This hook resolved all buffers before entering a glBegin/End block, thus preventing an infinitely recurring call to vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to flush its vertex queue in response to GL state changes. Unfortunately, these hooks were not sufficient. The meta-op state changes still interacted badly with glPopAttrib (as discovered in bug 44927) and with swrast rendering (as discovered by debugging gen6's swrast fallback for glBitmap). I expect there are more undiscovered bugs. Rather than play whack-a-mole in a minefield, the sane approach is to replace the HiZ meta-op with something safer. ==== How it was killed ==== This patch consists of several logical components: 1. Rewrite the HiZ op by replacing function gen6_resolve_slice with gen6_hiz_exec and gen7_hiz_exec. The new functions do not call a meta-op, but instead manually construct and emit a batch to "draw" the HiZ op's rectangle primitive. The new functions alter no GL state. 2. Add fields to brw_context::hiz for the new HiZ op. 3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable. 4. Kill all dead HiZ code: - the function gen6_resolve_slice - the dirty flag BRW_NEW_HIZ - the dead fields in brw_context::hiz - the state packet manipulation triggered by the now removed brw_context::hiz::op - the meta-op workaround in brw_predraw_resolve_buffers (discussed above) - the meta-op workaround brwPrepareExecBegin (discussed above) Note: This is a candidate for the 8.0 branch. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Paul Berry <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327 Reported-by: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927 Reported-by: [email protected] Signed-off-by: Chad Versace <[email protected]>
* intel: Avoid divide by zero for very small linear blitsIan Romanick2012-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | If size is small (such as 1), pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4); makes pitch = 0. Then height = size / pitch; causes a division-by-zero exception. If pitch is zero, set height to 1 and avoid the division. This fixes piglit's bin/getteximage-formats test and glean's bufferObject test. NOTE: This is a candidate for the 8.0 release branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44971
* intel: Remove num_mapped_regions assertion from _intel_batchbuffer_flushIan Romanick2012-02-071-7/+0
| | | | | | | | | | | | | | There are cases where a buffer can be mapped while another buffer is flushed. This can happen in the CopyPixels meta-op path for piglit's fbo-mipmap-copypix. After some discussion with Eric, it seems this assertion is no longer necessary, and it has always been too strict. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43328 Cc: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: remove unused _mesa_error_check_format_type() functionBrian Paul2012-02-072-121/+0
| | | | | | | This was only used by glReadPixels and glDrawPixels. Now those functions do the corresponding error checks. Signed-off-by: Brian Paul <[email protected]>
* mesa: stop using _mesa_error_check_format_type() in glReadPixelsBrian Paul2012-02-071-2/+7
| | | | | | | | Basically the same story as the previous commit. But we were already calling _mesa_source_buffer_exists() in ReadPixels(). Yeah, we were calling it twice. Signed-off-by: Brian Paul <[email protected]>
* mesa: stop using _mesa_error_check_format_type() in glDrawPixelsBrian Paul2012-02-071-3/+35
| | | | | | | | | | | | The _mesa_error_check_format_type() function does two things: check that format/type is legal and check that the destination (or source buffer for glReadPixels) actually exists. Just move the relevant parts of that into _mesa_DrawPixels(). We'll do a similar change in glReadPixels then get rid of the function altogether. Signed-off-by: Brian Paul <[email protected]>
* mesa: remove redundant format/type checks in glReadPixels()Brian Paul2012-02-071-35/+0
| | | | | | These are done in _mesa_error_check_format_and_type(). Signed-off-by: Brian Paul <[email protected]>
* mesa: remove redundant format/type checks in glGetTexImage()Brian Paul2012-02-071-34/+0
| | | | | | | The _mesa_error_check_format_and_type() function will catch all those cases now. Signed-off-by: Brian Paul <[email protected]>
* mesa: new _mesa_error_check_format_and_type() functionBrian Paul2012-02-075-94/+178
| | | | | | | | | | | | | | | | | | | | This replaces the _mesa_is_legal_format_and_type() function. According to the spec, some invalid format/type combinations to glDrawPixels, ReadPixels and glTexImage should generate GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION. With the old function we didn't make that distinction and generated GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION. The new function returns one of those errors or GL_NO_ERROR. This will also let us remove some redundant format/type checks in follow-on commit. v2: add more checks for ARB_texture_rgb10_a2ui at the top of _mesa_error_check_format_and_type() per Ian. Signed-off-by: Brian Paul <[email protected]>
* mesa: support more format/type combos in _mesa_dump_image()Brian Paul2012-02-061-1/+28
|
* dri: Don't build libdricommon.la if we don't need itJon TURNEY2012-02-061-1/+5
| | | | | | | | | | | Refine 80aa78142d12b21dd7d4f0edc786af98a159a80f "dri: make sure to build libdricommon.la" so we don't build libdricommon if we aren't building a dri driver which needs it (i.e. if we are just building swrast) In particular, this restores the ability to build the swrast dri driver without having to have a xf86drm.h Signed-off-by: Jon TURNEY <[email protected]>
* mesa: check_index_bounds off-by-one fixRoland Scheidegger2012-02-061-1/+1
| | | | | | | | in check_index_bounds the comparison needs to be "greater equal" since contrary to the name _MaxElement is the count of the array (this matches similar code in vbo_exec_DrawRangeElementsBaseVertex). Reviewed-by: Kenneth Graunke <[email protected]>
* intel: check for LLC support when reading mapsEugeni Dodonov2012-02-041-1/+1
| | | | | | | | This checks for advertised LLC support by the GPU instead of relying on the GPU generation for detection. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Eugeni Dodonov <[email protected]>
* intel: verify if hardware has LLC supportEugeni Dodonov2012-02-044-0/+12
| | | | | | | | | Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In case the libdrm version does not supports this check, fallback to older way of detecting it which assumed that GPUs newer than GEN6 have it. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Eugeni Dodonov <[email protected]>
* vbo: fix a building errorChih-Wei Huang2012-02-041-0/+2
| | | | | | Signed-off-by: Marek Olšák <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* intel: FBOs with texture border are unsupportedIan Romanick2012-02-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FBOs differ from textures in a significant way. With textures, we can strip the border and get correct rendering except when the application fetches texels outside [0,1]. With an FBO, the pixel at (0,0) is in the border. The ARB_framebuffer_object spec says: "If the attached image is a texture image, then the window coordinates (x[w], y[w]) correspond to the texel (i, j, k), from figure 3.10 as follows: i = (x[w] - b) j = (y[w] - b) k = (layer - b) where <b> is the texture image's border width..." Since the border doesn't exist, we can never render any pixels in the correct location. Just mark these FBOs FRAMEBUFFER_UNSUPPORTED. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42336
* dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.Eric Anholt2012-02-031-0/+3
| | | | | | | I wasn't seeing it be needed because of the previous bug. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eugeni Dodonov <[email protected]>
* dri: Fix typo in xml file that made all applications use the workaround.Eric Anholt2012-02-031-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eugeni Dodonov <[email protected]>
* mesa: Fix the error message function names for glFlushMappedBufferRange().Eric Anholt2012-02-031-7/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix bad-enum/no-buffer error handling for buffer object functions.Eric Anholt2012-02-031-87/+39
| | | | | | | | | | | | | | | For all the extension entrypoints using the get_buffer() helper, they wanted the same error handling. In some cases, the error was doing the same error return whether target was a bad enum, or a user buffer wasn't bound. (Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero buffer being bound for MapBufferRange, though it does for FlushMappedBufferRange. This appears to be an oversight). Fixes piglit GL_ARB_copy_buffer/negative-bound-zero. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_floatIan Romanick2012-02-021-3/+2
| | | | | | | | | | | GL_RG_INTEGER only has two components, not three. I'll be surprised if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER, ...). This was found by inspection. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix copy-and-paste bug in do_row_3DIan Romanick2012-02-021-3/+3
| | | | | | | | | | | | | Several of the half-float cases used 4 as the texel size when it should have been some smaller value. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
* mesa: Convert colors if span ChanType and renderbuffer data type don't matchIan Romanick2012-02-021-4/+15
| | | | | | | | | | | | This is a partial revert of f9874fe. It turns out that the types don't always match. Specifically, this can happen when doing glCopyPixels from a float FBO to a RGBA8 FBO. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429 Reviewed-by: Brian Paul <[email protected]>