summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* st/mesa: implement BlitFramebuffer using gallium blitMarek Olšák2012-09-301-2/+2
| | | | | | | | This also fixes a lot tests, especially all the clip-and-scissor-blit MSAA piglit tests. Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: move _mesa_error_check_format_and_type() to glformats.cBrian Paul2012-07-241-367/+0
| | | | | Now all the format/type-related helper functions are in glformats.c and image.c is just image-related functions.
* mesa: move more format helper functions to glformats.cBrian Paul2012-07-241-368/+1
|
* mesa: move some format helper functions to glformats.cBrian Paul2012-07-241-395/+0
|
* mesa: add glformats integer type/format detection routinesJordan Justen2012-07-211-76/+0
| | | | | | | | | | | | _mesa_is_integer_format is moved to formats.c and renamed as _mesa_is_enum_format_integer. _mesa_is_format_unsigned, _mesa_is_type_integer, _mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer are added. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibilityMarek Olšák2012-07-131-0/+1
| | | | | | | | | | This was not implemented, because the spec was changed just recently. Everything has been in place already. Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV caseBrian Paul2012-02-131-0/+9
| | | | | | in _mesa_error_check_format_and_type(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967
* mesa: new _mesa_error_check_format_and_type() functionBrian Paul2012-02-071-62/+154
| | | | | | | | | | | | | | | | | | | | This replaces the _mesa_is_legal_format_and_type() function. According to the spec, some invalid format/type combinations to glDrawPixels, ReadPixels and glTexImage should generate GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION. With the old function we didn't make that distinction and generated GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION. The new function returns one of those errors or GL_NO_ERROR. This will also let us remove some redundant format/type checks in follow-on commit. v2: add more checks for ARB_texture_rgb10_a2ui at the top of _mesa_error_check_format_and_type() per Ian. Signed-off-by: Brian Paul <[email protected]>
* mesa: allow exposing GL3 without EXT_texture_integerMarek Olšák2012-01-251-4/+8
| | | | | | | | | | | Strictly speaking, it's not legal to expose EXT_texture_integer without EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4 is available without checking for it). The check in compute_version is removed as well, because that's already covered by GLSLVersion >= 130. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing integer R/RG cases to _mesa_is_color_format().Eric Anholt2012-01-241-0/+12
| | | | | | | | | This is part of fixing Intel oglconform negative.typeFormatMismatch.copyteximage. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.Dave Airlie2011-12-101-0/+4
| | | | | | | | | | | This just adds the correct checks and asserts in the right places. This doesn't fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly. I'm not sure how much of that could be templated/shared will have a look once I write it the long way. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add _mesa_image_offset()nobled2011-12-081-17/+50
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa/image: assert on bad formatnobled2011-12-081-11/+9
| | | | | | | | | | | | | | | | | NULL as an error indicator is meaningless, since it will return NULL on success anyway if the caller passes in zero as the image's address and asks to calculate the offset of the first pixel. For example, _mesa_validate_pbo_access() does this. This also matches the code in the non-GL_BITMAP codepath, which already has an assert like this. v2: Per Brian Paul's review, remove the function call entirely and tighten the assert to only accept the two formats compatible with GL_BITMAP. They always have one component per pixel. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/image: delete dead storenobled2011-12-081-7/+0
| | | | | | The return value here is a) always zero, b) never used. Reviewed-by: Brian Paul <[email protected]>
* mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()Brian Paul2011-12-081-1/+7
| | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add support for GL_OES_compressed_ETC1_RGB8_textureChia-I Wu2011-12-021-0/+3
| | | | | | | | | | | Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa. There is no driver support yet. Unlike desktop GL compressed texture formats, GLES compressed texture formats usually can only be used with glCompressedTexImage2D. All other gl*Tex*Image* functions are updated to check for that. Reviewed-by: Brian Paul <[email protected]>
* mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().Eric Anholt2011-11-291-1/+0
| | | | | | | | | | | | | | | | | There was only one consumer of this API, meta.c, which was intending to ask "is this format just stencil index (and nothing else)?". Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type formats, it would just try to draw the stencil parts. Nothing good came of this. This function looks rather silly at this point, but I'm leaving it in place to be the obvious parallel API to _mesa_is_depth_format(). Note that if you want the old behavior, you should use it as (_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is commonly done for depth-related tests. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move _mesa_base_format_has_channel() into image.cBrian Paul2011-11-281-0/+87
| | | | | | This is where other format-related functions live. Reviewed-by: Eric Anholt <[email protected]>
* mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.Dave Airlie2011-11-281-0/+2
| | | | | | | | | | | | | | This format is used in the ARB_texture_rgb10_a2ui spec. It adds core mesa support, texformat + texstore support, format_unpack and fbobject.c (all patches from list merged + fixed up). also fixes some whitespace issues. Parts were: Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* image/pack: fix missing GL_BGR(A)_INTEGER support.Dave Airlie2011-11-281-0/+2
| | | | | | | These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* image: fix legal types for packed integer formats.Dave Airlie2011-11-271-2/+4
| | | | | | | | | After reading ARB_texture_rgb10_a2ui it appears the packed formats for integer types are only specified via this extension, and not via the original ones. So condition the checks on this. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Include R/RG integer textures in _mesa_is_integer_format.Eric Anholt2011-11-151-0/+12
| | | | | | | | Fixes some spurious GL errors in the upcoming gl-3.0-required-sized-formats piglit test. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: new BYTE/SHORT_TO_FLOATZ() macrosBrian Paul2011-11-151-16/+0
| | | | | | | Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new ones with different names. These macros preserve zero when converting. Reviewed-by: Eric Anholt <[email protected]>
* mesa: move CEILING() macro into macros.hBrian Paul2011-11-151-3/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: consolidate cases in _mesa_components_in_format()Brian Paul2011-11-151-28/+12
| | | | | | and _mesa_sizeof_packed_type() Reviewed-by: Eric Anholt <[email protected]>
* 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: Add GL_OES_compressed_paletted_texture formats to ↵Ian Romanick2011-09-191-0/+13
| | | | | | | | _mesa_is_compressed_format Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Jin Yang <[email protected]>
* mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.Dave Airlie2011-09-141-6/+2
| | | | | | | | | This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as suggested by Brian. It uses it in a few places I noticed from previous color changes, and also some core mesa places. I haven't updated other places yet. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Remove all mention of GL_COLOR_INDEX*_EXTIan Romanick2011-09-061-27/+0
| | | | | | | | These enums were only valid with the paletted texture extensions. This allows a couple other trivial clean-ups. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: initial ARB_depth_buffer_float supportMarek Olšák2011-07-101-2/+16
| | | | | | | Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there. The spec says the type is n/a. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: implement EXT_packed_floatMarek Olšák2011-04-291-0/+11
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: implement EXT_texture_shared_exponentMarek Olšák2011-04-291-0/+11
| | | | | | | | | swrast support done. There is no renderbuffer support in swrast, because it's not required by the extension. Reviewed-by: Brian Paul <[email protected]>
* mesa: initial EXT_texture_snorm supportMarek Olšák2011-03-291-3/+25
| | | | | The component ordering of some formats has been been reversed to match Gallium types.
* mesa: add ATI_texture_compression_3dcMarek Olšák2011-03-081-0/+3
| | | | | | | LUMINANCE_ALPHA_LATC2 = LUMINANCE_ALPHA_3DC, so this is easy. Note that there is no specification for 3DC, just a few white papers from ATI.
* mesa: add EXT_texture_compression_latcMarek Olšák2011-03-081-0/+9
| | | | | | | | | | | | | | | | | The encoding/decoding algorithms are shared with RGTC. Thanks to some magic with the base format, the RGTC texstore functions work for LATC too. swrast passes the related piglit tests besides two things: - The alpha channel is wrong (it's always 1), however the incorrect alpha channel makes some other tests fail too, so I guess it's unrelated to LATC. - Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]), however RGTC has the same problem. Further testing (with other of my patches) shows that hardware drivers and softpipe work. BTW, ETQW uses this extension.
* mesa: fix comments for _mesa_clip_readpixels()Brian Paul2011-02-171-2/+2
|
* mesa: fix mipmap generation for MESA_FORMAT_AL44Marek Olšák2011-02-161-0/+3
| | | | This was missed when implementing AL44.
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee2011-01-051-0/+1
| | | | | | Directly include mtypes.h if a file uses a gl_context struct. This allows future removal of headers that are not strictly necessary but indirectly include mtypes.h for a file.
* mesa: Fix GL_FIXED arrays.Chia-I Wu2010-12-091-0/+2
| | | | It is broken since 433e5e6defc85d8b1d6262aff990e3f5a8b37027.
* mesa: remove stray GL_FLOAT case in _mesa_is_legal_format_and_type()Brian Paul2010-11-071-1/+0
|
* mesa: additional integer formats in _mesa_bytes_per_pixel()Brian Paul2010-10-281-4/+8
|
* mesa: add const qualifier to _mesa_is_legal_format_and_type()Brian Paul2010-10-281-1/+2
|
* mesa: fix integer cases in _mesa_is_legal_format_and_type()Brian Paul2010-10-281-1/+65
| | | | Some integer formats work with some packed datatypes.
* mesa: Remove unnecessary header.Vinson Lee2010-10-271-1/+0
|
* mesa: additional switch cases for GL_EXT_texture_integerBrian Paul2010-10-251-2/+87
|
* mesa: split up the image.c fileBrian Paul2010-10-231-4363/+0
| | | | | | New files: pack.c - image/row packing/unpacking functions pixeltransfer.c - pixel scale/bias/lookup functions
* mesa: add missing cases for packing red/green imagesBrian Paul2010-10-211-0/+48
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-26/+26
|