summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* mesa: Move START/END_FAST_MATH macros to their only use.Matt Turner2015-02-231-79/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove definition of NULL.Matt Turner2015-02-231-4/+0
| | | | | | If your stdlib.h doesn't define this you should fix your stdlib.h. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-2360-330/+319
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: Remove CHECK macro.Matt Turner2015-02-231-6/+0
| | | | | | | There's some commentary about how it's defined by other "modules", and maybe that was true in 2000 when the code was added. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove dead CAPI define.Matt Turner2015-02-231-5/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Adds missing error condition in _mesa_check_sample_count()Eduardo Lima Mitev2015-02-231-3/+4
| | | | | | | | | | | | This corrects a trivial error introduced in commit 19252fee46b835cb4f6b1cce18d7737d62b64a2e. That patch was merged recently and omits one condition (that 'samples' is greater than zero) in one of the error checks. That error will definitely cause regressions. Also corrects the reference to the specification above the error check, which was wrongly quoting OpenGL instead of OpenGL-ES. Reviewed-by: Martin Peres <[email protected]>
* mesa: don't enable NV_fragment_program_option with swrastRoland Scheidegger2015-02-211-1/+0
| | | | | | | | | | Since dropping some NV_fragment_program opcodes (commits 868f95f1da74cf6dd7468cba1b56664aad585ccb, a3688d686f147f4252d19b298ae26d4ac72c2e08) we can no longer parse all opcodes necessary for this extension, leading to bugs (https://bugs.freedesktop.org/show_bug.cgi?id=86980). Hence don't announce support for it in swrast (no other driver enabled it). (Note that remnants of some NV_fp/vp extensions remain, they could be dropped but are required as hacks for getting viewperf11 catia to run.)
* mesa: Have configure define NDEBUG, not mtypes.h.Matt Turner2015-02-201-3/+0
| | | | | | | | | | | | mtypes.h had been defining NDEBUG (used by assert) if DEBUG was not defined. Confusing and bizarre that you don't get NDEBUG if you don't include mtypes.h. ... which is just what happened in commit bef38f62e. Let's let configure define this for us if not using --enable-debug. Reviewed-by: Kenneth Graunke <[email protected]>
* util: Move Mesa's bitset.h to util/.Eric Anholt2015-02-203-101/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Make bitset.h not rely on Mesa-specific types and functions.Eric Anholt2015-02-201-4/+3
| | | | | | | | | | Note that we can't use u_math.h's align() because it's a function instead of a macro, while BITSET_DECLARE needs a constant expression for nouveau's usage in global declarations. v2: Stick some parens around the bits macro argument usage (review by Jose). Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Use u_math.h from macros.hEric Anholt2015-02-201-17/+1
| | | | | | | | | | This avoids duplication of some macros and other definitions across the tree. Note that COPY_4FV switches from a memcpy-based implementation to an assignment of 4 floats. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Check that draw buffers are valid for glDrawBuffers on GLES3Eduardo Lima Mitev2015-02-201-0/+14
| | | | | | | | | | | | | Section 4.2 (Whole Framebuffer Operations) of the OpenGL 3.0 specification says: "Each buffer listed in bufs must be BACK, NONE, or one of the values from table 4.3 (NONE, COLOR_ATTACHMENTi)". Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.draw_buffers Reviewed-by: Matt Turner <[email protected]>
* mesa: Adds check for integer internal format and num samples in ↵Eduardo Lima Mitev2015-02-191-0/+10
| | | | | | | | | | | | | glRenderbufferStorageMultisample Per GLES3 specification, section 4.4 Framebuffer objects page 198, "If internalformat is a signed or unsigned integer format and samples is greater than zero, then the error INVALID_OPERATION is generated.". Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.renderbuffer_storage_multisample Reviewed-by: Matt Turner <[email protected]>
* mesa: Returns correct error values from gl(Get)SamplerParameter*() on GL-ES 3.0+Eduardo Lima Mitev2015-02-191-12/+60
| | | | | | | | | | | | | | | | | | | '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states: "An INVALID_OPERATION error is generated if sampler is not the name of a sampler object previously returned from a call to GenSamplers." In desktop GL, an GL_INVALID_VALUE is returned instead. Fixes 6 dEQP failing tests: * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameterfv * dEQP-GLES3.functional.negative_api.shader.sampler_parameteri * dEQP-GLES3.functional.negative_api.shader.sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.sampler_parameterf * dEQP-GLES3.functional.negative_api.shader.sampler_parameterfv Reviewed-by: Matt Turner <[email protected]>
* mesa: add double uniform support. (v5)Dave Airlie2015-02-193-30/+204
| | | | | | | | | | | | | | | | This adds support for the new uniform interfaces from ARB_gpu_shader_fp64. v2: support ARB_separate_shader_objects ProgramUniform*d* (Ian) don't allow boolean uniforms to be updated (issue 15) (Ian) v3: fix size_mul v4: Teach uniform update to take into account double precision (Topi) v5: add transpose for double case (Ilia) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add ARB_gpu_shader_fp64 extension info (v2)Dave Airlie2015-02-192-0/+2
| | | | | | | | | | | This just adds the entries to extensions.c and mtypes.h v2: use core profile only (Ian) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* glapi: add ARB_gpu_shader_fp64 (v2)Dave Airlie2015-02-193-35/+319
| | | | | | | | | | | | | | | Just add the xml file covering this extension, and dummy interface files in mesa, and fix up sanity tests. v2: Enable ProgramUniform*d* from ARB_separate_shader_objects (Ian) use 40 instead of 43 for dispatch_sanity.cpp (Chris) uncomment PU sanity tests. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nir: Add a nir_shader_compiler_options struct pointed to by the shaders.Eric Anholt2015-02-181-0/+2
| | | | | | | | | This will be used to give the optimization passes a chance to customize behavior for the particular target device. v2: Rebase to master (no TGSI->NIR present) Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* mesa: Add support for the ARB_pipeline_statistics_query extensionBen Widawsky2015-02-174-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | This was originally part of a single patch which added the extension, and implemented it for i965 classic. For information about the evolution of the patch, please see the subsequent commit. One difference here as compared to the original mega patch is this does build support for the compute shader query. Since it cannot be tested on any platform, it will always return NULL for now. Jordan has already written a patch to address this, and when that patch lands, this logic can be modified. v2: Fix typo in subject (Brian Paul) Add checks for desktop gl (Ilia) Fail for any callers for now (Ilia) Update QueryCounterBits for new tokens (Ilia) Jordan: Use _mesa_has_compute_shaders Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> v3: Rebased on patch which adds the proper information to unstub tessellation shaders. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add _mesa_has_compute_shadersJordan Justen2015-02-171-0/+11
| | | | | | | | | | v2 (Ben): Change GLboolean to bool as requested by Ian Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Ben Widawsky <[email protected]>
* mesa: Add ARB_tessellation_shader to extension table.Fabian Bieler2015-02-172-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* Make _mesa_swizzle_and_convert argument types in .c match those in .hAlan Coopersmith2015-02-171-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]>
* main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.Laura Ekstrand2015-02-171-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]>
* mesa/main: Silence unused parameter warningIan Romanick2015-02-173-12/+0
| | | | | | | | | | | | | Just remove the _mesa_free_lighting_data function. The body has been empty since the shine table was moved into the tnl module (commit ba1d921). main/light.c:1216:46: warning: unused parameter 'ctx' [-Wunused-parameter] _mesa_free_lighting_data( struct gl_context *ctx ) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: implement GL_AMD_pinned_memoryMarek Olšák2015-02-173-2/+39
| | | | | | | | | | | | | | It's not possible to query the current buffer binding, because the extension doesn't define GL_..._BUFFER__BINDING_AMD. Drivers should check the target parameter of Drivers.BufferData. If it's equal to GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, the memory should be pinned. That's all there is to it. A piglit test is on the piglit mailing list. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Christian König <[email protected]>
* mesa: fix AtomicBuffer typo in _mesa_DeleteBuffersMarek Olšák2015-02-171-1/+1
| | | | | Cc: 10.5 10.4 10.3 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: move assertion after declarations in texstore.cBrian Paul2015-02-161-1/+1
| | | | To fix MSVC build.
* mesa: silence uninitialized var warning in get_tex_rgba_uncompressed()Brian Paul2015-02-161-2/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix element count for byte-swaps in texstore, readpix and texgetimageIago Toral Quiroga2015-02-163-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]>
* mesa: Handle transferOps in texstore_rgbaIago Toral Quiroga2015-02-161-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]>
* mesa: fix OES_texture_float texture render target behaviorTapani Pälli2015-02-131-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]>
* mesa: Bump MAX_IMAGE_UNIFORMS to 32.Francisco Jerez2015-02-101-1/+1
| | | | | | So the i965 driver can expose 32 image uniforms per shader stage. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rename the CEILING() macro to DIV_ROUND_UP().Francisco Jerez2015-02-103-3/+3
| | | | | | | | | | Some people have complained that code using the CEILING() macro is difficult to understand because it's not immediately obvious what it is supposed to do until you go and look up its definition. Use a more descriptive name that matches the similar utility macro in the Linux kernel. Reviewed-by: Matt Turner <[email protected]>
* mesa: Make renderbuffer FBO attachments not layeredJames Legg2015-02-081-0/+1
| | | | | | | | | | | | For framebuffer completeness checks, consider renderbuffers as not layered. Previously, they would have counted as layered if a layered textured had previously been bound to the same attachment point. This could cause framebuffer completeness checks to incorrectly fail with GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS, even if no layered attachments were present. Reviewed-by: Chris Forbes <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89026
* 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]>