summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_context.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-03-22 07:58:39 +1000
committerDave Airlie <[email protected]>2016-03-31 09:14:11 +1000
commit0d1f679dedfb47944259e846d7f2eadbcf0907ca (patch)
tree31475536d0da8b84c49c0f5a2bf3da554a1dcac3 /src/gallium/auxiliary/draw/draw_context.c
parent22d1296013825a4dce84e6f579581202a18767c7 (diff)
draw: add support for passing images to vs/gs shaders.
This just adds support for passing through images to the tgsi execution stage. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 16a261c14cf..2ba9b099664 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -731,6 +731,24 @@ draw_texture_sampler(struct draw_context *draw,
}
}
+/**
+ * Provide TGSI image objects for vertex/geometry shaders that use
+ * texture fetches. This state only needs to be set once per context.
+ * This might only be used by software drivers for the time being.
+ */
+void
+draw_image(struct draw_context *draw,
+ uint shader,
+ struct tgsi_image *image)
+{
+ if (shader == PIPE_SHADER_VERTEX) {
+ draw->vs.tgsi.image = image;
+ } else {
+ debug_assert(shader == PIPE_SHADER_GEOMETRY);
+ draw->gs.tgsi.image = image;
+ }
+}
+