svga_context_create(struct pipe_screen *screen,
void *priv, unsigned flags);
+void svga_toggle_render_condition(struct svga_context *svga,
+ boolean render_condition_enabled,
+ boolean on);
/***********************************************************************
* Inline conversion functions. These are better-typed than the
blit_info->mask != (PIPE_MASK_ZS))
return false;
- if (svga->render_condition && blit_info->render_condition_enable)
- return false;
-
return check_blending_and_srgb_cond(svga, blit_info);
}
{
struct svga_texture *dtex, *stex;
+ if (svga->render_condition && blit_info->render_condition_enable)
+ return false;
+
/* can't copy between different resource types */
if (svga_resource_type(blit_info->src.resource->target) !=
svga_resource_type(blit_info->dst.resource->target))
&dst_face, &dst_z);
if (can_blit_via_copy_region_vgpu10(svga, blit)) {
+ svga_toggle_render_condition(svga, blit->render_condition_enable, FALSE);
+
copy_region_vgpu10(svga,
blit->src.resource,
blit->src.box.x, blit->src.box.y, src_z,
blit->dst.level, dst_face,
blit->src.box.width, blit->src.box.height,
blit->src.box.depth);
+
+ svga_toggle_render_condition(svga, blit->render_condition_enable, TRUE);
+
return true;
}
util_blitter_save_fragment_sampler_views(svga->blitter,
svga->curr.num_sampler_views[PIPE_SHADER_FRAGMENT],
svga->curr.sampler_views[PIPE_SHADER_FRAGMENT]);
- /*util_blitter_save_render_condition(svga->blitter, svga->render_cond_query,
- svga->render_cond_cond, svga->render_cond_mode);*/
if (!can_create_src_view) {
struct pipe_resource template;
blit.dst.resource = newDst;
}
+ svga_toggle_render_condition(svga, blit.render_condition_enable, FALSE);
+
util_blitter_blit(svga->blitter, &blit);
+ svga_toggle_render_condition(svga, blit.render_condition_enable, TRUE);
+
if (blit.dst.resource != dst) {
struct pipe_blit_info copy_region_blit;
{
if (util_can_blit_via_copy_region(blit, TRUE) ||
util_can_blit_via_copy_region(blit, FALSE)) {
+
+ if (svga->render_condition && blit->render_condition_enable) {
+ debug_warning("CPU copy_region doesn't support "
+ "conditional rendering.\n");
+ return false;
+ }
+
copy_region_fallback(svga, blit->dst.resource,
blit->dst.level,
blit->dst.box.x, blit->dst.box.y,
dstx, dsty, width, height);
}
-/**
- * \brief Toggle conditional rendering if already enabled
- *
- * \param svga[in] The svga context
- * \param render_condition_enabled[in] Whether to ignore requests to turn
- * conditional rendering off
- * \param on[in] Whether to turn conditional rendering on or off
- */
-static void
-svga_toggle_render_condition(struct svga_context *svga,
- boolean render_condition_enabled,
- boolean on)
-{
- SVGA3dQueryId query_id;
- enum pipe_error ret;
-
- if (render_condition_enabled ||
- svga->pred.query_id == SVGA3D_INVALID_ID) {
- return;
- }
-
- /*
- * If we get here, it means that the system supports
- * conditional rendering since svga->pred.query_id has already been
- * modified for this context and thus support has already been
- * verified.
- */
- query_id = on ? svga->pred.query_id : SVGA3D_INVALID_ID;
-
- ret = SVGA3D_vgpu10_SetPredication(svga->swc, query_id,
- (uint32) svga->pred.cond);
- if (ret == PIPE_ERROR_OUT_OF_MEMORY) {
- svga_context_flush(svga, NULL);
- ret = SVGA3D_vgpu10_SetPredication(svga->swc, query_id,
- (uint32) svga->pred.cond);
- assert(ret == PIPE_OK);
- }
-}
/**
* \brief Clear render target pipe callback
}
+/**
+ * \brief Toggle conditional rendering if already enabled
+ *
+ * \param svga[in] The svga context
+ * \param render_condition_enabled[in] Whether to ignore requests to turn
+ * conditional rendering off
+ * \param on[in] Whether to turn conditional rendering on or off
+ */
+void
+svga_toggle_render_condition(struct svga_context *svga,
+ boolean render_condition_enabled,
+ boolean on)
+{
+ SVGA3dQueryId query_id;
+ enum pipe_error ret;
+
+ if (render_condition_enabled ||
+ svga->pred.query_id == SVGA3D_INVALID_ID) {
+ return;
+ }
+
+ /*
+ * If we get here, it means that the system supports
+ * conditional rendering since svga->pred.query_id has already been
+ * modified for this context and thus support has already been
+ * verified.
+ */
+ query_id = on ? svga->pred.query_id : SVGA3D_INVALID_ID;
+
+ ret = SVGA3D_vgpu10_SetPredication(svga->swc, query_id,
+ (uint32) svga->pred.cond);
+ if (ret == PIPE_ERROR_OUT_OF_MEMORY) {
+ svga_context_flush(svga, NULL);
+ ret = SVGA3D_vgpu10_SetPredication(svga->swc, query_id,
+ (uint32) svga->pred.cond);
+ assert(ret == PIPE_OK);
+ }
+}
+
+
void
svga_init_query_functions(struct svga_context *svga)
{