summaryrefslogtreecommitdiff
path: root/src/amd/vulkan/radv_private.h
AgeCommit message (Collapse)AuthorFilesLines
2017-04-14radv: remove the temp descriptor set infrastructureFredrik Höglund1-10/+0
It is no longer used. Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-14radv: add private push descriptors for metaFredrik Höglund1-0/+8
This allows meta to use push descriptors without disturbing user push descriptors. radv_meta_push_descriptor_set differs from vkCmdPushDescriptorSetKHR in that partial updates are not supported; all descriptors used in subsequent draw commands must be pushed at the same time. Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-14radv: make sizes & offsets 32 bit in radv_descriptor_update_template_entry.Bas Nieuwenhuizen1-5/+5
v2: Also convert the calculations. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2017-04-12radv: Disable primitive restart for non-indexed drawsAlex Smith1-0/+1
According to the Vulkan spec, VkPipelineInputAssemblyStateCreateInfo's primitiveRestartEnable flag should only apply to indexed draws, however it was being enabled regardless of the type of draw. This could cause problems for non-indexed draws with >=65535 vertices if the previous indexed draw used 16-bit indices. Fixes corruption of the credits text in Mad Max. v2: Reset primitive restart state after executing a secondary command buffer. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-12radv: Use an offset instead of pointers for immutable samplers.Bas Nieuwenhuizen1-1/+1
Makes more sense when we hash the layout for the pipeline cache. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-04-11radv: Implement pipeline statistics queries.Bas Nieuwenhuizen1-0/+2
The devil is in the shader again, otherwise this is fairly straightforward. The CTS contains no pipeline statistics copy to buffer testcases, so I did a basic smoketest. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-04-11radv: Rename query pipeline/set layout.Bas Nieuwenhuizen1-2/+2
For using them with both occlusion and pipeline statistics queries. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-04-11radv: Add occlusion query shader.Bas Nieuwenhuizen1-0/+6
Adds a shader for writing occlusion query results to a buffer, as the CP packet isn't support on SI or secondary buffers, and doesn't handle the availability bit (or partial results) nor truncation to 32-bit. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-04-07radv: implement VK_KHR_descriptor_update_templateFredrik Höglund1-0/+39
All offsets and strides are precomputed by radv_CreateDescriptorUpdateTemplateKHR and stored in the template. v2: Move the new struct declarations from radv_descriptor_set.h to radv_private.h (Bas) Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-07radv: implement VK_KHR_push_descriptorFredrik Höglund1-0/+9
Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-07radv: refactor radv_UpdateDescriptorSetsFredrik Höglund1-0/+10
Move the implementation into a separate function that takes a cmd_buffer and a dstSetOverride parameter. When cmd_buffer is not NULL, radv_update_descriptor_sets calls cs_add_buffer directly instead of updating the buffer list. This will be used to implement VK_KHR_push_descriptor. Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-04-04radv: overhaul fragment shader sample positions.Dave Airlie1-0/+2
The current code was broken, and I decided to redesign it instead. This puts the sample positions for all samples into the queue constant descriptor buffer after all the spill/ring descriptors. It then uses a single offset register to point how far into the samples the samples for num_samples are. This saves one user sgpr and means we only generate the sample position data in the rare single case where we need it currently. This doesn't fix the failing CTS tests without the followup fix. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-04-01radv/pipeline: start calculating tess stage.Dave Airlie1-0/+13
This calculates the pipeline state for tessellation. It moves the gs ring calculation down to below where the tessellation shaders will be compiled, as it needs the info from those shaders. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-04-01radv: add tessellation ring allocation support. (v2)Dave Airlie1-0/+4
This patch adds support for the offchip rings for storing tessellation factors and attribute data. It includes the register setup for the TF ring v2: always do tess ring size calcs (Bas) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-04-01radv: add support for some device specific tess information.Dave Airlie1-0/+2
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-04-01radv: add helper function to denote if tess is enabled on a pipeline.Dave Airlie1-0/+5
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-30radv: Use the guard band.Bas Nieuwenhuizen1-1/+2
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-30radv: Prepare for not using the guard band for lines & points.Bas Nieuwenhuizen1-0/+1
Vulkan Clipping is defined in terms of vertices, the scissor based clipping happens on pixels. There is a difference with points and lines, as a vertex can be outside the viewport while some pixels are in. On Vulkan thoise pixels shouldn't be drawn, while they would be with the guardband. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-29radv: Implement sparse image creation.Bas Nieuwenhuizen1-0/+1
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-29radv: Implement sparse buffer creation.Bas Nieuwenhuizen1-0/+1
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move shader stages calculation to pipeline.Dave Airlie1-0/+1
With tess this becomes a bit more complex. so move to pipeline for now. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move pa_cl_vs_out_cntl calculation to pipelineDave Airlie1-1/+1
This also takes the side band setting code from radeonsi. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move calculating fragment shader i/os to pipeline.Dave Airlie1-0/+2
There is no need to calculate this on each command submit. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move shader_z_format calculation to pipeline.Dave Airlie1-0/+1
No need to recalculate this every time. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move db_shader_control calculation to pipeline.Dave Airlie1-0/+1
There is no need to recalculate this every time. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: move vgt_gs_mode value to pipeline.Dave Airlie1-0/+1
No need to recalculate this everytime. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-28radv: fix ia_multi_vgt_param for instanced vs indirect draw.Dave Airlie1-1/+2
The logic was different than radeonsi, fix it up before adding tess support. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-20Revert "radv: fallback to an in-memory cache when no pipline cache is provided"Dave Airlie1-2/+1
This reverts commit 2845a108a9a8bd4b0e6e9b590c976452fb99eb10. This break VK-GL-CTS randomly. ./deqp-vk --deqp-case=dEQP-VK.texture.filtering.3d.formats.r4g4b4a4* bounces around here from 6/6 to 3/6 or 4/6 to hanging. Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-03-17radv: fallback to an in-memory cache when no pipline cache is providedTimothy Arceri1-1/+2
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-17radv: always create an fallback pipeline cacheTimothy Arceri1-0/+3
This will be used as an in-memory cache when a pipeline cache is not provided by the app. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-15radv: Remove unused descriptor set field.Bas Nieuwenhuizen1-1/+0
Trivial. Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
2017-03-07radv: fix the size of the dynamic_buffers arrayFredrik Höglund1-1/+1
A buffer descriptor is 16 bytes, not 16 dwords. Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-07radv: Use winsys HTILE info.Bas Nieuwenhuizen1-3/+1
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Add L2 writeback.Bas Nieuwenhuizen1-8/+10
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: avoid casting warnings on 32bitGrazvydas Ignotas1-0/+3
Use the same helpers as for other handle<->pointer conversions. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-03-06radv/amdgpu: Add some debug flags.Bas Nieuwenhuizen1-12/+1
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-06radv: Cache command buffers in command pool.Bas Nieuwenhuizen1-0/+1
So that we don't keep allocating BOs for the IBs and upload buffers. We run some risk of memory increase with e.g. a bimodal size distribution of command buffers, but I haven't noticed a significant increase with dota2 and talos. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-02-27radv: add support for NV_dedicated_allocationDave Airlie1-1/+6
This adds initial support for NV_dedicated_allocation, then uses it for the wsi image/memory allocation paths internally in the driver. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-21radv: make radv_resolve_entrypoint staticEmil Velikov1-1/+0
Used only within the generated source file. Fixes: 12301c54186 ("radv: drop the RADV_CALL macro.") Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2017-02-21radv: remove unused radv_dispatch_table dtableEmil Velikov1-2/+0
Fixes: 12301c54186 ("radv: drop the RADV_CALL macro.") Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2017-02-21radv: Flush in the initial preamble CS.Bas Nieuwenhuizen1-1/+11
Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-02-20vulkan/wsi/x11: add support to detect if we can support rendering (v3)Dave Airlie1-0/+1
This adds support to radv_GetPhysicalDeviceXlibPresentationSupportKHR and radv_GetPhysicalDeviceXcbPresentationSupportKHR to check if the local device file descriptor is compatible with the descriptor retrieved from the X server via DRI3. This will stop radv binding to an X server until we have prime support in place. Hopefully apps use this API before trying to render things. v2: drop unneeded function, don't leak memory. (jekstrand) v3: also check in surface_get_support callback. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-20Revert "radv: detect command buffers that do no work and drop them (v2)"Dave Airlie1-2/+0
This just keeps popping up minor problems and regressions we should revisit in a more sustainable manner later. This also reverts: Revert "radv: query cmds should mark a cmd buffer as having draws." Revert "radv: also fixup event emission to not get culled." This reverts commit d1640e79328af4a63c056e3ccab299a3bffbede7. This reverts commit 8b47b97215af7157bc15676167cab73aa5a61a76. This reverts commit b4b19afebeac84ddce3f1f8b7ffe0da6474fe29a. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-17radv: Use different allocator for descriptor set vram.Bas Nieuwenhuizen1-14/+4
This one only keeps allocated memory in the list, and list nodes in the descriptor sets. Thsi doesn't need messing around with max_sets, and we get automatic merging of free regions. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-02-17radv: Never try to create more than max_sets descriptor sets.Bas Nieuwenhuizen1-0/+1
We only use the freed ones after all free space has been used. If the app only allocates small descriptor sets, we might go over max_sets before the memory is full. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com> CC: <mesa-stable@lists.freedesktop.org> Fixes: f4e499ec79147f4172f3669ae9dafd941aaeeb65
2017-02-14radv: fixup IA_MULTI_VGT_PARAM handling.Dave Airlie1-2/+10
This ports the remains of the workarounds from radeonsi for the non-TESS cases. It should provide equivalent workarounds for hawaii and bonarie. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-13radv: use indirect buffer for initial gfx state.Dave Airlie1-0/+7
This puts the common gfx state for the device into an indirect buffer, and just calls out to it, on CIK and above. This is taken from what radeonsi does. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-13radv: don't pass physical device to si_init_ fns.Dave Airlie1-4/+2
This is just a trivial cleanup. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-13radv: detect command buffers that do no work and drop them (v2)Dave Airlie1-0/+2
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 <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-07radv: Enable fast clears by default.Bas Nieuwenhuizen1-1/+1
Works for me on dota2 and talos now. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Andres Rodriguez <andresx7@gmail.com>