From: Hyunjun Ko Date: Thu, 20 Feb 2020 05:54:35 +0000 (+0900) Subject: turnip: Define structs for transform feedback X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82fdb13c25648de2fc4d381699f5bbbd2d8768f4;p=mesa.git turnip: Define structs for transform feedback Define new structures for streamout buffers and state. Most members of the state struct are taken from freedreno driver. v2. Use IR3_MAX_SO_* and avoid using magic values. v3. Remove the state of stream-output in tu_cmd_state and use one in tu_pipeline and split out reset and enabled fields. Signed-off-by: Hyunjun Ko Reviewed-by: Jonathan Marek Part-of: --- diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index dd0107bb6f5..d04fe99aad1 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -841,6 +841,7 @@ enum tu_cmd_dirty_bits TU_CMD_DIRTY_VERTEX_BUFFERS = 1 << 2, TU_CMD_DIRTY_DESCRIPTOR_SETS = 1 << 3, TU_CMD_DIRTY_PUSH_CONSTANTS = 1 << 4, + TU_CMD_DIRTY_STREAMOUT_BUFFERS = 1 << 5, TU_CMD_DIRTY_DYNAMIC_LINE_WIDTH = 1 << 16, TU_CMD_DIRTY_DYNAMIC_STENCIL_COMPARE_MASK = 1 << 17, @@ -848,6 +849,14 @@ enum tu_cmd_dirty_bits TU_CMD_DIRTY_DYNAMIC_STENCIL_REFERENCE = 1 << 19, }; +struct tu_streamout_state { + uint16_t stride[IR3_MAX_SO_BUFFERS]; + uint32_t ncomp[IR3_MAX_SO_BUFFERS]; + uint32_t prog[IR3_MAX_SO_OUTPUTS * 2]; + uint32_t prog_count; + uint32_t vpc_so_buf_cntl; +}; + struct tu_cmd_state { uint32_t dirty; @@ -864,6 +873,17 @@ struct tu_cmd_state struct tu_dynamic_state dynamic; + /* Stream output buffers */ + struct + { + struct tu_buffer *buffers[IR3_MAX_SO_BUFFERS]; + VkDeviceSize offsets[IR3_MAX_SO_BUFFERS]; + VkDeviceSize sizes[IR3_MAX_SO_BUFFERS]; + } streamout_buf; + + uint8_t streamout_reset; + uint8_t streamout_enabled; + /* Index buffer */ struct tu_buffer *index_buffer; uint64_t index_offset; @@ -1152,6 +1172,8 @@ struct tu_pipeline bool need_indirect_descriptor_sets; VkShaderStageFlags active_stages; + struct tu_streamout_state streamout; + struct { struct tu_bo binary_bo;