summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: don't set _ClampFragmentColor to TRUE if it has no effectMarek Olšák2013-04-061-1/+2
| | | | | | | | This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
* mesa: allow multisample texture targets in [Get]TexParameter*Chris Forbes2013-03-311-1/+87
| | | | | | | | | | | | | | | | | | | | ARB_texture_storage_multisample allows texture parameters to be queried for TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY targets. Some parameters may also be set, with the following exceptions: - TEXTURE_BASE_LEVEL may not be set to a nonzero value; generates INVALID_OPERATION - any state which appears in the `per-sampler` state table may not be set; generates INVALID_OPERATION V2: Don't introduce bogus handling of TEXTURE_MAX_LEVEL Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Implement TEXTURE_IMMUTABLE_LEVELS for ES 3.0.Matt Turner2013-03-211-0/+12
| | | | | | | NOTE: This is a candidate for the 9.1 branch. Fixes piglit's texture-immutable-levels test. Reported-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add texobj support for ARB_texture_multisampleChris Forbes2013-03-021-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* mesa: add missing case in _mesa_GetTexParameterfv()Tapani Pälli2013-02-251-0/+6
| | | | | | | | | | missing case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is required by OES_EGL_image_external extension. Note: This is a candidate for the stable branches. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: implement GL_ARB_texture_buffer_rangeChristoph Bumiller2013-01-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | v2: Record texObj.BufferSize as -1 in TexBuffer(non-Range) instead of the buffer's current size so we know we always have to use the full size of the buffer object (i.e. even if it changes without the user calling TexBuffer again) for the texture. Clarify invalid offset alignment error message. v3: Use extra GL_CORE-only section in get_hash_params.py for TEXTURE_BUFFER_OFFSET_ALIGNMENT. v4: Remove unnecessary check for profile in _mesa_TexBufferRange. Add check for extension enable in get_tex_level_parameter_buffer. v5: Fix position in gl_API.xml. Add comment about meaning of BufferSize == -1. v6: Add back checks for core profile and add a note about it. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add casts in _mesa_GetTexParameterfv() to silence warningsBrian Paul2013-01-251-4/+4
| | | | | | There are other similar int->float casts elsewhere in the function. Reviewed-by: José Fonseca <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-11/+0
| | | | | | | | | | | 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: Round float param in glTexparameterf() to nearest integerAnuj Phogat2013-01-151-9/+4
| | | | | | | | | | | | | | | | | | OpenGL 4.2 specification suggests rounding the float data to nearest integer when the type of internal state is integer. Out of range floats should be clamped to {INT_MIN, INT_MAX}. This is not specified anywhere in gl/gles spec but below test expects this behavior. This patch makes gles3 conformance sgis_texture_lod_basic_getter.test pass. A GL spec bug will be raised to include clamping of out of range floats. V2: Round float to nearest integer for all cases where _mesa_Texparameterf() converts float param to int. Use the same block of float to int conversion code for GL_TEXTURE_SWIZZLE_{R,G,B,A}_EXT cases as well. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: don't advertise ARB_texture_buffer_object in legacy contextsMarek Olšák2012-12-121-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename API_OPENGL to API_OPENGL_COMPAT.Paul Berry2012-11-291-15/+15
| | | | | | | | | | This should help avoid confusion now that we're using the gl_api enum to distinguishing between core and compatibility API's. The corresponding enum value for core API's is API_OPENGL_CORE. Acked-by: Eric Anholt <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* mesa: Fix error code for glTexParameteri of TEXTURE_MAX_LEVEL.Kenneth Graunke2012-11-191-1/+1
| | | | | | | | | | | | Calling glTexParameteri() with pname GL_TEXTURE_MAX_LEVEL and either a target of GL_TEXTURE_RECTANGLE or a negative value previously generated GL_INVALID_OPERATION. However, GL_INVALID_VALUE seems more appropriate. Fixes oglconform's api-error/negative.glTexParameter and es3conform's sgis_texture_lod_basic_error. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-and-tested-by: Matt Turner <[email protected]>
* mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-091-0/+5
| | | | | | | | | | | | | | | 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: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXTIan Romanick2012-09-201-0/+12
| | | | | | | | | This was already (correctly) supported for glGetSamplerParameter paths. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_OES_draw_texture define.Oliver McFadden2012-09-151-10/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES ↵Ian Romanick2012-08-231-13/+84
| | | | | | | | | | | | | | | wrapper This also adds a missing extension (and API) check around GL_TEXTURE_CROP_RECT_OES. v2: Add proper core-profile and GLES3 filtering. GL_TEXTURE_MAX_LEVEL is (incorrectly) accepted in ES contexts. A future patch will add GL_APPLE_texture_max_level, and meta really needs this. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapperIan Romanick2012-08-231-11/+51
| | | | | | | | | | | | | This also adds a missing extension (and API) check around GL_TEXTURE_CROP_RECT_OES. v2: Add proper core-profile, GLES1, and GLES3 filtering. GL_TEXTURE_MAX_LEVEL is (incorrectly) accepted in ES contexts. A future patch will add GL_APPLE_texture_max_level, and meta really needs this. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapperIan Romanick2012-08-231-8/+15
| | | | | | | | | | Ditto for glGetTexParameter targets. 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/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapperIan Romanick2012-08-231-4/+10
| | | | | | | | v2: Add proper core-profile filtering. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Refactor validate_texture_wrap_mode to use a switch-statementIan Romanick2012-08-231-35/+42
| | | | | | | | This makes the next couple changes a little easier. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove unused params, add const qualifiersBrian Paul2012-08-181-5/+4
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE for a buffer obj is illegalBrian Paul2012-08-181-7/+3
| | | | | | | | | GL_INVALID_OPERATION is to be raised when querying a non-compressed image/buffer. Since a buffer object can't have a compressed format this query always generates an error. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Support GL_TEXTURE_BUFFER in GetTexLevelParameter[if]v in GL 3.1+.Kenneth Graunke2012-08-171-1/+127
| | | | | | | | | | | | | | | | | | | | | The OpenGL 3.1 specification explicitly allows this. Oddly, the ARB_texture_buffer_object spec's issues section claims this isn't allowed, but proceeds to explain that the extension simply doesn't edit the underlying spec to allow it, and thus it didn't appear in the list of legal texture targets. Thus, this patch legalizes it only in 3.1+ contexts, but still returns INVALID_ENUM in earlier contexts that expose ARB_texture_buffer_object. Unfortunately, the behavior of the call is horrendously undefined. Fixes oglconform's tbo/negative.textureParams test. v2: Require desktop OpenGL. Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Signed-off-by: Ian Romanick <[email protected]>
* mesa: Split out part of glGetTexLevelParameter into a helper function.Kenneth Graunke2012-08-171-42/+52
| | | | | | | | | | Move the _mesa_GetTexLevelParameter[iv] functions below the helper function so the prototype is available. This will be useful in the next commit. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add explicit target checking to GetTexLevelParameter[if]v().Kenneth Graunke2012-08-171-3/+38
| | | | | | | | | | | | | | Previously, it relied on _mesa_max_texture_levels() for texture target error checking. This was somewhat dodgy, as _mesa_max_texture_levels() is called in seven diferent places, not all of which necessarily accept the same list of targets. I copied the list of legal targets from _mesa_max_texture_levels(), so this patch should not introduce any change in behavior. Future patches will cause the two to diverge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-141-24/+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: Replace VersionMajor/VersionMinor with a Version field.Eric Anholt2012-08-071-1/+1
| | | | | | | | | | | As we get into supporting GL 3.x core, we come across more and more features of the API that depend on the version number as opposed to just the extension list. This will let us more sanely do version checks than "(VersionMajor == 3 && VersionMinor >= 2) || VersionMajor >= 4". v2: Fix a bad <= 30 check. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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: move more format helper functions to glformats.cBrian Paul2012-07-241-1/+1
|
* mesa: rework texture completeness testingBrian Paul2012-03-201-4/+3
| | | | | | | | | | | | | | | | | | | 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: use _mesa_dirty_texobj() in glTexParameter codeBrian Paul2012-03-201-1/+2
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/texparam: drop double semicolonsDave Airlie2012-02-121-12/+12
| | | | | | no idea where these came from, drop them. Signed-off-by: Dave Airlie <[email protected]>
* mesa: remove the ctx->Driver.IsTextureResident() hookBrian Paul2011-12-081-4/+2
| | | | | | | No driver implemented this and we always returned "True" for residence queries. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move _mesa_base_format_has_channel() into image.cBrian Paul2011-11-281-83/+1
| | | | | | This is where other format-related functions live. Reviewed-by: Eric Anholt <[email protected]>
* mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queriesBrian Paul2011-11-281-17/+8
| | | | | | | Use the _mesa_base_format_has_channel() helper as we do for the other texture format component queries. Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_base_format_has_channel() in fbobject.c queriesBrian Paul2011-11-281-4/+21
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't report types for 0-sized components of textures.Eric Anholt2011-11-221-50/+69
| | | | | | | | | | | | | | | | | | | | The GL_TEXTURE_WHATEVER_SIZE entrypoints were checking if the specified base type of the texture allowed that channel to be present before reporting the size of the channel, so that GL_RGB didn't end up with an alpha size if the hardware driver had to store it that way. The GL_TEXTURE_WHATEVER_TYPE entrypoints weren't checking it, so you would end up with strange responses from the GL involving 0-bit floating-point alpha components in GL_RGB32F, even though it says GL_NONE as expected for other 0-sized channels. Make _TYPE check _BaseFormat the same as _SIZE, which results in fixing most of the GL_RGB* testcases of gl-3.0-required-sized-formats pass on i965. v2: Add a default case with a warning (suggestion by Brian Paul) Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-1/+19
| | | | | | | | | 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: clean up validate_texture_wrap_modeChia-I Wu2011-11-031-15/+27
| | | | | | | | GL_TEXTURE_RECTANGLE_NV (and soon GL_TEXTURE_EXTERNAL_OES) is special. Handle it in its own if-block. There should be no functional change. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: complete the GL_TEXTURE_SWIZZLE* setupYuanhan Liu2011-11-031-0/+27
| | | | | | | | | | | | | | | | | | | | | The ARB_texture_swizzle spec says: The error INVALID_OPERATION is generated if TexParameteri, TexParameterf, TexParameteriv, or TexParameterfv, parameter <pname> is TEXTURE_SWIZZLE_R, TEXTURE_SWIZZLE_G, TEXTURE_SWIZZLE_B, or TEXTURE_SWIZZLE_A, and <param> is not RED, GREEN, BLUE, ALPHA, ZERO, or ONE. The error INVALID_OPERATION is generated if TexParameteriv, or TexParameterfv, parameter <pname> TEXTURE_SWIZZLE_RGBA, and the four consecutive values pointed to by <param> are not all RED, GREEN, BLUE, ALPHA, ZERO, or ONE. So, the GL_TEXTURE_SWIZZLE* pname is legal for glTexParameterf(v) NOTE: this is a candidate for the 7.11 branch Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove the redundant checkYuanhan Liu2011-11-031-6/+5
| | | | | Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: glGetTexParameter support for GL_ARB_texture_storageBrian Paul2011-10-311-0/+12
|
* mesa: s/INLINE/inline/Brian Paul2011-10-011-2/+2
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: Remove ARB_texture_mirrored_repeat extension enable flagIan Romanick2011-09-291-2/+1
| | | | | | | | | | | | | All drivers remaining in Mesa support this extension. This extension is either required or optional features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x. This extension was previously not supported on mach64, mga, and savage (Savage3D and other pre-Savage4). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove EXT_texture_lod_bias extension enable flagIan Romanick2011-09-291-11/+4
| | | | | | | | | | | | All drivers remaining in Mesa support this extension. This extension is either required or optional features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x. This extension was previously not supported on mach64, mga, or r128. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move software texel fetch code into swrastBrian Paul2011-09-171-1/+0
| | | | It's only used by swrast now so move it out of core Mesa.
* mesa: move _mesa_update_fetch_functions() calls into swrastBrian Paul2011-09-171-1/+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: Remove API facing bits of EXT_paletted_texture and ↵Ian Romanick2011-09-061-6/+0
| | | | | | | | | | | | | | 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: whitespace, formatting fixes in GetTexParameter() codeBrian Paul2011-08-041-8/+6
|
* mesa: add null ptr checks in GetTexParameterI[u]iv() functionsBrian Paul2011-08-041-0/+4
|