aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
Commit message (Collapse)AuthorAgeFilesLines
...
* freedreno/ir3: drop shader->num_ubosRob Clark2020-06-192-12/+1
| | | | | | | | | | | | | | The only difference between this and `const_state->num_ubos` was that the latter is counting # of ubos loaded via `ldg` (based on UBO addrs in push-consts). But turns out there isn't really any reason to care. Instead just add an early return in the one code-path that cares about the number of `ldg` UBOs. This gets rid of one more thing we need to move from `ir3_shader` to `ir3_shader_variant`. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
* freedreno/ir3: move ubo_state into const_stateRob Clark2020-06-197-25/+24
| | | | | | | | | As with const_state, this will also need to move into the variant. To simplify that, just move it into the const_state itself, since after all it is related. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
* freedreno/ir3: add accessor for const_stateRob Clark2020-06-198-17/+26
| | | | | | | | | | | | | | We are going to want to move this back to the variant, and come up with a different strategy for binning/nonbinning to share the same constant layout, in order to implement shader-cache support. (Since then we can have a mix of dynamically compiled variants and cache hits, so there is no good place to serialize the const-state.) To reduce the churn as we re-arrange things, move direct access to the const-state to a helper fxn. This patch is the boring churny part. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
* freedreno/ir3: refactor out helper to compile shader from asmRob Clark2020-06-198-48/+127
| | | | | | | | | Deduplicate a bit of hand-building of ir3_shader/_variant from computerator and delay test. This also removes the need for external things to depend on generated ir3_parser header. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
* turnip: move enum translation functions to a common headerJonathan Marek2020-06-187-371/+247
| | | | | | | | | | | | | Instead of having these functions sprinkled around the driver (and ending with a duplicated tu6_compare_func for example), move everything to a common header (using the previously unused tu_util.h). Also applied some simplifications: using a cast when the HW enum matches the VK enum, and using a lookup table when it makes sense (which is IMO nicer than the switch case way). Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5538>
* turnip: set the API versionJonathan Marek2020-06-181-1/+1
| | | | | | | | | Some CTS tests don't run because of this. Fixes: 91c757b7963f458 ("turnip: use the common code for generating extensions and dispatch tables") Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5522>
* turnip: fix renderpass gmem configs when there are too many attachmentsJonathan Marek2020-06-181-0/+5
| | | | | | | | | | | | Since a value of at least "align" is used for nblocks, we might end up with nblocks greater than the number of GMEM blocks remaining. Check for this case and bail out, sysmem rendering will be used for such cases. Fixes some of these tests: dEQP-VK.pipeline.render_to_image.core.*.huge.* Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5499>
* turnip: fix a sample shading caseJonathan Marek2020-06-181-1/+10
| | | | | | | | | | | | Check pipeline's sampleShadingEnable to enable sample shading. Also fix behavior of gl_Fragcoord with sample shading. Fixes at least: dEQP-VK.pipeline.multisample.min_sample_shading.min_0_5.samples_4.primitive_triangle Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5499>
* turnip: fix a crash when rasterizerDiscardEnable is setJonathan Marek2020-06-181-25/+18
| | | | | | | | | | | | pMultisampleState needs to be ignored when rasterizerDiscardEnable, so the current code can crash when trying to load msaa_info->pNext. At the same time this simplifies tu_pipeline_shader_key_init a bit, by not calling it for the compute shader case (which doesn't need to set anything in the key struct). Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5499>
* freedreno/ir3: update obsolete commentRob Clark2020-06-181-4/+10
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/computerator: MERGEDREGS updateRob Clark2020-06-182-1/+3
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* turnip: set .MERGEDREGS based on variantRob Clark2020-06-181-1/+2
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: make mergedregs a property of the variantRob Clark2020-06-186-13/+35
| | | | | | | | | | | | Rather than assuming a6xx+ means mergedregs. We can actually (mostly?) do splitregs on a6xx as well. And GS/DS/HS currently require it, which might be papering over a bug, or might be something to do with how chaining shaders works. At any rate, we should at least be consistent, and not have the compiler thinking we are doing mergedregs when we are actually doing splitregs. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: re-work assembler APIRob Clark2020-06-185-19/+23
| | | | | | | | Just pass thru the variant, since it has everything we need. And will be needed in the next patch. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: pass variant to postschedRob Clark2020-06-183-3/+6
| | | | | | | Prep for the next patch. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: decouple regset from gpu genRob Clark2020-06-185-5/+8
| | | | | | | | Allow different regset's to coexist, so we can make mergedregs vs split reg file a variant property. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: move mergedreg state out of regRob Clark2020-06-183-20/+30
| | | | | | | It is only needed one place, let's move it there. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/ir3: convert regmask_t to structRob Clark2020-06-181-11/+15
| | | | | | | | Prep to make merged/split register file mode a property of the regmask, rather than the ir3_register. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5458>
* freedreno/fdl6: rework layout code a bit (reduce linear align to 64 bytes)Jonathan Marek2020-06-183-99/+98
| | | | | | | | | | | Reduce linear alignment, and rework the layout code a bit. This rework has a side effect of also increasing the alignment on linear levels of tiled (non-ubwc) cpp=1 and cpp=2 layouts. Since we should be UBWC for those cases anyway, its not a big loss. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5013>
* freedreno/a6xx: FETCHSIZE is PITCHALIGNJonathan Marek2020-06-187-29/+8
| | | | | | | | | | "FETCHSIZE" is actually a "minimum pitch" or "pitchalign" value that's relevant for mipmaps. The 0 value means 64-bytes. Understanding this allows some simplifications and will make it possible to use less alignment on linear formats. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5013>
* freedreno: replace all dup() with os_dupfd_cloexec()Eric Engestrom2020-06-182-4/+8
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
* replace all F_DUPFD_CLOEXEC with os_dupfd_cloexec()Eric Engestrom2020-06-181-1/+2
| | | | | | | | | | | All squashed into a single commit because it shouldn't have any behaviour change, except that it might work now on platforms where it was broken because F_DUPFD_CLOEXEC is not supported but FD_CLOEXEC is. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
* turnip: use u_format for packing gmem clear valuesJonathan Marek2020-06-171-212/+31
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5485>
* turnip: use draw states for input attachmentsJonathan Marek2020-06-173-22/+54
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: input attachment descriptor set reworkJonathan Marek2020-06-176-383/+211
| | | | | | | | | | | | Implement GMEM input attachments by using non-bindless texture state which is emitted at the start of every subpass. This achieves two things: * More vulkan-like CmdBindDescriptorSets * Fixing secondary command buffer input attachments with GMEM Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: refactor draw states and dynamic statesJonathan Marek2020-06-174-500/+381
| | | | | | | | | This reworks dynamic states to use draw states, and reworks draw states. This moves towards doing as little as possible in bind_draw_states. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: delete dead dynamic state codeJonathan Marek2020-06-172-173/+0
| | | | | | | Remove unused code, split this out to reduce the diff in the next patch. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: improve dirty bit handling a bitJonathan Marek2020-06-172-34/+22
| | | | | | | | | | | | | | This moves some logic out of bind_draw_states, moving towards the eventual goal of doing very little in bind_draw_states. Split this out as a separate patch to make the DIRTY_INPUT_ATTACHMENTS more visible: it can be safely removed because pipelines are subpass specific, so there will always be a pipeline change to go with the CmdBeginRenderPass and CmdNextSubpass (the CmdBindPipeline may not be in the subpass, but the draw that flushes the pipeline update will be). Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: move descriptor set BO tracking to CmdBindDescriptorSetsJonathan Marek2020-06-171-37/+16
| | | | | | | This avoids the duplicated code. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* turnip: compute and graphics have completely separate stateJonathan Marek2020-06-171-11/+1
| | | | | | | | | The comment about fragment shader state overwriting compute shader state is wrong, if either path is overwriting the other's state then it is a mistake. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5446>
* tu: Actually remove dead variables after io loweringConnor Abbott2020-06-171-3/+8
| | | | | | | I forgot that their derefs would still be lying around, so we need to eliminate them first. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5519>
* ir3: Don't calculate num_samp ourselvesConnor Abbott2020-06-171-9/+5
| | | | | | | In addition to duplicating what core NIR does better, this was wrong for Vulkan, where it should be 0 as there are no non-bindless samplers. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5519>
* tu: Set num_components to 0 when building bindless intrinsicsConnor Abbott2020-06-171-2/+2
| | | | | Fixes: 167fa288 (" nir/validate: validate intr->num_components") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5520>
* tu: Remove tu_shader_compile_optionsConnor Abbott2020-06-173-77/+54
| | | | | | | | | The only two fields were always true, and I don't think we'd ever have use for them. If we want to disable optimizations then we'd need a different approach, and I don't even know what include_binning_pass was for. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5500>
* tu: Use the ir3 shader APIConnor Abbott2020-06-173-225/+71
| | | | | | | | This will be necessary once we start compiling multiple variants due to different const size limits, and it will also be necessary for properly implementing the pipeline cache. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5500>
* tu: Remove num_samp hackConnor Abbott2020-06-171-3/+7
| | | | | | | Delete the variables so that ir3 thinks there are no samplers and images instead. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5500>
* ir3: Pass reserved_user_consts to ir3_shader_from_nir()Connor Abbott2020-06-172-2/+3
| | | | | | | | | | ir3_shader_from_nir() calls ir3_optimize_nir(), which currently sets up the const state. However, we need to know the number of user consts reserved by the driver before setting up the const state, which means that this information needs to be passed into ir3_shader_from_nir() somehow rather than being set in the shader. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5500>
* turnip: fix cubic filtering with CmdBlitImageJonathan Marek2020-06-173-19/+26
| | | | | | | | | | This fixes the newly added cubic blit_image tests for A650, by falling back to the 3D path and setting the filter correctly. Note: there are still failures with the texture filtering tests. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5509>
* turnip: fix 3D path always being used for CmdBlitImageJonathan Marek2020-06-171-1/+1
| | | | | | | | | | This change accidentally made it into 72d7df40a5e5b50, and started causing blit_image flakes (because of the issue fixed in the previous patch) Fixes: 72d7df40a5e5b50 ("turnip: add layered 3D path clear for CmdClearAttachments") Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5509>
* turnip: set VFD_INDEX_OFFSET in 3D clear/blit pathJonathan Marek2020-06-171-4/+8
| | | | | | | | This was missing an causing flakes when used after a test that set it to a non-zero value. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5509>
* freedreno/ir3: add post-scheduler cp passRob Clark2020-06-165-0/+223
| | | | | | | | | | A pass to eliminate extra mov's from an array. We need to do this after scheduling so we know that there are not any potentially conflicting array writes between the original `mov` and it's use(s). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2124 Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/cp: extract valid_flagsRob Clark2020-06-163-174/+178
| | | | | | | We'll also need this in the postsched-cp pass. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3: delay test support for vectorish instructionsRob Clark2020-06-162-5/+68
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3: add helpers to move instructionsRob Clark2020-06-164-6/+25
| | | | | | | | | A bit cleaner than open coding the list manipulation. Plus I want to use it in the next patch, rather than adding more open coded list futzing. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/delay: calculate delay properly for (rptN)'d instructionsRob Clark2020-06-161-1/+23
| | | | | | | | | When a sequence of same instruction is encoded with repeat flag, destination registers are written on successive cycles. Teach the delay calculation about this. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3: add test for delay slot calculationRob Clark2020-06-162-0/+178
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/print: print (r) flagRob Clark2020-06-161-0/+3
| | | | | Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/legalize: don't allow (nopN) if (rptN)Rob Clark2020-06-161-1/+2
| | | | | | | | | These two encodings are mutually exclusive. If the instruction is a vector(ish) `(rptN)` instruction, then we can't fold a `(nopN)` post- delay into it. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/cp: properly handle already-folded RELATIVRob Clark2020-06-161-3/+5
| | | | | | | | | | | | | | | In the `try_swap_mad_two_srcs()` case, valid_flags() gets called both for the src that we want to try to fold, and for the other src that we are trying to swap to make that possible. It can happen in the 2nd case that a RELATIV src has already been folded. Since `ssa()` returns non- null in both the `IR3_REG_SSA` and `IR3_REG_ARRAY` cases (in the later case, it is the dependent array access that the current instruction cannot be moved ahead of), we need to explicitly check that the src reg we are looking at is still an SSA src. Reported-by: Jonathan Marek <[email protected]> Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>
* freedreno/ir3/validate: also check instr->addressRob Clark2020-06-161-0/+9
| | | | | | | | Verify that instructions which have a relative src and/or dest, have `instr->address`. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>