summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/main: In _mesa_CompressedTextureSubImage3D() check found texObjJuha-Pekka Heikkila2015-01-121-0/+2
| | | | | | | Check returned texObj is not null. If texObj is null there is already GL_INVALID_OPERATION error set. Signed-off-by: Juha-Pekka Heikkila <[email protected]>
* mesa: Fix incorrect assertion in init_teximage_fields_msIago Toral Quiroga2015-01-121-1/+1
| | | | | | | | | | | | | | | | _BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the arb_texture_view-lifetime-format piglit test on nouveau, since that test calls _mesa_base_tex_format with GL_R16F with a context that does not have ARB_texture_float, so it returns -1 for the BaseFormat, which was not being caught properly by the ASSERT in init_teximage_fields_ms until now. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix get_texbuffer_format().Samuel Iglesias Gonsalvez2015-01-121-2/+2
| | | | | | | | | We were returning incorrect mesa formats for GL_LUMINANCE_ALPHA16I_EXT and GL_LUMINANCE_ALPHA32I_EXT. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: compute row stride outside of loop and fix MSVC compilation errorBrian Paul2015-01-081-2/+4
| | | | | | Can't do void pointer arithmetic with MSVC. Reviewed-by: Jose Fonseca <[email protected]>
* main: Checking for cube completeness in TextureSubImage.Laura Ekstrand2015-01-081-13/+35
| | | | | | | | This is part of a potential solution to a spec bug. Cube completeness is a concept from glGenerateMipmap, but it seems reasonable to check for it in TextureSubImage when target=GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <[email protected]>
* main: Refactor in teximage.c to handle NULL from _mesa_get_current_tex_object.Laura Ekstrand2015-01-081-0/+22
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureBuffer.Laura Ekstrand2015-01-081-16/+74
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Fix texObj->Immutable flag update in _mesa_texture_image_multisample.Laura Ekstrand2015-01-081-1/+1
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureStorage[23]DMultisample.Laura Ekstrand2015-01-081-28/+96
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glCompressedTextureSubImage*D.Laura Ekstrand2015-01-081-52/+187
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for CopyTextureSubImage*D.Laura Ekstrand2015-01-081-46/+124
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureSubImage*D.Laura Ekstrand2015-01-081-81/+251
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Removed trailing whitespaces in texture code.Laura Ekstrand2015-01-081-19/+19
| | | | | | | | main: Removed trailing whitespace in texstate.c. main: Deleted trailing whitespaces in texobj.c. main: Fixed whitespace errors in teximage.h and teximage.c. Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_get_current_tex_object from teximage.c to texobj.c.Laura Ekstrand2015-01-081-81/+0
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: remove unused ctx parameter for _mesa_select_tex_image()Brian Paul2015-01-051-13/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix height error check for 1D array texturesBrian Paul2014-12-021-1/+1
| | | | | | | | height=0 is legal for 1D array textures (as depth=0 is legal for 2D arrays). Fixes new piglit ext_texture_array-errors test. Cc: "10.3 10.4" <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* mesa: Mark buffer objects that are used as TexBOsChris Forbes2014-10-161-0/+6
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: fix error reported on gTexSubImage2D when level not validTapani Pälli2014-10-101-1/+1
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
* mesa: fix compressed_subtexture_error_check() return valueBrian Paul2014-08-161-3/+3
| | | | | | | | | The function should return GLboolean, not GLenum. If we detect invalid compressed pixel storage parameters, we should return GL_TRUE, not GL_FALSE so that the function is no-op'd. An update to the piglit s3tc-errors test will check this. Reviewed-by: Matt Turner <[email protected]>
* mesa: move _mesa_compressed_texture_pixel_storage_error_check()Brian Paul2014-08-161-37/+7
| | | | | | | to pixelstore.c, add const qualifier to the 'packing' parameter. Add comments. Reviewed-by: Matt Turner <[email protected]>
* mesa: Add the format enums for BPTC-compressed imagesNeil Roberts2014-08-121-0/+14
| | | | | | | | | | | | | | | | | | This adds the following four Mesa image format enums which correspond to the four BPTC compressed texture formats: MESA_FORMAT_BPTC_RGBA_UNORM MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT It also updates the format information functions to handle these and the corresponding GL enums. v2: Also modify _mesa_get_format_color_encoding, _mesa_get_srgb_format_linear and _mesa_get_uncompressed_format Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formatsAnuj Phogat2014-08-041-0/+1
| | | | | | | | | GL_TEXTURE_CUBE_MAP is an allowed texture target in glTexStorage2D() and is allowed to be used (like GL_TEXTURE_2D) with compressed internal formats. Cc: <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()Anuj Phogat2014-08-041-0/+15
| | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in ↵Anuj Phogat2014-08-041-18/+29
| | | | | | | | | | | glCopyTexImage*() Fixes many failures in gles3 Khronos CTS test: packed_pixels Khronos bug# 9807 Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()Anuj Phogat2014-08-041-0/+46
| | | | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels V2: Add the check for alpha bits to avoid confusion. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3Anuj Phogat2014-08-041-0/+11
| | | | | | | | Fixes few failures in gles3 Khronos CTS test: packed_pixels Cc: "10.2" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix condition for using compressed internalformat in ↵Anuj Phogat2014-08-041-1/+8
| | | | | | | | glCompressedTexImage3D() Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Turn target_can_be_compressed() in to a utility functionAnuj Phogat2014-08-041-6/+6
| | | | | | | | V2: Declare the function in teximage.h Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/main: Add generic bits of ARB_clear_texture implementationNeil Roberts2014-07-231-1/+245
| | | | | | | | | This adds the driver entry point for glClearTexSubImage and fills in the _mesa_ClearTexImage and _mesa_ClearTexSubImage functions that call it. v2: Don't clear some of the images if only one of them makes an error Reviewed-by: Jason Ekstrand <[email protected]>
* teximage: Add utility func for format/internalFormat compatibility checkNeil Roberts2014-07-231-21/+38
| | | | | | | In texture_error_check() there was a snippet of code to check whether the given format and internal format are basically compatible. This has been split out into its own static helper function so that it can be used by an implementation of glClearTexImage too.
* mesa/main: add ARB_clear_texture entrypointsIlia Mirkin2014-07-231-0/+16
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
* Remove the ATI_envmap_bumpmap extensionJason Ekstrand2014-06-301-12/+1
| | | | | | | | | | | As far as I can tell, the Intel mesa driver is the only driver in the world still supporting this legacy extension. If someone wants to do bump mapping, they can use shaders. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1] Reviewed-by: Chris Forbes <[email protected]> [v2] Reviewed-by: Ian Romanick <[email protected]> [v3]
* mesa: Emit errors for inconsistent compressed pixel store stateChris Forbes2014-06-101-0/+45
| | | | | | | V2: Use bool rather than GLboolean for internal function Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make CompressedTexSubImage errors more consistentChris Forbes2014-06-101-3/+3
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: pass target through to driver when choosing texture formatIlia Mirkin2014-05-071-1/+1
| | | | | | | | | This only matters for TextureView where the texObj's target has not been set yet, in all other instances, texObj->target should be the same as the passed-in target parameter. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix error condition for multisample proxy texture targetsAnuj Phogat2014-04-171-3/+13
| | | | | | | | Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix texture border handling for cube arraysMarek Olšák2014-03-211-1/+4
| | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_textureIlia Mirkin2014-03-191-8/+3
| | | | | | | | | | | | | | | | | | | EXT_packed_depth_stencil is supported by all drivers, but ARB_depth_texture isn't (notably nouveau_vieux). This should avoid passing unexpected values down to ChooseTextureFormat. The EXT_packed_depth_stencil spec does not make any explicit references to requiring ARB_depth_texture in order to allow textures with that format, however if there is no dependency, ARB_depth_texture would be practically implied by the extension. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "10.0 10.1" <[email protected]> Note for 10.0 backport: This will produce a conflict, the solution is to move the surrounding if as well.
* mesa: new init_teximage_fields_ms() function to init MS texture imagesBrian Paul2014-03-051-15/+29
| | | | | | | Before, it was kind of ugly to set the multisample fields with assignments after we called _mesa_init_teximage_fields(). Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in ↵Anuj Phogat2014-03-041-2/+11
| | | | | | | | | | | | | | | | | | glTexImage{123}D() From OpenGL 3.3 spec, page 141: "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL require either depth component data or depth/stencil component data. Textures with other base internal formats require RGBA component data. The error INVALID_OPERATION is generated if one of the base internal format and format is DEPTH_COMPONENT or DEPTH_STENCIL, and the other is neither of these values." Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use clear_teximage_fields() in place of _mesa_init_teximage_fields()Anuj Phogat2014-03-041-2/+1
| | | | | | | This patch makes no functional changes to the code. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make TexImage error cases about internalFormat more informative.Eric Anholt2014-02-121-7/+13
| | | | | | | | | | I tripped over one of these when debugging meta, and it's a lot nicer to just see the internalFormat being complained about. v2: Drop a note in the other errors path that there is one early return. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: GL_ARB_half_float_pixel is not optionalIan Romanick2014-02-111-15/+2
| | | | | | | | | | | | | | | | | Almost every driver already supported it. All current and future Gallium drivers always support it, and most existing classic drivers support it. This only changes radeon and nouveau. This extension only adds data types that can be passed to, for example, glTexImage2D. It does not add internal formats. Since you can already pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues with those drivers. Note that r200 and i915 already supported this extension, and they don't support floating-point textures either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix extension dependency for half-float TexBOsIan Romanick2014-02-111-1/+12
| | | | | | | | | | | Half-float TexBOs should require both GL_ARB_half_float_pixel and GL_ARB_texture_float. This doesn't matter much in practice. Every driver that supports GL_ARB_texture_buffer_object already supports GL_ARB_half_float_pixel. We only expose the TexBO extension in core profiles, and those require GL_ARB_texture_float. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: don't signal _NEW_TEXTURE in TexSubImage() functionsBrian Paul2014-02-021-3/+9
| | | | | | | | | | | glTexSubImage(), glCopyTexSubImage() and glCompressedTexSubImage() only change the texel data, not other state like texture size or format. If a driver really needs do something special it can hook into the corresponding driver functions or Map/UnmapTextureImage(). This should avoid some needless state validation effort. Reviewed-by: Marek Olšák <[email protected]>
* mesa: make _mesa_get_proxy_target() staticBrian Paul2014-02-021-5/+5
| | | | | | Wasn't used in any other file. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove unused _mesa_select_tex_object() functionBrian Paul2014-02-021-22/+6
| | | | | | | The _mesa_get_current_tex_object() function is now used everywhere that _mesa_select_tex_object() was formerly used. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Allow depth = 0 parameter for TexImage3D.Kevin Rogovin2014-01-281-2/+2
| | | | | | | | | | Fixes the tests for the depth parameter for TexImage3D calls when the target type is GL_TEXTURE_2D_ARRAY or GL_TEXTURE_CUBE_MAP_ARRAY so that a depth value of 0 is accepted. Previously, the check incorrectly required the depth argument to be atleast 1. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix Type A _INT formats to MESA_FORMAT naming standardMark Mueller2014-01-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Replace Type A _INT formats names with _SINT to match naming spec, and update type C formats as follows: s/MESA_FORMAT_R_INT8\b/MESA_FORMAT_R_SINT8/g s/MESA_FORMAT_R_INT16\b/MESA_FORMAT_R_SINT16/g s/MESA_FORMAT_R_INT32\b/MESA_FORMAT_R_SINT32/g s/MESA_FORMAT_RG_INT8\b/MESA_FORMAT_RG_SINT8/g s/MESA_FORMAT_RG_INT16\b/MESA_FORMAT_RG_SINT16/g s/MESA_FORMAT_RG_INT32\b/MESA_FORMAT_RG_SINT32/g s/MESA_FORMAT_RGB_INT8\b/MESA_FORMAT_RGB_SINT8/g s/MESA_FORMAT_RGB_INT16\b/MESA_FORMAT_RGB_SINT16/g s/MESA_FORMAT_RGB_INT32\b/MESA_FORMAT_RGB_SINT32/g s/MESA_FORMAT_RGBA_INT8\b/MESA_FORMAT_RGBA_SINT8/g s/MESA_FORMAT_RGBA_INT16\b/MESA_FORMAT_RGBA_SINT16/g s/MESA_FORMAT_RGBA_INT32\b/MESA_FORMAT_RGBA_SINT32/g s/\bMESA_FORMAT_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_UNORM/g s/\bMESA_FORMAT_SIGNED_RED_RGTC1\b/MESA_FORMAT_R_RGTC1_SNORM/g s/\bMESA_FORMAT_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_UNORM/g s/\bMESA_FORMAT_SIGNED_RG_RGTC2\b/MESA_FORMAT_RG_RGTC2_SNORM/g s/\bMESA_FORMAT_L_LATC1\b/MESA_FORMAT_L_LATC1_UNORM/g s/\bMESA_FORMAT_SIGNED_L_LATC1\b/MESA_FORMAT_L_LATC1_SNORM/g s/\bMESA_FORMAT_LA_LATC2\b/MESA_FORMAT_LA_LATC2_UNORM/g s/\bMESA_FORMAT_SIGNED_LA_LATC2\b/MESA_FORMAT_LA_LATC2_SNORM/g
* mesa: Fix MESA_FORMAT names with ALPH, INTENSITY, and LUMINANCEMark Mueller2014-01-271-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compressed spelled out color components ALPHA, INTENSITY, and LUMINANCE to A, I, and L: s/MESA_FORMAT_ALPHA_UINT8\b/MESA_FORMAT_A_UINT8/g' s/MESA_FORMAT_ALPHA_UINT16\b/MESA_FORMAT_A_UINT16/g' s/MESA_FORMAT_ALPHA_UINT32\b/MESA_FORMAT_A_UINT32/g' s/MESA_FORMAT_ALPHA_INT32\b/MESA_FORMAT_A_SINT32/g' s/MESA_FORMAT_ALPHA_INT16\b/MESA_FORMAT_A_SINT16/g' s/MESA_FORMAT_ALPHA_INT8\b/MESA_FORMAT_A_SINT8/g' s/MESA_FORMAT_INTENSITY_UINT8\b/MESA_FORMAT_I_UINT8/g' s/MESA_FORMAT_INTENSITY_UINT16\b/MESA_FORMAT_I_UINT16/g' s/MESA_FORMAT_INTENSITY_UINT32\b/MESA_FORMAT_I_UINT32/g' s/MESA_FORMAT_INTENSITY_INT32\b/MESA_FORMAT_I_SINT32/g' s/MESA_FORMAT_INTENSITY_INT16\b/MESA_FORMAT_I_SINT16/g' s/MESA_FORMAT_INTENSITY_INT8\b/MESA_FORMAT_I_SINT8/g' s/MESA_FORMAT_LUMINANCE_UINT8\b/MESA_FORMAT_L_UINT8/g' s/MESA_FORMAT_LUMINANCE_UINT16\b/MESA_FORMAT_L_UINT16/g' s/MESA_FORMAT_LUMINANCE_UINT32\b/MESA_FORMAT_L_UINT32/g' s/MESA_FORMAT_LUMINANCE_INT32\b/MESA_FORMAT_L_SINT32/g' s/MESA_FORMAT_LUMINANCE_INT16\b/MESA_FORMAT_L_SINT16/g' s/MESA_FORMAT_LUMINANCE_INT8\b/MESA_FORMAT_L_SINT8/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT8\b/MESA_FORMAT_LA_UINT8/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT16\b/MESA_FORMAT_LA_UINT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_UINT32\b/MESA_FORMAT_LA_UINT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT32\b/MESA_FORMAT_LA_SINT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT16\b/MESA_FORMAT_LA_SINT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_INT8\b/MESA_FORMAT_LA_SINT8/g' s/MESA_FORMAT_ALPHA_FLOAT16\b/MESA_FORMAT_A_FLOAT16/g' s/MESA_FORMAT_ALPHA_FLOAT32\b/MESA_FORMAT_A_FLOAT32/g' s/MESA_FORMAT_INTESITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g' s/MESA_FORMAT_INTESITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g' s/MESA_FORMAT_INTENSITY_FLOAT16\b/MESA_FORMAT_I_FLOAT16/g' s/MESA_FORMAT_INTENSITY_FLOAT32\b/MESA_FORMAT_I_FLOAT32/g' s/MESA_FORMAT_LUMINANCE_FLOAT16\b/MESA_FORMAT_L_FLOAT16/g' s/MESA_FORMAT_LUMINANCE_FLOAT32\b/MESA_FORMAT_L_FLOAT32/g' s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16\b/MESA_FORMAT_LA_FLOAT16/g' s/MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32\b/MESA_FORMAT_LA_FLOAT32/g'