gallium: delete duplicated viewmask member in draw info
this was added for lavapipe, but it should have been in the framebuffer state since it is a framebuffer state now the GL multiview extensions are supported with viewmask in the framebuffer struct, which means this is all redundant and should be corrected/deleted Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31590>
This commit is contained in:

committed by
Marge Bot

parent
8487ecfa44
commit
f5bd39e0e3
@@ -372,6 +372,12 @@ draw_set_clip_state(struct draw_context *draw,
|
|||||||
memcpy(&draw->plane[6], clip->ucp, sizeof(clip->ucp));
|
memcpy(&draw->plane[6], clip->ucp, sizeof(clip->ucp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
draw_set_viewmask(struct draw_context *draw, uint8_t viewmask)
|
||||||
|
{
|
||||||
|
draw->viewmask = viewmask;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the draw module's viewport state.
|
* Set the draw module's viewport state.
|
||||||
|
@@ -327,6 +327,9 @@ void draw_set_vertex_elements(struct draw_context *draw,
|
|||||||
unsigned count,
|
unsigned count,
|
||||||
const struct pipe_vertex_element *elements);
|
const struct pipe_vertex_element *elements);
|
||||||
|
|
||||||
|
void
|
||||||
|
draw_set_viewmask(struct draw_context *draw, uint8_t viewmask);
|
||||||
|
|
||||||
void draw_set_indexes(struct draw_context *draw,
|
void draw_set_indexes(struct draw_context *draw,
|
||||||
const void *elements, unsigned elem_size,
|
const void *elements, unsigned elem_size,
|
||||||
unsigned available_space);
|
unsigned available_space);
|
||||||
|
@@ -355,6 +355,8 @@ struct draw_context
|
|||||||
*/
|
*/
|
||||||
float plane[DRAW_TOTAL_CLIP_PLANES][4];
|
float plane[DRAW_TOTAL_CLIP_PLANES][4];
|
||||||
|
|
||||||
|
uint32_t viewmask;
|
||||||
|
|
||||||
/* If a prim stage introduces new vertex attributes, they'll be stored here
|
/* If a prim stage introduces new vertex attributes, they'll be stored here
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
|
@@ -619,8 +619,8 @@ draw_vbo(struct draw_context *draw,
|
|||||||
* the min_index/max_index hints given by gallium frontends.
|
* the min_index/max_index hints given by gallium frontends.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (use_info->view_mask) {
|
if (draw->viewmask) {
|
||||||
u_foreach_bit(i, use_info->view_mask) {
|
u_foreach_bit(i, draw->viewmask) {
|
||||||
draw->pt.user.viewid = i;
|
draw->pt.user.viewid = i;
|
||||||
draw_instances(draw, drawid_offset, use_info, use_draws, num_draws);
|
draw_instances(draw, drawid_offset, use_info, use_draws, num_draws);
|
||||||
}
|
}
|
||||||
|
@@ -4281,7 +4281,6 @@ agx_draw_without_restart(struct agx_batch *batch,
|
|||||||
.mode = u_decomposed_prim(info->mode),
|
.mode = u_decomposed_prim(info->mode),
|
||||||
.index_size = info->index_size,
|
.index_size = info->index_size,
|
||||||
.index.resource = ctx->heap,
|
.index.resource = ctx->heap,
|
||||||
.view_mask = info->view_mask,
|
|
||||||
.increment_draw_id = info->increment_draw_id,
|
.increment_draw_id = info->increment_draw_id,
|
||||||
.index_bias_varies = info->index_bias_varies,
|
.index_bias_varies = info->index_bias_varies,
|
||||||
};
|
};
|
||||||
@@ -4813,7 +4812,6 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||||||
.index_size = with_counts ? 4 : (point_mode ? 0 : 2),
|
.index_size = with_counts ? 4 : (point_mode ? 0 : 2),
|
||||||
.index.resource = (!with_counts && point_mode) ? NULL : ctx->heap,
|
.index.resource = (!with_counts && point_mode) ? NULL : ctx->heap,
|
||||||
.instance_count = 1,
|
.instance_count = 1,
|
||||||
.view_mask = info->view_mask,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Wrap the pool allocation in a fake resource for meta-Gallium use */
|
/* Wrap the pool allocation in a fake resource for meta-Gallium use */
|
||||||
@@ -5147,7 +5145,6 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
|
|||||||
.restart_index = ~0,
|
.restart_index = ~0,
|
||||||
.index.resource = ctx->heap,
|
.index.resource = ctx->heap,
|
||||||
.instance_count = 1,
|
.instance_count = 1,
|
||||||
.view_mask = info->view_mask,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
indirect_gs = (struct pipe_draw_indirect_info){
|
indirect_gs = (struct pipe_draw_indirect_info){
|
||||||
|
@@ -97,6 +97,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
|
|||||||
draw_set_zs_format(lp->draw, depth_format);
|
draw_set_zs_format(lp->draw, depth_format);
|
||||||
|
|
||||||
lp_setup_bind_framebuffer(lp->setup, &lp->framebuffer);
|
lp_setup_bind_framebuffer(lp->setup, &lp->framebuffer);
|
||||||
|
draw_set_viewmask(lp->draw, fb->viewmask);
|
||||||
|
|
||||||
lp->dirty |= LP_NEW_FRAMEBUFFER;
|
lp->dirty |= LP_NEW_FRAMEBUFFER;
|
||||||
}
|
}
|
||||||
|
@@ -1450,8 +1450,8 @@ static void render_clear(struct rendering_state *state)
|
|||||||
struct lvp_image_view *imgv = state->color_att[i].imgv;
|
struct lvp_image_view *imgv = state->color_att[i].imgv;
|
||||||
assert(imgv->surface);
|
assert(imgv->surface);
|
||||||
|
|
||||||
if (state->info.view_mask) {
|
if (state->framebuffer.viewmask) {
|
||||||
u_foreach_bit(i, state->info.view_mask)
|
u_foreach_bit(i, state->framebuffer.viewmask)
|
||||||
clear_attachment_layers(state, imgv, &state->render_area,
|
clear_attachment_layers(state, imgv, &state->render_area,
|
||||||
i, 1, 0, 0, 0, &color_clear_val);
|
i, 1, 0, 0, 0, &color_clear_val);
|
||||||
} else {
|
} else {
|
||||||
@@ -1480,8 +1480,8 @@ static void render_clear(struct rendering_state *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ds_clear_flags) {
|
if (ds_clear_flags) {
|
||||||
if (state->info.view_mask) {
|
if (state->framebuffer.viewmask) {
|
||||||
u_foreach_bit(i, state->info.view_mask)
|
u_foreach_bit(i, state->framebuffer.viewmask)
|
||||||
clear_attachment_layers(state, state->ds_imgv, &state->render_area,
|
clear_attachment_layers(state, state->ds_imgv, &state->render_area,
|
||||||
i, 1, ds_clear_flags, dclear_val, sclear_val, NULL);
|
i, 1, ds_clear_flags, dclear_val, sclear_val, NULL);
|
||||||
} else {
|
} else {
|
||||||
@@ -1512,7 +1512,7 @@ static void render_clear_fast(struct rendering_state *state)
|
|||||||
state->render_area.extent.height != state->framebuffer.height)
|
state->render_area.extent.height != state->framebuffer.height)
|
||||||
goto slow_clear;
|
goto slow_clear;
|
||||||
|
|
||||||
if (state->info.view_mask)
|
if (state->framebuffer.viewmask)
|
||||||
goto slow_clear;
|
goto slow_clear;
|
||||||
|
|
||||||
if (state->render_cond)
|
if (state->render_cond)
|
||||||
@@ -1828,7 +1828,7 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd,
|
|||||||
state->forced_stencil_resolve_mode = 0;
|
state->forced_stencil_resolve_mode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
state->info.view_mask = info->viewMask;
|
state->framebuffer.viewmask = info->viewMask;
|
||||||
state->render_area = info->renderArea;
|
state->render_area = info->renderArea;
|
||||||
state->suspending = suspending;
|
state->suspending = suspending;
|
||||||
state->framebuffer.width = info->renderArea.offset.x +
|
state->framebuffer.width = info->renderArea.offset.x +
|
||||||
@@ -1915,8 +1915,8 @@ static void handle_end_rendering(struct vk_cmd_queue_entry *cmd,
|
|||||||
|
|
||||||
for (unsigned i = 0; i < state->framebuffer.nr_cbufs; i++) {
|
for (unsigned i = 0; i < state->framebuffer.nr_cbufs; i++) {
|
||||||
if (state->color_att[i].imgv && state->color_att[i].store_op == VK_ATTACHMENT_STORE_OP_DONT_CARE) {
|
if (state->color_att[i].imgv && state->color_att[i].store_op == VK_ATTACHMENT_STORE_OP_DONT_CARE) {
|
||||||
if (state->info.view_mask) {
|
if (state->framebuffer.viewmask) {
|
||||||
u_foreach_bit(i, state->info.view_mask)
|
u_foreach_bit(i, state->framebuffer.viewmask)
|
||||||
clear_attachment_layers(state, state->color_att[i].imgv, &state->render_area,
|
clear_attachment_layers(state, state->color_att[i].imgv, &state->render_area,
|
||||||
i, 1, 0, 0, 0, &color_clear_val);
|
i, 1, 0, 0, 0, &color_clear_val);
|
||||||
} else {
|
} else {
|
||||||
@@ -1939,8 +1939,8 @@ static void handle_end_rendering(struct vk_cmd_queue_entry *cmd,
|
|||||||
double dclear_val = 0.2389234;
|
double dclear_val = 0.2389234;
|
||||||
uint32_t sclear_val = rand() % UINT8_MAX;
|
uint32_t sclear_val = rand() % UINT8_MAX;
|
||||||
if (ds_clear_flags) {
|
if (ds_clear_flags) {
|
||||||
if (state->info.view_mask) {
|
if (state->framebuffer.viewmask) {
|
||||||
u_foreach_bit(i, state->info.view_mask)
|
u_foreach_bit(i, state->framebuffer.viewmask)
|
||||||
clear_attachment_layers(state, state->ds_imgv, &state->render_area,
|
clear_attachment_layers(state, state->ds_imgv, &state->render_area,
|
||||||
i, 1, ds_clear_flags, dclear_val, sclear_val, NULL);
|
i, 1, ds_clear_flags, dclear_val, sclear_val, NULL);
|
||||||
} else {
|
} else {
|
||||||
@@ -2885,7 +2885,7 @@ static void handle_begin_query(struct vk_cmd_queue_entry *cmd,
|
|||||||
|
|
||||||
emit_state(state);
|
emit_state(state);
|
||||||
|
|
||||||
uint32_t count = util_bitcount(state->info.view_mask ? state->info.view_mask : BITFIELD_BIT(0));
|
uint32_t count = util_bitcount(state->framebuffer.viewmask ? state->framebuffer.viewmask : BITFIELD_BIT(0));
|
||||||
for (unsigned idx = 0; idx < count; idx++) {
|
for (unsigned idx = 0; idx < count; idx++) {
|
||||||
if (!pool->queries[qcmd->query + idx]) {
|
if (!pool->queries[qcmd->query + idx]) {
|
||||||
enum pipe_query_type qtype = pool->base_type;
|
enum pipe_query_type qtype = pool->base_type;
|
||||||
@@ -2922,7 +2922,7 @@ static void handle_begin_query_indexed_ext(struct vk_cmd_queue_entry *cmd,
|
|||||||
|
|
||||||
emit_state(state);
|
emit_state(state);
|
||||||
|
|
||||||
uint32_t count = util_bitcount(state->info.view_mask ? state->info.view_mask : BITFIELD_BIT(0));
|
uint32_t count = util_bitcount(state->framebuffer.viewmask ? state->framebuffer.viewmask : BITFIELD_BIT(0));
|
||||||
for (unsigned idx = 0; idx < count; idx++) {
|
for (unsigned idx = 0; idx < count; idx++) {
|
||||||
if (!pool->queries[qcmd->query + idx]) {
|
if (!pool->queries[qcmd->query + idx]) {
|
||||||
enum pipe_query_type qtype = pool->base_type;
|
enum pipe_query_type qtype = pool->base_type;
|
||||||
@@ -2968,7 +2968,7 @@ static void handle_write_timestamp2(struct vk_cmd_queue_entry *cmd,
|
|||||||
if (!(qcmd->stage == VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT))
|
if (!(qcmd->stage == VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT))
|
||||||
state->pctx->flush(state->pctx, NULL, 0);
|
state->pctx->flush(state->pctx, NULL, 0);
|
||||||
|
|
||||||
uint32_t count = util_bitcount(state->info.view_mask ? state->info.view_mask : BITFIELD_BIT(0));
|
uint32_t count = util_bitcount(state->framebuffer.viewmask ? state->framebuffer.viewmask : BITFIELD_BIT(0));
|
||||||
for (unsigned idx = 0; idx < count; idx++) {
|
for (unsigned idx = 0; idx < count; idx++) {
|
||||||
if (!pool->queries[qcmd->query + idx]) {
|
if (!pool->queries[qcmd->query + idx]) {
|
||||||
pool->queries[qcmd->query + idx] = state->pctx->create_query(state->pctx, PIPE_QUERY_TIMESTAMP, 0);
|
pool->queries[qcmd->query + idx] = state->pctx->create_query(state->pctx, PIPE_QUERY_TIMESTAMP, 0);
|
||||||
@@ -3185,8 +3185,8 @@ static void handle_clear_attachments(struct vk_cmd_queue_entry *cmd,
|
|||||||
rect->rect.offset.y = MAX2(rect->rect.offset.y, 0);
|
rect->rect.offset.y = MAX2(rect->rect.offset.y, 0);
|
||||||
rect->rect.extent.width = MIN2(rect->rect.extent.width, state->framebuffer.width - rect->rect.offset.x);
|
rect->rect.extent.width = MIN2(rect->rect.extent.width, state->framebuffer.width - rect->rect.offset.x);
|
||||||
rect->rect.extent.height = MIN2(rect->rect.extent.height, state->framebuffer.height - rect->rect.offset.y);
|
rect->rect.extent.height = MIN2(rect->rect.extent.height, state->framebuffer.height - rect->rect.offset.y);
|
||||||
if (state->info.view_mask) {
|
if (state->framebuffer.viewmask) {
|
||||||
u_foreach_bit(i, state->info.view_mask)
|
u_foreach_bit(i, state->framebuffer.viewmask)
|
||||||
clear_attachment_layers(state, imgv, &rect->rect,
|
clear_attachment_layers(state, imgv, &rect->rect,
|
||||||
i, 1,
|
i, 1,
|
||||||
ds_clear_flags, dclear_val, sclear_val,
|
ds_clear_flags, dclear_val, sclear_val,
|
||||||
|
@@ -2425,7 +2425,6 @@ init_draw_info(struct pipe_draw_info *info,
|
|||||||
info->increment_draw_id = false;
|
info->increment_draw_id = false;
|
||||||
info->was_line_loop = false;
|
info->was_line_loop = false;
|
||||||
info->restart_index = 0;
|
info->restart_index = 0;
|
||||||
info->view_mask = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CSMT_ITEM_NO_WAIT(nine_context_draw_primitive,
|
CSMT_ITEM_NO_WAIT(nine_context_draw_primitive,
|
||||||
|
@@ -854,8 +854,7 @@ struct pipe_draw_info
|
|||||||
/* sizeof(mode) == 1 is required by draw merging in u_threaded_context. */
|
/* sizeof(mode) == 1 is required by draw merging in u_threaded_context. */
|
||||||
uint8_t mode; /**< the mode of the primitive */
|
uint8_t mode; /**< the mode of the primitive */
|
||||||
#endif
|
#endif
|
||||||
uint8_t index_size; /**< if 0, the draw is not indexed. */
|
uint16_t index_size; /**< if 0, the draw is not indexed. */
|
||||||
uint8_t view_mask; /**< mask of multiviews for this draw */
|
|
||||||
bool primitive_restart:1;
|
bool primitive_restart:1;
|
||||||
bool has_user_indices:1; /**< if true, use index.user_buffer */
|
bool has_user_indices:1; /**< if true, use index.user_buffer */
|
||||||
bool index_bounds_valid:1; /**< whether min_index and max_index are valid;
|
bool index_bounds_valid:1; /**< whether min_index and max_index are valid;
|
||||||
|
@@ -1167,7 +1167,6 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
|
|||||||
/* Packed section end. */
|
/* Packed section end. */
|
||||||
info.start_instance = baseInstance;
|
info.start_instance = baseInstance;
|
||||||
info.instance_count = numInstances;
|
info.instance_count = numInstances;
|
||||||
info.view_mask = 0;
|
|
||||||
info.min_index = start;
|
info.min_index = start;
|
||||||
info.max_index = start + count - 1;
|
info.max_index = start + count - 1;
|
||||||
|
|
||||||
@@ -1474,7 +1473,6 @@ _mesa_MultiDrawArrays(GLenum mode, const GLint *first,
|
|||||||
/* Packed section end. */
|
/* Packed section end. */
|
||||||
info.start_instance = 0;
|
info.start_instance = 0;
|
||||||
info.instance_count = 1;
|
info.instance_count = 1;
|
||||||
info.view_mask = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < primcount; i++) {
|
for (int i = 0; i < primcount; i++) {
|
||||||
draw[i].start = first[i];
|
draw[i].start = first[i];
|
||||||
@@ -1640,7 +1638,6 @@ _mesa_validated_drawrangeelements(struct gl_context *ctx,
|
|||||||
*/
|
*/
|
||||||
draw->info.mode = mode;
|
draw->info.mode = mode;
|
||||||
draw->info.index_size = 1 << index_size_shift;
|
draw->info.index_size = 1 << index_size_shift;
|
||||||
draw->info.view_mask = 0;
|
|
||||||
/* Packed section begin. */
|
/* Packed section begin. */
|
||||||
draw->info.primitive_restart = primitive_restart;
|
draw->info.primitive_restart = primitive_restart;
|
||||||
draw->info.has_user_indices = false;
|
draw->info.has_user_indices = false;
|
||||||
@@ -1680,7 +1677,6 @@ _mesa_validated_drawrangeelements(struct gl_context *ctx,
|
|||||||
/* Packed section end. */
|
/* Packed section end. */
|
||||||
info.start_instance = baseInstance;
|
info.start_instance = baseInstance;
|
||||||
info.instance_count = numInstances;
|
info.instance_count = numInstances;
|
||||||
info.view_mask = 0;
|
|
||||||
info.restart_index = ctx->Array._RestartIndex[index_size_shift];
|
info.restart_index = ctx->Array._RestartIndex[index_size_shift];
|
||||||
|
|
||||||
if (info.has_user_indices) {
|
if (info.has_user_indices) {
|
||||||
@@ -2071,7 +2067,6 @@ _mesa_validated_multidrawelements(struct gl_context *ctx,
|
|||||||
/* Packed section end. */
|
/* Packed section end. */
|
||||||
info.start_instance = 0;
|
info.start_instance = 0;
|
||||||
info.instance_count = 1;
|
info.instance_count = 1;
|
||||||
info.view_mask = 0;
|
|
||||||
info.restart_index = ctx->Array._RestartIndex[index_size_shift];
|
info.restart_index = ctx->Array._RestartIndex[index_size_shift];
|
||||||
|
|
||||||
if (info.has_user_indices) {
|
if (info.has_user_indices) {
|
||||||
@@ -2450,7 +2445,6 @@ _mesa_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
|
|||||||
struct pipe_draw_info info;
|
struct pipe_draw_info info;
|
||||||
info.mode = mode;
|
info.mode = mode;
|
||||||
info.index_size = 0;
|
info.index_size = 0;
|
||||||
info.view_mask = 0;
|
|
||||||
/* Packed section begin. */
|
/* Packed section begin. */
|
||||||
info.primitive_restart = false;
|
info.primitive_restart = false;
|
||||||
info.has_user_indices = false;
|
info.has_user_indices = false;
|
||||||
@@ -2545,7 +2539,6 @@ _mesa_MultiDrawElementsIndirect(GLenum mode, GLenum type,
|
|||||||
struct pipe_draw_info info;
|
struct pipe_draw_info info;
|
||||||
info.mode = mode;
|
info.mode = mode;
|
||||||
info.index_size = 1 << index_size_shift;
|
info.index_size = 1 << index_size_shift;
|
||||||
info.view_mask = 0;
|
|
||||||
/* Packed section begin. */
|
/* Packed section begin. */
|
||||||
info.primitive_restart = ctx->Array._PrimitiveRestart[index_size_shift];
|
info.primitive_restart = ctx->Array._PrimitiveRestart[index_size_shift];
|
||||||
info.has_user_indices = false;
|
info.has_user_indices = false;
|
||||||
|
Reference in New Issue
Block a user