summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* main: Complete error conditions for glInvalidate*Framebuffer.Laura Ekstrand2015-05-201-1/+19
| | | | | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit b4368ac09db75cea412121ada6c12af1414feb50)
* main: Fix an error generated by FramebufferTextureLaura Ekstrand2015-05-201-4/+13
| | | | | | | | | | | | | gl*FramebufferTexture should generate GL_INVALID_VALUE when the texture doesn't exist. [Fredrik: Split this change out from the next commit] Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit 69bdc9dcb8e5d3648e8d96029d5988b8971de8dc)
* mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0Fredrik Höglund2015-05-201-0/+12
| | | | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit 8ba7ad8abc7d71131e17970203c991ccb1befbe6)
* main: Require that the texture exists in framebuffer_textureFredrik Höglund2015-05-201-1/+1
| | | | | | | | | Generate GL_INVALID_OPERATION if the texture hasn't been created. Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit f9f5c822845698482d0d81eaa64bc13c2fd8852a)
* main: glGetIntegeri_v fails for GL_VERTEX_BINDING_STRIDEMarta Lofstedt2015-05-201-0/+1
| | | | | | | | | | | The return type for GL_VERTEX_BINDING_STRIDE is missing, this cause glGetIntegeri_v to fail. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit 4a8cd2799c2467b9916dd0ba672f05a394aa9b9f)
* mesa: fix shininess check for ffvertex_prog v2Tim Rowley2015-05-201-1/+1
| | | | | | | | | Switch to using VERT_BIT_GENERIC macro, as varying_vp_inputs is a bitmask. Reviewed-by: Ilia Mirkin <[email protected]> Cc: [email protected] (cherry picked from commit ce01c0af70f2475fbbb1c3ab90d43a19047abc5c)
* main: Fix target checking for CopyTexSubImage*D.Laura Ekstrand2015-03-071-8/+54
| | | | | | | | | | | | | | This fixes a dEQP test failure. In the test, glCopyTexSubImage2D was called with target = 0 and failed to throw INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx, target) being called before the target checking. To remedy this, target checking was separated from the main error-checking function and called prior to _mesa_get_current_tex_object. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89312 Reviewed-by: Anuj Phogat <[email protected]> (cherry picked from commit ca65764d6042d2ea220a1e3952490f79c226f3e0)
* main: Fix target checking for CompressedTexSubImage*D.Laura Ekstrand2015-03-071-15/+65
| | | | | | | | | | | | | | This fixes a dEQP test failure. In the test, glCompressedTexSubImage2D was called with target = 0 and failed to throw INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx, target) being called before the target checking. To remedy this, target checking was made into its own function and called prior to _mesa_get_current_tex_object. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89311 Reviewed-by: Anuj Phogat <[email protected]> (cherry picked from commit 549078cb5a95e0ee381d036b8c36bc41506f21bc)
* main/base_tex_format: Properly handle STENCIL_INDEX1/4/16Jason Ekstrand2015-03-071-0/+3
| | | | | | | | | This takes "fbo-stencil blit GL_STENCIL_INDEX1/4/16" from crash to pass on BDW. Cc: 10.5 <[email protected]> Reviewed-by: Matt Turner <[email protected]> (cherry picked from commit c4925d7f3b66d63fbdd7b7607cd809db1e58bee9)
* mesa: Correct backwards NULL check.Matt Turner2015-03-071-1/+1
| | | | | | | Cc: "10.4, 10.5" <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit 491d42135ad0e5670756216154f2ba9fc79d4ba7)
* mesa: Free memory allocated for luminance in readpixels.Matt Turner2015-03-071-0/+1
| | | | | | | Cc: "10.4, 10.5" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> (cherry picked from commit 87109acbed9c9b52f33d58ca06d9048d0ac7a215)
* mesa: Indent break statements and add a missing one.Matt Turner2015-03-071-5/+6
| | | | | | | | | Always indenting break statements makes spotting missing ones easier. Cc: "10.4, 10.5" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> (cherry picked from commit 2b2fa1865248c6e3b7baec81c4f92774759b201f)
* mesa: rename format_info.c to format_info.hEmil Velikov2015-03-021-1/+1
| | | | | | | | | | The file is auto-generated, and #included by formats.c. Let's rename it to reflect the latter. This will also help up fix the dependency tracking by adding it to the _SOURCES variable, without the side effect of it being compiled (twice). Cc: "10.4, 10.5" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* mesa/main: update .gitignoreEmil Velikov2015-03-021-3/+1
| | | | | | Drop the no longer present get_es{1,2}.c from the list. Signed-off-by: Emil Velikov <[email protected]>
* mesa: Fix error validating args for TexSubImage3DEduardo Lima Mitev2015-02-241-2/+2
| | | | | | | | | | | | | | The zoffset and depth values were not being considered when calling error_check_subtexture_dimensions(). Fixes 2 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_offset * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_invalid_offset Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit 2aa71e9485a5a062b1bd2dd8bdc081a8fa4c873d)
* Make _mesa_swizzle_and_convert argument types in .c match those in .hAlan Coopersmith2015-02-241-2/+2
| | | | | | | | | | | Caused Solaris Studio compilers to fail to build with errors about incompatible function redefinitions. Signed-off-by: Alan Coopersmith <[email protected]> Cc: "10.5" <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit b7ce7c00e35ceb3518d932359ed52cacd6679acb)
* main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.Laura Ekstrand2015-02-241-2/+2
| | | | | | | | | | | | Previously array textures were not working with GetCompressedTextureImage, leading to failures in the test arb_direct_state_access/getcompressedtextureimage.c. Tested-by: Laura Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.4, 10.5" <[email protected]> (cherry picked from commit 92163482bda87216764edc0beca3ca090678038d)
* mesa: fix AtomicBuffer typo in _mesa_DeleteBuffersMarek Olšák2015-02-241-1/+1
| | | | | | Cc: 10.5 10.4 10.3 <[email protected]> Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit e8625a29fe0942af2876f0684b06c6ed01939227)
* mesa: Fix element count for byte-swaps in texstore, readpix and texgetimageIago Toral Quiroga2015-02-243-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some old format conversion code in pack.c implemented byte-swapping like this: GLint comps = _mesa_components_in_format(dstFormat); GLint swapSize = _mesa_sizeof_packed_type(dstType); if (swapSize == 2) _mesa_swap2((GLushort *) dstAddr, n * comps); else if (swapSize == 4) _mesa_swap4((GLuint *) dstAddr, n * comps); where n is the pixel count. But this is incorrect for packed formats, where _mesa_sizeof_packed_type is already returning the size of a pixel instead of the size of a single component, so multiplying this by the number of components in the format results in a larger element count for _mesa_swap than we want. Unfortunately, we followed the same implementation for byte-swapping in the rewrite of the format conversion code for texstore, readpixels and texgetimage. This patch computes the correct element counts for _mesa_swap calls by computing the bytes per pixel in the image and dividing that by the swap size to obtain the number of swaps required per pixel. Then multiplies that by the number of pixels in the image to obtain the swap count that we need to use. Also, when handling byte-swapping in texstore_rgba, we were ignoring the image's depth. This patch fixes this too. Reviewed-by: Jason Ekstrand <[email protected]> Cc: "10.5" <[email protected]> (cherry picked from commit ba426522dddf0860f59dedfe9953dbd509160c7d)
* mesa: Handle transferOps in texstore_rgbaIago Toral Quiroga2015-02-241-5/+52
| | | | | | | | | | In the recent rewrite of the format conversion code we did not handle this. This patch adds the missing support. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068 Reviewed-by: Jason Ekstrand <[email protected]> Cc: "10.5" <[email protected]> (cherry picked from commit 4b249d2eed686384d6d7c36f3232360891d5eeda)
* mesa: fix OES_texture_float texture render target behaviorTapani Pälli2015-02-241-0/+12
| | | | | | | | | | | | | | | | | | Current implementation allowed usage of unsized type texture GL_FLOAT and GL_HALF_FLOAT as a render target as this was 'expected behavior' by WEBGL_oes_texture_float and is also allowed by the oes-texture-float WebGL test. However this broke some ES3 conformance tests that do not accept such behavior. Patch sets such an fbo incomplete as expected by the ES3 conformance tests. Textures with sized types like RGBA32F will still continue to work as render targets. v2: code style cleanups (Ian Romanick, Matt Turner) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88905 Reviewed-by: Ian Romanick <[email protected]> Cc: "10.5" <[email protected]> (cherry picked from commit e333035c47a6a4cc88f0f9ca2bced500538bebae)
* mesa: Fix _mesa_format_convert fallback path when src is not an array formatIago Toral Quiroga2015-02-041-2/+2
| | | | | | | | | | | When a rebase swizzle is provided and we call _mesa_swizzle_and_convert after unpacking the source format we were always passing normalized=false. We should pass true or false depending on the formats involved in the conversion for the byte and float paths (the integer path cannot ever be normalized). Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mark Janes <[email protected]>
* mesa: Returns a GL_INVALID_VALUE error on several APIs when buffer size is ↵Eduardo Lima Mitev2015-02-033-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | negative Section 2.3.1 (Errors) of the OpenGL 4.5 spec says: "If a negative number is provided where an argument of type sizei or sizeiptr is specified, an INVALID_VALUE error is generated. This patch adds checks for negative buffer size values passed to different APIs. It also moves up the check on other APIs that already had it, making it the first error check performed in the function, for consistency. While there may be other APIs throughtout the code lacking this check (or at least not at the beginning of the function), this patch focuses on the cases that break the dEQP tests listed below. It could be a good excersize for the future to check all other cases, and improve consistency in the order of the checks throughout the whole Mesa code base. This fixes 5 dEQP test: * dEQP-GLES3.functional.negative_api.state.get_attached_shaders * dEQP-GLES3.functional.negative_api.state.get_shader_source * dEQP-GLES3.functional.negative_api.state.get_active_uniform * dEQP-GLES3.functional.negative_api.state.get_active_attrib * dEQP-GLES3.functional.negative_api.shader.program_binary Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix error value in GetFramebufferAttachmentParameteriv for OpenGL ES 3.0Samuel Iglesias Gonsalvez2015-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Section 6.1.13 "Framebuffer Object Queries" of OpenGL ES 3.0 spec: "If the default framebuffer is bound to target, then attachment must be BACK, identifying the color buffer; DEPTH, identifying the depth buffer; or STENCIL, identifying the stencil buffer." OpenGL ES 3.0, section 2.5 (GL Errors): "If a command that requires an enumerated value is passed a symbolic constant that is not one of those specified as allowable for that command, an INVALID_ENUM error is generated." Then change the returned error to INVALID_ENUM. Fixes: dEQP-GLES3.functional.fbo.api.attachment_query_default_fbo Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow querying for GL_PRIMITIVE_RESTART_FIXED_INDEX under GLES 3Eduardo Lima Mitev2015-02-031-0/+1
| | | | | | | | | | | | | | GLES 3.0.0 spec introduces context state PRIMITIVE_RESTART_FIXED_INDEX (2.8.1 Transferring Array Elements, page 26) which is not currently possible to query using glGet*() funcs. Fixes 4 dEQP tests: * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getboolean * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getinteger * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getinteger64 * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getfloat Reviewed-by: Ian Romanick <[email protected]>
* mesa: add support for GL_EXT_polygon_offset_clampIlia Mirkin2015-02-029-13/+70
| | | | | | | | | | Nothing enables the extension yet, but the values are now available. The spec calls for it to only be exposed for GL 3.3+, which is core-only in mesa. Instead we allow any driver to enable it, including in a compat context for any GL version. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
* glapi: add GL_EXT_polygon_offset_clampIlia Mirkin2015-02-023-1/+13
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
* DD: Refactor BlitFramebuffer.Laura Ekstrand2015-02-024-7/+14
| | | | | | | | | In preparation for glBlitNamedFramebuffer, the DD table function BlitFramebuffer needs to accept two arbitrary framebuffer objects rather than assuming ctx->ReadBuffer and ctx->DrawBuffer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Add STENCIL_INDEX formats to base_tex_formatJason Ekstrand2015-01-301-0/+10
| | | | | | | | This fixes a bug on BDW when our meta-based stencil blit path assert-fails due to an invalid internal format even though we do support the ARB_stencil_texturing extension. Reviewed-by: Matt Turner <[email protected]>
* teximage: Don't indent switch casesJason Ekstrand2015-01-301-146/+146
| | | | | | No functional change. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove some dead display list codeBrian Paul2015-01-301-80/+11
| | | | | | | The size of a Node is always four bytes so no need for the old code that was used when sizeof(Node)==8. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove stale comment in dlist.c codeBrian Paul2015-01-301-1/+1
| | | | | | sizeof(Node) is always 4 bytes. Reviewed-by: Matt Turner <[email protected]>
* mesa: s/union gl_dlist_node/Node/ in dlist.c codeBrian Paul2015-01-301-3/+3
| | | | | | Just minor clean-up. Reviewed-by: Matt Turner <[email protected]>
* mesa: fix display list 8-byte alignment issueBrian Paul2015-01-302-6/+70
| | | | | | | | | | | | | | | | | | | | | The _mesa_dlist_alloc() function is only guaranteed to return a pointer with 4-byte alignment. On 64-bit systems which don't support unaligned loads (e.g. SPARC or MIPS) this could lead to a bus error in the VBO code. The solution is to add a new _mesa_dlist_alloc_aligned() function which will return a pointer to an 8-byte aligned address on 64-bit systems. This is accomplished by inserting a 4-byte NOP instruction in the display list when needed. The only place this actually matters is the VBO code where we need to allocate a 'struct vbo_save_vertex_list' which needs to be 8-byte aligned (just as if it were malloc'd). The gears demo and others hit this bug. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88662 Cc: "10.4" <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* Mesa: Add support for HALF_FLOAT_OES type.Kalyan Kondapally2015-01-294-6/+52
| | | | | | | | | This patch adds needed support for accepting HALF_FLOAT_OES as valid type for TexImage*D and TexSubImage*D when Texture FLoat extensions are supported. Signed-off-by: Kevin Rogovin <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Mesa: Add support for GL_OES_texture_*float* extensions.Kalyan Kondapally2015-01-294-0/+132
| | | | | | | | | | | | | | | | | | | This patch series adds support for following GLES2 Texture Float extensions: 1)GL_OES_texture_float, 2)GL_OES_texture_half_float, 3)GL_OES_texture_float_linear, 4)GL_OES_texture_half_float_linear. This patch adds basic infrastructure and needed boolean flags to advertise support for these extensions, by default the support is disabled. Next patch in the series introduces support for HALF_FLOAT_OES token. v4: take assert away and make valid_filter_for_float conditional (Tapani), fix the alphabetical order (Emil) Signed-off-by: Kevin Rogovin <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Move simple_list.h to src/util.Eric Anholt2015-01-285-214/+4
| | | | | | We have two copies of it in the tree, I'm going to delete one. Reviewed-by: Marek Olšák <[email protected]>
* Revert "util: Move the alternate fpclassify implementation to util"Jason Ekstrand2015-01-281-1/+50
| | | | | | | | | | | | | This reverts commits d6eb572905e39c36168b8f5da240af961f9dde0a and 58e8468d113c7d3d4a59ea4a8d70fd45b78e85e6. This is no longer necessary as we aren't using it in NIR anymore. Also, it broke the build on some strange systems so let's put it back in querymatrix where it came from. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88852 Acked-by: Matt Turner <[email protected]>
* util: Move the alternate fpclassify implementation to utilJason Ekstrand2015-01-281-50/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: improve error messaging for format CSV parserTapani Pälli2015-01-282-2/+7
| | | | | | | | Patch adds 2 error messages that point user directly to fix mispelled or impossible swizzle field for a format. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: simplify detection of fpclassifyFelix Janda2015-01-261-11/+7
| | | | | | Fixes compilation with musl libc. Reviewed-by: Ian Romanick <[email protected]>
* formats: Use a hash table for _mesa_format_from_array_formatJason Ekstrand2015-01-221-12/+56
| | | | | | | | | | | Going through the for loop every time has noticable overhead. This fixes things up so we only do that once ever and then just do a hash table lookup which should be much cheaper. v2 Jason Ekstrand <[email protected]>: - Use once_flag and call_once from c11/threads.h instead of pthreads Reviewed-by: Neil Roberts <[email protected]>
* mesa/dd: Add a function for creating a texture from a buffer objectJason Ekstrand2015-01-221-0/+16
| | | | Reviewed-by: Neil Roberts <[email protected]>
* mesa: change assert to unreachable in two format functionsTobias Klausmann2015-01-212-2/+2
| | | | | | | | | | This fixes two problems reported by osc: I: Program returns random data in a function E: Mesa no-return-in-nonvoid-function ../../src/mesa/main/format_utils.c:180 E: Mesa no-return-in-nonvoid-function ../../src/mesa/main/glformats.c:2714 Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Tobias Klausmann <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-2114-34/+33
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix a trivial spelling mistakeMartin Peres2015-01-191-1/+1
| | | | | Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: support GL_RGB for GL_EXT_texture_type_2_10_10_10_REVTapani Pälli2015-01-194-0/+6
| | | | | | | | | | | | | | | | | Commit 8ec6534 changed texture upload path and the way how texture format is being checked, this commit adds support for GL_RGB with GL_UNSIGNED_INT_2_10_10_10_REV as specified by the extension EXT_texture_type_2_10_10_10_REV specification. This fixes regression in ES3 conformance test ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels v2: add MESA_FORMAT_R10G10B10X2_UNORM format (Iago Toral) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88385 Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Add ARB_shader_precision infrastructureMicah Fedke2015-01-192-0/+2
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* format_utils: Use a more precise conversion when decreasing bitsNeil Roberts2015-01-161-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting to a format that has fewer bits the previous code was just shifting off the bits. This doesn't provide very accurate results. For example when converting from 8 bits to 5 bits it is equivalent to doing this: x * 32 / 256 This works as if it's taking a value from a range where 256 represents 1.0 and scaling it down to a range where 32 represents 1.0. However this is not correct because it is actually 255 and 31 that represent 1.0. We can do better with a formula like this: (x * 31 + 127) / 255 The +127 is to make it round correctly. The new code has a special case to use uint64_t when the result of the multiplication would overflow an unsigned int. This function is inline and only ever called with constant values so hopefully the if statements will be folded. The main incentive to do this is to make the CPU conversion path pick the same values as the hardware would if it did the conversion. This fixes failures with the ‘texsubimage pbo’ test when using the patches from here: http://lists.freedesktop.org/archives/mesa-dev/2015-January/074312.html v2: Use 64-bit arithmetic when src_bits+dst_bits > 32 Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: move GET_CURRENT_CONTEXT() to top of _mesa_init_renderbuffer()Brian Paul2015-01-151-1/+2
| | | | | | To fix MSVC build. Reviewed-by: Matt Turner <[email protected]>