summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: accelerate glCopyPixels(STENCIL)Marek Olšák2019-07-031-20/+38
| | | | Tested-by: Dieter Nützel
* mesa/st: simplify format usage in st_bind_egl_imageMike Blumenkrantz2019-07-011-15/+13
| | | | | | | | | | | the formats handled in the switch statement will always return an unknown mesa format, so process them directly and leave the default case for other/unknown formats no functional changes Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* sparc: Reuse m_vector_asm.h.Eric Anholt2019-07-013-34/+14
| | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: Enable asm unconditionally, now that gen_matypes is gone.Eric Anholt2019-07-012-4/+0
| | | | | Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Replace gen_matypes with a simple header for V4F/mat layout.Eric Anholt2019-07-0126-270/+101
| | | | | | | | We can greatly simplify our builds by just hardcoding GLvector4f and GLmatrix's layouts. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* matypes: Drop some unused defines.Eric Anholt2019-07-011-113/+0
| | | | | | | | | | | | | Most of these haven't been used since the conversion from checked-in matypes to generation. By cutting down the generated contents, this should clarify why the file is generated: we need architecture-specific offsets to the V4F fields in the asm that uses it. v2: Keep matrix offsets to prevent x86 build breakage.. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* swrast: simplify function pointer callsEric Engestrom2019-07-012-3/+3
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]>
* glspirv: Enable the new deref-base UBO/SSBO path on gl_spirvAlejandro Piñeiro2019-06-301-2/+10
| | | | | | | | | | | | | | | | | | Among other things, it supports arrays of arrays of UBO/SSBO (default codepath doesn't). Acked-by: Timothy Arceri <[email protected]> v2: nir_address_format_vk_index_offset got renamed to nir_address_format_32bit_index_offset (after rebase against master) v3: the ptr_type fields in spirv_to_nir_options got changed to be of type nir_address_format. v4: remove phys_ssbo_addr_format and push_const_addr_format as they are not used by glspirv Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* i965: call to gl_nir_link_uniform_blocksAlejandro Piñeiro2019-06-301-0/+4
| | | | | | | | When using a SPIR-V shader. Note that needs to be done before linking uniforms, so when creating the uniform storage entries, block_index could be filled properly (among other things). Reviewed-by: Timothy Arceri <[email protected]>
* i965: use GLboolean for all brw_link_shader returnsAlejandro Piñeiro2019-06-301-3/+3
| | | | | | | The function had a mix of true/GL_TRUE and false/GL_FALSE returns. Using GL_TRUE/GL_FALSE as the function returns a GLboolean. Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use binary search for MESA_EXTENSION_OVERRIDEEric Engestrom2019-06-301-6/+16
| | | | | | | | | | | Not a hot path obviously, but the table still has 425 extensions, which you can go through in just 9 steps with a binary search. The table is already sorted, as required by other parts of the code and enforced by mesa's `main-test`. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: stop trying new filenames if the filename existing is not the issueEric Engestrom2019-06-281-0/+6
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: use os_file_create_unique()Eric Engestrom2019-06-281-5/+4
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965/icl: Apply WA_1606682166 to compute workloadsAnuj Phogat2019-06-281-1/+3
| | | | | | | We missed the workaround for compute workloads in earlier patches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "i965/icl: Add WA_2204188704 to disable pixel shader panic dispatch"Anuj Phogat2019-06-282-10/+0
| | | | | | | | | | | | | | SLICE_COMMON_CHICKEN3 is a privileged register not accesible from userspace. This patch silences a simulator warning about it. We don't need to add this workaround in linux kernel as the WA description says it's fixed on latest stepping. This reverts commit 85ecd14ef6a084f5e82860de6dbc79870b335682. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/icl: Fix WA_1606682166Anuj Phogat2019-06-281-2/+1
| | | | | | | | | | An earlier change was setting the SamplerCount = 0 for Gen 11 under #if GEN_GEN < 7. This commit fixes the problem. This WA has also been added to the linux kernel. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add display list support for gl(Compressed)TextureSubImage2DEXTPierre-Eric Pelloux-Prayer2019-06-281-0/+89
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add glTextureParameteri/iv/f/fvEXTPierre-Eric Pelloux-Prayer2019-06-284-6/+223
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: extend _mesa_lookup_or_create_texture to support EXT_dsaPierre-Eric Pelloux-Prayer2019-06-282-3/+19
| | | | | | | Adds a boolean to implement EXT_dsa specifics. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: refactor bind_texturePierre-Eric Pelloux-Prayer2019-06-282-17/+36
| | | | | | | | | Splits texture lookup and binding actions. The new _mesa_lookup_or_create_texture will be useful to implement the EXT_direct_state_access extension. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: extract helper function for glTexParameter*Pierre-Eric Pelloux-Prayer2019-06-281-13/+24
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add buffer != 0 checks to glNamedBufferEXT functionsPierre-Eric Pelloux-Prayer2019-06-281-2/+33
| | | | | | | | | | | | | | | | | | The EXT_direct_state_access spec says: INVALID_OPERATION is generated by GetNamedBufferParameterivEXT, GetNamedBufferPointervEXT, GetNamedBufferSubDataEXT, MapNamedBufferEXT, NamedBufferDataEXT, NamedBufferSubDataEXT, and UnmapNamedBufferEXT if the buffer parameter is zero. This commits adds buffer != 0 validation to the implemented functions. glNamedBufferStorageEXT isn't included in this list and the EXT_buffer_storage doesn't says that buffer = 0 is an error either so I didn't add the same validation for this function. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: fix a typo in map_named_buffer_rangeMarek Olšák2019-06-281-2/+2
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glMapNamedBufferEXT()Timothy Arceri2019-06-283-1/+26
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glUnmapNamedBufferEXT()Timothy Arceri2019-06-283-6/+5
| | | | | | | | | Since the ARB DSA function glUnmapNamedBuffer() is only exposed for 3.1 or above we make glUnmapNamedBuffer() an alias of glUnmapNamedBufferEXT() rather than the other way around. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glCompressedTextureSubImage2DEXT()Timothy Arceri2019-06-283-25/+59
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glTextureSubImage2DEXT()Timothy Arceri2019-06-283-29/+116
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glMapNamedBufferRangeEXT()Timothy Arceri2019-06-283-14/+36
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glNamedBufferStorageEXTTimothy Arceri2019-06-283-0/+19
| | | | | | | | This is available in ARB_buffer_storage when EXT_direct_state_access is present. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glNamedBuffer*DataEXT()Timothy Arceri2019-06-283-2/+39
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glBindMultiTextureEXTTimothy Arceri2019-06-283-10/+37
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: delete framebuffer texture attachment sampler viewsPierre-Eric Pelloux-Prayer2019-06-281-0/+15
| | | | | | | | | | | | | | | | | | | | | When a context is destroyed the destroy_tex_sampler_cb makes sure that all the sampler views created by that context are destroyed. This is done by walking the ctx->Shared->TexObjects hash table. In a multiple context environment the texture can be deleted by a different context, so it will be removed from the TexObjects table and will prevent the above mechanism to work. This can result in an assertion in st_save_zombie_sampler_view because the sampler_view owns a reference to a destroyed context. This issue occurs in blender 2.80. This commit fixes this by explicitly releasing sampler_view created by the destroyed context for all texture attachments. Fixes: 593e36f956 (st/mesa: implement "zombie" sampler views (v2)) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110944 Signed-off-by: Marek Olšák <[email protected]>
* meson: set up a proper internal dependency for xmlconfigEric Engestrom2019-06-272-5/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* mesa: use a correct function return typeAndrii Simiklit2019-06-272-2/+2
| | | | | | | | v2: standard 'bool' can be used ( Eric Engestrom <[email protected]> ) Reviewed-by: Eric Engestrom <[email protected]> Signed-off-by: Andrii Simiklit <[email protected]>
* st/mesa: Set EmitNoIndirectSampler if GLSLVersion < 400.Kenneth Graunke2019-06-261-1/+1
| | | | | | | | | | | | | | | This patch changes the code which sets EmitNoIndirectSampler to check the core profile GLSL version, rather than the ARB_gpu_shader5 extension enable. st/mesa exposes ARB_gpu_shader5 if GLSLVersion (in core profiles) or GLSLVersionCompat (in compat profiles) >= 400. The Intel drivers do not currently expose ARB_gpu_shader5 in compat profiles. But the backend can absolutely handle indirect samplers. Looking at the core profile version number should be a good indication of what the driver supports. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/glsl: fix silly regression finding gs/tes variantsTimothy Arceri2019-06-261-1/+1
| | | | | | Fixes: d19fe5e67a39 ("st/glsl: support clamping color outputs in compat for gs/tes") Reviewed-by: Ilia Mirkin <[email protected]>
* st/glsl: support clamping color outputs in compat for gs/tesTimothy Arceri2019-06-264-13/+60
| | | | | | | This support requires the driver to be a NIR driver as we use the NIR lowering pass to do the clamping. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: leaking of upload-BO with push constantsSergii Romantsov2019-06-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of any enabled VS members from: uses_firstvertex, uses_baseinstance, uses_drawid, uses_is_indexed_draw leaks may happens. Call gen6_upload_push_constants allocates stage_stat->push_const_bo. It than takes pointer from push_const_bo to draw_params_bo (in the call brw_prepare_shader_draw_parameters by brw_upload_data) and do reference which finally haven't got unreferenced. Fixes leak: 136 bytes in 1 blocks are definitely lost in loss record 6 of 13 at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xC2B64B7: bo_alloc_internal (brw_bufmgr.c:596) by 0xC2B6748: brw_bo_alloc (brw_bufmgr.c:672) by 0xC314BB3: brw_upload_space (intel_upload.c:88) by 0xC2EBBC5: gen6_upload_push_constants (gen6_constant_state.c:155) by 0xC9E4FA6: gen9_upload_vs_push_constants (genX_state_upload.c:3300) by 0xC2E0EDA: check_and_emit_atom (brw_state_upload.c:540) by 0xC2E0EDA: brw_upload_pipeline_state (brw_state_upload.c:659) by 0xC2E0FF1: brw_upload_render_state (brw_state_upload.c:681) by 0xC2C5D2D: brw_draw_single_prim (brw_draw.c:1052) by 0xC2C62CB: brw_draw_prims (brw_draw.c:1175) by 0xC488AD1: vbo_exec_vtx_flush (vbo_exec_draw.c:386) by 0xC485270: vbo_exec_FlushVertices_internal (vbo_exec_api.c:652) Reviewed-by: Lionel Landwerlin <[email protected]> Reported-by: Yevhenii Kolesnikov <[email protected]> Signed-off-by: Sergii Romantsov <[email protected]>
* i965: Move resources lowering after NIR linkingCaio Marcelo de Oliveira Filho2019-06-243-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Those either depend on information filled by the NIR linking steps OR are restricted by those: - gl_nir_lower_samplers: depends on UniformStorage being set by the linker. - brw_nir_lower_image_load_store: After 6981069fc80 "i965: Ignore uniform storage for samplers or images, use binding info" we want this pass to happen after gl_nir_lower_samplers. - gl_nir_lower_buffers: depends on UniformBlocks and SharedStorageBlocks being set by the linker. For the regular GLSL code path, those datastructures are filled earlier. For NIR linking code path we need to generate the nir_shader first then process it -- and currently the processing works with all shaders together. So move the passes out of brw_create_nir into its own function, called by the brwProgramStringNotify and brw_link_shader(). This patch prepares ground for ARB_gl_spirv, that will make use of NIR linker. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965,iris: Move guardband calculations to a common locationJason Ekstrand2019-06-211-92/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* glspirv: Call pass to lower frexp instructionsCaio Marcelo de Oliveira Filho2019-06-191-0/+2
| | | | | | | | These were previously handled by the spirv_to_nir, but that changed to be an explict pass in 23d30f4099f "spirv,nir: lower frexp_exp/frexp_sig inside a new NIR pass" Reviewed-by: Jason Ekstrand <[email protected]>
* glsl/types: Rename is_integer to is_integer_32Jason Ekstrand2019-06-191-1/+1
| | | | | | | It only accepts 32-bit integers so it should have a more descriptive name. This patch should not be a functional change. Reviewed-by: Karol Herbst <[email protected]>
* meson: Search for execinfo.hJory Pratt2019-06-191-1/+1
| | | | | | | | | | Rather than checking __GLIBC__/__UCLIBC__ macros as a proxy for execinfo.h presence, just check directly. This allows the build to work on musl. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/nir: Use gl_nir_opt_accessConnor Abbott2019-06-191-0/+2
| | | | | | Nothing uses its results yet, that will come with the following commits. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: Respect GL_TEXTURE_SRGB_DECODE_EXT in GenerateMipmaps()Kenneth Graunke2019-06-141-0/+3
| | | | | | | | | | | | | | Apparently, we're supposed to look at the texture object's built-in sampler object's sRGB decode setting in order to decide whether to decode/downsample/re-encode, or simply downsample as-is. Previously, we had just respected the pipe_resource's format. Fixes SKQP's Skia_Unit_Tests.SRGBMipMaps test. (This ports commit 337a808062c756b474ee80a9ac04b5a3dbbeb67e from i965 to st/mesa for Gallium drivers.) Reviewed-by: Eric Anholt <[email protected]>
* i965: support UYVY for external import onlyHaihao Xiang2019-06-141-1/+2
| | | | | | | | It is similar with YUYV Fixes: 165e704719b85c ("i965/i915: Add UYVY as the supported format") Signed-off-by: Haihao Xiang <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* gallium: Add PIPE_CAP_ATOMIC_FLOAT_MINMAXCaio Marcelo de Oliveira Filho2019-06-131-0/+1
| | | | | | | Used to enable INTEL_shader_atomic_float_minmax. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix INTEL_DEBUG=batCaio Marcelo de Oliveira Filho2019-06-122-23/+9
| | | | | | | | | | | | | Use hash_table_u64 instead of hash_table directly, since the former will also handle the special keys (deleted and freed) and allow use the whole u64 space. Fixes crash in INTEL_DEBUG=bat when using a key with value 0 -- the current value for a freed key. Fixes: b38dab101ca "util/hash_table: Assert that keys are not reserved pointers" Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macrosNicolai Hähnle2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The main motivation for this change is API ergonomics: most operations on dynarrays are really on elements, not on bytes, so it's weird to have grow and resize as the odd operations out. The secondary motivation is memory safety. Users of the old byte-oriented functions would often multiply a number of elements with the element size, which could overflow, and checking for overflow is tedious. With this change, we only need to implement the overflow checks once. The checks are cheap: since eltsize is a compile-time constant and the functions should be inlined, they only add a single comparison and an unlikely branch. v2: - ensure operations are no-op when allocation fails - in util_dynarray_clone, call resize_bytes with a compile-time constant element size v3: - fix iris, lima, panfrost Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Add rgbx handling for fp formatsKevin Strasser2019-06-121-0/+6
| | | | | | | | | Add missing cases for fp32 and fp16 formats. Fixes: c68334ffc0a9 "st/mesa: add floating point formats in st_new_renderbuffer_fb()" Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>