aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium')
-rw-r--r--mesalib/src/gallium/auxiliary/Makefile.am6
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_pack_color.h1
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_simple_shaders.c34
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_simple_shaders.h4
4 files changed, 40 insertions, 5 deletions
diff --git a/mesalib/src/gallium/auxiliary/Makefile.am b/mesalib/src/gallium/auxiliary/Makefile.am
index a4eee4773..49792930a 100644
--- a/mesalib/src/gallium/auxiliary/Makefile.am
+++ b/mesalib/src/gallium/auxiliary/Makefile.am
@@ -45,3 +45,9 @@ util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@
+
+# XXX: As a work around for https://bugs.freedesktop.org/show_bug.cgi?id=59334
+# clover needs to link against libgallium.a. Delete this once we have a real
+# fix for this bug.
+all-local: libgallium.la
+ ln -f $(builddir)/.libs/libgallium.a $(builddir)/libgallium.a
diff --git a/mesalib/src/gallium/auxiliary/util/u_pack_color.h b/mesalib/src/gallium/auxiliary/util/u_pack_color.h
index 6c6d9669c..1f6a56a33 100644
--- a/mesalib/src/gallium/auxiliary/util/u_pack_color.h
+++ b/mesalib/src/gallium/auxiliary/util/u_pack_color.h
@@ -52,6 +52,7 @@ union util_color {
ubyte ub;
ushort us;
uint ui;
+ ushort h[4]; /* half float */
float f[4];
double d[4];
};
diff --git a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c
index 5f0134d70..7e3666122 100644
--- a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -316,13 +316,39 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
/**
- * Make simple fragment color pass-through shader.
+ * Make simple fragment color pass-through shader that replicates OUT[0]
+ * to all bound colorbuffers.
*/
void *
-util_make_fragment_passthrough_shader(struct pipe_context *pipe)
+util_make_fragment_passthrough_shader(struct pipe_context *pipe,
+ int input_semantic,
+ int input_interpolate)
{
- return util_make_fragment_cloneinput_shader(pipe, 1, TGSI_SEMANTIC_COLOR,
- TGSI_INTERPOLATE_PERSPECTIVE);
+ static const char shader_templ[] =
+ "FRAG\n"
+ "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n"
+ "DCL IN[0], %s[0], %s\n"
+ "DCL OUT[0], COLOR[0]\n"
+
+ "MOV OUT[0], IN[0]\n"
+ "END\n";
+
+ char text[sizeof(shader_templ)+100];
+ struct tgsi_token tokens[1000];
+ struct pipe_shader_state state = {tokens};
+
+ sprintf(text, shader_templ, tgsi_semantic_names[input_semantic],
+ tgsi_interpolate_names[input_interpolate]);
+
+ if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
+ assert(0);
+ return NULL;
+ }
+#if 0
+ tgsi_dump(state.tokens, 0);
+#endif
+
+ return pipe->create_fs_state(pipe, &state);
}
diff --git a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h
index e4ffde652..22b9cee4d 100644
--- a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h
+++ b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h
@@ -87,7 +87,9 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
extern void *
-util_make_fragment_passthrough_shader(struct pipe_context *pipe);
+util_make_fragment_passthrough_shader(struct pipe_context *pipe,
+ int input_semantic,
+ int input_interpolate);
extern void *