aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_cmd_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* radv: don't pass physical device to si_init_ fns.Dave Airlie2017-02-131-2/+2
| | | | | | | This is just a trivial cleanup. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: detect command buffers that do no work and drop them (v2)Dave Airlie2017-02-131-0/+3
| | | | | | | | | | | | | | If a buffer is just full of flushes we flush things on command buffer submission, so don't bother submitting these. This will reduce some CPU overhead on dota2, which submits a fair few command streams that don't end up drawing anything. v2: reorganise loop to count first then malloc, rename some vars (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: handle VK_QUEUE_FAMILY_IGNORED in image transitions (v3)Dave Airlie2017-02-021-6/+6
| | | | | | | | | | | | | The CTS tests at least are using this, and we were totally ignoring it. This hopefully fixes the bouncing multisample CTS tests. v2: get family mask in ignored case from command buffer. v3: only change things in one place, use logic from Bas. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Pass draw index to shader.Bas Nieuwenhuizen2017-02-011-5/+9
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* radv: handle layer export from vs->fs properlyDave Airlie2017-01-311-0/+14
| | | | | | | | Fixes: dEQP-VK.geometry.layered.1d_array.fragment_layer Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: emit esgs itemsize register.Dave Airlie2017-01-311-0/+2
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: handle prim id inputs to fragment shader.Dave Airlie2017-01-311-1/+15
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: emit geometry shaders to hardwareDave Airlie2017-01-311-2/+96
| | | | | | | This emits the compiled geometry shader and other state registers. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: emit geometry ring size and pointers via preamble (v2)Dave Airlie2017-01-311-0/+31
| | | | | | | | | | | | This uses the scratch infrastructure to handle the esgs and gsvs rings. (this replaces the old code that did this with patching). v2: fix correct ring sizes, reset sizes (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: emit vertex shader to correct hw block.Dave Airlie2017-01-311-1/+20
| | | | | | | This emits the shader to the ES block in the correct case. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: extend shader stage code to cover geometry shaders.Dave Airlie2017-01-311-8/+22
| | | | | | | This enables the paths for setting up user ptrs to vs/es and gs. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move hw vertex shader emit to separate functionDave Airlie2017-01-311-29/+40
| | | | | | | This is to later allow ES shaders to be emitted. Review-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Prevent Coverity warningRobert Foss2017-01-301-0/+2
| | | | | | | | | Prevent Coverity seeing potential errors when src is no initialized in the switch case. Coverity-Id: 1396397 Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: handle transfer_write as a dst flag.Dave Airlie2017-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears we can get image barriers like: srcStageMask: VkPipelineStageFlags = 4096 (VK_PIPELINE_STAGE_TRANSFER_BIT) dstStageMask: VkPipelineStageFlags = 4096 (VK_PIPELINE_STAGE_TRANSFER_BIT) dependencyFlags: VkDependencyFlags = 0 memoryBarrierCount: uint32_t = 0 pMemoryBarriers: const VkMemoryBarrier* = NULL bufferMemoryBarrierCount: uint32_t = 0 pBufferMemoryBarriers: const VkBufferMemoryBarrier* = NULL imageMemoryBarrierCount: uint32_t = 1 pImageMemoryBarriers: const VkImageMemoryBarrier* = 0x7ffc882367b0 pImageMemoryBarriers[0]: const VkImageMemoryBarrier = 0x7ffc882367b0: sType: VkStructureType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER (45) pNext: const void* = NULL srcAccessMask: VkAccessFlags = 4096 (VK_ACCESS_TRANSFER_WRITE_BIT) dstAccessMask: VkAccessFlags = 4096 (VK_ACCESS_TRANSFER_WRITE_BIT) oldLayout: VkImageLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL (7) newLayout: VkImageLayout = VK_IMAGE_LAYOUT_GENERAL (1) srcQueueFamilyIndex: uint32_t = 4294967295 dstQueueFamilyIndex: uint32_t = 4294967295 image: VkImage = 0x2df55e0 subresourceRange: VkImageSubresourceRange = 0x7ffc882367e0: aspectMask: VkImageAspectFlags = 1 (VK_IMAGE_ASPECT_COLOR_BIT) baseMipLevel: uint32_t = 0 levelCount: uint32_t = 1 baseArrayLayer: uint32_t = 0 layerCount: uint32_t = 1 This fixes all the CTS dEQP-VK.memory.pipeline_barrier.transfer_dst tests here, not sure if this is a too large hammer. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: vkAllocateCommandBuffers should NULL all output handlesAndres Rodriguez2017-01-301-0/+3
| | | | | | | This is part of the spec and fixes CTS tests: dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_* Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add trim command pool stubAndres Rodriguez2017-01-301-0/+7
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Track scratch usage across pipelines & command buffers.Bas Nieuwenhuizen2017-01-301-1/+21
| | | | | | | Based on code written by Dave Airlie. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: program a default point size.Dave Airlie2017-01-251-1/+2
| | | | | | | | | | | | Along the lines of what 3b804819 anv: Default PointSize to 1.0 if not written by the shader does for anv, program a default point size in the hw of 1.0. This preempt fixes a bunch of geom shader tests. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: disable vertex reuse when writing viewport indexDave Airlie2017-01-181-0/+2
| | | | | | | | This fixes some issues we'd hit later if using viewport indexes. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for writing layer/viewport index (v2)Dave Airlie2017-01-181-1/+5
| | | | | | | | | | | This just adds the infrastructure to allow writing layer and viewport index. It's just a first patch out of the geom shader tree, and doesn't do much on its own. v2: add missing if statement change (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Get physical device from radv_device instead of the instance.Bas Nieuwenhuizen2017-01-161-9/+9
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Dump command buffer on hang.Bas Nieuwenhuizen2017-01-091-0/+35
| | | | | | | | | | | | | v2: - Now use the filename specified by RADV_TRACE_FILE env var. - Use the same var to enable tracing. I thought we could as well always set the filename explicitly instead of having some arbitrary defaults, and at that point we don't need a separate feature enable. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Also skip DCC clear flushes for compute.Bas Nieuwenhuizen2016-12-271-5/+9
| | | | | | (airlied: fixes DOOM hang with compute queue enabled) Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Bas Nieuwenhuizen <[email protected]>
* radv: flush smem for uniform buffer bit.Dave Airlie2016-12-211-1/+3
| | | | | | | | (cc'ing stable as I'd like to backport the ubo speedup as well) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Don't enable CMASK on compute queues.Bas Nieuwenhuizen2016-12-181-4/+36
| | | | | | | We can't fast clear on compute queues. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Implement indirect dispatch for the MEC.Bas Nieuwenhuizen2016-12-181-9/+17
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: init compute queue and avoid initing transfer queuesDave Airlie2016-12-181-12/+29
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Store queue family in command buffers.Dave Airlie2016-12-181-2/+28
| | | | | | v2: Added helper (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix release build unused variable warningsGrazvydas Ignotas2016-12-101-16/+18
| | | | | | | Just mark with MAYBE_UNUSED. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: move userdata sgpr ownership to compiler side.Dave Airlie2016-12-071-55/+126
| | | | | | | | | | | | This isn't fully what we want yet, but is a good step on the way. This allows the compiler to create the information structures for the state setting side, however the state setting still expects things to be pretty much in 2 sgpr wide register sets, and can't handle the indirect setting yet. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: refactor out the constant setting user sgpr code.Dave Airlie2016-12-071-18/+17
| | | | | | | | This just refactors out some common code to make future changes easier to understand. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: refactor out the descriptor user sgpr setting.Dave Airlie2016-12-071-18/+18
| | | | | | | This just splits some common code into a utility function. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: only bind descriptor sets to stages that need themDave Airlie2016-12-071-16/+29
| | | | | | | | | This copies the push constant code and only binds descriptor sets to the stages that need them. It also now has to dirty descriptors on pipeline binds. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move descriptor set userdata emission to draw flush time.Dave Airlie2016-12-071-2/+22
| | | | | | | | | | | This is another step towards having the compiler decide the user sgpr layout. This still emits the descriptors sets for all shader types, but we will fix this later. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: refactor descriptor set userdata emission out.Dave Airlie2016-12-071-15/+22
| | | | | | | This just moves this into a separate function. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: pass pipeline to constant flush functionDave Airlie2016-12-071-4/+6
| | | | | | | I'll need this later rather than just the layout. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: consolidate compute pipeline flushing (v1.1)Dave Airlie2016-12-071-12/+14
| | | | | | | | | | This just moves some common code into a utility function to avoid having to change multiple places later. v1.1: rename function to better reflect what it does. (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: set spi_baryc_cntl.pos_float_location to 0Dave Airlie2016-11-291-1/+1
| | | | | | | | | | | This fixes: dEQP-VK.pipeline.multisample_interpolation.offset_interpolate_at_sample_position.* This should probably be 2 when sample shading is enabled, but I'm not sure. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: force persample shading when required.Dave Airlie2016-11-291-3/+3
| | | | | | | | | | | | | | | | | | | We need to force persample shading when a) shader uses sample_id b) shader uses sample_position c) shader uses sample qualifier. Also since ps_iter_samples can now change independently of the rasterizer samples we need to move setting the regs more often. This fixes: dEQP-VK.pipeline.multisample_interpolation.centroid_interpolate_at_consistency.* dEQP-VK.pipeline.multisample_interpolation.centroid_qualifier_inside_primitive.137_191_1.* dEQP-VK.pipeline.multisample_interpolation.sample_interpolate_at_distinct_values.* dEQP-VK.pipeline.multisample_interpolation.sample_qualifier_distinct_values.128_128_1.* Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for VK_AMD_draw_indirect_countFredrik Höglund2016-11-241-14/+80
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: move pipeline barrier image transitions after src flushingDave Airlie2016-11-231-8/+12
| | | | | | | | | This seems like it would conform better with the spec. noticed while digging into fast clears. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: make sure to flush input attachments correctly.Dave Airlie2016-11-211-0/+1
| | | | | | | | | | This fixes 9 of the dEQP-VK.renderpass.attachment_allocation.input_output.* tests. Cc: "13.0" <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: allow cmask transitions without fast clearDave Airlie2016-10-241-3/+0
| | | | | | | | | | | | | | This fixes dEQP-VK.pipeline.multisample.sampled_image* These all render to multisampled image, and then sample from it, so we must transition it correctly, since we have a cmask and fmask this will cause the correct transition. Cc: "13.0" <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: decompress fmask before reading using texture unitDave Airlie2016-10-191-0/+3
| | | | | | | | Before we can read the fmask using the compute shader, we need to decompress the fmask in place. This fixes a bunch of remaining failure and hopefully multisampling in Talos.
* radv: start using defines for the user sgpr offsetsDave Airlie2016-10-191-12/+12
| | | | | | | | This adds some comments and adds defines for the user sgprs, so that we can move them around easier later and not have to change/revalidate every one of these. Signed-off-by: Dave Airlie <[email protected]>
* radv: move to using shared vk_alloc inlines.Dave Airlie2016-10-191-7/+7
| | | | | | | | This moves to the shared vk_alloc inlines for vulkan memory allocations. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add initial non-conformant radv vulkan driverDave Airlie2016-10-071-0/+2413
This squashes all the radv development up until now into one for merging. History can be found: https://github.com/airlied/mesa/tree/semi-interesting This requires llvm 3.9 and is in no way considered a conformant vulkan implementation. It can run a number of vulkan applications, and supports all GPUs using the amdgpu kernel driver. Thanks to Intel for providing anv and spirv->nir, and Emil Velikov for reviewing build integration. Parts of this are: Reviewed-by: Nicolai Hähnle <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> Authors: Bas Nieuwenhuizen and Dave Airlie Signed-off-by: Dave Airlie <[email protected]>