summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* glsl_to_tgsi: set shader_info::writes_memoryMarek Olšák2020-03-261-0/+8
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* glsl: Add an IR lowering pass to convert mediump operations to 16-bitNeil Roberts2020-03-242-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works by finding the first rvalue that it can lower using an ir_rvalue_visitor. In that case it adds a conversion to float16 after each rvalue and a conversion back to float before storing the assignment. Also it uses a set to keep track of rvalues that have been lowred already. The handle_rvalue method of the rvalue visitor doesn’t provide any way to stop iteration. If we handle a value in find_precision_visitor we want to be able to stop it from descending into the lowered rvalue again. Additionally this pass disallows converting nodes containing non-float. The can_lower_rvalue function explicitly excludes any branches that have non-float types except bools. This avoids the need to have special handling for functions that convert to int or double. Co-authored-by: Hyunjun Ko <[email protected]> v2. Adds lowering for texture samples v3. Instead of checking whether each node can be lowered while walking the tree, a separate tree walk is now done to check all of the nodes in a single pass. The lowerable nodes are added to a set which is checked during find_precision_visitor instead of calling can_lower_rvalue. v4. Move the special case for temporaries to find_lowerable_rvalues. This needs to be handled while checking for lowerable rvalues so that any later dereferences of the variable will see the right precision. v5. Add an override to visit ir_call instructions and apply the same technique to override the precision of the temporary variable in the same way as done for builtin temporaries and ir_assignment calls. v6. Changes the pass so that it doesn’t need to lower an entire subtree in order do perform a lowering. Instead, certain instructions can be marked as being indepedent of their child instructions. For example, this is the case with array dereferences. The precision of the array index doesn’t have any bearing on whether things using the result of the array deref can be lowered. Now, only toplevel lowerable nodes are added to the lowerable_rvalues instead instead of additionally adding all of the subnodes. It now also only needs one hash table instead of two. v7. Don’t try to lower sampler types. Instead, the sample instruction is now treated as an independent point where the result of the sample can be used in a lowered section. The precision of the sampler type determines the precision of the sample instruction. This also means the coordinates to the sampler can be lowered. v8. Use f2fmp instead of f2f16. v9. Disable lowering derivatives calcualtions, which might not work properly on some hw backends. Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* i965/iris: fix crash when calling GetPerfQueryDataINTELLionel Landwerlin2020-03-241-0/+9
| | | | | | | | | On a query that was never begun. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302>
* glthread: compile marshal_generated.c faster by breaking it up into 8 filesMarek Olšák2020-03-244-12/+61
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected] Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270>
* st/mesa: fix use of uninitialized memory due to st_nir_lower_builtinMarek Olšák2020-03-231-1/+1
| | | | | | | | | reported by valgrind Cc: 19.3 20.0 <[email protected]> Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4274> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4274>
* vbo,gallium: make glBegin/End buffer size configurable by driversMarek Olšák2020-03-217-14/+18
| | | | | | | | The default is 512 KB, but radeonsi wants 4 MB. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4154> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4154>
* glthread: ignore vertex arrays with user pointers if they're disabledMarek Olšák2020-03-203-9/+18
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: track which vertex array attribs are enabledMarek Olšák2020-03-203-0/+58
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: rename non_vbo helper functionsMarek Olšák2020-03-201-4/+4
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: handle buffer unbinding via glDeleteBuffersMarek Olšák2020-03-204-28/+41
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* mesa: put gl_thread_state inside gl_context to remove pointer indirectionMarek Olšák2020-03-207-30/+29
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: rename marshal.h/c to glthread_marshal.h and glthread_shaderobj.cMarek Olšák2020-03-206-16/+8
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: move buffer functions into glthread_bufferobj.cMarek Olšák2020-03-204-277/+303
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: autogenerate prototypes for custom-marshalled functionsMarek Olšák2020-03-202-64/+4
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* glthread: remove _mesa_post_marshal_hook, because it's not very usefulMarek Olšák2020-03-202-16/+0
| | | | | | | and also remove the useless forward declaration of enum marshal_dispatch_cmd_id. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>
* mesa/main: Fix overflow in validation of DispatchComputeGroupSizeARBCaio Marcelo de Oliveira Filho2020-03-201-5/+9
| | | | | | | | | | | | | | An uint64_t can store the result of multiplying two GLuint (uint32_t), so use that property to check for overflow when calculating the total. Change the error message so we don't need to care about the actual total -- which means we don't need a larger than 64-bit value to hold it. Fixes: 45ab63c0cb2 ("mesa/main: add support for ARB_compute_variable_groups_size") Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4240> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4240>
* glthread: clean up debug_print_sync codeMarek Olšák2020-03-202-24/+3
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4251>
* glthread: remove debug_print_marshal functionMarek Olšák2020-03-202-9/+0
| | | | | | | We don't need to print every function we execute. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4251>
* glthread: don't execute any custom VAO and BindBuffer code in the Core profileMarek Olšák2020-03-201-1/+1
| | | | | | | It's not needed, because user pointers can never occur there. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4251>
* glthread: align the batch buffer to 8 bytes for pointers and doubles againMarek Olšák2020-03-201-0/+5
| | | | | | | This was changed when I switched to types from size_t to int. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4251>
* mesa: remove redundant api_loopback functionsMarek Olšák2020-03-192-108/+0
| | | | | | | | | vbo_attrib_tmp.h implements them, so this loopback code isn't needed and shouldn't be used. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4123> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4123>
* mesa: use vbo_attrib_tmp.h to generate display list vertex attrib functionsMarek Olšák2020-03-194-1318/+177
| | | | | | | | | | | This removes about 1150 lines of code. The diff is messy, but the new code really starts with save_Attr32bit and below. Ignore false Eval/Material/Begin changes etc. Git can't figure out what was really changed. I didn't change them. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4123>
* intel/blorp: Add support for swizzling fast-clear colorsJason Ekstrand2020-03-181-0/+1
| | | | | | Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4218>
* st/mesa: disallow deferred flush if there are multiple contextsPierre-Eric Pelloux-Prayer2020-03-181-1/+2
| | | | | | | | | | | | | u_threaded can hang in these situation, with one context waiting on a deferred fence from the other context. But the other context isn't flushing its pending work (because it's waiting for more work to pushed) so everything is stuck. Fixes: d17b35e671a ("gallium: add PIPE_FLUSH_DEFERRED") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1430 Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4213> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4213>
* intel/blorp: Plumb the stage through blorp upload_shaderCaio Marcelo de Oliveira Filho2020-03-171-1/+1
| | | | | | | | | | Vulkan uses that for its own upload function -- even though for BLORP it doesn't really currently care. Neither Iris and i965 makes use of it at the moment. Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4170> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4170>
* intel/compiler: detect if atomic load store operations are usedTapani Pälli2020-03-161-1/+1
| | | | | | | | | Patch adds a new arg and modifies existing calls from i965, anv pass NULL but iris stores this information for later use. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4080>
* nir/glsl: gather bitmask of images used by programTapani Pälli2020-03-161-0/+1
| | | | | | | In a similar fashion as commit f5c7df4dc95 does for textures. Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4080>
* st/mesa: Fix signed integer overflow when using util_throttle_memory_usageDanylo Piliaiev2020-03-161-3/+3
| | | | | | | | | | ../src/mesa/state_tracker/st_cb_texture.c:1719:57: runtime error: signed integer overflow: 203489280 * 16 cannot be represented in type 'int' Fixes: 21ca322e637291b89a445159fc45b8dbf638e6c9 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4185> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4185>
* mesa: don't unroll glMultiDrawElements with user indices for galliumMarek Olšák2020-03-113-6/+18
| | | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
* vbo: fix vbo_copy_vertices for GL_PATCHES and adjacency primitive typesMarek Olšák2020-03-111-1/+1
| | | | | | | Fixes: 4c6323c49f1 - vbo: handle GS and tess primitive types when splitting Begin/End Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
* vbo: fix transitions from glVertexN to glVertexM where M < NMarek Olšák2020-03-111-1/+15
| | | | | | | Fixes: 1f6e53e2 "vbo: don't store glVertex values temporarily into exec" Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
* vbo: use vbo_exec_wrap_upgrade_vertex for glVertex in ATTR_UNIONMarek Olšák2020-03-111-6/+12
| | | | | | | | We can't decrease the size for glVertex before a flush, so use vbo_exec_wrap_upgrade_vertex directly. Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
* st/mesa: keep serialized NIR instead of nir_shader in st_programMarek Olšák2020-03-114-8/+79
| | | | | | | | | | | This decreases memory usage, because serialized NIR is more compact. The first variant is created from nir_shader for uncached shaders. All other variants are created from serialized NIR. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2909> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2909>
* gallium/cso_context: remove cso_delete_xxx_shader helpers to fix the live cacheMarek Olšák2020-03-106-24/+68
| | | | | | | | | | | | | | | | | | With the live shader cache, equivalent shaders can be backed by the same CSO. This breaks the logic that identifies whether the shader being deleted is bound. For example, having shaders A and B, you can bind shader A and delete shader B. Deleting shader B will unbind shader A if they are equivalent. Pierre-Eric figured out the root cause for this issue. Fixes: 0db74f479b9 - radeonsi: use the live shader cache Closes: #2596 Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078>
* i965: Use gl_vertex_format in brw_vertex_element.Mathias Fröhlich2020-03-103-15/+13
| | | | | | | | | | | State upload needs to cope with the vertex format rather than with the full attribute data. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Make use of the vertex format functions in i965.Mathias Fröhlich2020-03-101-6/+4
| | | | | | | | | v2: Style fixes. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* mesa: Provide gl_vertex_format accessors.Mathias Fröhlich2020-03-101-0/+21
| | | | | | | | | | | | | Provide the same set of VAO and current value gl_vertex_format accessor functions like we have for the gl_array_attributes. For most purpose the vertex format is what we need. v2: Style fixes. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* mesa: Remove now unused _mesa_draw_attrib.Mathias Fröhlich2020-03-101-15/+0
| | | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* mesa: Remove now unused _mesa_draw_attrib_and_binding.Mathias Fröhlich2020-03-101-19/+0
| | | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Remove glbinding from brw_vertex_element.Mathias Fröhlich2020-03-102-7/+0
| | | | | | | | v2: Rebase. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Reorder workaround flags computation.Mathias Fröhlich2020-03-101-26/+49
| | | | | | | | | | | | | | | Vertex processing workaround flags can be split into array and current vertex attributes. By that we can use specific access functions for these different vertex attribute kinds. This finally obsoletes some access functions that I introduced last winter for a smooth transition. v2: Style fixes. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Split merge_inputs and clear_buffers.Mathias Fröhlich2020-03-101-10/+23
| | | | | | | | | | | | | | The merge_inputs function handles that part that changes when the inputs change. The clear_buffers function triggers when we may need a new upload. Thus the merge_inputs can be limited to be once per brw_draw_prims. v2: Move declaration of attribute index into the for scope. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Test original vertex array pointer to skip array upload.Mathias Fröhlich2020-03-101-1/+1
| | | | | | | | | | Rather than do a NULL pointer check on a pointer that may be offset by the min-max index range of an GL draw operation, execute the NULL test on the original vertex array pointer. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Use the VAOs binding information in array setup.Mathias Fröhlich2020-03-101-181/+163
| | | | | | | | | | | | | | | | | | The change basically reimplements array setup by walking the gl_contex::Array._DrawVAO on a per binding sequence. In this way we can make direct use of the application provided minimum set of buffer objects and emit fewer relocs. v2: Rebase onto: compiler: Move double_inputs to gl_program::DualSlotInputs v3: Rebase onto introduction of gl_vertex_format v4: Reorder and extend patch series. v5: Split out two hunks into seperate patches. v6: Avoid using GL* types. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Use 32 bit u_bit_scan for vertex attribute setup.Mathias Fröhlich2020-03-101-7/+9
| | | | | | | | | | | | | | | The vertex array object contains 32 vertex arrays. By that we cannot reference more then these in the vertex shader inputs. So, we can use the 32 bits u_bit_scan function to iterate the vertex shader inputs and place an assert that only these are present. Also place an other assert that the vertex array setup in i965 does not overrun the enabled array in brw_context::vs::enabled. v2: Style fixes. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* i965: Move down genX_upload_sbe in profiles.Mathias Fröhlich2020-03-101-3/+3
| | | | | | | | | | | | | | | | | Avoid looping over all VARYING_SLOT_MAX urb_setup array entries from genX_upload_sbe. Prepare an array indirection to the active entries of urb_setup already in the compile step. On upload only walk the active arrays. v2: Use uint8_t to store the attribute numbers. v3: Change loop to build up the array indirection. v4: Rebase. v5: Style fix. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
* st/mesa: fix a possible crash with selection and feedback modesMarek Olšák2020-03-091-1/+1
| | | | | | | | The index bounds are always valid without an index buffer, but they won't be. Reviewed-by: Dave Airlie <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3986> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3986>
* st/mesa: flush the bitmap cache before st/dri and vbo flushesMarek Olšák2020-03-092-2/+7
| | | | | Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3986>
* glsl: Add ir_unop_f2fmpNeil Roberts2020-03-092-0/+2
| | | | | | | | | | | | This is the same as ir_unop_f2f16 except that it comes with a promise that it is safe to optimise it out if the result is immediately converted back to float32 again. Normally this would be a lossy operation but it is safe to do if the conversion was generated as part of the precision lowering pass. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3929>
* glsl: Add b2f16 and f162b conversion operationsNeil Roberts2020-03-092-0/+4
| | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3929>