brw->need_flush_throttle = true;
}
+static void
+intel_glEnable(struct gl_context *ctx, GLenum cap, GLboolean state)
+{
+ struct brw_context *brw = brw_context(ctx);
+
+ switch (cap) {
+ case GL_BLACKHOLE_RENDER_INTEL:
+ brw->frontend_noop = state;
+ intel_batchbuffer_flush(brw);
+ intel_batchbuffer_maybe_noop(brw);
+ /* Because we started previous batches with a potential
+ * MI_BATCH_BUFFER_END if NOOP was enabled, that means that anything
+ * that was ever emitted after that never made it to the HW. So when the
+ * blackhole state changes from NOOP->!NOOP reupload the entire state.
+ */
+ if (!brw->frontend_noop) {
+ brw->NewGLState = ~0u;
+ brw->ctx.NewDriverState = ~0ull;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
static void
intel_finish(struct gl_context * ctx)
{
if (!brw->driContext->driScreenPriv->dri2.useInvalidate)
functions->Viewport = intel_viewport;
+ functions->Enable = intel_glEnable;
functions->Flush = intel_glFlush;
functions->Finish = intel_finish;
functions->GetString = intel_get_string;
*/
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
brw_collect_and_report_shader_time(brw);
+
+ intel_batchbuffer_maybe_noop(brw);
}
/**
return ret;
}
+void
+intel_batchbuffer_maybe_noop(struct brw_context *brw)
+{
+ if (!brw->frontend_noop || USED_BATCH(brw->batch) != 0)
+ return;
+
+ BEGIN_BATCH(1);
+ OUT_BATCH(MI_BATCH_BUFFER_END);
+ ADVANCE_BATCH();
+}
+
bool
brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo)
{
int _intel_batchbuffer_flush_fence(struct brw_context *brw,
int in_fence_fd, int *out_fence_fd,
const char *file, int line);
+void intel_batchbuffer_maybe_noop(struct brw_context *brw);
#define intel_batchbuffer_flush(brw) \
_intel_batchbuffer_flush_fence((brw), -1, NULL, __FILE__, __LINE__)
ctx->Extensions.OES_copy_image = true;
}
+ /* Gen < 6 still uses the blitter. It's somewhat annoying to add support
+ * for blackhole there... Does anybody actually care anymore anyway?
+ */
+ if (devinfo->gen >= 6)
+ ctx->Extensions.INTEL_blackhole_render = true;
+
if (devinfo->gen >= 8) {
ctx->Extensions.ARB_gpu_shader_int64 = true;
/* requires ARB_gpu_shader_int64 */