aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_tex.c
Commit message (Collapse)AuthorAgeFilesLines
* i965: add support for multisample texturesChris Forbes2013-03-021-0/+9
| | | | | | | | | | | V2: - Fix for state moving from texobj to image - Rebased onto Paul's logical/physical cleanup - Fixed missing quantization of sample count - Fold in IMS renderbuffer wrapper fixes from later in the series - Use correct physical slice offset for UMS/CMS surfaces on Gen7 Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* intel: Skip texture validation logic when nothing has changed.Eric Anholt2012-12-281-0/+4
| | | | | | Improves GLBenchmark 2.1 offscreen performance by 3.2% +/- 1.5% (n=52). Reviewed-by: Kenneth Graunke <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + free ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - free((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - } @@ expression E; type T; @@ + free ((T) E); - if (unlikely (E != NULL)) { - free ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-241-1/+1
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* intel: Implement ARB_texture_storageIan Romanick2012-08-141-0/+26
| | | | | | | | This is basically cut-and-paste from the swrast implementation, and it could probably be (slightly) more optimal. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary parameters from AllocTextureImageBufferPauli Nieminen2012-08-121-6/+4
| | | | | | | | | | Size and format information is always stored in gl_texture_image structure. That makes it preferable to remove duplicate information from parameters to make interface easier to understand. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i915: Initialize swrast_texture_image structure fields.Paul Berry2012-02-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale fields to swrast) moved the initialization of the Width, Height, and DepthScale fields to _swrast_alloc_texture_image_buffer(). However, i915 doesn't call this function because it performs its own buffer allocation. As a result, the Width, Height, and DepthScale fields weren't getting initialized properly, and some operations requiring swrast would fail. This patch ensures that Width, Height, and DepthScale are properly initialized by separating the code that sets them into a new function, _swrast_init_texture_image(), which is called by intel_alloc_texture_image_buffer() as well as _swrast_alloc_texture_image_buffer(). It also moves the initialization of _IsPowerOfTwo into this function. Fixes piglit test fbo/fbo-cubemap on i915. Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216 This is a candidate for the 8.0 branch. Reviewed-and-tested-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Move the teximage mapping logic to a miptree level/slice mapping.Eric Anholt2011-12-071-48/+10
| | | | | | | This will let us share teximage mapping logic with renderbuffer mapping, which has an intel_mipmap_tree but not a gl_texture_image. Reviewed-by: Chad Versace <[email protected]>
* intel: Resolve buffers in intel_map_texture_image()Chad Versace2011-11-221-0/+5
| | | | | Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Replace intel_texture_image::stencil_irb with ↵Chad Versace2011-11-221-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intel_mipmap_tree::stencil_mt [v3] For depthstencil textures using separate stencil, we embedded a stencil buffer in intel_texture_image. The intention was that the embedded stencil buffer would be the golden copy of the texture's stencil bits. When necessary, we scattered/gathered the stencil bits between the texture miptree and the embedded stencil buffer. This approach had a serious deficiency for mipmapped or multi-layer textures. Any given moment the embedded stencil buffer was consistent with exactly one miptree slice, the most recent one to be scattered. This permitted tests of type A to pass, but broke tests of type B. Test A: 1. Create a depthstencil texture. 2. Upload data into (level=x1,layer=y1). 3. Read and test stencil data at (level=x1, layer=y1). 4. Upload data into (level=x2,layer=y2). 5. Read and test stencil data at (level=x2, layer=y2). Test B: 1. Create a depthstencil texture. 2. Upload data into (level=x1,layer=y1). 3. Upload data into (level=x2,layer=y2). 4. Read and test stencil data at (level=x1, layer=y1). 5. Read and test stencil data at (level=x2, layer=y2). v2: Only allocate stencil miptree if intel->must_use_separate_stencil, because we don't make the conversion from must_use_separate_stencil to has_separate_stencil until commit intel: Use separate stencil whenever possible v3: Don't call ChooseNewTexture in intel_renderbuffer_wrap_miptree() in order to determine the renderbuffer format. Instead, pass the format as a param to that function. CC: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* dri: Remove driver GenerateMipmap hooks.Eric Anholt2011-10-281-23/+0
| | | | | Mesa sets up _mesa_meta_GenerateMipmap as the default hook, which does this check for fallback and call the fallback itself.
* intel: Drop texture border support code.Eric Anholt2011-10-261-38/+20
| | | | | | | | | | Now that texture borders are gone, we never need to allocate our textures through non-miptrees, which simplifies some irritating paths. v2: Remove the !mt support case from intel_map_texture_image() Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]>
* mesa: add swrast_texture_image::BufferBrian Paul2011-10-231-5/+5
| | | | | | | | | | | | | | | In the past, swrast_texture_image::Data has been overloaded. It could either point to malloc'd memory storing texture data, or it could point to a current mapping of GPU memory. Now, Buffer always points to malloc'd memory (if we're not using GPU memory) and Data always points to mapped memory. The next step would be to rename Data -> Map. This change also involves adding swrast functions for mapping textures and renderbuffers prior to rendering to setup the Data pointer. Plus, corresponding functions to unmap texures and renderbuffers. This is very much like similar code in the dri drivers.
* mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()Brian Paul2011-10-231-1/+1
| | | | Core Mesa no longer does any texture memory allocation.
* mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrastBrian Paul2011-10-231-5/+31
| | | | | | Only swrast and the drivers that fall back to swrast need these fields now. This removes the last of the fields related to software rendering from gl_texture_image.
* intel: Add 'mode' param to intel_region_mapChad Versace2011-10-181-1/+2
| | | | | | | | | | The 'mode' param is a bitset of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT. A future commit will perform buffer resolves in intel_region_map(). So, even though the access mode is irrelevant to the GTT, the extra information allows us to intelligently avoid unneccessary buffer resolves. Signed-off-by: Chad Versace <[email protected]>
* intel: Fix scatter/gather for depthstencil texturesChad Versace2011-10-181-5/+5
| | | | | | | | | During anholt's MapTextureImage refactoring, the call to intel_tex_image_s8z24_create_renderbuffers was missplaced. It needs to occur *after* the miptree is allocated. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Add a safety check for mapping 1D texture arrays.Eric Anholt2011-10-031-0/+4
| | | | So easy to screw up with the crazy way GL manages them.
* intel: Add debug output to intel_map_texture_image.Eric Anholt2011-10-031-1/+7
|
* intel: Make PBO TexImage use AllocTextureImageBuffer like non-PBO does.Eric Anholt2011-10-031-0/+6
| | | | | Now that whole block that also lives in AllocTextureImageBuffer can go away.
* intel: Allocate s8z24 separate renderbuffers from AllocTextureImageBuffer().Eric Anholt2011-10-031-0/+5
| | | | | | Before, we were only allocating these from our TexImage, so if the texture image was set up in any other way (non-accelerated glGenerateMipmaps()), they'd be missing or wrong.
* intel: Add an AllocTextureImageBuffer() implementation using miptrees.Eric Anholt2011-10-031-0/+43
| | | | | Now we can rely on Mesa core for uploads of data without introducing an extra copy at validate time.
* mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.Brian Paul2011-10-031-29/+1
| | | | | | | | | | | 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]>
* intel: Drop our custom glGetTexImage() code.Eric Anholt2011-09-271-3/+7
| | | | | | | | | The mesa core code uses MapTextureImage() like we need now. v2: Drop mapping around _mesa_generate_mipmap for compressed, since the whole path ends up going through MapTextureImage(), and the meta decompression code ended up causing us to lose track of the region that was originally mapped and assertion fail.
* intel: Drop the "intel" argument to intel_miptree_release().Eric Anholt2011-09-261-5/+3
| | | | | | | We don't have it in the other refcounting functions, and it was totally unused. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop some extra equality checks on reference/release functions.Eric Anholt2011-09-261-13/+4
| | | | | | | _mesa_reference_renderbuffer already short-circuits equality, and intel_miptree_release does nothing on NULL. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: fix potential segfault error at intel_(un)map_texture_imageYuanhan Liu2011-09-261-2/+3
| | | | | | | | | intel_image->mt might be NULL, say with border width set. It then would trigger a segfault at intel_map/unmap_texture_image function. This would fix the oglc misctest(basic.textureBorderIgnore) fail. Signed-off-by: Yuanhan Liu <[email protected]>
* mesa: add new DeleteTextureImage() driver hookBrian Paul2011-09-171-0/+8
| | | | | | Matches the NewTextureImage() hook. With new subclasses of gl_texture_image coming we need a new hook to properly delete objects of those subclasses.
* intel: Silence several "warning: unused parameter"Ian Romanick2011-09-091-0/+2
| | | | | | | Trivially silence the compiler by adding '(void) foo;' for each unused parameter. These parameters could not be removed. They are part of interface used elsewhere in Mesa, and some of the other customers actually use these parameters.
* intel: Add implementation of MapTextureImage/UnmapTextureImage.Eric Anholt2011-08-291-0/+84
| | | | Reviewed-by: Brian Paul <[email protected]>
* Rename some driver FreeTextureImageData functions to FreeTextureImageBuffer.Eric Anholt2011-08-291-2/+3
| | | | | 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]>
* intel: use new gl_texture_image:Face, Level fieldsBrian Paul2011-08-241-5/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* intel: Add fields to intel_texture for faking s8z24 with separate stencilChad Versace2011-06-241-0/+9
| | | | | | | | Add the fields depth_rb and stencil_rb, and put hooks in place to release the renderbuffers in intelFreeTextureImageData and intelTexImage. Signed-off-by: Chad Versace <[email protected]>
* mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.Eric Anholt2011-06-141-1/+2
| | | | | | | | | | | | | 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.
* intel: Merge our choosetexformat fallbacks into core.Eric Anholt2011-01-041-1/+0
| | | | | | We now share the type/format -> MESA_FORMAT_* mappings with software mesa, and the core supports most of the fallbacks hardware drivers will want.
* intel: Remove the magic unaligned memcpy code.Eric Anholt2010-11-031-89/+0
| | | | | | | | In testing on Ironlake, the histogram of clocks/pixel results for the system memcpy and magic unaligned memcpy show no noticeable difference (and no statistically significant difference with the 5510 samples taken, though the stddev is large due to what looks like the cache effects from the different texture sizes used).
* intel: Annotate debug printout checks with unlikely().Eric Anholt2010-11-031-2/+1
| | | | | | | This provides the optimizer with hints about code hotness, which we're quite certain about for debug printouts (or, rather, while we developers often hit the checks for debug printouts, we don't care about performance while doing so).
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-5/+5
|
* Remove unnescessary initializations of UpdateTexturePaletteIan Romanick2010-09-271-1/+0
| | | | This is already NULL'ed in _mesa_init_driver_functions.
* intel: Add fallback debug to glGenerateMipmap.Eric Anholt2010-09-241-0/+4
|
* intel: Remove dead intelIsTextureResident().Eric Anholt2010-09-231-18/+0
| | | | | It always returned 1 (GL_TRUE), which is the same thing that happens when the driver hook isn't present.
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-2/+2
|
* intel: fix broken sw generate mipmap pathBrian Paul2009-10-131-0/+22
| | | | Need to restore code that fixed up the intel_texture_image state.
* intel: wrap _mesa_meta_GenerateMipmap()Brian Paul2009-10-021-0/+27
| | | | | | | | Need to check if we'll take the software path so which requires mapping the src texture image. Fixes crash in piglit gen-compressed-teximage, bug 24219. However, the test still does not pass (it may never have).
* intel: Drop my generatemipmap code in favor of the new shared code.Eric Anholt2009-09-281-1/+0
|
* intel: make a bunch of glTexImage-related functions staticBrian Paul2009-06-091-16/+0
|
* intel: Add a metaops version of glGenerateMipmapEXT/SGIS_generate_mipmaps.Eric Anholt2009-05-081-55/+1
| | | | | | | In addition to being HW accelerated, it avoids the incorrect (black) rendering of the mipmaps that SW was doing in fbo-generatemipmap. Improves the performance of the mipmap generation and drawing in fbo-generatemipmap by 30%.
* intel: asst. casts to silence warningsBrian Paul2009-01-261-1/+1
|
* intel: stub out CompressedTexSubImage2D instead of segfaulting.Eric Anholt2008-12-151-0/+1
|