summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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: Handle updating texture state for buffer textures.Eric Anholt2012-04-091-0/+4
| | | | | | | | | 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: rework texture completeness testingBrian Paul2012-03-201-2/+5
| | | | | | | | | | | | | | | | | | | 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/+8
| | | | | | | | | | | | 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: fix proxy texture target initializationBrian Paul2012-02-101-7/+12
| | | | | | | | | | | The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in alloc_proxy_textures() because the elements in the targets[] array were in the wrong order. This didn't actually cause any failures since we never really use the proxy texture's Target field. But let's get it right. NOTE: This is a candidate for the 8.0 branch.
* mesa: use STATIC_ASSERT in a few more placesBrian Paul2012-01-101-1/+1
|
* mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-1/+2
| | | | | | | | | 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: Use gl_shader_program::_LinkedShaders instead of FragmentProgramIan Romanick2011-10-071-5/+5
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgramIan Romanick2011-10-071-4/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove API facing bits of EXT_paletted_texture and ↵Ian Romanick2011-09-061-8/+2
| | | | | | | | | | | | | | EXT_shared_texture_palette This was also discussed at XDS 2010. However, actually making the change was delayed because several drivers still exposed these extensions to significant benefit (e.g., tdfx). Now that those drivers have been removed, this code can be removed as well. v2: A lot of bits that were missed in the previous patch have been removed. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-1/+7
| | | | | | 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: init/release the default texture buffer objectBrian Paul2011-04-061-0/+8
|
* mesa: core support for GL_ARB_texture_buffer_objectBrian Paul2011-04-051-1/+2
| | | | No GLSL or driver support yet.
* mesa: remove GL_SGI_texture_color_table supportBrian Paul2011-02-281-3/+0
| | | | | | It was only implemented in the swrast driver and probably not used by any applications. A modern app would use a dependent/chained texture lookup in the fragment shader.
* Track separate programs for each stageIan Romanick2010-10-271-14/+19
| | | | | The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-11/+11
|
* ARB_texture_rg: Handle RED and RG the same as RGB for tex envIan Romanick2010-10-011-0/+6
|
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-1/+1
|
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-19/+19
|
* mesa: increase number of texture units to MAX_COMBINED_TEXTURE_IMAGE_UNITSBrian Paul2010-02-031-10/+19
| | | | | | | | | | | | | | | | | | | We were misinterpretting GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS previously. It's the number of texture units for which we need to keep state; not just the total number of texture units addressable by the vertex shader plus fragment shader. Since sw Mesa independently supports 16 texture units in vertex shaders and 16 texture units in fragment shaders, the max combined units is 32. Note that the docs for glActiveTexture() indicate the max legal unit is MAX(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, MAX_TEXTURE_COORDS) - 1. A new piglit test (texunits.c) tests the various texture unit limits. I'm pretty sure I've got this all right now, but additional reviews are welcome...
* mesa: add out of bounds assertions for accessing texture matrix stackBrian Paul2010-02-031-0/+2
|
* mesa: more info in glActiveTexture error msgBrian Paul2010-01-271-1/+2
|
* mesa: Remove unnecessary headers from texstate.c.Vinson Lee2010-01-171-2/+0
|
* mesa: avoid redundant state setting in glClientActiveTextureBrian Paul2009-10-271-0/+7
| | | | Plus add code for verbose/debugging.
* mesa: remove unused ctx->Driver.TextureMatrix() hookBrian Paul2009-10-141-7/+0
|
* Merge branch 'mesa_7_6_branch'Brian Paul2009-09-291-8/+14
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile configs/default docs/relnotes.html src/gallium/drivers/softpipe/sp_context.c src/gallium/drivers/softpipe/sp_tile_cache.c src/mesa/main/version.h
| * mesa: work-around glXCopyContext() bug in _mesa_copy_texture_state()Brian Paul2009-09-291-8/+14
| | | | | | | | See bug 24217.
* | mesa/main: Make FEATURE_colortable follow feature conventions.Chia-I Wu2009-09-241-6/+0
|/ | | | | As shown in mfeatures.h, this allows users of colortab.h to work without knowing if the feature is available.
* mesa: remove redundant assignmentsBrian Paul2009-09-011-8/+1
|
* mesa: Fixed a texture memory leakRobert Ellison2009-05-081-0/+3
| | | | | | | | | | | | The current texture for any particular texture unit is given an additional reference in update_texture_state(); but if the context is closed before that texture can be released (which is quite frequent in normal use, unless a program unbinds and deletes the texture and renders without it to force a call to update_texture_state(), the memory is lost. This affects general Mesa; but the i965 is particularly affected because it allocates a considerable amount of additional memory for each allocated texture.
* mesa: only use fallback texture when using shaders, not fixed-function (take ↵Brian Paul2009-05-051-8/+14
| | | | | | | | | | | two) The semantics are a little different for shaders vs. fixed-function when trying to use an incomplete texture. The fallback texture returning (0,0,0,1) should only be used with shaders. For fixed function, the texture unit is truly disabled/ignored. Fixes glean fbo test regression.
* Revert "mesa: only use fallback texture when using shaders, not fixed-function"Brian Paul2009-05-051-14/+8
| | | | | | This reverts commit a0edbfb28fb2e670c657d52190a7e8b1ccf4f46e. This patch didn't completely fix the problem. The next patch will.
* mesa: only use fallback texture when using shaders, not fixed-functionBrian Paul2009-05-051-8/+14
| | | | | | | | The semantics are a little different for shaders vs. fixed-function when trying to use an incomplete texture. The fallback texture returning (0,0,0,1) should only be used with shaders. Fixes glean fbo test regression.
* mesa: only use fallback texture when using shaders, not fixed-functionBrian Paul2009-05-051-4/+4
| | | | | | | | The semantics are a little different for shaders vs. fixed-function when trying to use an incomplete texture. The fallback texture returning (0,0,0,1) should only be used with shaders. Fixes glean fbo test regression.
* mesa: create/use a fallback texture when bound texture is incompleteBrian Paul2009-05-011-2/+7
| | | | | | | | | | | | | | When a GLSL sampler reads from an incomplete texture it should return (0,0,0,1). Instead of jumping through hoops in all the drivers to make this happen, just create/install a fallback texture with those texel values. Fixes piglit/fp-incomplete-tex on i965 and more importantly, fixes some GPU lockups when trying to sample from missing surfaces. If a binding table entry is NULL, it seems that sampling sometimes works, but not always (lockup). Todo: create a fallback texture for each type of texture target?
* mesa: improve another _mesa_problem() callBrian Paul2009-03-131-1/+2
|
* mesa: add GL_DUDV_ATI cases in calculate_derived_texenv()Brian Paul2009-03-131-0/+3
|
* mesa: more info in _mesa_problem() callBrian Paul2009-03-131-1/+3
|
* mesa: add support for ATI_envmap_bumpmapRoland Scheidegger2009-03-121-0/+20
| | | | | | | | add new entrypoints, new texture format, etc translate in texenvprogram.c for drivers using the mesa-generated tex env fragment program also handled in swrast, but not tested (cannot work due to negative texel results not handled correctly)
* mesa: remove gl_texture_object::_Function field and associated codeBrian Paul2009-03-111-32/+0
| | | | It was only used in one place in swrast.
* mesa: move call to update_texture_compare_function()Brian Paul2009-03-021-3/+1
| | | | Another conditional can be avoided.
* mesa: fix texture enable regressionBrian Paul2009-03-021-2/+3
| | | | | | | Need to clear the _ReallyEnabled field before possibly continuing the loop. Also, set _Current pointer to NULL if the unit is no longer enabled. Fixes piglit lodbias regression
* mesa: use _mesa_reference_texobj() when setting texUnit->Current pointerBrian Paul2009-03-021-2/+1
| | | | Fixes piglit copytexsubimage regression.
* mesa: fixed computation of _EnabledCoordUnitsBrian Paul2009-03-021-8/+18
| | | | | This field should not include vertex textures. It indicates the coord inputs for fragment / fixed-function processing.
* mesa: move texture_override() code into calling loopBrian Paul2009-03-021-30/+19
| | | | We can avoid a few iterations this way.
* mesa: move update_texture_compare_function() call out of loopBrian Paul2009-03-021-1/+3
|
* mesa: move _GenFlags = 0x0 to texgen loopBrian Paul2009-02-281-1/+2
|
* mesa: move a bunch of compiler-related stuff into new compiler.h headerBrian Paul2009-02-221-0/+1
| | | | This trims down and cleans up imports.h and glheader.h quite a bit.
* mesa: assorted clean-ups, var renaming, etc.Brian Paul2009-02-221-59/+59
|
* mesa: simplify texture combine state copying in _mesa_copy_texture_state()Brian Paul2009-02-221-8/+1
| | | | Just copy the whole struct.