summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
Commit message (Collapse)AuthorAgeFilesLines
* meta: Don't enable TEXTURE_RECTANGLE when it's unsupported.Kenneth Graunke2011-10-061-1/+2
| | | | | | | | | In particular, drivers don't enable this in ES 1.1 contexts. Prior to this, none of the OpenGL ES 1.1 conformance tests passed. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove unused tnl items from dd_functionsChad Versace2011-09-301-2/+0
| | | | | | | Remove NeedValidate and ValidateTnlModule. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* meta: fix GetTexImage() for luminance, l/a, intensity formatsBrian Paul2011-09-301-2/+22
| | | | | | | | The GL spec says that luminance values are returned as (l, 0, 0, 1), L/A values as (l, 0, 0, a) and intensity values as (i, 0, 0, 1). Use the pixel transfer scale controls to implement that. This fixes a few failures in the new piglit getteximage-formats test when getting a compressed L or L/A image.
* mesa: simplify parameters to GetTexImage() driver hookBrian Paul2011-09-302-6/+4
| | | | | | | The target, level and texObj can be obtained through the texImage parameter. We could make similar changes for the TexImage() hooks too. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add missing includes to meta.hChad Versace2011-09-231-0/+2
| | | | | | Include mtypes.h. Signed-off-by: Chad Versace <[email protected]>
* meta: Don't hang on to program refcounts after metaops are done.Eric Anholt2011-09-211-0/+5
| | | | | | | Fixes piglit ARB_shader_objects/clear-with-deleted. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577 Reviewed-by: Brian Paul <[email protected]>
* meta: use _mesa_set_enable() in more placesBrian Paul2011-09-201-5/+5
| | | | | | Avoids an extra context lookup. Reviewed-by: Eric Anholt <[email protected]>
* meta: use _mesa_set_enable(), fix decompress_texture_image()Brian Paul2011-09-201-1/+4
| | | | | | | | | Use _mesa_set_enable() to avoid a redudant context lookup. Need to disable the texture target in decompress_texture_image() so the unit isn't still enabled after glGetTexImage() returns. Arguably, the meta restore code should do this, but it doesn't. Reviewed-by: Eric Anholt <[email protected]>
* meta: fix broken sRGB mipmap generationBrian Paul2011-09-201-0/+28
| | | | | | | | | | If we're generating a mipmap for an sRGB texture we need to bypass sRGB->linear conversion. Otherwise the destination mipmap level (drawn with a textured quad) will have the wrong colors. If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode) we need to use the software fallback for mipmap generation. Note: This is a candidate for the 7.11 branch.
* mesa: plug in swrast texture image alloc/free functionsBrian Paul2011-09-171-1/+2
| | | | Use the swrast allocation/free functions instead of core Mesa.
* swrast: plug in _swrast_new/delete_texture_image() functionsBrian Paul2011-09-171-2/+2
|
* mesa: add new DeleteTextureImage() driver hookBrian Paul2011-09-171-0/+1
| | | | | | Matches the NewTextureImage() hook. With new subclasses of gl_texture_image coming we need a new hook to properly delete objects of those subclasses.
* meta: fix/add checks for GL_EXT_framebuffer_sRGBBrian Paul2011-09-171-2/+4
| | | | | | | This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension is not supported. Note: This is a candidate for the 7.11 branch
* mesa: introduce a clear color union to be used for int/unsigned buffersDave Airlie2011-09-141-5/+5
| | | | | | | | | | This introduces a new gl_color_union union and moves the current ClearColorUnclamped to use it, it removes current ClearColor completely and renames CCU to CC, then all drivers are modified to expected unclamped floats instead. also fixes st to use translated color in one place it wasn't. Signed-off-by: Dave Airlie <[email protected]>
* meta: added _mesa_meta_GetTexImage()Brian Paul2011-09-083-1/+232
| | | | | If the texture is compressed, call the meta decompress_texture_image() function. Otherwise, call the core _mesa_get_teximage() function.
* meta: move texcoord setup into setup_texture_coords()Brian Paul2011-09-081-92/+176
|
* mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ↵Ian Romanick2011-09-063-80/+0
| | | | | | | | | | ::UpdateTexturePalette There's nothing left that can call any of these functions. This also removes the meta-ops code that implemented the first two. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* swrast: Add implementation of MapTextureImage/UnmapTextureImage.Brian Paul2011-08-291-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Rename FreeTexImageData to FreeTextureImageBuffer.Eric Anholt2011-08-291-1/+1
| | | | | | | | This was produced by sed, except for one hunk in driverfuncs.c where trailing whitespace was dropped. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: use fallback mipmap generation for 1D/2D texture arraysBrian Paul2011-08-191-2/+5
| | | | | | | We could do 1D/2D arrays with textured quad rendering, but it'll take some work (as with 3D textures). Reviewed-by: Ian Romanick <[email protected]>
* mesa: Declare _mesa_meta_begin()/end() as publicChad Versace2011-08-192-142/+147
| | | | | | | | | | | Declare _mesa_meta_begin()/end() in meta.h so that drivers can write custom meta-ops (such as HiZ resolves for i965). This necessitates moving the the META_* macros into meta.h. To prevent naming collisions, this commit renames each macro to be MESA_META_*. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: fix initialization of GL_FOG_MODE in _mesa_init_driver_state()Brian Paul2011-08-111-1/+4
|
* mesa: fix ColorMask array index in _mesa_init_driver_state()Brian Paul2011-08-111-4/+4
| | | | | This doesn't really make any difference because all the colormasks are the same upon context set-up, but it makes more sense.
* mesa: fix format selection for meta CopyTexSubImage()Brian Paul2011-07-281-0/+10
| | | | | | | | | | | | | When we do a glReadPixels into the temporary buffer, we don't want to use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will compute L=R+G+B which is not what we want. This bug has existed all along but was only exposed by the elimination of the driver hook for glCopyTexImage() in 5874890c26f434f54e9218b83fae4eb8175c24e9. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604 Tested-by: Ian Romanick <[email protected]>
* meta: Also save/restore clip planes for GLSL.Eric Anholt2011-07-251-1/+13
| | | | | | | | Fixes user-clip on 965 with 3D clears enabled. I created a separate flag because I wanted to avoid the overhead of the matrix operations in this path. Reviewed-by: Brian Paul <[email protected]>
* Merge branch 'remove-copyteximage-hook'Brian Paul2011-07-213-125/+0
|\
| * meta: remove _mesa_meta_CopyTexImage1D/2D()Brian Paul2011-07-193-125/+0
| |
* | meta: Add a GLSL-based _mesa_meta_Clear() variant.Eric Anholt2011-07-202-1/+162
|/ | | | | | | | | This cuts out a large portion of the overhead of glClear() from resetting the texenv state and recomputing the fixed function programs. It also means less use of fixed function internally in our GLES2 drivers, which is rather bogus. Reviewed-by: Brian Paul <[email protected]>
* meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.Eric Anholt2011-06-131-0/+14
| | | | | | | glReadPixels() was performing RGB -> L conversion differently from the glTexImage() style conversion appropriate for glCopyTexImage(). Fixes gles2conform copy_texture.
* mesa: move texrender.c to swrastBrian Paul2011-06-131-3/+2
| | | | | | | This stuff is really for software rendering, it's not core Mesa. A small step toward pushing the FetchTexel() stuff down into swrast. Reviewed-by: Eric Anholt <[email protected]>
* meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.Eric Anholt2011-06-051-0/+6
| | | | | | | Fixes fbo-srgb-blit. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373 Reviewed-by: Brian Paul <[email protected]>
* meta: Don't do srgb to linear decode when blitting srgb textures.Eric Anholt2011-06-051-0/+10
| | | | | | Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c Reviewed-by: Brian Paul <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>