summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/mipmap.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: fix potential mem leak in generate_mipmap_compressed()Brian Paul2011-12-021-0/+1
| | | | | | Fixes a coverity warning. Reviewed-by: Vinson Lee <[email protected]>
* mesa: handle MapTextureImage() failures in mipmap generation codeBrian Paul2011-11-281-24/+57
| | | | | | And handle potential malloc failures too. Reviewed-by: Eric Anholt <[email protected]>
* mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-0/+1
| | | | | | | | | This is an OpenGL ES specific extension. External textures are textures that may be sampled from, but not be updated (no glTexSubImage* and etc.). The image data are taken from an EGLImage. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: fix software mipmap generation code for packed Z/stencil formatsBrian Paul2011-10-071-1/+37
| | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32458 Reviewed-by: Chad Versace <[email protected]>
* mesa: remove unused _mesa_rescale_teximage2d() functionBrian Paul2011-10-051-75/+0
| | | | It was only used by the old tdfx driver, IIRC.
* mesa: remove unused gl_texture_image::DriverData fieldBrian Paul2011-10-051-1/+0
| | | | Was only used by some older/removed DRI drivers.
* mesa: Reuse existing make_2d_mipmap for 2D array generation.Eric Anholt2011-10-031-99/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Make the uncompressed sw mipmap gen path do a Map per 1D array slice.Eric Anholt2011-10-031-44/+17
| | | | | | This also fixes what was probably a bug in 1D arrays with border. Reviewed-by: Brian Paul <[email protected]>
* mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.Brian Paul2011-10-031-122/+148
| | | | | | | | | | | Now that we can zero-copy generate the mipmaps into brand new glTexImage()-generated storage using MapTextureImage(), we no longer need to allocate image->Data in mipmap generate. This requires deleting the drivers' old overrides of the miptree tracking after calling _mesa_generate_mipmap at the same time, or the drivers promptly lose our newly-generated data. Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify parameters to GetTexImage() driver hookBrian Paul2011-09-301-2/+3
| | | | | | | 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: fix indentation in mipmap.c (3 spaces)Brian Paul2011-09-261-2/+2
|
* mesa: move _mesa_upscale_teximage2d() to texcompress_fxt1.cBrian Paul2011-09-201-34/+0
| | | | Was used by no other code.
* mesa: s/GLchan/GLubyte/ in mipmap generation codeBrian Paul2011-09-201-3/+3
|
* mesa: use ctx->Driver.AllocTextureImageBuffer() to alloc texture memoryBrian Paul2011-09-171-9/+7
|
* mesa: move _mesa_update_fetch_functions() calls into swrastBrian Paul2011-09-171-4/+0
| | | | | | Do it during swrast state validation since the FetchTexel() functions are only called from swrast now and not core Mesa. Remove assertions in mipmap.c since they're no longer appropriate.
* mesa: use ctx->Driver.GetTexImage() to decompress base texture imageBrian Paul2011-09-081-42/+43
| | | | | This is a simple way to do the job and it removes one more use of the soon-to-be-removed gl_texture_image::FetchTexelc() function.
* mesa: Don't check for image->Data when freeing an image's contents.Eric Anholt2011-08-291-2/+1
| | | | | | | | | | | | | | | | | | | | | All driver implementations of FreeTextureImageBuffer already check that Data != NULL and free it. However, this means that we will also free driver storage if the driver storage wasn't in the form of a Data pointer. This was produced by the following semantic patch: @@ expression C; expression T; @@ - if (T->Data) { - C->Driver.FreeTextureImageBuffer(C, T); + C->Driver.FreeTextureImageBuffer(C, T); - } Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[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]>
* mesa: implement generatemipmap for GL_FLOAT_32_UNSIGNED_INT_24_8_REVMarek Olšák2011-07-101-0/+20
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.Eric Anholt2011-06-141-66/+38
| | | | | | | | | | | | | The code was playing fast and loose with rowstrides, which meant that if a driver chose anything different for its alignment requirements, the generated mipmaps came out garbage. Unlike the uncompressed case, we can't generate mipmaps directly into image->Data, so by using TexImage2D we cut out most of the weird logic that existed to generate in-place into ->Data. The up/downside is that the driver recovery code for the fact that _mesa_generate_mipmaps whacked ->Data has to be turned off for compressed now. Fixes 6 piglit tests about compressed mipmap gen.
* mesa: Remove uncompressed code from generate_mipmaps_compressed().Eric Anholt2011-06-141-100/+77
|
* mesa: Remove compressed code from generate_mipmaps_uncompressed().Eric Anholt2011-06-141-114/+4
|
* mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.Eric Anholt2011-06-141-26/+225
| | | | | | | | | | The path taken is wildly different based on this (do we generate from a temporary image, or from level-1's data), and we appear to have stride bugs in the compressed case that are tough to disentangle. This just duplicates the code for the moment, the followon commit will do the actual changes. Only real code change here is handling maxLevel in one common place.
* mesa: implement EXT_packed_floatMarek Olšák2011-04-291-0/+47
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa, util: move RGB9E5 conversion functions to gallium/utilMarek Olšák2011-04-291-1/+1
| | | | | | | Also use MAX3 and incorporate Ian's suggestion in texformat.c. I don't think wrapping u_format_rgb9e5.h in another header and thus making it more complicated is worth it.
* mesa: implement EXT_texture_shared_exponentMarek Olšák2011-04-291-0/+49
| | | | | | | | | swrast support done. There is no renderbuffer support in swrast, because it's not required by the extension. Reviewed-by: Brian Paul <[email protected]>
* mesa: implement generate-mipmap fallback for RGB10_A2Marek Olšák2011-04-251-0/+80
| | | | | | | | | | I hit this when testing RV350, which lacks RGB10_A2 render target support. It had been missed when implementing the format and probably unused by anything else too. Not applicable to 7.10. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't assert on the compressed convertformat for GenerateMipmaps.Eric Anholt2011-04-231-1/+0
| | | | | | | | | | | | | | This assertion doesn't make any sense to me -- the convertFormat is already something valid (tested above), and the BaseFormat dictated by convertFormat doesn't matter to the function about to be called (it's the datatype/comps that were pulled out of convertFormat). Fixes assertion failure in GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats (still has a rendering failure in NPOT like S3TC does). Reviewed-by: Brian Paul <[email protected]>
* mesa: add EXT_texture_compression_latcMarek Olšák2011-03-081-2/+7
| | | | | | | | | | | | | | | | | The encoding/decoding algorithms are shared with RGTC. Thanks to some magic with the base format, the RGTC texstore functions work for LATC too. swrast passes the related piglit tests besides two things: - The alpha channel is wrong (it's always 1), however the incorrect alpha channel makes some other tests fail too, so I guess it's unrelated to LATC. - Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]), however RGTC has the same problem. Further testing (with other of my patches) shows that hardware drivers and softpipe work. BTW, ETQW uses this extension.
* rgtc: fixup mipmap generationDave Airlie2011-03-021-2/+7
| | | | this allows swrast to pass mipmap generation for these formats.
* mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2 and 4_4Marek Olšák2011-02-161-2/+2
| | | | | | | Oops, I copy-pasted a typo from 3_3_2. The 3_3_2 part is a candidate for 7.9 and 7.10. The 4_4 part isn't, because AL44 is in neither branches.
* mesa: fix mipmap generation for MESA_FORMAT_AL44Marek Olšák2011-02-161-0/+50
| | | | This was missed when implementing AL44.
* mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee2011-01-051-0/+1
| | | | | | Directly include mtypes.h if a file uses a gl_context struct. This allows future removal of headers that are not strictly necessary but indirectly include mtypes.h for a file.
* mesa: pass gl_format to _mesa_init_teximage_fields()Brian Paul2010-11-181-2/+2
| | | | | | | | | | | 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.
* mesa: handle more pixel types in mipmap generation codeBrian Paul2010-11-111-0/+166
| | | | NOTE: This is a candidate for the 7.9 branch.
* mesa: Add missing else in do_row_3DBrian Rogers2010-10-181-1/+1
| | | | | | This fixes erroneous "bad format in do_row()" messages Signed-off-by: Brian Paul <[email protected]>
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-1/+1
|
* mesa/mipmap: fix warning since 1acadebd6270d3604b026842b8a21360968618a0Dave Airlie2010-09-251-1/+1
| | | | 1acadebd6270d3604b026842b8a21360968618a0 fixed the pointer but not the cast.
* mesa: Fix type typo in glGenerateMipmap handling of GL_UNSIGNED_INT data.Eric Anholt2010-09-241-1/+1
| | | | Fixes ARB_depth_texture/fbo-generatemipmap-formats.
* mesa: fix out of bounds memory read in mipmap gen codeBrian Paul2010-09-011-5/+12
| | | | | | | Out of bounds reads could happen for reducing WxH to WxH/2 or WxH to W/2xH. Fixes fd.o bug 29918.
* mesa: simplify some code in _mesa_generate_mipmap()Brian Paul2010-04-231-19/+10
|
* mesa: Add asserts to check inputs to memcpy.Vinson Lee2010-03-041-0/+2
|
* mesa: Add asserts to check inputs to memcpy.Vinson Lee2010-03-021-0/+2
|
* mesa: Add asserts to check inputs to memcpy.Vinson Lee2010-02-271-0/+3
|
* mesa: Add assert to check input to memcpy is not null.Vinson Lee2010-02-271-0/+1
|
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-1/+1
|
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-5/+5
|
* mesa: replace old MEMCPY macro with memcpyBrian Paul2010-02-191-20/+20
|
* mesa: Remove unnecessary header from mipmap.c.Vinson Lee2010-01-181-1/+0
|
* Merge branch 'texformat-rework'Brian Paul2009-10-281-40/+38
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/mesa/drivers/dri/radeon/radeon_fbo.c src/mesa/drivers/dri/s3v/s3v_tex.c src/mesa/drivers/dri/s3v/s3v_xmesa.c src/mesa/drivers/dri/trident/trident_context.c src/mesa/main/debug.c src/mesa/main/mipmap.c src/mesa/main/texformat.c src/mesa/main/texgetimage.c