summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/glsl: add support for alternate TG4 encoding.Dave Airlie2019-10-112-1/+22
| | | | | | | | This will encode the component selection value (0, 1, 2, 3) into the X swizzle of the sampler, if the driver requests it. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* meson: Add necessary defines for mesa_gallium on windowsDylan Baker2019-10-101-2/+14
| | | | | | | v4: - Retain scons comments for windows specific defines v5: - key GLAPI_NO_EXPORTS off of shared-glapi instead of gles Acked-by: Kristian H. Kristensen <[email protected]>
* GL: drop symbols mangling supportEric Engestrom2019-10-102-8/+0
| | | | | | | | | | SCons and Meson have never supported that feature, and Autotools was deleted over 6 months ago and no-one complained yet, so it's pretty obvious nobody cares about it. Fixes: 95aefc94a941701616fd ("Delete autotools") Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* st/mesa: use nir_shader_compiler_options::lower_to_scalarMarek Olšák2019-10-104-43/+20
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: move gl_nir_opt_access from glsl directoryMarek Olšák2019-10-101-1/+1
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: add a strip parameter to nir_serializeMarek Olšák2019-10-102-2/+2
| | | | | | | so that drivers don't have to call nir_strip manually. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* st/mesa: fix R8 bitmap texture for TGSI paths.Dave Airlie2019-10-101-1/+1
| | | | | | | | The initial patch only fixed up the NIR path, but forgot the TGSI path needed fixing as well. Fixes: f92226931b ("st/mesa: Prefer R8 for bitmap textures") Reviewed-by: Marek Olšák <[email protected]>
* i965: Disable fast clears when running with INTEL_DEBUG=nofcCaio Marcelo de Oliveira Filho2019-10-092-0/+6
| | | | Reviewed-by: Rafael Antognolli <[email protected]>
* meta: leak of shader program when decompressing tex-imagesSergii Romantsov2019-10-091-0/+1
| | | | | | CC: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Signed-off-by: Sergii Romantsov <[email protected]>
* mesa/main: prefer R8-textures instead of A8 for glBitmap in display listsErik Faye-Lund2019-10-093-3/+16
| | | | | | | This allows drivers to communicate that they prefer R8 textures rather than A8 for glBitmap usage. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Prefer R8 for bitmap texturesDave Airlie2019-10-092-8/+3
| | | | | | | If it's not available, we fall back to A8. This should work on all drivers, because we depend on it in the display-list code already. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Fix inverted polygon stipple conditionKenneth Graunke2019-10-081-1/+1
| | | | | | | | Fixes Piglit's gl-2.1-polygon-stipple-fs on iris. Fixes: 63f24c3c016 ("gallium: Enable MESA_framebuffer_flip_y") Reviewed-by: Fritz Koenig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* gallium: Enable MESA_framebuffer_flip_yFritz Koenig2019-10-084-6/+4
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Allow MESA_framebuffer_flip_y for GLES 3Fritz Koenig2019-10-084-13/+62
| | | | | | | | Implement glFramebufferParameteriMESA on GLES 3 so that the extension is not dependant on GLES 3.1 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* gallium/tgsi: add support for DEMOTE and READ_HELPER opcodesIlia Mirkin2019-10-071-2/+5
| | | | | | | | | | This mirrors the intrinsics in the GLSL IR. One could imagine an alternate definition where reading the semantic would account for the READ_HELPER functionality, but that feels potentially dodgy and could be subject to CSE unpleasantness. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use simple_mtx_t instead of mtx_tMarek Olšák2019-10-074-34/+34
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't forget to clear _Layer field on texture unitLionel Landwerlin2019-10-011-1/+1
| | | | | | | | | | | | | | On the Android Antutu benchmark we ran into an assert in ISL where the (base layer + num layers) > total layers. It turns out the core of mesa forgot to clear the _Layer variable, potentially leaving an inconsistent value. v2: Pull setting u->_Layer out of the conditional blocks (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Enable EXT_demote_to_helper_invocationCaio Marcelo de Oliveira Filho2019-09-301-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: Add PIPE_CAP_DEMOTE_TO_HELPER_INVOCATIONCaio Marcelo de Oliveira Filho2019-09-301-0/+1
| | | | | | | | | | | | To enable EXT_demote_to_helper_invocation: This extension adds a "demote" keyword that is similar to "discard" but only suppresses subsequent writes and outputs to the framebuffer, and does not terminate the execution of the invocation. For the remainder of the execution, the invocation is "demoted" to act like a helper invocation. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add helperInvocationEXT() builtinCaio Marcelo de Oliveira Filho2019-09-301-0/+1
| | | | | | | | | | | From EXT_demote_to_helper_invocation, implemented with the existing nir_intrinsic_is_helper_invocation. Such builtin is necessary when using `demote` because we can't redefine the value of gl_HelperInvocation (since it is an input variable). Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add ir_demoteCaio Marcelo de Oliveira Filho2019-09-302-0/+14
| | | | | | | | | | | | | | | To represent the new `demote` keyword when using EXT_demote_to_helper_invocation extension. Most of the changes are to include it in the visitors. Demote is not considered a control flow, so also include an empty visit member function in ir_control_flow_visitor. Only NIR actually supports `demote`, so assert the translations for TGSI and Mesa's gl_program -- since the demote is not expected to appear for those. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Extension boilerplate for EXT_demote_to_helper_invocationCaio Marcelo de Oliveira Filho2019-09-302-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* shader_enums: Move MAX_DRAW_BUFFERS to this file.Eric Anholt2019-09-271-6/+1
| | | | | | | | | We include shader_enums.h from freedreno's compiler for both GL and Vulkan, and the main/config.h include resulted in polluting the namespace with things like MAX_VIEWPORTS that other Vulkan drivers use as their driver-specific maximums. Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa/st: calculate texture size based on EGLImage miplevelTapani Pälli2019-09-261-2/+5
| | | | | | | Fixes issues with 'egl-gl_oes_egl_image' Piglit test. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* intel: Increase Gen11 compute shader scratch IDs to 64.Kenneth Graunke2019-09-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | From the MEDIA_VFE_STATE docs: "Starting with this configuration, the Maximum Number of Threads must be set to (#EU * 8) for GPGPU dispatches. Although there are only 7 threads per EU in the configuration, the FFTID is calculated as if there are 8 threads per EU, which in turn requires a larger amount of Scratch Space to be allocated by the driver." It's pretty clear that we need to increase this for scratch address calculations, because the FFTID has a certain bit-pattern. The quote above seems to indicate that we should increase the actual thread count programmed in MEDIA_VFE_STATE as well, but we think the intention is to only bump the scratch space. Fixes GPU hangs in Bioshock Infinite and Synmark's CSDof on Icelake 8x8. Fixes: 5ac804bd9ac ("intel: Add a preliminary device for Ice Lake") Reviewed-by: Matt Turner <[email protected]>
* Revert "intel/gen11+: Enable Hardware filtering of Semi-Pipelined State in WM"Kenneth Graunke2019-09-232-9/+0
| | | | | | | | | | | | | | | This reverts commit 729de1488f49033bc181b8123af5658228a51bf1. It turns out that, although the register is in the logical context, it isn't whitelisted, so we can't actually write it from userspace batch buffers. The write just becomes a noop, which is why we saw no performance changes. I manually whitelisted it, and still observed no performance gains, but it did regress KHR-GL46.texture_cube_map_array.color_depth_attachments on the iris driver. So we might need to fix something before enabling this. To prevent it randomly getting turned on should the kernel ever whitelist this register, we revert the patch for now.
* st/mesa: Bail on incomplete attachments in discard_framebufferKenneth Graunke2019-09-221-1/+1
| | | | | | | | | | | Incomplete attachments don't have an associated pipe_surface, so this would crash. Fixes a WebGL conformance test that uses incomplete attachments: https://www.khronos.org/registry/webgl/sdk/tests/conformance2/renderbuffers/invalidate-framebuffer.html?webglVersion=2&quiet=0&quick=1 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111756 Reviewed-By: Tapani Pälli <[email protected]>
* clover: add support for passing kernels as nir to the driverKarol Herbst2019-09-211-0/+3
| | | | | | | | | | | | | v2: minor formatting fixes v3: call glsl_type_singleton_init_or_ref and glsl_type_singleton_decref v4: capitalize and punctuate comments fix text_executable -> text_intermediate in TODO make glsl_type_singleton wrapper static v5: rewrite how we run the nir passes v6: fix unhandled case switch warning in st/mesa Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v4)
* Move blob from compiler/ to util/Jason Ekstrand2019-09-193-3/+3
| | | | | | | | There's nothing whatsoever compiler-specific about it other than that's currently where it's used. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* util/u_queue: track job size and limit the size of queue growthTimothy Arceri2019-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | When both UTIL_QUEUE_INIT_RESIZE_IF_FULL and UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY are set, we can get into a situation where the queue never executes and grows to a huge size due to all other threads being busy. This is the case with the shader cache when attempting to compile a huge number of shaders up front. If all threads are busy compiling shaders the cache queues memory use can climb into the many GBs very fast. The use of these two flags with the shader cache is intended to allow shaders compiled at runtime to be compiled as fast as possible. To avoid huge memory use but still allow the queue to perform optimally in the run time compilation case, we now add the ability to track memory consumed by the jobs in the queue and limit it to a hardcoded 256MB which should be more than enough. Reviewed-by: Marek Olšák <[email protected]>
* i965: support AYUV/XYUV for external import onlyHaihao Xiang2019-09-181-0/+2
| | | | | | | | | Fixes: 89785e2d56e7fa ("i965: add support for sampling from AYUV") Fixes: 7cab8d3661f243 ("i965: Add support for sampling from XYUV images") Cc: Vivek Kasireddy <[email protected]> Cc: Lionel Landwerlin <[email protected]> Signed-off-by: Haihao Xiang <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "gallium: remove PIPE_CAP_TEXTURE_SHADOW_MAP"Christian Gmeiner2019-09-181-2/+2
| | | | | | | | | | There are GPUs that do not support this feature. This reverts commit e871abe452ad40efcccb0bab6b88fc31d0551e29 Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: remove always-true expressionErik Faye-Lund2019-09-171-1/+0
| | | | | | | | | | In case the GLSL version is 130 or higher, we've already enabled ARB_shader_bit_encoding a bit earlier in this same function. So this condition will always be true. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Increase GL_POINT_SIZE_RANGE minimum to 1.0Kenneth Graunke2019-09-161-4/+1
| | | | | | | | | | | | | | | | | | Table 23.54 of the OpenGL 4.5 spec lists the minimum values for GL_POINT_SIZE_RANGE as [1, 1]. So zero is not allowed (even though arguably this could be useful for MSAA rendering, where a sub-1px point might cover only some samples...) This fixes the WebGL 2.0 conformance suite's state.gl-get-calls test on Chromium on Linux, which uses desktop OpenGL. The test checks that the minimum value of GL_ALIASED_POINT_SIZE_RANGE is 1. Unfortunately, that query doesn't exist in desktop GL, so it checks POINT_SIZE_RANGE, which is the anti-aliased value. There's not really anything better for Chromium to do here, unfortunately. When running Chromium with --api=es3, it maps it to the correct query and the test already works. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: Prefer 5551 formats for GL_UNSIGNED_SHORT_5_5_5_1.Kenneth Graunke2019-09-161-0/+7
| | | | | | | | | | | | Previously, internalformat GL_RGBA and type GL_UNSIGNED_SHORT_5_5_5_1 was promoted to RGBA8888 as the table entry with the 5551 formats is listed below the 8888 entry, and it also doesn't have GL_RGBA as a possible internalformat. Using actual 5551 fixes the following dEQP-EGL test: - dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8 Reviewed-by: Eric Anholt <[email protected]>
* scons: Make scons and meson agree about path to glapi generated headersDylan Baker2019-09-163-1/+3
| | | | | | | | Currently scons puts them in src/mapi/glapi, meosn puts them in src/mapi/glapi/gen. This results in some things being compilable only by one or the other, put them in the same places so that everyone is happy. Reviewed-by: Eric Engestrom <[email protected]>
* mesa/gl: Sync with Khronos registryHeinrich Fink2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | Update GL headers and xml API from upstream Khronos registry (commit 3d0c3eb). Keep `BUILDING_MESA` quirk in glext.h. mesa/extensions: Expose EXT_EGL_sync instead of MESA_EGL_sync to reflect Khronos request of changing this extension's scope from MESA to EXT. EGL_EGL_sync is also the name of the extension that has been merged into the upstream Khronos GL registry. Remove MESA_EGL_sync spec txt from Mesa tree as it is now published as EXT by Khronos. v1: Remove MESA_EGL_sync spec and squash commits (Eric E) Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* driconfig: add a new engine name/version parameterLionel Landwerlin2019-09-156-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan applications can register with the following structure : typedef struct VkApplicationInfo { VkStructureType sType; const void* pNext; const char* pApplicationName; uint32_t applicationVersion; const char* pEngineName; uint32_t engineVersion; uint32_t apiVersion; } VkApplicationInfo; This enables the Vulkan implementations to apply workarounds based off matching this description. Here we add a new parameter for matching the driconfig options with the following : <device driver="anv"> <application engine_name_match="MyOwnEngine.*" engine_versions="10:12,40:42"> <option name="blaaah" value="true" /> </application> </device> v2: switch engine name match to use regexps v3: Verify that the regexec returns REG_NOMATCH for match failure (Eric) v4: Add missing bit that went to the following commit (Eric) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: 19.2 <[email protected]>
* mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINTJiadong Zhu2019-09-121-3/+3
| | | | | | | | | | | | _mesa_texstore_z32f_x24s8 calculates source rowStride at a pace of 64-bit, this will make inaccuracy offset if the width of src image is an odd number. Modify src pointer to int_32* as source image format is gl_float which is 32-bit per pixel. Reviewed by Ilia Mirkin Signed-off-by: Jiadong Zhu <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/st: Fallback to name lookup when the variable have no ParameterCaio Marcelo de Oliveira Filho2019-09-121-2/+46
| | | | | | | | | | | | | | This brings back the fallback previously present in st_nir_lookup_parameter_index(): if there's no parameter associated with the variable, use a parameter from a variable with the same prefix. We'll have to sort out something for SPIR-V, but in the meantime let's fix GLSL. Fixes: b6384e57f5f ("mesa/st: Lookup parameters without using names") Reviewed-by: Eric Anholt <[email protected]> Tested-by: Eric Anholt <[email protected]>
* prog_to_nir: VARYING_SLOT_PSIZ is a scalarIago Toral Quiroga2019-09-121-3/+5
| | | | | | | v2: remove stray change (Erik Faye-Lund) Reviewed-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri: Use DRM_FORMAT_* instead of defining our own copy.Eric Anholt2019-09-112-46/+47
| | | | | | | | | | | | We have only two defines that aren't from DRM_FORMAT_*: SARGB and SABGR. Keep only those as __DRI_IMAGE_FOURCC and garbage collect the rest. While this header is also used from the X server, the X server doesn't use any __DRI_IMAGE enums. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* st/mesa: Only pause queries if there are any active queries to pause.Kenneth Graunke2019-09-115-4/+17
| | | | | | | | | | | | | Previously, ReadPixels, PBO upload/download, and clears would call cso_save_state with CSO_PAUSE_QUERIES, causing cso_context to call pipe->set_active_query_state() twice for each operation. This can potentially cause driver work to enable/disable statistics counters. But often, there are no queries happening which need to be paused. By keeping a simple tally of active queries, we can skip this work. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* intel/gen11+: Enable Hardware filtering of Semi-Pipelined State in WMAnuj Phogat2019-09-112-0/+9
| | | | | | | Initial benchmarking didn't show any performance benefits. But it might eventually. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/nir: fix illegal designated initializer in st_glsl_to_nir.cppBrian Paul2019-09-111-1/+1
| | | | | | | | | IIRC, designated initializers are not legal C++. Fixes the MSVC build. Fixes: 83fd1e58 ("glsl/nir: Add and use a gl_nir_link() function") Reviewed-by: Neha Bhende <[email protected]>
* prog_to_nir, tgsi_to_nir: make sure kill doesn't discard NaNsMarek Olšák2019-09-111-0/+3
| | | | Reviewed-by: Connor Abbott <[email protected]>
* glsl/nir: Add and use a gl_nir_link() functionCaio Marcelo de Oliveira Filho2019-09-102-15/+8
| | | | | | | | | Perform all the NIR linking steps in order. Change iris and i965 to use it. Suggested by Alejandro. v2: Add gl_nir_linker_options struct. Reviewed-by: Alejandro Piñeiro <[email protected]> [v1]
* gallium: Add ARB_gl_spirv supportCaio Marcelo de Oliveira Filho2019-09-101-0/+21
| | | | | | | | | | | | | | The PIPE_CAP_GL_SPIRV capability enables ARB_gl_spirv and ARB_spirv_extensions, and will make sure the corresponding SPIR-V capabilities and extensions lists are initialized. The additional PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS capability enables the support for Variable Pointers in SPIR-V shaders. This depends on the driver and is not mandatory for ARB_gl_spirv support. v2: Add a PIPE_CAP for Variable Pointers. (Marek) Reviewed-by: Alejandro Piñeiro <[email protected]> [v1]
* mesa/spirv: Set a few more extensionsCaio Marcelo de Oliveira Filho2019-09-101-0/+3
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa/st: Don't expect prog->nir to already existCaio Marcelo de Oliveira Filho2019-09-101-6/+5
| | | | | | | | There's no such case, if we load prog->nir from the shader cache, we shouldn't hit this path. Suggested-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>