summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* anv/cmd_buffer: Remove the 1-D case from the HiZ QPitch calculationJason Ekstrand2016-12-141-3/+6
| | | | | | | | | | | | The 1-D special case doesn't actually apply to depth or HiZ. I discovered this while converting BLORP over to genxml and ISL. The reason is that the 1-D special case only applies to the new Sky Lake 1-D layout which is only used for LINEAR 1-D images. For tiled 1-D images, such as depth buffers, the old gen4 2-D layout is used and the QPitch should be in rows. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit f469235a6e0c239166ba803e121994063b47ddd3)
* anv/image: Rename hiz_surface to aux_surfaceJason Ekstrand2016-12-141-5/+5
| | | | (cherry picked from commit c3eb58664e5e537b21a75172916b42bd4b5504b3)
* anv/cmd_buffer: Re-emit MEDIA_CURBE_LOAD when CS push constants are dirtyJason Ekstrand2016-12-141-10/+13
| | | | | | | | | | | | | | | | | | | | | | | This can happen even if the binding table isn't changed. For instance, you could have dynamic offsets with your descriptor set. This fixes the new stress.lots-of-surface-state.cs.dynamic cricible test. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 054e48ee0ead7e5a81d28220e3890c7dfc410188) Conflicts: src/intel/vulkan/genX_cmd_buffer.c Squashed with commit: anv/cmd_buffer: Emit CS push constants after binding tables Emitting binding tables can cause push constants to be dirtied if the shader uses images so we need to handle push constants later. (cherry picked from commit 7a2cfd4adb891fb93e84fd8aedfbe387a8a2c781)
* anv/cmd_buffer: Emit a CS stall before setting a CS pipelineJason Ekstrand2016-11-241-1/+13
| | | | | | | Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit f680a01ad4ed360b44cd1b9d3c447a95cedbccd5)
* anv/cmd_buffer: Handle running out of binding tables in compute shadersJason Ekstrand2016-11-241-5/+15
| | | | | | | | | | | | If we try to allocate a binding table and fail, we have to get a new binding table block, re-emit STATE_BASE_ADDRESS, and then try again. We already handle this correctly for 3D and blorp but it never got handled for CS. This fixes the new stress.lots-of-surface-state.cs.static crucible test. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 722ab3de9f0e30e1dfbbd2b5217330b85f53bcec)
* anv: Implement a depth stall restriction on gen7Jason Ekstrand2016-11-241-0/+31
| | | | | | | | Fixes around 60 Vulkan CTS tests on Haswell Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a8b85f1f772ef45cdeba9d5d205d105e689c3bdf)
* anv/cmd_buffer: Enable a CS stall workaround for Sky Lake gt4Jason Ekstrand2016-11-111-0/+6
| | | | | | | | This fixes hangs in Dota2 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a6c3d0f92b754e11e74cea9d6bd5ac329c73a8ba)
* anv/cmd_buffer: Take a command buffer instead of a batch in two helpersJason Ekstrand2016-11-111-8/+8
| | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1e3e347fd5d1d55cdb36c39442def31d121ebae5)
* anv: Move relocation handling from EndCommandBuffer to QueueSubmitJason Ekstrand2016-11-091-11/+0
| | | | | | | | | | | | | | | | | | | | Ever since the early days of the Vulkan driver, we've been setting up the lists of relocations at EndCommandBuffer time. The idea behind this was to move some of the CPU load out of QueueSubmit which the client is required to lock around and into command buffer building which could be done in parallel. Then QueueSubmit basically just becomes a bunch of execbuf2 calls. Technically, this works. However, when you start to do more in QueueSubmit than just execbuf2, you start to run into problems. In particular, if a block pool is resized between EndCommandBuffer and QueueSubmit, the list of anv_bo's and the execbuf2 object list can get out of sync. This can cause problems if, for instance, you wanted to do relocations in userspace. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8b61c57049ff75766715ad4f7b1ad2d3657b9b4d)
* anv/cmd_buffer: Move descriptor flushing into genX_cmd_buffer.cJason Ekstrand2016-10-171-35/+327
| | | | | | | | It really should have gone here all along. We were trying a bit too hard to make it gen-agnostic just because it didn't have any #if's. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* anv/cmd_buffer: Unify flush_compute_state across gensJason Ekstrand2016-10-171-0/+91
| | | | | | | | | With one small genxml change, the two versions were basically identical. The only differences were one #define for HSW+ and a field that is missing on Haswell but exists everywhere else. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* anv/cmd_buffer: Move Begin/End/Execute to genX_cmd_buffer.cJason Ekstrand2016-10-171-0/+95
| | | | | | | | | vkBeginCommandBuffer and vkCmdExecuteCommands both call into the gen-specific emit_state_base_address function and vkEndCommandBuffer belongs with begin. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* anv: replace , with ; in anv_batch_emit()Lionel Landwerlin2016-10-171-10/+10
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* anv/image: Add an isl_view to anv_image_viewJason Ekstrand2016-10-141-2/+2
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* anv: Enable fast depth clearsNanley Chery2016-10-071-2/+22
| | | | | | | | | Provides an FPS increase of ~30% on the Sascha triangle and multisampling demos. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org>
* anv/cmd_buffer: Enable rendering to HiZChad Versace2016-10-071-4/+36
| | | | | | | | | | | | | | | | | | | | | Nanley Chery: (rebase) - Resolve conflicts with new anv_batch_emit macro (amend) - Handle a QPitch TODO - Emit 3DSTATE_HIER_DEPTH_BUFFER on pre-BDW systems - Only use HiZ for single-subpass renderpasses - Emit the HiZ instruction before the stencil instruction to follow the optimized clear sequence specified in the PRMs - Don't modify clear params - Enable resolves when a HiZ buffer is used to ensure depth buffer validity Provides an FPS increase of ~15% on the Sascha triangle and multisampling demos. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/cmd_buffer: Move the clear_subpasses calls to set_subpassJason Ekstrand2016-10-061-2/+2
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/cmd_buffer: Don't call set_subpass in a secondaryJason Ekstrand2016-10-061-4/+1
| | | | | | | | | | | | | Initially, we had intended set_subpass to be an interesting function that did whatever (presumably a lot) setup we needed for a subpass. In reality, it just sets a pointer and a dirty bit and then emits depth and stencil state. When we call BeginCommandBuffer on a secondary, there's no point in setting depth and stencil state since it will already be set by the primary. Instead, the only thing we need to do at the start of a secondary is set the subpass pointer and the dirty bit. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/cmd_buffer: Rework descriptor dirtying in set_subpassJason Ekstrand2016-10-061-1/+5
| | | | | | | | | We have a DIRTY_RENDER_TARGETS flag and that makes a lot more sense than just dirtying fragment descriptors. We're checking for it in some of the gen7 code but unfortunately, nothing was setting it and it didn't do what it was supposed to do in cmd_buffer_flush_state. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/cmd_buffer: Set the L3 atomic disable mask bit in CHICKEN3 on HSWJason Ekstrand2016-09-141-0/+1
| | | | | | | | | | | Without this bit set, the value in "L3 Atomic Disable" won't get applied by the hardware so we won't properly get L3 atomic caching. Fixes dEQP-VK.spirv_assembly.instruction.compute.opatomic.compex and 198 of the dEQP-VK.image.atomic_operations.* tests on HSW Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* anv: Move cmd_buffer_config_l3 into anv_cmd_buffer.cJason Ekstrand2016-09-031-1/+159
| | | | | | | | This is the only remaining part of genX_l3.c and there's really no good reason for it to be in its own file. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/cmd_buffer: Move emit_lri and emit_lrm higher upJason Ekstrand2016-09-031-19/+19
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv: Add a stub for CmdCopyQueryPoolResults on Ivy BridgeJason Ekstrand2016-07-131-0/+13
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* isl: Change the physical size of a W-tile to 128x32Jason Ekstrand2016-07-131-6/+1
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv/dump: Add support for dumping framebuffersJason Ekstrand2016-07-091-0/+4
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv: Use different BOs for different scratch sizes and stagesJason Ekstrand2016-06-221-14/+1
| | | | | | | | | This solves a race condition where we can end up having different stages stomp on each other because they're all trying to scratch in the same BO but they have different views of its layout. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd: Dirty descriptor sets when a new pipeline is boundJason Ekstrand2016-06-211-0/+6
| | | | | | | | | Ever since c2581a9375ea, the binding table layout has depended on the pipeline. This means that whenever we change pipelines we also need to re-emit binding tables for the new layout. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd: Move emit_descriptor_pointers to genX_cmd_buffer.cJason Ekstrand2016-06-211-1/+42
| | | | | | | | It's tiny and fully generic so there's really no reason for it to be in a gen7-specific file. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd: Move flush_descriptor_sets to anv_cmd_buffer.cJason Ekstrand2016-06-211-1/+1
| | | | | | | There's no good reason for recompiling it Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add proper support for depth clampingJason Ekstrand2016-06-201-2/+6
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd_buffer: Split emit_viewport in twoJason Ekstrand2016-06-201-1/+3
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd_buffer: Set depth/stencil extent based on the imageJason Ekstrand2016-06-201-5/+5
| | | | | | | | It used to be based on the framebuffer which isn't quite right. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* i965: Store number of threads in brw_cs_prog_dataJordan Justen2016-06-011-2/+2
| | | | | | Cc: "12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Emit DRAWING_RECTANGLE once at driver initializationJason Ekstrand2016-05-271-13/+0
| | | | | | | | | | Also, we don't actually need it for clipping because meta always colors inside the lines and, for all other operations, the user is required to set a scissor. Since DRAWING_RECTANGLE stalls the GPU, we want to emit it as little as possible. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/cmd_buffer: Only emit PIPE_CONTROL on-demandJason Ekstrand2016-05-271-70/+93
| | | | | | | | | | | This is in contrast to emitting it directly in vkCmdPipelineBarrier. This has a couple of advantages. First, it means that no matter how many vkCmdPipelineBarrier calls the application strings together it gets one or two PIPE_CONTROLs. Second, it allow us to better track when we need to do stalls because we can flag when a flush has happened and we need a stall. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/clear: Only clear the render area when doing subpass clearsJason Ekstrand2016-05-271-0/+1
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv: Move push constant allocation to the command bufferJason Ekstrand2016-05-271-9/+69
| | | | | | | | | | Instead of blasting it out as part of the pipeline, we put it in the command buffer and only blast it out when it's really needed. Since the PUSH_CONSTANT_ALLOC commands aren't pipelined, they immediately cause a stall which we would like to avoid. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* Revert "HACK: Don't re-configure L3$ in render stages pre-BDW"Jordan Justen2016-05-171-11/+0
| | | | | | | This reverts commit 41af9b2e517dd0c17e519490ca915b96f6898390. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94468 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Port L3 cache programming from i965Jordan Justen2016-05-171-1/+1
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/image: Add an aspects fieldJason Ekstrand2016-05-171-4/+3
| | | | | This makes several checks easier and allows us to avoid calling anv_format_for_vk_format in a number of cases.
* anv: s/anv_batch_emit_blk/anv_batch_emit/Jason Ekstrand2016-04-201-43/+43
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for quariesJason Ekstrand2016-04-201-24/+32
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for DRAWING_RECTANGLEJason Ekstrand2016-04-201-9/+10
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for compute shader dispatchJason Ekstrand2016-04-201-52/+64
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for 3DSTATE_CONSTANTJason Ekstrand2016-04-201-10/+11
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for DEPTH/STENCIL_BUFFERJason Ekstrand2016-04-201-34/+42
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for PIPE_CONTROL and STATE_BASE_ADDRESSJason Ekstrand2016-04-201-62/+76
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/cmd_buffer: Use the new emit macro for 3DPRIMITIVE commandsJason Ekstrand2016-04-201-24/+28
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv/gen7: Fix command parser version test with indirect dispatchJordan Justen2016-03-281-1/+1
| | | | | Caught-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/gen7: DispatchIndirect requires cmd parser 5Jordan Justen2016-03-281-0/+26
| | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>