summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_context.c
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2014-10-01 20:00:50 +0100
committerAdam Jackson <[email protected]>2017-11-06 16:09:03 -0500
commit6ce9006d76c050663af0be61cc88c3215d6f8cea (patch)
tree91f09acee5206bbf97b6fca37e8afd16fe4b79cc /src/mesa/drivers/dri/i965/brw_context.c
parent791d06b23bba7d8a785a89b86af6ccf03e1271ba (diff)
i965: Enable flush control
Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index bb8b755cb55..879daae7748 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -850,7 +850,9 @@ brwCreateContext(gl_api api,
return false;
}
- if (ctx_config->attribute_mask & ~__DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY) {
+ if (ctx_config->attribute_mask &
+ ~(__DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY |
+ __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR)) {
*dri_ctx_error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
return false;
}
@@ -859,6 +861,20 @@ brwCreateContext(gl_api api,
((ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY) &&
ctx_config->reset_strategy != __DRI_CTX_RESET_NO_NOTIFICATION);
+ GLenum release_behavior = GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH;
+ if (ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR) {
+ switch (ctx_config->release_behavior) {
+ case __DRI_CTX_RELEASE_BEHAVIOR_NONE:
+ release_behavior = GL_NONE;
+ break;
+ case __DRI_CTX_RELEASE_BEHAVIOR_FLUSH:
+ break;
+ default:
+ *dri_ctx_error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
+ return false;
+ }
+ }
+
struct brw_context *brw = rzalloc(NULL, struct brw_context);
if (!brw) {
fprintf(stderr, "%s: failed to alloc context\n", __func__);
@@ -1030,6 +1046,8 @@ brwCreateContext(gl_api api,
ctx->Const.RobustAccess = GL_TRUE;
}
+ ctx->Const.ContextReleaseBehavior = release_behavior;
+
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
brw_init_shader_time(brw);