aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.h
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove unneeded #includes of main/compiler.hBrian Paul2018-01-171-1/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Add _mesa_bind_texture methodIan Romanick2018-01-021-1/+3
| | | | | | | Light-weight glBindTexture for internal use. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "mesa: remove unused _mesa_delete_nameless_texture()"Ian Romanick2018-01-021-0/+5
| | | | | | | | | | | Changes in this series use this function. This reverts commit 048de9e34a2214371481143cddcaa53f52468c6b. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: Samuel Pitoiset <[email protected]> Cc: Timothy Arceri <[email protected]>
* st/mesa: fix switching from surface-based to non-surface-based texturesNicolai Hähnle2017-10-101-1/+2
| | | | | | | | | This can happen with surface-based texture objects derived from EGL images, since those aren't immutable. Fixes tests in dEQP-EGL.functional.sharing.gles2.multithread.random.images.teximage2d.* and others Reviewed-by: Marek Olšák <[email protected]>
* mesa: add KHR_no_error support to glDeleteTextures()Samuel Pitoiset2017-07-311-0/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBindTextures()Samuel Pitoiset2017-07-311-0/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBindTexture()Samuel Pitoiset2017-07-311-0/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glInvalidate*()Samuel Pitoiset2017-07-311-0/+8
| | | | | | | | These are just no-op because we don't actually do anything useful in the errors path. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for gl*Textures()Samuel Pitoiset2017-06-281-0/+6
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glBindTextureUnit()Samuel Pitoiset2017-06-281-0/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused _mesa_delete_nameless_texture()Samuel Pitoiset2017-06-221-5/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: stop abstracting texture object hashtable lockingTimothy Arceri2017-04-071-6/+0
| | | | | | | This doesn't do anything useful so just remove it. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* main: allow NEAREST_MIPMAP_NEAREST for stencil texturingRoland Scheidegger2016-12-061-15/+8
| | | | | | | | | | | | As per GL 4.5 rules, which fixed a spec mistake in GL_ARB_stencil_texturing. The extension spec wasn't updated, but just allow it with older GL versions as well, hoping there aren't any crazy tests which want to see an error there... (Compile tested only.) Reported by Józef Kucia <[email protected]> Acked-by: Józef Kucia <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move _mesa_num_tex_faces() to teximage.hBrian Paul2016-02-121-19/+0
| | | | | | | So it's near the other cube map helper functions. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused _mesa_create_nameless_texture()Brian Paul2015-10-081-3/+0
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Tested-by: Mark Janes <[email protected]>
* mesa: make _mesa_bind_texture_unit() staticBrian Paul2015-08-241-4/+0
| | | | | | It's only called from the file it's defined in. Reviewed-by: Timothy Arceri <[email protected]>
* main: Added _mesa_cube_level_complete to check for the completeness of an ↵Laura Ekstrand2015-01-081-0/+4
| | | | | | arbitrary cube map level. Reviewed-by: Chad Versace <[email protected]>
* main: Nameless texture creation and deletion. Does not affect normal ↵Laura Ekstrand2015-01-081-0/+7
| | | | | | | | | | | | | | | | | | | | creation and deletion paths. In implementing ARB_DIRECT_STATE_ACCESS functions, it is often necessary to abstract the functionality of a traditional GL API function into a backend that both the traditional and dsa API functions can share. For instance, glTexParameteri and glTextureParameteri both call _mesa_texture_parameteri, which takes a context object and a texture object as arguments. The existance of such backend functions provides the opportunity for driver internals (such as meta) to pass around the actual texture object rather than its ID or target, saving on texture object storage and look-up overhead. This patch provides nameless texture creation and deletion for meta. This will be used in an upcoming refactor of meta. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for BindTextureUnit.Laura Ekstrand2015-01-081-0/+7
| | | | | | | | | | | | | | | | | | | The following preparations were made in texstate.c and texstate.h to better facilitate the BindTextureUnit function: Dylan Noblesmith: mesa: add _mesa_get_tex_unit() mesa: factor out _mesa_max_tex_unit() This is about to appear in a lot more places, so reduce boilerplate copy paste. add _mesa_get_tex_unit_err() checking getter function Reduce boilerplate across files. Laura Ekstrand: Made note of why BindTextureUnit should throw GL_INVALID_OPERATION if the unit is out of range. Added assert(unit > 0) to _mesa_get_tex_unit. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glCreateTextures.Laura Ekstrand2015-01-081-1/+3
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_get_current_tex_object from teximage.c to texobj.c.Laura Ekstrand2015-01-081-0/+3
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_lock_texture and _mesa_unlock_texture to texobj.h from ↵Laura Ekstrand2015-01-081-0/+18
| | | | | | teximage.h. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added utility function _mesa_lookup_texture_err().Laura Ekstrand2015-01-081-0/+3
| | | | | | | | | Most ARB_DIRECT_STATE_ACCESS functions take an object's ID and use it to look up the object in its hash table. If the user passes a fake object ID (ie. a non-generated name), the implementation should throw INVALID_OPERATION. This is a convenience function for texture objects. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: create, use new _mesa_texture_base_format() functionBrian Paul2015-01-051-0/+3
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: put extern "C" in header filesBrian Paul2014-12-161-0/+10
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Add helper functions for looking up multiple texturesFredrik Höglund2014-05-021-0/+9
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add infrastructure for ARB_multi_bindFredrik Höglund2014-05-021-0/+4
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).Kenneth Graunke2014-03-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While the GL_ARB_stencil_texturing extension does not allow the creation of stencil textures, it does allow shaders to sample stencil values stored in packed depth/stencil textures. Specifically, applications can call glTexParameter* with a pname of GL_DEPTH_STENCIL_TEXTURE_MODE and value of either GL_DEPTH_COMPONENT or GL_STENCIL_INDEX to select which component they wish to sample. The default value is GL_DEPTH_COMPONENT (for traditional depth sampling). Shaders should use an unsigned integer sampler (presumably usampler2D) to access stencil data. Otherwise, results are undefined. Using shadow samplers with GL_STENCIL_INDEX selected also is undefined behavior. This patch creates a new gl_texture_object field, StencilSampling, to indicate that stencil should be sampled rather than depth. (I chose to use a boolean since I figured it would be more convenient for drivers.) It also introduces the [Get]TexParameter code to get and set the value, and of course the extension plumbing. v2: Also consider textures incomplete when sampling stencil with non-NEAREST min/mag filters (caught by Eric Anholt). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make target_enum_to_index available outside texobj.cIan Romanick2014-02-021-0/+3
| | | | | | | | | | The next patch will use this function in another file. v2: Rename _mesa_target_enum_to_index to _mesa_tex_target_to_index. Suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().Kenneth Graunke2013-09-261-2/+1
| | | | | | | Every caller passed true. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: default DEPTH_TEXTURE_MODE should be RED in the core profileMarek Olšák2013-07-301-1/+2
| | | | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-091-0/+2
| | | | | | | | | | | | | | | This adds the mesa core + texture + fbo support for the texture cube map array extension. v2: add comment to _mesa_num_tex_faces related to cube map arrays (Brian) drop wrong comment cut-n-paste (Brian) fix / 6 maximum check issue (Kenneth) coalsece some array case statements (Kenneth) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces()Brian Paul2012-09-171-1/+7
|
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-241-0/+11
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* mesa: Add skeleton implementations of glInvalidateTex{Sub,}ImageIan Romanick2012-08-141-0/+8
| | | | | | | | | | | | | These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0). v2: Add comment explaining why minimum dimensions are set to 1 for some texture targets. Add default case to switch statement to silence compiler warnings and detect new texture targets. Both changes suggested by Brian. Also use _mesa_is_desktop_gl as suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add _mesa_total_texture_memory() debug functionBrian Paul2012-04-111-0/+3
| | | | | This function can be called in gdb to find out how much memory is used by all texture objects.
* mesa: add integer texture completeness checkBrian Paul2012-03-201-0/+8
| | | | | | | | Per the spec, only nearest filtering is supported for integer textures. Otherwise, the texture is incomplete. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: rework texture completeness testingBrian Paul2012-03-201-0/+13
| | | | | | | | | | | | | | | | | | | Instead of gl_texture_object::_Complete there are now two fields: _BaseComplete and _MipmapComplete. The former indicates whether the base texture level is valid. The later indicates whether the whole mipmap is valid. With sampler objects, a single texture can appear to be both complete and incomplete at the same time. See the GL_ARB_sampler_objects spec for more details. To implement this we now check if the texture is complete with respect to a sampler state. Another benefit of this is we no longer need to invalidate a texture's completeness state when we change the minification/magnification filters with glTexParameter(). Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix _mesa_get_fallback_texture() to handle all texture targetsBrian Paul2012-02-151-2/+2
| | | | | | | | | | | | Previously, this function only handled 2D textures. The fallback texture is used when we try to sample from an incomplete texture object. GLSL says sampling an incomplete texture should return (0,0,0,1). v2: use a 1-texel texture image, per José. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: s/INLINE/inline/Brian Paul2011-10-011-1/+1
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: use inline function wrapper for _mesa_reference_texobj()Brian Paul2011-07-141-1/+11
|
* mesa: 80-column wrappingBrian Paul2011-04-051-2/+4
|
* mesa: test for cube map completeness in glGenerateMipmap()Brian Paul2010-12-061-0/+3
| | | | | | | The texture is not cube complete if the base level images aren't of the same size and format. NOTE: This is a candidate for the 7.9 branch.
* mesa: Clean up header file inclusion in texobj.h.Vinson Lee2010-12-041-1/+2
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-9/+9
|
* mesa/main: Add functions to clear and dirty texture objects.Chia-I Wu2009-08-051-1/+7
| | | | | | | | This commit adds a function to clear a texture object such that there is no image data associated with it, and a function to dirty it so that it will be re-tested for completeness. Signed-off-by: Chia-I Wu <[email protected]>