summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: free object labels when deletingTimothy Arceri2013-09-041-0/+2
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use _mesa_detach_renderbuffer when deleting a textureIan Romanick2013-08-131-15/+27
| | | | | | | | | | | | | | | | | | | | The functional change is that now invalidate_framebuffer is called if the texture is actually detached from one of the currently bound FBOs. Previously this was only done for renderbuffers. The remaining changes make the texture delete path look more similar to the renderbuffer delete path. This includes adding relevant spec quotations to justify the behavior. Fixes piglit fbo-incomplete "delete texture of bound FBO" test. v2: Move 'fb->Attachment[i].Texture == att' check from previous patch to this patch... where it was intended to be in the first place. Noticed by Chad. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Use MIN3 instead of two MIN2s.Matt Turner2013-08-021-4/+5
|
* mesa: Update comments to match newer specs.Matt Turner2013-08-021-1/+1
| | | | | Old GL 1.x specs used 'b' but newer specs use 'p'. The line immediately above the second hunk also uses 'p'.
* mesa: default texture buffer format should be R8 in the core profileMarek Olšák2013-07-301-2/+2
| | | | | | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> v2: Since we don't expose the extension in the compatibility profile, the "if (API == CORE) .. else .." statement is removed.
* mesa: default DEPTH_TEXTURE_MODE should be RED in the core profileMarek Olšák2013-07-301-3/+4
| | | | | | | 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: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: add texobj support for ARB_texture_multisampleChris Forbes2013-03-021-18/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the new texture targets, and per-image state for GL_TEXTURE_SAMPLES and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS. V2: - Allow multisample texture targets in glInvalidateTexSubImage too. This was already partly there, but I missed it the first time around since the interaction is defined in a newer extension. Fixed weird indentation. - Allow multisample array textures in glFramebufferTextureLayer. This was overlooked as the tests originally only used 2d multisample textures. V3: - Set min/mag filters sensibly for multisample textures. This can't actually be changed by the user, so it's more sensible to initialize it correctly than to hack around it being bogus later. V4: - Tidy up initial min/mag filter setup. Setup in _mesa_initialize_texture_object was bogus, but benign since finish_texture_init() clobbered everything with correct values. For V4, just do the setup in finish_texture_init(). V5: - Don't break glPopAttrib(GL_TEXTURE_BIT) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* texobj: add verbose api trace messages to several routinesJordan Justen2013-02-271-0/+21
| | | | | | | | Motivated by wanting to see if GenTextures was called by an application while debugging another Steam overlay issue. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-8/+4
| | | | | | | | | | | We now have a separate dispatch table for begin/end that prevent these functions from being entered during that time. The ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to change any return values or introduce new error-only stubs at this point. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.Kenneth Graunke2013-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the OpenGL 3.2 Core Profile specification, section 3.8.12: "For one-, two-, and three-dimensional and one-and two-dimensional array textures, a texture is mipmap complete if all of the following conditions hold true: - [...] - levelbase <= levelmax [...] Using the preceding definitions, a texture is complete unless any of the following conditions hold true: - [...] - The minification filter requires a mipmap (is neither NEAREST nor LINEAR), and the texture is not mipmap complete." (This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.) From this, we see that levelbase <= levelmax should only affect mipmap completeness, not base-level completeness. Prior versions of GL did not have the notion of mipmap completeness, simply calling the texture incomplete in this case. But I don't think we really care. Fixes es3conform's sgis_texture_lod_basic_completeness test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: don't advertise ARB_texture_buffer_object in legacy contextsMarek Olšák2012-12-121-3/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: use MaxNumlevels in _mesa_test_texobj_completenessMarek Olšák2012-11-121-11/+3
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-091-1/+10
| | | | | | | | | | | | | | | 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: Use "non-gen name" more consistently as an error message in GL core.Eric Anholt2012-11-041-1/+1
| | | | | | | | | I used this to help verify that my test was actually testing the paths I wanted to. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix a crash in update_texture_state() for external texture typeAbdiel Janulgue2012-10-151-0/+3
| | | | | | | NOTE: This is a candidate for the stable branch. Signed-off-by: Abdiel <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: Require names from Gen in core contextIan Romanick2012-08-291-0/+5
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: add texture target field to ChooseTextureFormat() driver hookBrian Paul2012-08-241-1/+2
| | | | | | | | | This will let us choose the actual hardware format depending on the type of texture. v2: fixup radeon, nouveau, intel and swrast drivers too Reviewed-by: Eric Anholt <[email protected]>
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-241-2/+2
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* mesa: Filter glBindTexture targets based on supported features.Ian Romanick2012-08-231-9/+21
| | | | | | | | | | | | Fixed the piglit test arb_texture_buffer_object-negative-unsupported. NOTE: This is a candidate for stable release branches. v2: Add proper core-profile and GLES3 filtering. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add skeleton implementations of glInvalidateTex{Sub,}ImageIan Romanick2012-08-141-0/+211
| | | | | | | | | | | | | 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: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-141-2/+0
| | | | | | | | | | No driver supports this extension, and it seems unlikely than any driver ever will. I think r300c may have supported it at one time, but that driver has already been removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove unnecessary parameters from TexImagePauli Nieminen2012-08-121-2/+1
| | | | | | | | | | | gl_texture_image structure always holds size and internal format before TexImage driver hook is called. Those passing same information in function parameters only duplicates information making the interface harder to understand. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on compatibility profile specifications. OpenGL specification 4.1 compatibility 20100725 3.9.2: "... The values accepted in the pname parameter are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_- FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_- LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and in the sampler state in table 6.26 is not part of the sampler state, and remains in the texture object." The list of states is in Table 6.24 "Textures (state per texture object)" instead of 6.25 mentioned in the specification text. Same can be found from 3.3 compatibility specification. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: consolidate internal glTexImage1/2/3D codeBrian Paul2012-06-061-24/+4
| | | | | | | The functions for handling 1D, 2D and 3D texture images were nearly identical. This folds them all together. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix assertion failure when a cube face is not present.Eric Anholt2012-05-171-1/+2
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flagsBrian Paul2012-05-111-8/+9
| | | | | | | Instead of having to hack the code to enable these debugging options, set them through the MESA_DEBUG env var. Reviewed-by: Eric Anholt <[email protected]>
* mesa: add _mesa_total_texture_memory() debug functionBrian Paul2012-04-111-0/+59
| | | | | This function can be called in gdb to find out how much memory is used by all texture objects.
* mesa: Track a gl_format for the texture buffer format.Eric Anholt2012-04-091-0/+1
| | | | | | | | | | | There was a function full of unused mappings from the GLenum to datatype/comps, but that wasn't all the information a driver would want, which includes the other fields that a gl_format has. Given that all the texture buffer formats were represented in gl_format, just use that as our description. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Handle updating texture state for buffer textures.Eric Anholt2012-04-091-0/+8
| | | | | | | | | We have to skip some work that wants to look at texture images, since buffer textures don't have any of that complexity. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Create the default (name==0) buffer texture.Eric Anholt2012-04-091-0/+5
| | | | | | | | All that should be needed is that it exists. Fixes segfaults on first _mesa_update_context() with a samplerBuffer-using shader active but without a particular buffer texture enabled. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set the correct initial value of the texture buffer object format.Eric Anholt2012-04-091-0/+1
| | | | | | | Fixes piglit GL_ARB_texture_buffer_object/get Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()Brian Paul2012-03-231-1/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: only test cube face widths in _mesa_test_texobj_completeness()Brian Paul2012-03-201-5/+8
| | | | | | | As Eric pointed out, we know the cube faces are square at this point so we only need to test the texture widths for consistency. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add integer texture completeness checkBrian Paul2012-03-201-0/+6
| | | | | | | | 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-25/+44
| | | | | | | | | | | | | | | | | | | 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: rewrite/consolidate code in _mesa_test_texobj_completeness()Brian Paul2012-03-201-138/+45
| | | | | | | | Merge the mipmap level checking code that was separate cases for 1D, 2D, 3D and CUBE before. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: use new baseImage var to simplify _mesa_test_texobj_completeness()Brian Paul2012-03-201-24/+27
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add comments in _mesa_test_texobj_completeness() related to the specBrian Paul2012-03-201-2/+2
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: better debug message in _mesa_test_texobj_completeness()Brian Paul2012-03-201-1/+1
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move some code in _mesa_test_texobj_completeness()Brian Paul2012-03-201-7/+7
| | | | | | | | Move the simple MaxLevel < BaseLevel test earlier to be closer to where we error-check BaseLevel. Also, use the local baseLevel var in more places. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: use switch(target) in _mesa_test_texobj_completeness()Brian Paul2012-03-201-15/+19
| | | | | | | and add missing case for GL_TEXTURE_BUFFER. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()Brian Paul2012-03-201-3/+3
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> 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-29/+97
| | | | | | | | | | | | 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: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functionsBrian Paul2012-01-121-1/+1
| | | | | | Rather than testing the fbo's name against zero. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix cubemap depth completeness testDave Airlie2012-01-111-3/+5
| | | | | | | | This fixes the test to allow cube/depth combinations on GL3 or EXT_gpu_shader4. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>