sbuf.buffer_offset = qbuf->head;
sbuf.buffer_size = sizeof(struct gfx10_sh_query_buffer_mem);
si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, &sbuf);
+ sctx->current_vs_state |= S_VS_STATE_STREAMOUT_QUERY_ENABLED(1);
si_mark_atom_dirty(sctx, &sctx->atoms.s.shader_query);
return true;
gfx10_alloc_query_buffer(sctx);
} else {
si_set_rw_shader_buffer(sctx, GFX10_GS_QUERY_BUF, NULL);
+ sctx->current_vs_state &= C_VS_STATE_STREAMOUT_QUERY_ENABLED;
/* If a query_begin is followed by a query_end without a draw
* in-between, we need to clear the atom to ensure that the
/* Update query buffer */
/* TODO: this won't catch 96-bit clear_buffer via transform feedback. */
if (!info->properties[TGSI_PROPERTY_VS_BLIT_SGPRS]) {
+ tmp = si_unpack_param(ctx, ctx->param_vs_state_bits, 6, 1);
+ tmp = LLVMBuildTrunc(builder, tmp, ctx->i1, "");
+ ac_build_ifcc(&ctx->ac, tmp, 5029); /* if (STREAMOUT_QUERY_ENABLED) */
tmp = LLVMBuildICmp(builder, LLVMIntEQ, get_wave_id_in_tg(ctx), ctx->ac.i32_0, "");
ac_build_ifcc(&ctx->ac, tmp, 5030);
tmp = LLVMBuildICmp(builder, LLVMIntULE, ac_get_thread_id(&ctx->ac),
}
ac_build_endif(&ctx->ac, 5031);
ac_build_endif(&ctx->ac, 5030);
+ ac_build_endif(&ctx->ac, 5029);
}
/* Export primitive data to the index buffer. Format is:
}
/* Write shader query data. */
+ tmp = si_unpack_param(ctx, ctx->param_vs_state_bits, 6, 1);
+ tmp = LLVMBuildTrunc(builder, tmp, ctx->i1, "");
+ ac_build_ifcc(&ctx->ac, tmp, 5109); /* if (STREAMOUT_QUERY_ENABLED) */
unsigned num_query_comps = sel->so.num_outputs ? 8 : 4;
tmp = LLVMBuildICmp(builder, LLVMIntULT, tid,
LLVMConstInt(ctx->i32, num_query_comps, false), "");
ctx->i32, args, 5, 0);
}
ac_build_endif(&ctx->ac, 5110);
+ ac_build_endif(&ctx->ac, 5109);
/* TODO: culling */
#define C_VS_STATE_OUTPRIM 0xFFFFFFF3
#define S_VS_STATE_PROVOKING_VTX_INDEX(x) (((unsigned)(x) & 0x3) << 4)
#define C_VS_STATE_PROVOKING_VTX_INDEX 0xFFFFFFCF
+#define S_VS_STATE_STREAMOUT_QUERY_ENABLED(x) (((unsigned)(x) & 0x1) << 6)
+#define C_VS_STATE_STREAMOUT_QUERY_ENABLED 0xFFFFFFBF
#define S_VS_STATE_LS_OUT_PATCH_SIZE(x) (((unsigned)(x) & 0x1FFF) << 8)
#define C_VS_STATE_LS_OUT_PATCH_SIZE 0xFFE000FF
#define S_VS_STATE_LS_OUT_VERTEX_SIZE(x) (((unsigned)(x) & 0xFF) << 24)