summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* mesa: always compare optype with symbolic name in ATI_fsMiklós Máté2017-12-251-3/+3
| | | | | Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: document ati_fragment_shader::cur_pass and swizzlerqMiklós Máté2017-12-251-0/+4
| | | | Signed-off-by: Miklós Máté <[email protected]>
* mesa: move ATI_fs state compile changes after the error checksMiklós Máté2017-12-251-54/+53
| | | | | | | | | | Both in setup and arithmetic instructions. Also, remove the useless new_*_inst() functions, and refactor check_arith_arg(), because it did two completely different things. Piglit: spec/ati_fragment_shader/error04-endshader Signed-off-by: Miklós Máté <[email protected]>
* tnl: fix not having texture coords in ATI_fs in swrastMiklós Máté2017-12-251-1/+2
| | | | | | | | | ATI_fs in swrast only had access to texture coordinates if there was a valid texture bound and texturing was enabled. Piglit: spec/ati_fragment_shader/render-sources and render-notexture Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix not having secondary color in ATI_fs in swrastMiklós Máté2017-12-251-7/+10
| | | | | | | | | ATI_fs in swrast only had secondary color if GL_COLOR_SUM was enabled. This patch probably fixes the same issue in r200. Piglit: spec/ati_fragment_shader/render-sources and render-precedence Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix validate for secondary interpolatorMiklós Máté2017-12-251-13/+27
| | | | | | | | | | | | | | | This patch fixes multiple problems: - the interpolator check was duplicated - both had arg instead of argRep - I split it into color and alpha for better readability and error msg - the DOT4 check only applies to color instruction according to the spec - made the DOT4 check fatal, and improved the error msg Piglit: spec/ati_fragment_shader/error08-secondary v2: fixed formatting, added spec quotations Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix typo in ATI_fs dstMod error checkingMiklós Máté2017-12-251-1/+1
| | | | | | | Piglit: spec/ati_fragment_shader/error14-invalidmod Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix crash when an ATI_fs pass begins with an alpha instMiklós Máté2017-12-251-3/+7
| | | | | | | | | | | | | This fixes crash when: - first pass begins with alpha inst - first pass ends with color inst, second pass begins with alpha inst Also, use the symbolic name instead of a number. Piglit: spec/ati_fragment_shader/api-alphafirst v2: fixed formatting Signed-off-by: Miklós Máté <[email protected]>
* mesa: add fallback texture for SampleMapATI if there is nothingMiklós Máté2017-12-251-0/+30
| | | | | | | | | | | This fixes crash in the state tracker. Piglit: spec/ati_fragment_shader/render-notexture v2: fixed formatting, moved stuff inside the loop, moved the fallback later to fix more cases Signed-off-by: Miklós Máté <[email protected]>
* gallium: plumb context priority through to driverRob Clark2017-12-191-0/+5
| | | | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Andres Rodriguez <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* intel/compiler/gen10: Disable push constants.Rafael Antognolli2017-12-191-0/+7
| | | | | | | | | | | | We still have gpu hangs on Cannonlake when using push constants, so disable them for now until we have a proper fix for these hangs. v2: Add warning message when creating context too. Signed-off-by: Rafael Antognolli <[email protected]> Cc: Ben Widawsky <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* i965: Allow old begin/end queryobj for gen4/5 with HW contextsChris Wilson2017-12-151-6/+0
| | | | | | | | | | | | | Since we have HW contexts on gen4/5, we could take advantage of them, as done for gen6+ in commit e32cd5ffbb72 ("i965: Rely on hardware contexts for query objects on Gen6+."), to only emit a pair of counters at begin/end queryobj, rather than around every primitive. However, to keep queryobj working in the meantime as we bringup support for HW ctx on gen4/5, we can keep using the existing code. References: e32cd5ffbb72 ("i965: Rely on hardware contexts for query objects on Gen6+.") Cc: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: enable EXT_disjoint_timer_query extensionTapani Pälli2017-12-151-0/+2
| | | | | | | | | | | | | Following dEQP cases pass: dEQP-EGL.functional.get_proc_address.extension.gl_ext_disjoint_timer_query dEQP-EGL.functional.client_extensions.disjoint Piglit test 'ext_disjoint_timer_query-simple' passes with these changes. No changes/regression observed in Intel CI. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: GL_EXT_disjoint_timer_query extension API bitsTapani Pälli2017-12-156-1/+30
| | | | | | | | | | | Patch adds GL_GPU_DISJOINT_EXT and enables to use timer queries when EXT_disjoint_timer_query is enabled. v2: enable extension only when EXT_disjoint_timer_query set Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
* glapi: add GL_EXT_disjoint_timer_queryTapani Pälli2017-12-151-0/+5
| | | | | | | | | Most entrypoints already available via other extensions like GL_EXT_occlusion_query_boolean, GL_EXT_timer_query. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add DisjointOperation to gl_shared_stateTapani Pälli2017-12-152-0/+9
| | | | | | | | | This state will be used by EXT_disjoint_timer_query. As first usage, patch sets DisjointOperation true when gpu reset happens. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel/decoder: Take a bit offset in gen_print_groupJason Ekstrand2017-12-141-5/+5
| | | | | | | | | | Previously, if a group was nested in another group such that it didn't start on a dword boundary, we would decode it as if it started at the start of its first dword. This changes things to work even more in terms of bits so that we can properly decode these structs. This affects MOCS, attribute swizzles, and several other things. Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Don't allocate an MCS for 16x MSAA and width > 8192.Kenneth Graunke2017-12-141-0/+4
| | | | | | | | | | | | The hardware doesn't support this, and isl_surf_get_mcs_surf will fail. I feel a bit bad replicating this logic, but we want to decide up front. This fixes the following test when run with --deqp-surface-width=16384: - GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_error_blitframebuffer_multisampled_framebuffers_different_sample_count Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Add glSpecializeShaderARB to common_desktop_functionsDylan Baker2017-12-131-0/+3
| | | | | | | | | CC: Nicolai Hähnle <[email protected]> CC: Mark Janes <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104231 Fixes: 46b21b8f906 ("mesa: add GL_ARB_gl_spirv boilerplate") Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* program: Don't reset SamplersValidated when restoring from shader cacheJordan Justen2017-12-131-7/+9
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103988 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove second include of errors.h in src/mesa/main/glspirv.cKai Wasserbäch2017-12-121-4/+0
| | | | | | Fixes: 5bc03d2508 ("mesa: implement SPIR-V loading in glShaderBinary") Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Ian Romanick <[email protected]>