summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* 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'
* mesa: Change many Type P MESA_FORMATs to meet naming specMark Mueller2014-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion of Type P formats as follows (w/related comment fixes): s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g Conflicts: src/mesa/drivers/dri/i965/brw_surface_formats.c src/mesa/main/format_pack.c src/mesa/main/format_unpack.c src/mesa/main/formats.c src/mesa/main/texformat.c src/mesa/main/texstore.c
* mesa: Change many Type A MESA_FORMATs to meet naming standardMark Mueller2014-01-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update comments. Conversion of the following Type A formats: s/MESA_FORMAT_RGB888\b/MESA_FORMAT_BGR_UNORM8/g s/MESA_FORMAT_BGR888\b/MESA_FORMAT_RGB_UNORM8/g s/MESA_FORMAT_A8\b/MESA_FORMAT_A_UNORM8/g s/MESA_FORMAT_A16\b/MESA_FORMAT_A_UNORM16/g s/MESA_FORMAT_L8\b/MESA_FORMAT_L_UNORM8/g s/MESA_FORMAT_L16\b/MESA_FORMAT_L_UNORM16/g s/MESA_FORMAT_I8\b/MESA_FORMAT_I_UNORM8/g s/MESA_FORMAT_I16\b/MESA_FORMAT_I_UNORM16/g s/MESA_FORMAT_R8\b/MESA_FORMAT_R_UNORM8/g s/MESA_FORMAT_R16\b/MESA_FORMAT_R_UNORM16/g s/MESA_FORMAT_Z16\b/MESA_FORMAT_Z_UNORM16/g s/MESA_FORMAT_Z32\b/MESA_FORMAT_Z_UNORM32/g s/MESA_FORMAT_S8\b/MESA_FORMAT_S_UINT8/g s/MESA_FORMAT_SRGB8\b/MESA_FORMAT_BGR_SRGB8/g s/MESA_FORMAT_RGBA_16\b/MESA_FORMAT_RGBA_UNORM16/g s/MESA_FORMAT_SL8\b/MESA_FORMAT_L_SRGB8/g s/MESA_FORMAT_Z32_FLOAT\b/MESA_FORMAT_Z_FLOAT32/g s/MESA_FORMAT_XBGR16161616_UNORM\b/MESA_FORMAT_RGBX_UNORM16/g s/MESA_FORMAT_XBGR16161616_SNORM\b/MESA_FORMAT_RGBX_SNORM16/g s/MESA_FORMAT_XBGR16161616_FLOAT\b/MESA_FORMAT_RGBX_FLOAT16/g s/MESA_FORMAT_XBGR16161616_UINT\b/MESA_FORMAT_RGBX_UINT16/g s/MESA_FORMAT_XBGR16161616_SINT\b/MESA_FORMAT_RGBX_SINT16/g s/MESA_FORMAT_XBGR32323232_FLOAT\b/MESA_FORMAT_RGBX_FLOAT32/g s/MESA_FORMAT_XBGR32323232_UINT\b/MESA_FORMAT_RGBX_UINT32/g s/MESA_FORMAT_XBGR32323232_SINT\b/MESA_FORMAT_RGBX_SINT32/g s/MESA_FORMAT_XBGR8888_UINT\b/MESA_FORMAT_RGBX_UINT8/g s/MESA_FORMAT_XBGR8888_SINT\b/MESA_FORMAT_RGBX_SINT8/g
* mesa: Rename 4 color component unsigned byte MESA_FORMATsMark Mueller2014-01-271-1/+1
| | | | | | | | | | | | | Change all 4 color component unsigned byte formats to meet spec for P Type formats: s/MESA_FORMAT_RGBA8888\b/MESA_FORMAT_A8B8G8R8_UNORM/g s/MESA_FORMAT_RGBA8888_REV\b/MESA_FORMAT_R8G8B8A8_UNORM/g s/MESA_FORMAT_ARGB8888\b/MESA_FORMAT_B8G8R8A8_UNORM/g s/MESA_FORMAT_ARGB8888_REV\b/MESA_FORMAT_A8R8G8B8_UNORM/g s/MESA_FORMAT_RGBX8888\b/MESA_FORMAT_X8B8G8R8_UNORM/g s/MESA_FORMAT_RGBX8888_REV\b/MESA_FORMAT_R8G8B8X8_UNORM/g s/MESA_FORMAT_XRGB8888\b/MESA_FORMAT_B8G8R8X8_UNORM/g s/MESA_FORMAT_XRGB8888_REV\b/MESA_FORMAT_X8R8G8B8_UNORM/g
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-13/+13
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* mesa: Validate internalFormat with target in glTexStorage pathsIan Romanick2014-01-271-1/+3
| | | | | | | | | Fixes the glTexStorage3D failure in ext_packed_depth_stencil-depth-stencil-texture and oes_packed_depth_stencil-depth-stencil-texture_gles2. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor internalFormat / target checks to a separate functionIan Romanick2014-01-271-40/+70
| | | | | | | | | We need almost identical code in the glTexStorage path. v2: Fix typo in a comment noticed by Topi. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Generate the correct error for a depth format with a 3D textureIan Romanick2014-01-271-3/+17
| | | | | | | | | | | | | | | All versions of the OpenGL spec are quite clear that GL_INVALID_OPERATION should be generated. I added a quotation from the 3.3 core profile spec. Fixes the glTexImage3D subcases of ext_packed_depth_stencil-depth-stencil-texture and oes_packed_depth_stencil-depth-stencil-texture_gles2. The same subtests of oes_packed_depth_stencil-depth-stencil-texture_gles1 fail, but they fail with a different wrong error code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Define helper function to get the number of texture layers.Francisco Jerez2014-01-151-0/+87
| | | | | | | | | | | And to check if it can have layers at all. This will be used by the implementation of ARB_shader_image_load_store. v2: Fix constness of texobj argument, use assert and return reasonable default rather than calling unreachable() in default switch case. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Clean up bad code formatting left from previous commitIan Romanick2013-12-201-7/+7
| | | | | | | Also s/_EXT// on enums that are now part of core. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_packed_depth_stencil is not optionalIan Romanick2013-12-201-2/+0
| | | | | | | | Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add API/extension checks for 3-component texture buffer formatsBrian Paul2013-12-181-7/+14
| | | | | | | | | | The GL_RGB32F, GL_RGB32UI and GL_RGB32I texture buffer formats are only supposed to be allowed if the GL_ARB_texture_buffer_object_rgb32 extension is supported. Note that the texture buffer extensions require a core profile. This patch adds those checks. Fixes the soon-to-be-added arb_clear_buffer_object-negative-bad-internalformat piglit test.
* mesa: get_texbuffer_format(): differentiate between core and compat contextPi Tabred2013-12-181-80/+87
| | | | | | | | alpha, lumincance and intensity formats are illegal in a core context. Add a check to return MESA_FORMAT_NONE if one of those is requested within a core context. Reviewed-by: Brian Paul <[email protected]>
* mesa: Modify format validation to check for extension not context versionPi Tabred2013-12-181-7/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Make validate_texbuffer_format function available externallyPi Tabred2013-12-181-3/+4
| | | | | | | - change storage class from static to extern - rename validate_texbuffer_format to _mesa_validate_texbuffer_format Reviewed-by: Brian Paul <[email protected]>
* mesa: Update TexStorage to support ARB_texture_viewCourtney Goeltzenleuchter2013-12-131-0/+6
| | | | | | | | | | | Call TextureView helper function to set TextureView state appropriately for the TexStorage calls. Misc updates from review feedback. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use a single enable for GL_EXT_texture_array and GL_MESA_texture_arrayIan Romanick2013-12-041-21/+8
| | | | | | | | | | | Every driver that enables one also enables the other. The difference between the two is MESA adds support for fixed-function and assembly fragment shaders, but EXT only adds support for GLSL. The MESA extension was created back when Mesa did not support GLSL. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: resolve typo DTXn/DXTnEmil Velikov2013-12-031-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* mesa: change glTexImage[23]DMultisample() internalformat to GLenumBrian Paul2013-10-161-2/+2
| | | | | | To match glext.h and the GL_ARB_texture_multisample extension. However, the GL 4.0 spec and man page say it's GLint. An OpenGL spec bug will be filed.
* mesa: consolidate cube width=height error checkingBrian Paul2013-10-161-38/+5
| | | | | | | | | | | | | | | Instead of checking width==height in four places, just do it in _mesa_legal_texture_dimensions() where we do the other width, height, depth checks. Similarly, move the check that cube map array depth is a multiple of 6. This change also fixes some missing cube dimension checks for the glTexStorage[23]D() functions. Remove width==height assertion in _mesa_get_tex_max_num_levels() since that's called before the other size checks for glTexStorage. Cc: "9.2" <[email protected]>
* mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().Kenneth Graunke2013-09-261-3/+3
| | | | | | | Every caller passed true. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove handcounted magic numberDylan Noblesmith2013-09-241-13/+20
| | | | | | Also make it a compile-time error with STATIC_ASSERT. Reviewed-by: Kenneth Graunke <[email protected]>