summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r--src/gallium/drivers/i915/i915_state.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index b2f52d5d689..c90fcfd7491 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -42,6 +42,7 @@
#include "i915_state_inlines.h"
#include "i915_fpc.h"
#include "i915_resource.h"
+#include "i915_state.h"
/* The i915 (and related graphics cores) do not support GL_CLAMP. The
* Intel drivers for "other operating systems" implement GL_CLAMP as
@@ -812,6 +813,26 @@ i915_set_sampler_views(struct pipe_context *pipe, unsigned shader,
}
+struct pipe_sampler_view *
+i915_create_sampler_view_custom(struct pipe_context *pipe,
+ struct pipe_resource *texture,
+ const struct pipe_sampler_view *templ,
+ unsigned width0,
+ unsigned height0)
+{
+ struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
+
+ if (view) {
+ *view = *templ;
+ view->reference.count = 1;
+ view->texture = NULL;
+ pipe_resource_reference(&view->texture, texture);
+ view->context = pipe;
+ }
+
+ return view;
+}
+
static struct pipe_sampler_view *
i915_create_sampler_view(struct pipe_context *pipe,
struct pipe_resource *texture,