summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state.c
diff options
context:
space:
mode:
authorStéphane Marchesin <[email protected]>2014-05-26 06:48:11 -0700
committerStéphane Marchesin <[email protected]>2014-05-26 23:08:49 -0700
commitb419ca937a666b0e5a6aca4cf179d8d43e0a3996 (patch)
tree42b78d1fd6c0be448a3f887426cd52556bfa78a5 /src/gallium/drivers/i915/i915_state.c
parenta26e2bc2e3578b50bd581c8f8d8e3c428c85158f (diff)
i915g: handle more formats in copy
We can handle depth, luminance,... copies by simply replacing the format with a known format of the same bpp.
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,