summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: split extensions overrides and glGetString(GL_EXTENSIONS)Emil Velikov2017-11-163-20/+15
| | | | | | | | | | | | | Currently we apply the extension overrides and construct the extensions string upon MakeCurrent. They are two distinct things, so let's slit the two while pushing the overrides management _before_ _mesa_compute_version(). This ensures that the version is updated to reflect the enabled/disabled extensions. Cc: Jordan Justen <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: minor tidy up for memory object error stringsAndres Rodriguez2017-11-141-16/+14
| | | | | Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: enable ARB_texture_buffer_* extensions in the Compatibility profileMarek Olšák2017-11-095-21/+19
| | | | | | | | | | | | | | We already have piglit tests testing alpha, luminance, and intensity formats. They were skipped by piglit until now. Additionally, I'm enabling one ARB_texture_buffer_range piglit test to run with the compat profile. i965 behavior is unchanged except that it doesn't expose TBOs in the Compat profile. Not sure how that affects the GL version override. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/program: add hw atomic counter fileDave Airlie2017-11-101-0/+1
| | | | | | | | | This is needed for the GLSL->TGSI translation for hw atomic counters. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-By: Gert Wollny <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: s/GLint/gl_buffer_index/ for _ColorDrawBufferIndexesBrian Paul2017-11-094-15/+16
| | | | | | | Also fix local variable declarations and replace -1 with BUFFER_NONE. No Piglit changes. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: s/GLint/gl_buffer_index/ for _ColorReadBufferIndexBrian Paul2017-11-091-1/+1
| | | | | | BUFFER_NONE is -1 so no reason for GLint. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: minor reformatting, add const to gl_external_samplers()Brian Paul2017-11-091-1/+4
| | | | | | This function should probably be moved elsewhere, too. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: flush and wait after creating a fallback textureNicolai Hähnle2017-11-091-0/+5
| | | | | | | | Fixes non-deterministic failures in dEQP-EGL.functional.sharing.gles2.multithread.simple_egl_sync.images.texture_source.teximage2d_render and others in dEQP-EGL.functional.sharing.gles2.multithread.* Reviewed-by: Marek Olšák <[email protected]>
* mesa: increase MaxServerWaitTimeoutNicolai Hähnle2017-11-091-1/+1
| | | | | | | | | | | | The current value was introduced in commit a27180d0d8666, which claims that it represents ~1.11 years. However, it is interpreted in nanoseconds, so it actually only represents ~9.8 hours. That seems a bit short. Use the largest value consistent with both int32 and int64. It corresponds to ~292 years in nanoseconds. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: use simple mtx in core mesaTimothy Arceri2017-11-0912-73/+74
| | | | | | | | | Results from x11perf -copywinwin10 on Eric's SKL: 4.33338% ± 0.905054% (n=40) Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Yogesh Marathe <[email protected]>
* mesa: rework how we free gl_shader_program_dataTimothy Arceri2017-11-092-42/+16
| | | | | | | | | | | | | | | | When I introduced gl_shader_program_data one of the intentions was to fix a bug where a failed linking attempt freed data required by a currently active program. However I seem to have failed to finish hooking up the final steps required to have the data hang around. Here we create a fresh instance of gl_shader_program_data every time we link. gl_program has a reference to gl_shader_program_data so it will be freed once the program is no longer active. Cc: "17.2 17.3" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Neil Roberts <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102177
* glsl: drop cache_fallbackTimothy Arceri2017-11-092-17/+13
| | | | | | | | | | This turned out to be a dead end, it is much easier and less error prone to just cache the IR used by the drivers backend e.g. TGSI or NIR. Cc: "17.2 17.3" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix deleting the dummy ATI_fsMiklós Máté2017-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DummyShader is used by GenFragmentShadersATI() as a placeholder to mark IDs as allocated. Context cleanup wants to delete everything in ctx->Shared->ATIShaders, and crashes on these placeholders with this backtrace: ==15060== Invalid free() / delete / delete[] / realloc() ==15060== at 0x482F478: free (vg_replace_malloc.c:530) ==15060== by 0x57694F4: _mesa_delete_ati_fragment_shader (atifragshader.c:68) ==15060== by 0x58B33AB: delete_fragshader_cb (shared.c:208) ==15060== by 0x5838836: _mesa_HashDeleteAll (hash.c:295) ==15060== by 0x58B365F: free_shared_state (shared.c:377) ==15060== by 0x58B3BC2: _mesa_reference_shared_state (shared.c:469) ==15060== by 0x578687F: _mesa_free_context_data (context.c:1366) ==15060== by 0x595E9EC: st_destroy_context (st_context.c:642) ==15060== by 0x5987057: st_context_destroy (st_manager.c:772) ==15060== by 0x5B018B6: dri_destroy_context (dri_context.c:217) ==15060== by 0x5B006D3: driDestroyContext (dri_util.c:511) ==15060== by 0x4A1CBE6: dri3_destroy_context (dri3_glx.c:170) ==15060== Address 0x7b5dae0 is 0 bytes inside data symbol "DummyShader" Also, DeleteFragmentShadersATI() should not assert on DummyShader, just remove the hash entry. Normally one would define a shader after GenFragmentShadersATI(), and BindFragmentShaderATI() replaces the placeholder with a real object. However, the specification doesn't say that one has to define a shader for each allocated ID. Signed-off-by: Miklós Máté <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/glsl: add api_enabled flag to gl_transform_feedback_infoTimothy Arceri2017-10-311-0/+3
| | | | | | | | | | This will be used to disable the shader cache when xfb is enabled via the api as we don't currently allow for it when generating the sha for the shader. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* main: Add driver cache blob fields to gl_programJordan Justen2017-10-311-0/+4
| | | | | | | | | | | | | These fields can be used to optionally save off a driver blob with the program metadata. For example, serialized nir, or tgsi. v3: * Rename serialized_nir* to driver_cache_blob*. (Tim) * Free memory. (Jason) Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Accept GL_BACK in get_fb0_attachment with ARB_ES3_1_compatibility.Kenneth Graunke2017-10-271-0/+9
| | | | | | | | | | | According to the ARB_ES3_1_compatibility specification, glGetFramebufferAttachmentParameteriv is supposed to accept BACK, and it behaves exactly like BACK_LEFT. Fixes a GL error in GFXBench 5 Aztec Ruins. Cc: "17.3 17.2" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* formatquery: use correct target check for IMAGE_FORMAT_COMPATIBILITY_TYPEAlejandro Piñeiro2017-10-271-1/+7
| | | | | | | | | | | | | | | | From the spec: "IMAGE_FORMAT_COMPATIBILITY_TYPE: The matching criteria use for the resource when used as an image textures is returned in <params>. This is equivalent to calling GetTexParameter" So we would need to return None for any target not supported by GetTexParameter. By mistake, we were using the target check for GetTexLevelParameter. v2: fix typo (GetTextParameter vs GetTexParemeter) on comment (Illia Mirkin) Reviewed-by: Antia Puentes <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gles2: support for GL_EXT_occlusion_query_booleanHarish Krupo2017-10-252-7/+25
| | | | | | | | | | | | | | | | Following test checking entrypoints passes: dEQP-EGL.functional.get_proc_address.extension.gl_ext_occlusion_query_boolean Piglit test 'ext_occlusion_query_boolean-any-samples' passes with these changes. No changes/regression observed in WebGL occlusion tests or Intel CI. v2: add es2="2.0" for glapi entrypoints, clean up xml dispatch_sanity changes (fix 'make check') Signed-off-by: Harish Krupo <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: enum checks for GL_EXT_occlusion_query_booleanTapani Pälli2017-10-251-0/+44
| | | | | | | Some of the checks are valid for generic ES 3.2 as well. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/bufferobj: don't double negate the rangeDave Airlie2017-10-241-3/+3
| | | | | | | | | | | | | This fixes a regression I introduced refactoring this code, I managed to invert range twice, I moved the inversion into the common code, but forgot to stop doing it in the callee. Fixes: GL45-CTS.multi_bind.dispatch_bind_buffers_base Fixes: 35ac13ed3 (mesa/bufferobj: consolidate some codepaths between ubo/ssbo/atomics.) Reported-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix trivial typo in _mesa_PixelMapusv() error stringBrian Paul2017-10-181-1/+1
| | | | | Signed-off-by: Brian Paul <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103323
* Revert "mesa: fix texture updates for ATI_fragment_shader"Marek Olšák2017-10-171-5/+3
| | | | | | | | This reverts commit 9d54025cd1eee3f42b80c062d1f644904bf2ba41. It breaks KOTOR. Cc: 17.1 17.2 <[email protected]>
* mesa: remove redundant NULL check in update_single_program_texture_stateMiklós Máté2017-10-171-2/+0
| | | | | | | | update_single_program_texture() never returns NULL. Signed-off-by: Miklós Máté <[email protected]> Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* meson: build mesa test.Dylan Baker2017-10-161-0/+43
| | | | | | | v2: - add dependency on dispatch.h generator (which this test needs) Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (v1)
* mesa: minor simplification in test_attachment_completeness()Brian Paul2017-10-141-2/+1
| | | | | | We already have a pointer to the texture object. Use it here. Reviewed-by: Timothy Arceri <[email protected]>
* meta: Delete the PBO texture upload/download pathJason Ekstrand2017-10-121-16/+0
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* compiler: Move gl_program::TexelFetchSamplers to shader_info.Kenneth Graunke2017-10-121-1/+0
| | | | | | | I'd like to put this sort of metadata in the shader_info structure, rather than adding more things to gl_program. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/bufferobj: fix atomic offset/size getDave Airlie2017-10-131-2/+4
| | | | | | | | | | | When I realigned the bufferobj code, I didn't see the getters were different, realign the getters to work the same as ssbo. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103214 Fixes: 65d3ef7cd (mesa: align atomic buffer handling code with ubo/ssbo (v1.1)) Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Mark Janes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: Disallow GL_RED/GL_RG with half-floats on GLES2.Eric Anholt2017-10-121-0/+4
| | | | | | | | | Sure, you'd think that the combination of GL_OES_texture_half_float and GL_EXT_texture_rg would mean that GL_RG16F exists, but it doesn't. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227 Fixes: c16a7443e999 ("mesa: Expose GL_OES_required_internalformat on GLES contexts.") Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: ignore GL_TEXTURE_SRGB_DECODE_EXT for samplers used with ↵Nicolai Hähnle2017-10-111-0/+1
| | | | | | | | | | | | | | texelFetch*() See the comment for the relevant spec quote. Fixes dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.texel_fetch v2: note the interaction between ARB_bindless_texture and EXT_texture_sRGB_decode as a TODO Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/bufferobj: consolidate some buffer binding code.Dave Airlie2017-10-111-42/+35
| | | | | | | | | These paths are again 90% the same, consolidate them into one. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/bufferobj: consolidate some codepaths between ubo/ssbo/atomics.Dave Airlie2017-10-111-102/+47
| | | | | | | | | These are 90% the same code, consolidate them into a couple of common codepaths. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: rename various buffer bindings to one struct.Dave Airlie2017-10-112-38/+13
| | | | | | | | One binding to bind them all, these are all the same thing. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: align atomic buffer handling code with ubo/ssbo (v1.1)Dave Airlie2017-10-112-44/+92
| | | | | | | | | | | | | | this adds automatic size support to the atomic buffer code, but also realigns the code to act like the ubo/ssbo code. v1.1: add missing blank lines. reindent one block properly. check for NullBufferObj. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* 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]>