pvr: Replace sub_cmd flags with bools within each sub_cmd type.
This commit remove: - PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG. - PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY. The first flag was specific to transfer sub commands and the last one, for graphics ones. Now we just have a bool in the transfer sub_cmd, and one in the graphics sub_cmd. Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19957>
This commit is contained in:
@@ -1500,7 +1500,7 @@ VkResult pvr_cmd_buffer_end_sub_cmd(struct pvr_cmd_buffer *cmd_buffer)
|
||||
query_pool = gfx_sub_cmd->query_pool;
|
||||
}
|
||||
|
||||
sub_cmd->flags |= PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY;
|
||||
gfx_sub_cmd->has_occlusion_query = true;
|
||||
|
||||
util_dynarray_clear(&state->query_indices);
|
||||
}
|
||||
@@ -5603,8 +5603,7 @@ pvr_resolve_unemitted_resolve_attachments(struct pvr_cmd_buffer *cmd_buffer,
|
||||
src_view->vk.image->format = src_format;
|
||||
dst_view->vk.image->format = dst_format;
|
||||
|
||||
state->current_sub_cmd->flags |=
|
||||
PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG;
|
||||
state->current_sub_cmd->transfer.serialize_with_frag = true;
|
||||
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
@@ -5773,7 +5772,6 @@ static VkResult pvr_execute_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
||||
|
||||
primary_sub_cmd->type = sec_sub_cmd->type;
|
||||
primary_sub_cmd->owned = false;
|
||||
primary_sub_cmd->flags = sec_sub_cmd->flags;
|
||||
|
||||
list_addtail(&primary_sub_cmd->link, &cmd_buffer->sub_cmds);
|
||||
|
||||
|
@@ -117,11 +117,6 @@ enum pvr_event_type {
|
||||
PVR_EVENT_TYPE_BARRIER,
|
||||
};
|
||||
|
||||
enum pvr_sub_command_flags {
|
||||
PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG = BITFIELD_BIT(0),
|
||||
PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY = BITFIELD_BIT(1),
|
||||
};
|
||||
|
||||
enum pvr_depth_stencil_usage {
|
||||
PVR_DEPTH_STENCIL_USAGE_UNDEFINED = 0, /* explicitly treat 0 as undefined */
|
||||
PVR_DEPTH_STENCIL_USAGE_NEEDED,
|
||||
@@ -751,6 +746,8 @@ struct pvr_sub_cmd_gfx {
|
||||
* both texture reads and texture writes.
|
||||
*/
|
||||
bool frag_uses_texture_rw;
|
||||
|
||||
bool has_occlusion_query;
|
||||
};
|
||||
|
||||
struct pvr_sub_cmd_compute {
|
||||
@@ -770,6 +767,8 @@ struct pvr_sub_cmd_compute {
|
||||
};
|
||||
|
||||
struct pvr_sub_cmd_transfer {
|
||||
bool serialize_with_frag;
|
||||
|
||||
/* List of pvr_transfer_cmd type structures. */
|
||||
struct list_head transfer_cmds;
|
||||
};
|
||||
@@ -815,8 +814,6 @@ struct pvr_sub_cmd {
|
||||
|
||||
enum pvr_sub_cmd_type type;
|
||||
|
||||
enum pvr_sub_command_flags flags;
|
||||
|
||||
/* True if the sub_cmd is owned by this command buffer. False if taken from
|
||||
* a secondary command buffer, in that case we are not supposed to free any
|
||||
* resources associated with the sub_cmd.
|
||||
|
@@ -730,7 +730,7 @@ static VkResult pvr_process_cmd_buffer(
|
||||
link) {
|
||||
switch (sub_cmd->type) {
|
||||
case PVR_SUB_CMD_TYPE_GRAPHICS: {
|
||||
if (sub_cmd->flags & PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY) {
|
||||
if (sub_cmd->gfx.has_occlusion_query) {
|
||||
struct pvr_sub_cmd_event frag_to_transfer_barrier = {
|
||||
.type = PVR_EVENT_TYPE_BARRIER,
|
||||
.barrier = {
|
||||
@@ -780,8 +780,7 @@ static VkResult pvr_process_cmd_buffer(
|
||||
break;
|
||||
|
||||
case PVR_SUB_CMD_TYPE_TRANSFER: {
|
||||
const bool serialize_with_frag =
|
||||
sub_cmd->flags & PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG;
|
||||
const bool serialize_with_frag = sub_cmd->transfer.serialize_with_frag;
|
||||
|
||||
if (serialize_with_frag) {
|
||||
struct pvr_sub_cmd_event frag_to_transfer_barrier = {
|
||||
|
Reference in New Issue
Block a user