summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_context.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-03-22 07:58:39 +1000
committerDave Airlie <airlied@redhat.com>2016-03-31 09:14:11 +1000
commit0d1f679dedfb47944259e846d7f2eadbcf0907ca (patch)
tree31475536d0da8b84c49c0f5a2bf3da554a1dcac3 /src/gallium/auxiliary/draw/draw_context.c
parent22d1296013825a4dce84e6f579581202a18767c7 (diff)
downloadexternal_mesa3d-0d1f679dedfb47944259e846d7f2eadbcf0907ca.tar.gz
external_mesa3d-0d1f679dedfb47944259e846d7f2eadbcf0907ca.tar.bz2
external_mesa3d-0d1f679dedfb47944259e846d7f2eadbcf0907ca.zip
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 <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
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 16a261c14c..2ba9b09966 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;
+ }
+}
+