[Mesa-dev] [PATCH 5/5] i965: add __DRI2_BLOB support and set cache functions
Tapani Pälli
tapani.palli at intel.com
Mon Jan 22 13:00:37 UTC 2018
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
src/mesa/drivers/dri/i965/intel_screen.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index a4e34e9f2c..84009382c6 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -36,6 +36,7 @@
#include "main/version.h"
#include "swrast/s_renderbuffer.h"
#include "util/ralloc.h"
+#include "util/disk_cache.h"
#include "brw_defines.h"
#include "brw_state.h"
#include "compiler/nir/nir.h"
@@ -1493,6 +1494,19 @@ brw_query_renderer_string(__DRIscreen *dri_screen,
return -1;
}
+static void
+brw_set_cache_funcs(__DRIcontext *dri_ctx,
+ __DRIblobCacheSet set, __DRIblobCacheGet get)
+{
+ struct brw_context *brw = dri_ctx->driverPrivate;
+ struct gl_context *ctx = &brw->ctx;
+
+ if (!ctx->Cache)
+ return;
+
+ disk_cache_set_callbacks(ctx->Cache, set, get);
+}
+
static const __DRI2rendererQueryExtension intelRendererQueryExtension = {
.base = { __DRI2_RENDERER_QUERY, 1 },
@@ -1504,6 +1518,11 @@ static const __DRIrobustnessExtension dri2Robustness = {
.base = { __DRI2_ROBUSTNESS, 1 }
};
+static const __DRI2blobExtension intelBlobExtension = {
+ .base = { __DRI2_BLOB, 1 },
+ .set_cache_funcs = brw_set_cache_funcs
+};
+
static const __DRIextension *screenExtensions[] = {
&intelTexBufferExtension.base,
&intelFenceExtension.base,
@@ -1512,6 +1531,7 @@ static const __DRIextension *screenExtensions[] = {
&intelRendererQueryExtension.base,
&dri2ConfigQueryExtension.base,
&dri2NoErrorExtension.base,
+ &intelBlobExtension.base,
NULL
};
@@ -1524,6 +1544,7 @@ static const __DRIextension *intelRobustScreenExtensions[] = {
&dri2ConfigQueryExtension.base,
&dri2Robustness.base,
&dri2NoErrorExtension.base,
+ &intelBlobExtension.base,
NULL
};
--
2.14.3
More information about the mesa-dev
mailing list