aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_cs.h
Commit message (Collapse)AuthorAgeFilesLines
* turnip: tu_cs_emit_arrayChia-I Wu2019-03-111-0/+11
| | | | | | Array version of tu_cs_emit. Useful for updating multiple consecutive array-like registers, or loading a shader binary with SS6_DIRECT.
* turnip: add tu_cs_discard_entriesChia-I Wu2019-03-111-0/+11
| | | | | | We will start a draw IB at the beginning of a subpass and consume it at the end of the subpass. With tu_cs_discard_entries, we can reuse the same tu_cs for all subpasses.
* turnip: more/better asserts for tu_csChia-I Wu2019-03-111-2/+4
| | | | | | | | Asserting (cur < end) in tu_cs_emit catches much less programming errors comparing to asserting (cur < reserved_end). We should never write more commands than what we have reserved. Assert IB is non-empty and sane in tu_cs_emit_ib.
* turnip: add TU_CS_MODE_SUB_STREAMChia-I Wu2019-03-111-1/+10
| | | | | | | When in TU_CS_MODE_SUB_STREAM, tu_cs_begin_sub_stream (or tu_cs_end_sub_stream) should be called instead of tu_cs_begin (or tu_cs_end). It gives the caller a TU_CS_MODE_EXTERNAL cs to emit commands to.
* turnip: add tu_cs_modeChia-I Wu2019-03-111-0/+5
| | | | | | | | | Add tu_cs_mode and TU_CS_MODE_EXTERNAL. When in TU_CS_MODE_EXTERNAL, tu_cs wraps an external buffer and can not grow. This also moves tu_cs* up in tu_private.h, such that other structs can embed tu_cs_entry.
* turnip: provide both emit_ib and emit_callChia-I Wu2019-03-111-7/+30
| | | | | tu_cs_emit_ib emits a CP_INDIRECT_BUFFER for a BO. tu_cs_emit_call emits a CP_INDIRECT_BUFFER for each entry of a target cs.
* turnip: add tu_cs_sanity_checkChia-I Wu2019-03-111-1/+3
| | | | | It replaces tu_cs_reserve_space_assert and can be called at any time to sanity check tu_cs.
* turnip: never fail tu_cs_begin/tu_cs_endChia-I Wu2019-03-111-27/+11
| | | | | | Error checking tu_cs_begin/tu_cs_end is too tedious for the callers. Move tu_cs_add_bo and tu_cs_reserve_entry to tu_cs_reserve_space such that tu_cs_begin/tu_cs_end never fails.
* turnip: specify initial size in tu_cs_initChia-I Wu2019-03-111-1/+1
| | | | | We will drop size parameter from tu_cs_begin shortly, such that tu_cs_begin never fails.
* turnip: add tu_cs_reserve_space(_assert)Chia-I Wu2019-03-111-3/+21
| | | | | | | | | | | They are used like tu_cs_reserve_space(...); tu_cs_emit(...); ...; tu_cs_reserve_space_assert(); to make sure we reserved enough space at the beginning.
* turnip: add more tu_cs helpersChia-I Wu2019-03-111-2/+28
|
* turnip: inline tu_cs_check_spaceChia-I Wu2019-03-111-2/+16
| | | | This allows the fast path (size check) to be inlined.
* turnip: document tu_csChia-I Wu2019-03-111-0/+9
|
* turnip: run sed and clang-format on tu_csChia-I Wu2019-03-111-24/+20
|
* turnip: Add emit functions in a header.Bas Nieuwenhuizen2019-03-111-0/+90
This adds a radv-style check_space functions + emit functions. Also puts them in a header as a bunch of inlines, so (1) we can use them from meta code. (2) they are inline for performance as these are common and small. Did not put them in tu_private.h as a bunch of inlines only clutters up that huge headerfile. Precise error propagation for memory allocation failures is still todo.