summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* main/format: skip format conversion if src and dst format are equalKarol Herbst2017-10-101-0/+14
| | | | | | | | | | | Fixes 'KHR-GL45.copy_image.functional' on Nouveau and i965. v2: (by Kenneth Graunke) Rewrite patch according to Jason Ekstrand's review feedback. This makes it handle differing strides, which i965 needed. Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Make _mesa_get_format_bytes handle array formats.Jason Ekstrand2017-10-101-0/+5
| | | | | | This is easier than making callers handle a bunch of special cases. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Alphabetize GL_MESA_tile_raster_order in the extensions list.Eric Anholt2017-10-101-1/+1
| | | | trivial, fixes make check.
* mesa: Implement a new GL_MESA_tile_raster_order extension.Eric Anholt2017-10-104-0/+55
| | | | | | | | | | | | | | The intent is to use this extension on vc4 to allow X11 to do overlapping CopyArea() within a pixmap without first blitting the pixmap to a temporary. With associated glamor patches, improves x11perf -copywinwin100 performance on a Raspberry Pi 3 from ~4700/sec to ~5130/sec, and is an even larger boost to uncomposited window movement performance (most copywinwin100 copies don't overlap). v2: Fix glIsEnabled() on the new enums. v3: Drop the local spec since I'm upstreaming the spec. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move _mesa_half_is_negative() to half_float.hBrian Paul2017-10-101-6/+0
| | | | | | | | v2: use !! in the function to be explicit about type conversion. Though, gcc generates the same code with or without the logical !!. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: move _mesa_exec_malloc/free() prototypes to their own headerBrian Paul2017-10-103-7/+38
| | | | | | | | Try to start removing things from the cluttered imports.h file. v2: add new header to Makefile.sources Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Set new renderbuffers to RGBA4 on all GLES contexts.Eric Anholt2017-10-101-1/+1
| | | | | | | | | Before we were doing RGBA4 on GLES3 only, but as of GLES2 2.0.22 it should be RGBA4 as well. Fixes DEQP functional.state_query.rbo.renderbuffer_internal_format. Tested-by: Matt Turner <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Expose GL_OES_required_internalformat on GLES contexts.Eric Anholt2017-10-104-38/+74
| | | | | | | | | | | | | | | | | | | | | | | This extension is effectively a backport of GLES3's internalformat handling to GLES 1/2. It guarantees that sized internalformats specified for textures and renderbuffers have at least the specified size stored. That's a pretty minimal requirement, so I think it can be dummy_true and exposed as a standard in Mesa. As a side effect, it also allows GL_RGB565 to be specified as a texture format, not just as a renderbuffer. Mesa had previously been allowing 565 textures, which angered DEQP in the absence of this extension being exposed. v2: Allow 2101010rev with sized internalformats even on GLES3, citing the extension spec. Extend extension checks for GLES2 contexts exposing with texture_float, texture_half_float, and texture_rg. v3: Fix ALPHA/LUMINANCE/LUMINANCE_ALPHA error checking (GLES3 CTS failures) v4: Mark GL_RGB10 non-color-renderable on ES, fix A/L/LA errors on GLES2 with float formats. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Only expose GLES's EXT_texture_type_2_10_10_10_REV if supported in HW.Eric Anholt2017-10-103-2/+4
| | | | | | | | | | | | Previously, we were downconverting to 8888 automatically if the hardware didn't suport it. However, with the advent of GL_OES_required_internalformat, we have to actually store the internalformats we advertise support for. And, it seems rather disingenuous to advertise the extension if we don't actually support it. v2: Throw an error when using the format on ES2 without the extension present. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Add X1B5G5R5 along with A1B5G5R5.Eric Anholt2017-10-104-0/+8
| | | | | | | | | | For supporting RGB5 in hardware with A in the low bit (vc4), we need this format as well. v2: Add proper _mesa_format_matches_format_and_type() support (from Nicolai). Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st/mesa: fix switching from surface-based to non-surface-based texturesNicolai Hähnle2017-10-102-5/+9
| | | | | | | | | This can happen with surface-based texture objects derived from EGL images, since those aren't immutable. Fixes tests in dEQP-EGL.functional.sharing.gles2.multithread.random.images.teximage2d.* and others Reviewed-by: Marek Olšák <[email protected]>
* meson: Build i965 and dri stackDylan Baker2017-10-091-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets pretty much the entire classic tree building, as well as i965, including the various glapis. There are some workarounds for bugs that are fixed in meson 0.43.0, which is due out on October 8th. I have tested this with piglit using glx. v2: - fix typo "vaule" -> "value" - use gtest dep instead of linking to libgtest (rebase error) - use gtest dep instead of linking against libgtest (rebase error) - copy the megadriver, then create hard links from that, then delete the megadriver. This matches the behavior of the autotools build. (Eric A) - Use host_machine instead of target_machine (Eric A) - Put a comment in the right place (Eric A) - Don't have two variables for the same information (Eric A) - Put pre_args at top of file in this patch (Eric A) - Fix glx generators in this patch instead of next (Eric A) - Remove -DMESON hack (Eric A) - add sha1_h to mesa in this patch (Eric A) - Put generators in loops when possible to reduce code in mapi/glapi/gen (Eric A) v3: - put HAVE_X11_PLATFORM in this patch Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: make glFramebuffer* check immutable texture level boundsKenneth Graunke2017-10-071-6/+14
| | | | | | | | | | | | | | When a texture is immutable, we can't tack on extra levels after-the-fact like we could with glTexImage. So check against that level limit and return an error if it's surpassed. This fixes: KHR-GL45.geometry_shader.layered_fbo.fb_texture_invalid_level_number (Based on a patch by Ilia Mirkin.) Reviewed-by: Antia Puentes <[email protected]> [imirkin v2] Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Use a 565 format for GL_RGB and GL_UNSIGNED_SHORT_5_6_5 textures.Kenneth Graunke2017-10-051-0/+3
| | | | | | | | | | Found while trying to optimize an application. Not observed to help performance on i965, but should at least reduce the memory usage of such textures a bit. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Eero Tamminen <[email protected]>
* mesa: silence 'variable may be used uninitialized' warning in teximage.cBrian Paul2017-10-031-1/+1
| | | | | | Found with MinGW optimized build. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: silence 'variable may be used uninitialized' warning in bufferobj.cBrian Paul2017-10-031-0/+1
| | | | | | Found with MinGW optimized build. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: Delete now unused dlopen.hMatt Turner2017-10-022-98/+0
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Drop Mesa_DXTn from gl_contextMatt Turner2017-10-027-61/+6
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Drop function pointer checks in s3tc codeMatt Turner2017-10-021-133/+60
| | | | | | | Now never null! Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Call DXTn functions directlyMatt Turner2017-10-021-92/+25
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Remove fprintf referring to libdxtnMatt Turner2017-10-021-1/+1
| | | | | | | | | When this file is included by Gallium, the fprintf causes it to fail to compile. This is an unreachable error case, and we shouldn't be calling fprintf directly. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Remove prototypes and mark S3TC functions staticMatt Turner2017-10-021-18/+5
| | | | | | | This file will be #included, so the functions should be static. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Remove commented-out DXTn fetch codeMatt Turner2017-10-021-80/+0
| | | | | | | Has been disabled for 12 years. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Combine libtxc_dxtn sources into texcompress_s3tc_tmp.hMatt Turner2017-10-024-303/+245
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Import libtxc_dxtn sourcesMatt Turner2017-10-023-0/+1141
| | | | | | | | Imported from master (commit ef07298391c6dcad843e0b13e985090c1dd76e76) of https://cgit.freedesktop.org/~mareko/libtxc_dxtn/ Acked-by: Nicolai Hähnle <[email protected]> Acked-by: Emil Velikov <[email protected]>
* mesa/main: R10G10B10_(A2) formats are not color renderable in ESNicolai Hähnle2017-10-021-2/+5
| | | | | | | | | | | | | The EXT_texture_type_2_10_10_10_REV (ES only) states the following issue: "1. Should textures specified with this type be renderable? UNRESOLVED: No. A separate extension could provide this functionality." This partially fixes dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.{rgb,rgba}_unsigned_int_2_10_10_10_rev Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: select the R10G10B10X2_UNORM internal format based on data typeNicolai Hähnle2017-10-021-1/+3
| | | | | | | ES requires it. This is a partial fix for dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev Reviewed-by: Marek Olšák <[email protected]>
* glsl: do not set the 'smooth' qualifier by default on ES shadersNicolai Hähnle2017-10-021-1/+7
| | | | | | | | | | | | It leads to surprising states with integer inputs and outputs on vertex processing stages (e.g. geometry stages). Instead, rely on the driver to choose smooth interpolation by default. We still allow varyings to match when one stage declares it as smooth and the other declares it without interpolation qualifiers. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: fix texture updates for ATI_fragment_shaderMarek Olšák2017-09-281-3/+5
| | | | | | Cc: 17.1 17.2 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: free current ComputeProgram state in _mesa_free_context_dataTapani Pälli2017-09-211-0/+2
| | | | | | | | | | | This is already done for other programs stages, fixes a leak when using compute programs. Signed-off-by: Tapani Pälli <[email protected]> Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102844 Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Deal with size differences between GLuint and GLhandleARB in ↵Jeremy Huddleston Sequoia2017-09-131-7/+15
| | | | | | | GetAttachedObjectsARB Signed-off-by: Jeremy Huddleston Sequoia <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: whitespace, formatting fixes in teximage.cBrian Paul2017-09-081-55/+55
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: provide more info in some texture image error messagesBrian Paul2017-09-081-9/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa/main: Fix GetTransformFeedbacki64 for glTransformFeedbackBufferBaseIago Toral Quiroga2017-09-071-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | The spec has special rules for querying buffer offsets and sizes when BindBufferBase is used, described in the OpenGL 4.6 spec, section 6.8 Buffer Object State: "To query the starting offset or size of the range of a buffer object binding in an indexed array, call GetInteger64i_v with target set to respectively the starting offset or binding size name from table 6.5 for that array. Index must be in the range zero to the number of bind points supported minus one. If the starting offset or size was not specified when the buffer object was bound (e.g. if it was bound with BindBufferBase), or if no buffer object is bound to the target array at index, zero is returned." Transform feedback buffer queries should follow the same rules, since it is the same case for them. There is a CTS test for this. Fixes: KHR-GL45.direct_state_access.xfb_buffers Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: allow user to set MESA_NO_ERROR=0Eric Engestrom2017-09-071-1/+2
| | | | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102530 Cc: Michel Dänzer <[email protected]> Cc: Alexandre Demers <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: replace date/time macros with MESA_GIT_SHA1Emil Velikov2017-09-061-3/+7
| | | | | | | | | | Former is non-deterministic, results in non-reproducible builds and compilers throw a warning about it. Cc: Rob Herring <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: don't use %s for PACKAGE_VERSION macroEmil Velikov2017-09-062-4/+4
| | | | | | | | | | | | The macro itself is a well defined string, which cannot cause issues with printf or other printf-like functions. All other places through Mesa already use it directly, so let's update the final two instances. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa/main: Fix GetTextureImage error reportingIago Toral Quiroga2017-09-061-1/+1
| | | | | | | | | | | | | | | | | GetTex*Image should return INVALID_ENUM if target is not valid, however, GetTextureImage does not receive a target, and instead should return INVALID_OPERATION if the effective target is not valid. From the OpenGL 4.6 core profile spec, section 8.11 Texture Queries: "An INVALID_OPERATION error is generated by GetTextureImage if the effective target is not one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_RECTANGLE, or TEXTURE_CUBE_MAP (for GetTextureImage only)." Fixes: KHR-GL45.direct_state_access.textures_image_query_errors Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/mtypes: repack gl_sampler_object.Dave Airlie2017-09-061-1/+1
| | | | | | | | 160->152. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: repack gl_texture_object.Dave Airlie2017-09-061-5/+5
| | | | | | | | reduces size from 1144 to 1128. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: repack gl_shader_program_data.Dave Airlie2017-09-061-3/+3
| | | | | | | | This reduces the size from 144 bytes to 128 bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: reorganise gl_shaderDave Airlie2017-09-061-4/+5
| | | | | | | | | | This reduces this from 200->182 bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: repack display list structs.Dave Airlie2017-09-061-3/+2
| | | | | | | | This reduces each of these by 8 bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: reduce size of gl_sync_object.Dave Airlie2017-09-061-1/+1
| | | | | | | | Drops from 40->32 bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: reorg vertex/fragment program state.Dave Airlie2017-09-061-6/+6
| | | | | | | | reduces both of these by 8 bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/bindless: reorder gl_bindless_image gl_bindless_sampler.Dave Airlie2017-09-061-6/+6
| | | | | | | | This makes these use 16-bytes instead of 24-bytes. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* util: move string_to_uint_map to glslEmil Velikov2017-08-292-2/+2
| | | | | | | | | | | | | | | | | | The functionality is used by glsl and mesa. With the latter already depending on the former. With this in place the src/util/ static library libmesautil.la no longer has a C++ dependency. Thus objects which use it (like libEGL) don't need the C++ link. Cc: "17.2" <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851 Signed-off-by: Emil Velikov <[email protected]> Suggested-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mike Lothian <[email protected]> Tested-by: James Harvey <[email protected]>
* mesa: Implement GL_ARB_polygon_offset_clampAdam Jackson2017-08-257-13/+11
| | | | | | | | | | | Semantically identical to the EXT version (whose string is still valid for GLES), so rename the bit but expose both extension strings. (Suggested by Ilia Mirkin and Ian Romanick.) v3: Fix the entrypoint alias in GL4x.xml (Ilia) Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Implement GL_ARB_texture_filter_anisotropicAdam Jackson2017-08-254-1/+4
| | | | | | | | | | | The only difference from the EXT version is bumping the minmax to 16, so just hit all the drivers at once. v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add KHR_no_error support to glBindBufferOffsetEXT()Samuel Pitoiset2017-08-252-0/+14
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>