summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* Revert "i965: Enable flush control"Adam Jackson2018-01-152-21/+1
| | | | | | | This reverts commit 6ce9006d76c050663af0be61cc88c3215d6f8cea. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104490 Signed-off-by: Adam Jackson <[email protected]>
* mesa: require at least 14 UBOs for GL 4.3Roland Scheidegger2018-01-121-0/+1
| | | | | | | | | | | | ARB_ubo requires 12 UBOs (per stage) at least, but this limit has been raised by GL 4.3 to 14, so don't advertize GL 4.3 without it (only checking the vertex stage since all drivers probably have the same limit anyway for other stages). (piglit has minmax tests for that kind of thing, but they go only up to 3.3, so this won't really be noticed.) I think this currently should not affect any driver - r600 until very recently only supported 12 but now advertizes 14 too. Reviewed-by: Brian Paul <[email protected]>
* meson: Use dependencies for nirDylan Baker2018-01-113-8/+9
| | | | | | | | | | | | | | | | | This creates two new internal dependencies, idep_nir_headers and idep_nir. The former encapsulates the generation of nir_opcodes.h and nir_builder_opcodes.h and adding src/compiler/nir as an include path. This ensures that any target that needs nir headers will have the includes and that the generated headers will be generated before the target is build. The second, idep_nir, includes the first and additionally links to libnir. This is intended to make it easier to avoid race conditions in the build when using nir, since the number of consumers for libnir and it's headers are quite high. Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* meson: don't use intermediate variables that are immediately discardedDylan Baker2018-01-111-2/+1
| | | | | | | | | | | | | | | | For things like: loop x = func() list += x end just do: loop list += func() end Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* meson: Use consistent style for testsDylan Baker2018-01-111-1/+3
| | | | | | | Don't use intermediate variables, use consistent whitespace. Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* meson: Use consistent styleDylan Baker2018-01-112-13/+21
| | | | | | | | | | | | | | | | | | | | Currently the meosn build has a mix of two styles: arg : [foo, ... bar], and arg : [ foo, ..., bar, ] For consistency let's pick one. I've picked the later style, which I think is more readable, and is more common in the mesa code base. v2: - fix commit message Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* dri_util: remove ALLOW_RGB10_CONFIGS option (v2)Marek Olšák2018-01-102-5/+2
| | | | | | | | This is unused because it's for libGL/libEGL, not drivers. v2: i965 was wrong, because it used dri_util instead of its own config. Reviewed-by: Tapani Pälli <[email protected]>
* i965/nir: lower TES PatchVerticesIn to a constant when a TCS is presentIago Toral Quiroga2018-01-101-4/+22
| | | | | | | | | | | | | When a TCS is present at link time we know the number of vertices in the patch and we can lower gl_PatchVerticesIn in the TesEval stage directly to a constant. We already have a pass for this that we use in the Vulkan pipeline, so we just reuse that. Notice that the GLSL linker also implements this optimization, which we are not removing because other drivers may still depend on it, so this should only be useful for OpenGL SPIR-V shaders for now. Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: remove Lower{TCS,TES}PatchVerticesInIago Toral Quiroga2018-01-102-4/+0
| | | | | | | | | | | | Intel was the only user and now NIR can do the lowering. v2: do not try to handle it as a system value directly for the SPIR-V path. In GL we rather handle it as a uniform like we do for the GLSL path (Jason). v3: drop LowerTESPatchVerticesIn as well (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
* i965: lower gl_PatchVerticesIn to a uniformIago Toral Quiroga2018-01-101-0/+8
| | | | | | | | | | | | | We want this here instead of nir_lower_system_values because for Vulkan we don't want this lowering to take place. v2: do not try to handle it as a system value directly for the SPIR-V path. In GL we rather handle it as a uniform like we do for the GLSL path (Jason). v3: do this also for the TessEval stage (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
* i965/nir: add a helper to lower gl_PatchVerticesIn to a uniformIago Toral Quiroga2018-01-101-0/+25
| | | | | | | | | | | | v2: do not try to handle it as a system value directly for the SPIR-V path. In GL we rather handle it as a uniform like we do for the GLSL path (Jason). v3: - Remove the uniform variable, it is alwats -1 now (Jason) - Also do the lowering for the TessEval stage (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
* Fix use of alloca() without #include <c99_alloca.h>Jon Turney2018-01-091-0/+1
| | | | | ../../../src/mesa/main/shaderapi.c: In function ‘_mesa_ShaderBinary’: ../../../src/mesa/main/shaderapi.c:2188:9: error: implicit declaration of function ‘alloca’ [-Werror=implicit-function-declaration]
* intel: Apply Geminilake "Barrier Mode" workaround.Kenneth Graunke2018-01-092-0/+20
| | | | | | | | | | | | | | | | | | | Apparently, Geminilake requires you to whack a chicken bit to select either compute or tessellation mode for barriers. The recommendation is to switch between them at PIPELINE_SELECT time. We may not need to do this all the time, but I don't know that it hurts either. PIPELINE_SELECT is already a pretty giant stall. This appears to fix hangs in tessellation control shaders with barriers on Geminilake. Note that this requires a corresponding kernel change, drm/i915: Whitelist SLICE_COMMON_ECO_CHICKEN1 on Geminilake. in order for the register write to actually happen. Without an updated kernel, this register write will be noop'd and the fix will not work. Reviewed-by: Rafael Antognolli <[email protected]>
* nir: fix st_nir_assign_var_locations for patch variablesKarol Herbst2018-01-081-2/+6
| | | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Torch public intel_batchbuffer_emit_dword/float helpers.Kenneth Graunke2018-01-062-15/+2
| | | | | | | | | | | intel_batchbuffer_emit_float is dead code, it should go. intel_batchbuffer_emit_dword only had one user, which had bungled using them by forgetting to call intel_batchbuffer_require_space first. So it seems wise to delete these unsafe helpers. Cc: [email protected] Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Require space for MI_BATCHBUFFER_END.Kenneth Graunke2018-01-061-2/+5
| | | | | | | | | | | intel_batchbuffer_emit_dword doesn't reserve space for the DWord it emits. In the past, we had some reserved batch space to ensure this worked. With the switch to growing batches, we need to actually request space so that we grow if necessary. Fixes: 2c46a67b4138631217141f (i965: Delete BATCH_RESERVED handling.) Cc: [email protected] Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Shut up a few unused variable warnings.Kenneth Graunke2018-01-061-2/+2
| | | | | If asserts are disabled, you get pointless warnings about devinfo being used (it's used to assert on devinfo->gen).
* mesa: remove dd_function_table::GetCompressedTexSubImage and clean it upMarek Olšák2018-01-065-32/+11
| | | | Reviewed-by: Ian Romanick <[email protected]>
* st/glsl_to_nir/radeonsi: enable tessellation shadersTimothy Arceri2018-01-051-1/+3
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/bindless: fix missing image _Layer initializationIlia Mirkin2018-01-041-0/+1
| | | | | | | | | | | Some later code relies on _Layer to set first/last_layer. Make sure it's always initialized. Detected by valgrind's conditional jump/move with uninit value logic. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Add GL_UNSIGNED_INT_2_10_10_10_REV OES read type for BGRX1010102.Mario Kleiner2018-01-031-1/+2
| | | | | | | | | | | | | | | | | | As Marek noted, the GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV type combo is also good for readback of BGRX1010102 framebuffers, not only for BGRA1010102 framebuffers for use with glReadPixels() under GLES, so add it for the GL_IMPLEMENTATION_COLOR_READ_TYPE_OES query. Successfully tested on gallium r600 driver with a (quickly hacked for RGBA 10 10 10 0) dEQP testcase dEQP-EGL.functional.wide_color.window_1010102_colorspace_default. Suggested-by: Marek Olšák <[email protected]> Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* st/mesa: Handle BGR[A/X]1010102 formats.Mario Kleiner2018-01-031-0/+6
| | | | | | Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: Add GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV for OES read type.Mario Kleiner2018-01-031-0/+3
| | | | | | | | | | | | | | This format + type combo is good for BGRA1010102 framebuffers for use with glReadPixels() under GLES, so add it for the GL_IMPLEMENTATION_COLOR_READ_TYPE_OES query. Allows successful testing of 10 bpc / depth 30 rendering with dEQP test case dEQP-EGL.functional.wide_color.window_1010102_colorspace_default. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965/screen: Honor 'allow_rgb10_configs' option. (v2)Mario Kleiner2018-01-031-0/+19
| | | | | | | | | | | | Allows to prevent exposing RGB10 configs and visuals to clients. v2: Rename expose_rgb10_configs to allow_rgb10_configs, as suggested by Emil. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* dri/common: Add option to allow exposure of 10 bpc color configs. (v2)Mario Kleiner2018-01-031-4/+8
| | | | | | | | | | | | | | | | | Some clients may not like RGB10X2 and RGB10A2 fbconfigs and visuals. Add a new driconf option 'allow_rgb10_configs' to allow per application enable/disable. The option defaults to enabled. v2: Rename expose_rgb10_configs to allow_rgb10_configs, as suggested by Emil. Add comment to option parsing, to make sure it stays before the ->InitScreen(). Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965/screen: Add basic support for rendering 10 bpc/depth 30 framebuffers. (v3)Mario Kleiner2018-01-031-1/+11
| | | | | | | | | | | | | | | | | | | Expose formats which are supported at least back to Gen 5 Ironlake, possibly further. Allow creation of 10 bpc winsys buffers for drawables. glxinfo now lists new RGBA 10 10 10 2/0 formats. v2: Move the BGRA/BGRX1010102 formats before the RGBA/RGBX8888 32 bit formats, as the code comments require. Thanks Emil! Update num_formats from 3 to 5, to keep the special Android handling intact. v3: Use num_formats = ARRAY_SIZE(formats) - 2 as suggested by Tapani, to only exclude the last 2 Android formats, add Tapani's r-b. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965/screen: Add XRGB2101010 and ARGB2101010 support for DRI3.Mario Kleiner2018-01-031-0/+6
| | | | | | | | | | Allow DRI3/Present buffer sharing for 10 bpc buffers. Otherwise composited desktops under DRI3 will only display black client areas for redirected windows. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965: Support accelerated blit for depth 30 formats. (v2)Mario Kleiner2018-01-031-1/+19
| | | | | | | | | | | | | | | | | | | Extend intel_miptree_blit() to handle at least ARGB2101010 -> XRGB2101010, ARGB2101010 -> ARGB2101010, and XRGB2101010 -> XRGB2101010 via the BLT engine, but not XRGB2101010 -> ARGB2101010 yet. This works as tested under Compiz, KDE-5, Gnome-Shell. v2: Restrict BLT fast path to exclude XRGB2101010 -> ARGB2101010, as intel_miptree_set_alpha_to_one() isn't ready to set 2 bit alpha channels to 1.0 yet. However, couldn't find a test case where this specific blit would be needed, so maybe not much of a point to improve here. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965: Support xrgb/argb2101010 formats for glx_texture_from_pixmap.Mario Kleiner2018-01-031-2/+10
| | | | | | | | Makes compositing under X11/GLX work. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965: Drop support for the legacy SNORM -> Float equation.Kenneth Graunke2018-01-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Older OpenGL defines two equations for converting from signed-normalized to floating point data. These are: f = (2c + 1)/(2^b - 1) (equation 2.2) f = max{c/2^(b-1) - 1), -1.0} (equation 2.3) Both OpenGL 4.2+ and OpenGL ES 3.0+ mandate that equation 2.3 is to be used in all scenarios, and remove equation 2.2. DirectX uses equation 2.3 as well. Intel hardware only supports equation 2.3, so Gen7.5+ systems that use the vertex fetcher hardware to do the conversions always get formula 2.3. This can make a big difference for 10-10-10-2 formats - the 2-bit value can represent 0 with equation 2.3, and cannot with equation 2.2. Ivybridge and older were using equation 2.2 for OpenGL, and 2.3 for ES. Now that Ivybridge supports OpenGL 4.2, this is wrong - we need to use the new rules, at least in core profile. That would leave Gen4-6 doing something different than all other hardware, which seems...lame. With context version promotion, applications that requested a pre-4.2 context may get promoted to 4.2, and thus get the new rules. Zero cases have been reported of this being a problem. However, we've received a report that following the old rules breaks expectations. SuperTuxKart apparently renders the cars red when following equation 2.2, and works correctly when following equation 2.3: https://github.com/supertuxkart/stk-code/issues/2885#issuecomment-353858405 So, this patch deletes the legacy equation 2.2 support entirely, making all hardware and APIs consistently use the new equation 2.3 rules. If we ever find an application that truly requires the old formula, then we'd likely want that application to work on modern hardware, too. We'd likely restore this support as a driconf option. Until then, drop it. This commit will regress Piglit's draw-vertices-2101010 test on pre-Haswell without the corresponding Piglit patch to accept either formula (commit 35daaa1695ea01eb85bc02f9be9b6ebd1a7113a1): draw-vertices-2101010: Accept either SNORM conversion formula. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* meta: Don't pollute the texture namespaceIan Romanick2018-01-022-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | tl;dr: For many types of GL object, we can *NEVER* use the Gen function. In OpenGL ES (all versions!) and OpenGL compatibility profile, applications don't have to call Gen functions. The GL spec is very clear about how you can mix-and-match generated names and non-generated names: you can use any name you want for a particular object type until you call the Gen function for that object type. Here's the problem scenario: - Application calls a meta function that generates a name. The first Gen will probably return 1. - Application decides to use the same name for an object of the same type without calling Gen. Many demo programs use names 1, 2, 3, etc. without calling Gen. - Application calls the meta function again, and the meta function replaces the data. The application's data is lost, and the app fails. Have fun debugging that. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363 Reviewed-by: Tapani Pälli <[email protected]>
* meta: Use _mesa_bind_texture instead of _mesa_BindTextureIan Romanick2018-01-022-5/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta: Use _mesa_CreateTextures instead of _mesa_GenTexturesIan Romanick2018-01-021-1/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta: Track temporary textures using gl_texture_object instead of GL API ↵Ian Romanick2018-01-023-17/+36
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Track temporary texture using gl_texture_object instead of GL API ↵Ian Romanick2018-01-022-7/+7
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Use _mesa_bind_texture instead of _mesa_BindTextureIan Romanick2018-01-021-1/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't bind texture in _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-7/+6
| | | | | | | | | | | | | All of the callers of _mesa_meta_bind_rb_as_tex_image call _mesa_meta_setup_sampler shortly after. _mesa_meta_setup_sampler also binds the texture. This is necessary because not all paths that lead to _mesa_meta_setup_sampler some through _mesa_meta_bind_rb_as_tex_image. Rename the function _mesa_meta_texture_object_from_renderbuffer to reflect its true purpose. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Track source texture using gl_texture_object instead of GL API ↵Ian Romanick2018-01-022-0/+2
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Since _mesa_meta_bind_rb_as_tex_image has only one output, return itIan Romanick2018-01-022-14/+14
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't return the texture handle from _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-9/+7
| | | | | | | It's always the same as *texObj->Name. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't return the target from _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-14/+10
| | | | | | | It's always the same as *texObj->Target. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't restore state of the temporary textureIan Romanick2018-01-021-21/+27
| | | | | | | It's about to be destroyed, so there's no point. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Check the values instead of the target before restoringIan Romanick2018-01-021-2/+6
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Add _mesa_bind_texture methodIan Romanick2018-01-022-2/+26
| | | | | | | Light-weight glBindTexture for internal use. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "mesa: remove unused _mesa_delete_nameless_texture()"Ian Romanick2018-01-022-0/+46
| | | | | | | | | | | Changes in this series use this function. This reverts commit 048de9e34a2214371481143cddcaa53f52468c6b. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: Samuel Pitoiset <[email protected]> Cc: Timothy Arceri <[email protected]>
* mesa: Fold _mesa_record_error into its only callerIan Romanick2018-01-023-30/+2
| | | | | | | | | Also, the comment on _mesa_record_error was wrong. dd_function_table::Error was not called because that function does not exist. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: increase size of glsl_base_type bitfieldsBrian Paul2017-12-282-3/+4
| | | | | | | | | Change 59f458cd8703b97b31b8 added more enums to glsl_base_type. We have to bump up the size of the bitfields for fields of this type for MSVC. Also, add another assertion to catch another place where this enum bitfield is used. Reviewed-by: Neha Bhende <[email protected]>
* st/glsl_to_nir: add patch support to st_nir_assign_var_locations()Timothy Arceri2017-12-271-5/+17
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_nir: call post opt functions after opts have finishedTimothy Arceri2017-12-271-0/+6
| | | | | | | | | | We need to move this to a separate loop because nir_compact_varyings() can alter the IR of a previous stage. Fixes: 6648bd68fd27 "st/glsl_to_nir: enable NIR link time opts" Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/st_glsl_to_nir: call nir_lower_64bit_packTimothy Arceri2017-12-271-0/+1
| | | | | | | Fixes 56 crashes in the radeonsi nir backend. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>