summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/teximage: restrict GL_ETC1_RGB8_OES support to GLESNanley Chery2015-09-151-1/+2
| | | | | | | | | | | According to the extensions table and our glext headers, OES_compressed_ETC1_RGB8_texture is only supported in GLES1 and GLES2. Since we may give users a GLES3 context when a GLES2 context is requested, we also allow this extension for GLES3 as well. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/extensions: restrict GL_OES_EGL_image to GLESNanley Chery2015-09-151-2/+1
| | | | | | | | Driver vendors do this as well. The extension specification lists GLES 1.1 or 2.0 as requirements. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/extensions: restrict luminance alpha formats to API_OPENGL_COMPATNanley Chery2015-09-152-4/+6
| | | | | | | According the GL 3.1 spec, luminance alpha formats are deprecated. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: add infra for ARB_shader_texture_image_samplesIlia Mirkin2015-09-102-0/+2
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Resolve GCC missing field initializer warning.Rhys Kidd2015-09-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve a series of missing field initializer warnings within get_hash_params.py Of the form: In file included from mesa/src/mesa/main/get.c:495:0: mesa/src/mesa/main/get_hash.h:180:5: warning: missing initializer for field 'extra' of 'const struct value_desc' [-Wmissing-field-initializers] { GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES, LOC_CUSTOM, TYPE_INT, 0 }, ^ mesa/src/mesa/main/get.c:165:15: note: 'extra' declared here const int *extra; ^ This patch addresses some likely code rot around the *extra field, where the initialization is via C code generated indirectly from a Python script. It resolves a number of warnings reported by GCC when configured to be pedantic. $ gcc --version gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 No piglit regressions on Ironlake. v2: - Squash series into a single patch. Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Jan Vesely <[email protected]> Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Allow query of GL_VERTEX_BINDING_BUFFERMarta Lofstedt2015-09-091-0/+8
| | | | | | | | | | According to OpenGL ES 3.1 specification table : 20.2 and OpenGL specification 4.4 table 23.4. The glGetIntegeri_v functions should report the name of the buffer bound when called with GL_VERTEX_BINDING_BUFFER. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Enable GL_MAX_VERTEX_ATTRIB enums for GLES 3.1Marta Lofstedt2015-09-091-7/+7
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/tests: Remove unneeded X11_CFLAGSJon TURNEY2015-09-071-1/+0
| | | | | | | | | | | | X11_CFLAGS is never defined. Path to X11 headers is not needed here, so just remove. Future work: Using AM_CFLAGS here looks wrong, as this Makefile only builds C++ files Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: change 'SHADER_SUBST' facility to work with env variablesTapani Pälli2015-09-041-38/+101
| | | | | | | | | | | | | | | | | | | Patch modifies existing shader source and replace functionality to work with environment variables rather than enable dumping on compile time. Also instead of _mesa_str_checksum, _mesa_sha1_compute is used to avoid collisions. Functionality is controlled via two environment variables: MESA_SHADER_DUMP_PATH - path where shader sources are dumped MESA_SHADER_READ_PATH - path where replacement shaders are read v2: cleanups, add strerror if fopen fails, put all functionality inside HAVE_SHA1 since sha1 is required Signed-off-by: Tapani Pälli <[email protected]> Suggested-by: Eero Tamminen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/pbo: Handle zero width, height or depth when validating accessNeil Roberts2015-09-031-0/+6
| | | | | | | | | | | | | | | It's legal to call glTexSubImage with zero values for the width, height or depth. Previously this was breaking the PBO access validation because it tries to work out the last pixel accessed by getting the pixel at height-1 and depth-1 which would end up with bogus values. This was causing GL errors to be generated during the Piglit texsubimage test, although the test was passing anyway. v2: Also check for width == 0. Don't validate the start pointer if any of the dimensions are zero. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Don't allow wrong type setters for matrix uniformsIan Romanick2015-09-021-0/+25
| | | | | | | | | | | | | Previously we would allow glUniformMatrix4fv on a dmat4 and glUniformMatrix4dv on a mat4. Both are illegal. That later also overwrites the storage for the mat4 and causes bad things to happen. Should fix the (new) arb_gpu_shader_fp64-wrong-type-setter piglit test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Cc: Dave Airlie <[email protected]> Cc: "10.6 11.0" <[email protected]>
* mesa: Pass the type to _mesa_uniform_matrix as a glsl_base_typeIan Romanick2015-09-023-42/+42
| | | | | | | | | | | | This matches _mesa_uniform, and it enables the bug fix in the next patch. v2: s/type/basicType/ in the assert in _mesa_uniform_matrix. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> [v1] Cc: Dave Airlie <[email protected]> Cc: "10.6 11.0" <[email protected]>
* mesa: Silence unused parameter warnings in bufferobj.cIan Romanick2015-09-021-0/+2
| | | | | | | | | | | | | | main/bufferobj.c: In function 'count_buffer_size': main/bufferobj.c:520:26: warning: unused parameter 'key' [-Wunused-parameter] count_buffer_size(GLuint key, void *data, void *userData) ^ main/bufferobj.c: In function 'flush_mapped_buffer_range_fallback': main/bufferobj.c:740:56: warning: unused parameter 'index' [-Wunused-parameter] gl_map_buffer_index index) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Remove target parameter from _mesa_handle_bind_buffer_genIan Romanick2015-09-023-7/+4
| | | | | | | | | | main/bufferobj.c: In function '_mesa_handle_bind_buffer_gen': main/bufferobj.c:915:37: warning: unused parameter 'target' [-Wunused-parameter] GLenum target, ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/readpixels: check strides are equal before skipping conversionDave Airlie2015-09-021-1/+2
| | | | | | | | | | | | | The CTS packed_pixels test checks that readpixels doesn't write into the space between rows, however we fail that here unless we check the format and stride match. This fixes all the core mesa problems with CTS packed_pixels tests. Cc: "11.0" <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* texcompress_s3tc/fxt1: fix stride checks (v1.1)Dave Airlie2015-09-022-5/+5
| | | | | | | | | | | | | | | | | | The fastpath currently checks the RowLength != width, but if you have a RowLength of 7, and Alignment of 4, then that shouldn't match. align the rowlength to the pack alignment before comparing. This fixes compressed cases in CTS packed_pixels_pixelstore test when SKIP_PIXELS is enabled, which causes row length to get set. v1.1: add fxt1 fix (Iago) Cc: "11.0" <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/formats: 8-bit channel integer formats additionDave Airlie2015-09-024-0/+60
| | | | | | | | | Add enough 8-bit channel formats to handle all the different things CTS throws at us. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/formats: add some formats from GL3.3Dave Airlie2015-09-024-0/+111
| | | | | | | | | | | | | | | | GL3.3 added GL_ARB_texture_rgb10_a2ui, which specifies a lot more things than just rgb10/a2ui. While playing with ogl conform one of the tests must attempted all valid formats for GL3.3 and hits the unreachable here. This adds the first chunk of formats that hit the assert. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: handle SwapBytes in compressed texture get code.Dave Airlie2015-09-021-0/+7
| | | | | | | | This case just wasn't handled, so add support for it. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix SwapBytes handling in numerous placesDave Airlie2015-09-025-49/+82
| | | | | | | | | | | | | | | | | | | In a number of places the SwapBytes handling didn't handle cases with GL_(UN)PACK_ALIGNMENT set and 7 byte width cases aligned to 8 bytes. This adds a common routine to swap bytes a 2D image and uses this code in: texture storage texture get readpixels swrast drawpixels. [airlied: updated with Brian's nitpicks]. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: Move gl_vert_attrib from mtypes.h to shader_enums.hJason Ekstrand2015-09-011-107/+0
| | | | | | It is a shader enum after all... Acked-by: Brian Paul <[email protected]>
* mesa: Limit Framebuffer Parameter OpenGL ES 3.1 usageMarta Lofstedt2015-09-011-1/+17
| | | | | | | | | | | | | | | According to OpenGL ES 3.1 specification, section 9.2.1 for glFramebufferParameter and section 9.2.3 for glGetFramebufferParameteriv: "An INVALID_ENUM error is generated if pname is not FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT, FRAMEBUFFER_DEFAULT_SAMPLES, or FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS." Therefore exclude OpenGL ES 3.1 from using the GL_FRAMEBUFFER_DEFAULT_LAYERS parameter. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Kevin Rogovin <kevin.rogovin at intel.com>
* mesa: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1Marta Lofstedt2015-09-013-8/+8
| | | | | | | V2: Conform to new standard for exposing enums for OpenGL ES 3.1. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/glformats: recognize ASTC formats as color formatsNanley Chery2015-08-311-0/+28
| | | | | | | ASTC formats contain RGBA components. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/texformat: use format conversion function in _mesa_choose_tex_formatvulkan-protex-2015.09.24.r01-baseNanley Chery2015-08-311-81/+13
| | | | | | | | | | | This function's cases for non-generic compressed formats duplicate the GL to MESA translation in _mesa_glenum_to_compressed_format(). This patch replaces the switch cases with a call to the translation function. This change teaches this function about ASTC, thus enabling ASTC for glTex*Storage*() calls. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/texcompress: correct mapping of S3TC formats in conversion functionNanley Chery2015-08-311-2/+2
| | | | | | | | | MESA_FORMAT_RGBA_DXT5 should actually be reserved for GL_RGBA[4]_DXT5_S3TC. Also, Gallium and other dri drivers (radeon and nouveau) follow this mapping scheme. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: return old name for deleted samplers for SAMPLER_BINDING queriesDaniel Scharrer2015-08-281-10/+1
| | | | | | | | | | | | | If the sampler object has been deleted in the same context the binding will have been cleared. If it has been deleted in another context, the spec does not say what should returned. None of the other binding point queries check for deletion in another context. Also, as names of deleted objects are free for reuse, the current code didn't even work reliably. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: add missing queries for ARB_direct_state_accessDaniel Scharrer2015-08-282-0/+98
| | | | | | | | | | | This adds index queries (glGet*i_v) for GL_TEXTURE_BINDING_* and GL_SAMPLER_BINDING, as well as textue queries (glGetTex{,ture}Parameter*) for GL_TEXTURE_TARGET. CC: "10.6 11.0" <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: fix dispatch sanity with GL_OES_texture_storage_multisample_2d_arrayIlia Mirkin2015-08-281-0/+3
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91785 Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Matt Turner <[email protected]>
* mesa: rename rowStride to imageStride in texturesubimage()Brian Paul2015-08-271-4/+4
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: only copy the requested teximage facesIlia Mirkin2015-08-271-2/+2
| | | | | | | | | | | | | | Cube maps are special in that they have separate teximages for each face. We handled that by copying the data to them separately, but in case zoffset != 0 or depth != 6 we would read off the end of the client array or modify the wrong images. zoffset/depth have already been verified by the time the code gets to this stage, so no need to double-check. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.6 11.0" <[email protected]>
* mesa: enable enums for OES_texture_storage_multisample_2d_arrayTapani Pälli2015-08-273-5/+6
| | | | | | | | | v2: use _mesa_is_gles31(ctx) for verifying we are on ES 3.1, remove _es31 usage from get_hash_params.py Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Add extension enable for OES_texture_storage_multisample_2d_arrayTapani Pälli2015-08-271-0/+1
| | | | | | | | v2: use ARB_texture_multisample bit to enable extension Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: return bool instead of GLboolean in compressedteximage_only_format()Nanley Chery2015-08-261-3/+3
| | | | | | | | | In agreement with the coding style, functions that aren't directly visible to the GL API should prefer the use of bool over GLboolean. Suggested-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/macros: move ALIGN_NPOT to macros.hNanley Chery2015-08-261-0/+10
| | | | | | | | | | | Aligning with a non-power-of-two number is a general task that can be used in various places. This commit is required for the next one. v2: add greater than 0 assertion (Anuj). convert the macro to a static inline function. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/macros: add power-of-two assertions for alignment macrosNanley Chery2015-08-261-2/+12
| | | | | | | | | | | | | ALIGN and ROUND_DOWN_TO both require that the alignment value passed into the macro be a power of two in the comments. Using software assertions verifies this to be the case. v2: use static inline functions instead of gcc-specific statement expressions (Brian). v3: fix indendation (Brian). v4: add greater than zero requirement (Anuj). Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/teximage: return the base internal format of the ASTC formatsNanley Chery2015-08-261-0/+4
| | | | | | | | | | | | | | | | | This is necesary to initialize the gl_texture_image struct. From the KHR_texture_compression_astc_ldr spec: "Added to Section 3.8.6, Compressed Texture Images Add the tokens specified above to Table 3.16, Compressed Internal Formats. In all cases, the base internal format will be RGBA. The encoding allows images to be encoded with fewer channels, but this is always presented as RGBA to the sampler." v2. use _mesa_is_astc_format(). Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/teximage: accept ASTC formats for 3D texture specificationNanley Chery2015-08-261-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ASTC spec was revised as follows: Revision 2, April 28, 2015 - added CompressedTex{Sub,}Image3D to commands accepting ASTC format tokens in the New Tokens section [...]. Support only exists in the HDR submode: Add a second new column "3D Tex." which is empty for all non-ASTC formats. If only the LDR profile is supported by the implementation, this column is also empty for all ASTC formats. If both the LDR and HDR profiles are supported only, this column is checked for all ASTC formats. LDR-only systems should generate an INVALID_OPERATION error when attempting to call CompressedTexImage3D with the TEXTURE_3D target. v2. return the proper error for LDR-only systems. v3. update is_astc_format(). v4. use _mesa_is_astc_format(). v5. place logic in _mesa_target_can_be_compressed. v6. fix issues handling ASTC formats. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/texcompress: enable translation between MESA and GL ASTC formatsNanley Chery2015-08-261-0/+114
| | | | | | | v3. conform the ASTC MESA_FORMAT enums to the existing naming convention. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/glformats: recognize ASTC formats as compressedNanley Chery2015-08-261-0/+29
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: add ASTC extensions to the extensions tableNanley Chery2015-08-262-0/+4
| | | | | | | | v2: alphabetize the extensions. remove OES ASTC extension. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: don't enable online compression for ASTC formatsNanley Chery2015-08-265-4/+80
| | | | | | | | | | | | | In agreement with the ASTC spec, this makes calls to TexImage*D unsuccessful. Implied by the spec, Generate[Texture]Mipmap and [Copy]Tex[Sub]Image*D calls must be unsuccessful as well. v2. actually force attempts to compress online to fail. v3. indentation (Matt). v4. update copytexture_error_check to account for CopyTexImage*D (Chad). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: define the 2D ASTC formatsNanley Chery2015-08-264-0/+108
| | | | | | | | | | | | | Define the mesa formats and make changes necessary for compilation without errors. Also add support for _mesa_get_srgb_format_linear(). v2. conform the ASTC MESA_FORMAT enums to the existing naming convention. v3. remove ASTC cases for _mesa_get_uncompressed_format(). This function is only used for generating mipmaps - something ASTC formats do not support due to lack of online compression. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: remove pointless es31 checks, fix indirect to only be in es31Ilia Mirkin2015-08-262-60/+25
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: uncomment checks in es31 computation, add texture_msIlia Mirkin2015-08-261-2/+4
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: create multisample fallback textures like normal texturesMarek Olšák2015-08-261-0/+2
| | | | | | | | | This works if drivers upsample on upload (like all radeon ones do). The alternative is an unexpected GL error from anything calling _mesa_update_state and possibly other issues. Cc: 10.6 11.0 <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: GetTexLevelParameter{if}v changes for OpenGL ES 3.1Tapani Pälli2015-08-261-6/+18
| | | | | | | | | | | | | Patch refactors existing parameters check to first check common enums between desktop GL and GLES 3.1 and modifies get_tex_level_parameter_image to be compatible with enums specified in 3.1. v2: remove extra is_gles31() checks (suggested by Ilia) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> (v1) Reviewed-by: Marta Lofstedt <[email protected]> (v1) Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/es3.1: Allow GL_COMPUTE_WORK_GROUP_SIZE for OpenGL ES 3.1Marta Lofstedt2015-08-261-1/+1
| | | | | | | | | According to OpenGL ES specification section 7.12, GL_COMPUTE_WORK_GROUP_SIZE, is supported by the glGetProgramiv function. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Enable getting MAX_COMPUTE_WORK_GROUP_ values for OpenGL ES 3.1Marta Lofstedt2015-08-261-2/+2
| | | | | | | | | According to the OpenGL ES 3.1 specification chapter 17, the MAX_COMPUTE_WORK_GROUP_COUNT and MAX_COMPUTE_WORK_GROUP_SIZE is available for glGetIntegeri_v. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/formats: pass correct parameter to _mesa_is_format_compressedDave Airlie2015-08-261-1/+1
| | | | | | | | | | | | | | commit 26c549e69d12e44e2e36c09764ce2cceab262a1b Author: Nanley Chery <[email protected]> Date: Fri Jul 31 10:26:36 2015 -0700 mesa/formats: remove compressed formats from matching function caused a regression in my CTS testing, this looks like a clear thinko. Reviewed-by: Nanley Chery <[email protected]> sSigned-off-by: Dave Airlie <[email protected]>