sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY);
}
}
-
- ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId,
- (uint32) condition);
- if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
+ /*
+ * if the kernel module doesn't support the predication command,
+ * we'll just render unconditionally.
+ * This is probably acceptable for the typical case of occlusion culling.
+ */
+ if (sws->have_set_predication_cmd) {
ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId,
(uint32) condition);
+ if (ret != PIPE_OK) {
+ svga_context_flush(svga, NULL);
+ ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId,
+ (uint32) condition);
+ }
}
}
return 1; /* may be a sw fallback, depending on restart index */
case PIPE_CAP_GENERATE_MIPMAP:
- return sws->have_vgpu10;
+ return sws->have_generate_mipmap_cmd;
/* Unsupported features */
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
/** To rebind resources at the beginnning of a new command buffer */
boolean need_to_rebind_resources;
+
+ boolean have_generate_mipmap_cmd;
+ boolean have_set_predication_cmd;
};
" (%i, %s).\n", ret, strerror(-ret));
goto out_no_caps;
}
+
+ if (((version->version_major == 2 && version->version_minor >= 10)
+ || version->version_major > 2) && vws->base.have_vgpu10) {
+
+ /* support for these commands didn't make it into vmwgfx kernel
+ * modules before 2.10.
+ */
+ vws->base.have_generate_mipmap_cmd = TRUE;
+ vws->base.have_set_predication_cmd = TRUE;
+ }
+
free(cap_buffer);
drmFreeVersion(version);
vmw_printf("%s OK\n", __FUNCTION__);