summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
Commit message (Collapse)AuthorAgeFilesLines
* meta: Don't ask for floating point textures if not ARB_texture_float.Eric Anholt2011-04-291-1/+2
| | | | | | | | | | | | | I was promoting to float for ARB_color_buffer_float unclamped, which failed when ARB_texture_float wasn't present. Since the metaops don't need results outside of [0,1] when not drawing to a floating point destination, they can just use a fixed point texture when floating point destinations are impossible. Fixes regression in fdo23670-depth_test when --enable-texture-float is not present. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
* intel: Add support for ARB_sampler_objects.Eric Anholt2011-04-231-0/+3
| | | | | | | | | | | | This extension support consists of replacing "gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->". One instance of referencing the texture's base sampler remains in the initial miptree allocation, where I'm not sure we have a clear association with any texture unit. Tested with piglit ARB_sampler_objects/sampler-objects. Reviewed-by: Brian Paul <brianp@vmware.com>
* meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.Eric Anholt2011-04-231-1/+24
| | | | | | | | | The NV_conditional_render spec calls out specific operations that conditional rendering applies to, which doesn't include these. Fixes NV_conditional_render/generatemipmap on swrast. Reviewed-by: Brian Paul <brianp@vmware.com>
* meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().Eric Anholt2011-04-201-4/+24
| | | | | | Tested with piglit arb_color_buffer_float-clear. Reviewed-by: Brian Paul <brianp@vmware.com>
* meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.Eric Anholt2011-04-201-0/+28
| | | | | | Tested with piglit arb_color_buffer_float-drawpixels. Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-9/+9
| | | | | | gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
* mesa: add NV_texture_barrierMarek Olšák2011-03-151-0/+3
|
* mesa: move PBO-related functions into a new fileBrian Paul2011-02-281-0/+1
|
* mesa: plug in fallback function for ctx->Driver.ValidateFramebuffer()Brian Paul2011-01-241-0/+1
| | | | | The software renderer doesn't support GL_ALPHA, GL_LUMINANCE, etc so we should report GL_FRAMEBUFFER_UNSUPPORTED during FBO validation.
* mesa: begin implementation of GL_ARB_draw_buffers_blendBrian Paul2011-01-151-5/+6
|
* meta: Actually use mipmapping when generating mipmaps.Eric Anholt2011-01-121-1/+1
| | | | | | | | With the change to not reset baselevel, this GL_LINEAR filtering was resulting in generating mipmaps off of the base level instead of the next higher detail level. Fixes fbo-generatemipmap-filtering. Reported by: Neil Roberts <neil@linux.intel.com>
* meta: Don't tweak BaseLevel when doing glGenerateMipmap().Eric Anholt2011-01-101-4/+1
| | | | | | | We don't need to worry about levels other than MaxLevel because we're minifying -- the lower levels (higher detail) won't contribute to the result. By changing BaseLevel, we forced hardware that doesn't support BaseLevel != 0 to relayout the texture object.
* mesa/meta: fix broken assertion, rename stack depth varBrian Paul2010-12-101-5/+7
| | | | | | | assert(current_save_state < MAX_META_OPS_DEPTH) did not compile. Rename current_save_state to SaveStackDepth to be more consistent with the style of the other fields.
* meta: allow nested meta operationsXiang, Haihao2010-12-101-4/+10
| | | | | | _mesa_meta_CopyPixels results in nested meta operations on Sandybridge. Previoulsy the second meta operation overrides all states saved by the first meta function.
* meta: Mask Stencil.Clear against stencilMax in _mesa_meta_ClearPeter Clifton2010-11-241-1/+2
| | | | | | | | | | | | | | | | | | This fixes incorrect behaviour when the stencil clear value exceeds the size of the stencil buffer, for example, when set with: glClearStencil (~1); /* Set a bit pattern of 111...11111110 */ glClear (GL_STENCIL_BUFFER_BIT); The clear value needs to be masked by the value 2^m - 1, where m is the number of bits in the stencil buffer. Previously, we passed the value masked with 0x7fffffff to _mesa_StencilFuncSeparate which then clamps, NOT masks the value to the range 0 to 2^m - 1. The result would be clearing the stencil buffer to 0xff, rather than 0xfe. Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk> Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: pass gl_format to _mesa_init_teximage_fields()Brian Paul2010-11-181-8/+6
| | | | | | | | | | | This should prevent the field going unset in the future. See bug http://bugs.freedesktop.org/show_bug.cgi?id=31544 for background. Also remove unneeded calls to clear_teximage_fields(). Finally, call _mesa_set_fetch_functions() from the _mesa_init_teximage_fields() function so callers have one less thing to worry about.
* meta: Handle bitmaps with alpha test enabled.Francisco Jerez2010-11-101-6/+35
| | | | Acked-by: Brian Paul <brianp@vmware.com>
* meta: Don't try to disable cube maps if the driver doesn't expose the extension.Francisco Jerez2010-11-061-1/+2
| | | | Signed-off-by: Brian Paul <brianp@vmware.com>
* meta: Fix incorrect rendering of the bitmap alpha component.Francisco Jerez2010-11-041-3/+9
| | | | Signed-off-by: Brian Paul <brianp@vmware.com>
* meta: Don't leak alpha function/reference value changes.Francisco Jerez2010-11-041-0/+5
| | | | Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Make metaops use program refcounts instead of names.Eric Anholt2010-10-291-17/+20
| | | | | | | Fixes failure on restoring state when the program was active but deleted, and the name no longer exists. Bug #31194
* Track separate programs for each stageIan Romanick2010-10-271-6/+24
| | | | | The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-134-50/+50
|
* mesa: Remove EXT_convolution.Eric Anholt2010-09-232-84/+0
| | | | More optional code.
* meta: Don't bind the created texture object in init_temp_texture().Francisco Jerez2010-09-161-1/+0
| | | | | | | | | | | This function is executed outside _mesa_meta_begin/end(), that means that e.g. _mesa_meta_Bitmap() clobbers the texturing state because it changes the currently active texture object. There's no need to bind the new texture when it's created, it's done again later anyway (from setup_drawpix/copypix_texture()). Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Remove unnecessary FEATURE tests.Chia-I Wu2010-09-142-18/+0
| | | | | Remove all FEATURE tests in mesa/drivers/common/. They are not needed and the code looks better without them.
* mesa: call ctx->Driver.ChooseTextureFormat() only when necessary.Brian Paul2010-07-201-6/+3
| | | | | | | | | | | | | | | | | | | When defining mipmap level 'L' and level L-1 exists and the new level's internalFormat matches level L-1's internalFormat, then use the same hw format. Otherwise, do the regular ctx->Driver.ChooseTextureFormat() call. This avoids a problem where we end up choosing different hw formats for different mipmap levels depending on how the levels are defined (glTexImage vs. glCopyTexImage vs. glGenerateMipmap, etc). The root problem is the ChooseTextureFormat() implementation in some drivers uses the user's glTexImage format/type parameters in the choosing heuristic. Later mipmap levels might be generated with different calls (ex: glCopyTexImage()) so we don't always have format/type info and the driver may choose a different format. For more background info see the July 2010 mesa-dev thread "Bug in _mesa_meta_GenerateMipmap"
* Merge branch 'shader-file-reorg'Brian Paul2010-06-232-9/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Move all GL entrypoint functions and files into src/mesa/main/ This includes the ARB vp/vp, NV vp/fp, ATI fragshader and GLSL bits that were in src/mesa/shader/ 2. Move src/mesa/shader/slang/ to src/mesa/slang/ to reduce the tree depth 3. Rename src/mesa/shader/ to src/mesa/program/ since all the remaining files are concerned with GPU programs. 4. Misc code refactoring. In particular, I got rid of most of the GLSL-related ctx->Driver hook functions. None of the drivers used them. Conflicts: src/mesa/drivers/dri/i965/brw_context.c
| * mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-102-2/+2
| |
| * mesa: move arbprogram.[ch] to main/Brian Paul2010-06-101-1/+1
| |
| * mesa: refactor shader api / object codeBrian Paul2010-06-102-6/+4
| | | | | | | | | | Remove the unneeded ctx->Driver hooks for shader-related functions. Move state and API-related things into main/.
* | Revert "Fix image_matches_texture_obj() MaxLevel check"Will Dyson2010-06-191-0/+3
|/ | | | | | | | | | | | | This reverts commit a9ee95651131e27d5acf3d10909b5b7e5c8d3e92. It was based on a failure to understand how ther driver allocates memory, and causes a regression with Celestia. Set MaxLevel to dstLevel before allocating new mipmap level. The radeon driver will fail to allocate space for a new level that is outside of BaseLevel..MaxLevel. Set MaxLevel before allocating. Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
* meta: Convert Z value from normalized to object-space in meta codeBrian Paul2010-05-241-4/+19
| | | | | | | | | | | | | | Convert Z from a normalized value in the range [0, 1] to an object-space Z coordinate in [-1, +1] so that drawing at the new Z position with the default/identity ortho projection results in the original Z value. Used by the meta-Clear, Draw/CopyPixels and Bitmap functions where the Z value comes from the clear value or raster position. Fixes piglit tests fdo23670-depth_test, quad-invariance and glsl-orangebook-ch06-bump as well as oglc zbfunc.c. https://bugs.freedesktop.org/show_bug.cgi?id=23670
* mesa: more transform feedback infrastructureBrian Paul2010-05-101-0/+7
| | | | | Includes GL_ARB_transform_feedback2 which encapsulates transform feedback state in objects.
* mesa: remove driver hooks for GetFloat/Integer/Doublev, etcBrian Paul2010-05-071-8/+0
| | | | | Once upon a time some drivers hooked into these for GL_HP_occlusion_test and GL_OES_read_format. They're not being used anymore so get rid of them.
* Disable scissor when begining meta operationsPierre Willenbrock2010-04-271-0/+1
| | | | Signed-off-by: Eric Anholt <eric@anholt.net>
* Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targetsPierre Willenbrock2010-04-271-4/+8
| | | | Signed-off-by: Eric Anholt <eric@anholt.net>
* meta: Fix up restoration of state if _mesa_map_pbo_source() fails.Eric Anholt2010-03-161-1/+3
|
* meta: Properly refcount our saved programs and texobjs.Eric Anholt2010-03-161-2/+7
| | | | Found while debugging bug #24119.
* meta: Use the DrawBuffer's stencil sizeIan Romanick2010-03-051-1/+1
| | | | | | | | | Previously the code was erroneously using the stencil size of the context instead of the stencil size of the DrawBuffer. With FBOs these may be different. As a result, clearing the stencil buffer of an FBO bound to a context that doesn't have stencil would fail. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Remove ClearIndex and IndexMask from device-driver interfaceIan Romanick2010-03-031-2/+0
| | | | | | | | These are used to inform the driver of the clear value for color-index buffers and to control write-masking of bits in color-index buffers. No driver use or need (not even Nouveau) these interfaces. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: disable unreachable meta mipmap gen codeBrian Paul2010-02-241-0/+3
| | | | | | | More work is needed to support 3D mipmap generation. Disable unreachable code until then. See bug 26722.
* mesa: restore _mesa_snprintf() - it's needed for WindowsBrian Paul2010-02-191-3/+3
| | | | This reverts part of commit 298be2b028263b2c343a707662c6fbfa18293cb2
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-3/+3
|
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-17/+17
|
* mesa: replace _mesa_bzero() with memset()Brian Paul2010-02-191-1/+1
|
* Remove _mesa_memcpy in favor of plain memcpy.Kenneth Graunke2010-02-192-7/+7
| | | | This may break the SUNOS4 build, but it's no longer relevant.
* mesa: Remove unnecessary headers.Vinson Lee2010-02-122-3/+0
|
* Merge branch 'mesa_7_7_branch'Brian Paul2010-01-081-18/+29
|\ | | | | | | | | | | Conflicts: src/mesa/drivers/dri/i965/brw_wm_emit.c
| * meta: remove F suffix from _mesa_Ortho() paramsBrian Paul2010-01-061-3/+3
| | | | | | | | _mesa_Ortho() takes GLdoubles.