path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-01-16swr/rast: New execution engine per JITAlok Hota2-42/+65
Fixes relocation errors with LLVM 7.0.0
2019-01-16swr/rast: Scope MEM_CLIENT enum for mem usagesAlok Hota6-40/+38
Avoids confusion with other defaulted integer parameters - fixed some unspecified usages - removed unnecessary includes - removed unecessary protected access specifier in buckets framework
2019-01-16swr/rast: Unaligned and translations in gathersAlok Hota1-21/+35
- added graphics address translation in odd gathers - added support for unaligned gathers in fetch shader - changed how 2+ GB offsets are handled to make them compatible with unaligned offsets
2019-01-16swr/rast: partial support for Tiled ResourcesAlok Hota2-0/+164
- updated sample from TRTT surfaces correctly - implemented mapped status return for TRTT surfaces - implemented per-sample instruction minLod clamp - updated bilinear filter weight calculation to be closer to D3D specs - implemented "ReducedTexcoordRange" operation from D3D specs to avoid loss of precision on high-value normalized coordinates
2019-01-16swr/rast: Add annotator to interleave isa textAlok Hota2-3/+36
To make debugging simpler
2019-01-16swr/rast: Use gfxptr_t value in JitGatherVerticesAlok Hota1-18/+16
Use gfxptr_t type value for stream pointer uses in gather and similar calls
2019-01-16gallium/swr: Fix multi-context sync fence deadlock.Bruce Cherniak1-1/+3
Various recreation scenarios lead to API thread getting stuck in swr_fence_finish(). This is a multi-context issue, whereby one context overwrites the fence read-value with a previous sync's lesser value. The fence sync value is supposed to be always increasing. In swr_fence_cb(), only update the "read" value if the new value is greater. (This may seem like we're not waiting on the other context to finish, but had we needed for it to finish there would have been a wait prior to submitting a new sync.) cc:
2019-01-16ac/nir: don't trash L1 caches for store operations with writeonly memorySamuel Pitoiset1-5/+15
Ported from RadeonSI. Signed-off-by: Samuel Pitoiset <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-15st/mesa: Optionally override RGB/RGBX dst alpha blend factorsKenneth Graunke8-2/+70
Intel's blending hardware does not properly return 1.0 for destination alpha for RGBX formats; it requires the factors to be overridden to either zero or one. Broadcom vc4 and v3d also could use this override. While overriding these factors is safe in general, Nouveau and Radeon would prefer not to. Their blending hardware already returns correct values for RGB/RGBX formats, and would like to avoid the resulting per-buffer blending and independent blend factors (rgb != a) since it can cause additional overhead. I considered simply handling this in the driver, but it's not as nice. pipe_blend_state doesn't have any format information, so we'd need the hardware blend state to depend on both pipe_blend_state and pipe_framebuffer_state. Furthermore, Intel GPUs don't have a native RGBX_SNORM format, so I avoid exposing one, which makes Gallium fall back to RGBA_SNORM. The pipe_surfaces we get in the driver have an RGBA format, making it impossible to tell that there shouldn't be an alpha channel. One could argue that st not handling it in that case is a bug. To work around this, we'd have to expose RGBX pipe formats, mapped to RGBA hardware formats, and add format swizzling special cases. All doable, but it ends up being more code than I'd like. st_atom_blend already has access to the right information and it's trivial to accomplish there, so we just add a cap bit and do that. Reviewed-by: Marek Olšák <> Reviewed-by: Eric Anholt <>
2019-01-15winsys/amdgpu: fix whitespaceMarek Olšák1-1/+1
2019-01-15gallium: Add the ability to query a single pipeline statistics counterKenneth Graunke7-2/+53
Gallium historically has treated pipeline statistics queries as a single query, PIPE_QUERY_PIPELINE_STATISTICS, which returns a block of 11 values. This was originally patterned after the D3D1x API. Much later, Brian introduced an OpenGL extension that exposed these counters - but it exposes 11 separate queries, each of which returns a single value. Today, st/mesa simply queries all 11 values, and returns a single value. While pipeline statistics counters aren't typically performance critical, this is still not a great fit. A D3D1x->GL translator might request all 11 counters by creating 11 separate GL queries...which Gallium would map to reads of all 11 values each time, resulting in a total 121 counter reads. That's not ideal. This patch adds a new cap, PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE, and corresponding query type PIPE_QUERY_PIPELINE_STATISTICS_SINGLE. When calling create_query(), q->index should be set to one of the PIPE_STAT_QUERY_* enums to select a counter. Unlike the block query, this returns the value in pipe_query_result::u64 (as it's a single value) instead of the pipe_query_data_pipeline_statistics group. We update st/mesa to expose ARB_pipeline_statistics_query if either capability is set, preferring the new SINGLE variant when available. Thanks to Roland, Ilia, and Marek for helping me sort this out. Reviewed-by: Marek Olšák <> Reviewed-by: Tapani Pälli <>
2019-01-15st/mesa: Rearrange PIPE_QUERY_PIPELINE_STATISTICS result fetching.Kenneth Graunke1-43/+45
This just changes the order of the switch statements, so we only look at target if the query type is PIPE_QUERY_PIPELINE_STATISTICS. The next commit will introduce a new SINGLE query type which can be used for the same GL query types, and it won't want this processing. Reviewed-by: Marek Olšák <> Reviewed-by: Tapani Pälli <>
2019-01-15st/mesa: Make an enum for pipeline statistics query result indices.Kenneth Graunke2-11/+28
Gallium handles pipeline statistics queries as a single query (PIPE_QUERY_PIPELINE_STATISTICS) which returns a struct with 11 values. Sometimes it's useful to refer to each of those values individually, rather than as a group. To avoid hardcoding numbers, we define a new enum for each value. Here, the name and enum value correspond to the index in the struct pipe_query_data_pipeline_statistics result. Reviewed-by: Marek Olšák <> Reviewed-by: Tapani Pälli <>
2019-01-15radv: add support for VK_EXT_memory_budgetSamuel Pitoiset6-1/+124
A simple Vulkan extension that allows apps to query size and usage of all exposed memory heaps. The different usage values are not really accurate because they are per drm-fd, but they should be close enough. Signed-off-by: Samuel Pitoiset <> Reviewed-by: Alex Smith <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-15radv: add two small helpers for getting VRAM and visible VRAM sizesSamuel Pitoiset1-5/+16
Signed-off-by: Samuel Pitoiset <> Reviewed-by: Alex Smith <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-15radv: remove unnecessary returns in GetPhysicalDevice*Properties()Samuel Pitoiset1-4/+4
These functions return nothing. Signed-off-by: Samuel Pitoiset <> Reviewed-by: Alex Smith <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-15radv: Set partial_vs_wave for pipelines with just GS, not tess.Bas Nieuwenhuizen1-8/+20
Looking at -pro we need to enable it for pipelines with just a GS too. This seems to reduce the hangs from on a RX 550 to the point where I can't reproduce, after the false start with the wd_switch_on_eop patch due to flakiness. (but people are reporting it does not fix the issue completely for them on polaris 11) CC: <> Reviewed-by: Samuel Pitoiset <>
2019-01-14radeonsi: also apply the GS hang workaround to draws without tessellationMarek Olšák1-11/+14
ported from AMDVLK. Cc: 18.3 <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14v3d: SHARED but not necessarily SCANOUT buffers on RO must be linear.Eric Anholt1-1/+1
We don't have a way to talk to RO about modifiers it can do yet, so assume the minimum.
2019-01-14v3d: Add support for CS barrier() intrinsics.Eric Anholt3-0/+61
2019-01-14v3d: Add support for CS shared variable load/store/atomics.Eric Anholt3-13/+83
CS shared variables are handled effectively as SSBO access to a temporary buffer that will be allocated at CS dispatch time.
2019-01-14v3d: Add support for CS workgroup/invocation id intrinsics.Eric Anholt5-1/+67
We get a payload for the ivec3 workgroup and an int local invocation index, and we use the core lowering to turn into the global invocation id and the local invocation id ivec3s.
2019-01-14v3d: Add support for shader_image_load_store.Eric Anholt13-5/+848
This is only exposed on V3D 4.1+, because we didn't have the TMU write operations for images on 3.3 (To do GLES 3.1 there, you have to lower it to SSBO load/stores, which is a problem to solve later).
2019-01-14v3d: Add SSBO/atomic counters support.Eric Anholt9-7/+245
So far I assume that all the buffers get written. If they weren't, you'd probably be using UBOs instead.
2019-01-14v3d: Drop the GLSL version level.Eric Anholt1-1/+1
This was an arbitrary "we support lots of stuff" value when I started the driver. However, at 400 we expose OES_gpu_shader5, which claims support for dynamically indexing samplers, which the driver doesn't do yet.
2019-01-14v3d: Add support for matrix inputs to the FS.Eric Anholt1-13/+14
We've been relying on linking splitting up our varying matrices into separate vectors, but with SSO that doesn't happen. Supporting matrix inputs isn't too hard, though.
2019-01-14v3d: Add an isr to the simulator to catch GMP violations.Eric Anholt3-0/+39
Otherwise, the simulator raises the GMP interrupt and waits for it to be handled, and v3d ends up spinning in v3d_hw_tick(). Aborting right when violation happens gives us a chance to look at the backtrace of whatever thread triggered the violation.
2019-01-14v3d: Fix txf_ms 2D_ARRAY array index.Eric Anholt1-8/+10
We need to pass the array index through our coordinate transform unchanged. Fixes dEQP-GLES31.functional.texture.multisample.samples_1.*_2d_array
2019-01-14v3d: Add support for GL_ARB_framebuffer_no_attachments.Eric Anholt3-2/+19
Fixes dEQP-GLES31.functional.state_query.integer.max_framebuffer_height_getboolean when GLES3 is enabled.
2019-01-14v3d: Add support for the early_fragment_tests flag.Eric Anholt1-0/+10
If this flag hasn't been set by the shader and it has some visible side effects, then we need to disable EZ.
2019-01-14v3d: Add support for flushing dirty TMU data at job end.Eric Anholt3-0/+43
This will be needed for SSBOs and image_load_store.
2019-01-14ac: add missing 16-bit types to glsl_base_to_llvm_type()Samuel Pitoiset1-1/+6
Fix crashes with dEQP-VK.spirv_assembly.instruction.compute.workgroup_memory.*16 Signed-off-by: Samuel Pitoiset <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14radv: Only use 32 KiB per threadgroup on Stoney.Bas Nieuwenhuizen1-1/+10
Causes hangs on some machines. What works for dEQP-VK.tessellation.shader_input_output.barrier: - running num_patches = 6 (which limits LDS to 32 KiB) - running num_patches = 8, and artificially cutting LDS size at 32 KiB. CC: <> Reviewed-by: Samuel Pitoiset <>
2019-01-14st/dri: fix dri2_format_table for argb1555 and rgb565Marek Olšák1-1/+1
The bug caused that rgb565 framebuffers used argb1555. Fixes: 433ca3127a3b94bfe9a513e7c7ce594e09e1359f Reviewed-by: Kristian H. Kristensen <> Reviewed-by: Rob Clark <>
2019-01-14nir: Add a bool to float32 lowering passJason Ekstrand4-0/+181
From @jekstrand's nir-1-bit-bool branch, with improved ior/inot lowering. ior: fmax instead of fadd allows removing the fsat. inot: seq(x, 0) can be better than fsub(1, x). On a2xx, it works better with the scalar instruction set. Reviewed-by: Jonathan Marek <>
2019-01-14src/intel: use new hash table and set creation helpersCaio Marcelo de Oliveira Filho3-8/+4
Replace calls to create hash tables and sets that use _mesa_hash_pointer/_mesa_key_pointer_equal with the helpers _mesa_pointer_hash_table_create() and _mesa_pointer_set_create(). Reviewed-by: Jason Ekstrand <> Acked-by: Eric Engestrom <>
2019-01-14src/compiler: use new hash table and set creation helpersCaio Marcelo de Oliveira Filho42-160/+72
Replace calls to create hash tables and sets that use _mesa_hash_pointer/_mesa_key_pointer_equal with the helpers _mesa_pointer_hash_table_create() and _mesa_pointer_set_create(). Reviewed-by: Jason Ekstrand <> Acked-by: Eric Engestrom <>
2019-01-14util: Helper to create sets and hashes with pointer keysCaio Marcelo de Oliveira Filho4-0/+27
These combinations are common enough and deserve a shortcut. Reviewed-by: Jason Ekstrand <> Acked-by: Eric Engestrom <>
2019-01-14ac/nir: set cache policy when loading/storing buffer imagesSamuel Pitoiset1-14/+11
This was missing. Signed-off-by: Samuel Pitoiset <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14ac/nir: add get_cache_policy() helper and use itSamuel Pitoiset1-12/+26
Signed-off-by: Samuel Pitoiset <> Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14anv: Implement VK_KHR_depth_stencil_resolveJason Ekstrand5-1/+204
2019-01-14anv: Move resolve_subpass to genX_cmd_buffer.cJason Ekstrand3-70/+59
We may have to do transitions around certain kinds of resolves so it helps to have it genX code.
2019-01-14anv/blorp: Refactor MSAA resolves into an exportable helper functionJason Ekstrand2-132/+107
This function is modeled after the aux_op functions except that it has a lot more parameters because it deals with two images as well as source and destination regions.
2019-01-14anv: Rename has_resolve to has_color_resolveJason Ekstrand3-5/+5
2019-01-14intel/blorp: Add two more filter modesJason Ekstrand2-12/+52
2019-01-14amd/common: Restore v4i32 suffix for llvm.SI.load.const intrinsicMichel Dänzer1-1/+1
It was accidentally dropped in commit e4803ab7d2b6 "amd/common: use llvm.amdgcn.s.buffer.load for LLVM 8.0", breaking the universe with LLVM 7. Trivial.
2019-01-14amd/common/vi+: enable SMEM loads with GLC=1Nicolai Hähnle1-3/+7
Only on LLVM 8.0+, which supports the new intrinsic. Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14amd/common: use llvm.amdgcn.s.buffer.load for LLVM 8.0Nicolai Hähnle1-4/+8
llvm.SI.load.const is deprecated. Reviewed-by: Bas Nieuwenhuizen <>
2019-01-14anv/pipeline_cache: free NIR shader cacheIago Toral Quiroga1-0/+7
Fixes: f6aa9f718516 'anv/pipeline_cache: Add support for caching NIR' Reviewed-by: Lionel Landwerlin <>
2019-01-14glsl: Fix copying function's out to temp if dereferenced by arrayDanylo Piliaiev1-24/+22
Function's out variable could be an array dereferenced by an array: func(v[w[i]]); or something more complicated. Copy index in any case. Fixes: 76c27e47b906 ("glsl: Copy function out to temp if we don't directly ref a variable") Signed-off-by: Danylo Piliaiev <> Reviewed-by: Timothy Arceri <> Reviewed-by: Matt Turner <> Reviewed-by: Kenneth Graunke <>