glsl: Prepare standalone compiler to be able to use parameter lists
authorCarl Worth <cworth@cworth.org>
Thu, 12 Mar 2015 00:31:11 +0000 (17:31 -0700)
committerTimothy Arceri <timothy.arceri@collabora.com>
Tue, 27 Sep 2016 01:11:15 +0000 (11:11 +1000)
As part of the shader-cache work an upcoming change will add new
references to _mesa_add_parameter and _mesa_new_parameter_list from
the glsl code. To prepare for that, and to allow the standalone
glsl_compiler to still link, here we add mesa/program/prog_parameter.c
to the libglsl_util sources.

Then, in order to get *that* to work, we also add to stubs to
standalone_scaffolding:

_mesa_program_state_flags
_mesa_program_state_string

These functions aren't actually used by the two functions in
prog_parameter.c that we are actually calling. They are used in other
functions in the same file. So we don't care what the implementation
of these stubs is, (they won't be called by glsl_compiler). We just
need the stubs present so that it can link.

Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/Makefile.am
src/compiler/glsl/standalone_scaffolding.cpp
src/compiler/glsl/standalone_scaffolding.h

index b0b64d738861c7c982f6a7148aa96925146c0af4..551f4312ac4391c5da9afd55e2c062747b35d1ff 100644 (file)
@@ -110,6 +110,8 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/include/ \
        -I$(top_srcdir)/src/mapi/ \
        -I$(top_srcdir)/src/mesa/ \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary \
        $(DEFINES)
 
 noinst_LTLIBRARIES = libglsl_util.la
@@ -117,5 +119,6 @@ noinst_LTLIBRARIES = libglsl_util.la
 libglsl_util_la_SOURCES = \
        mesa/main/extensions_table.c \
        mesa/main/imports.c \
+       mesa/program/prog_parameter.c \
        mesa/program/symbol_table.c \
        mesa/program/dummy_errors.c
index b0fb4b726aeb0784f972c8a1b44a9fc51c2bc6f1..aa79b8659e90d17fcbbda5654a45c828bda47f4d 100644 (file)
@@ -95,6 +95,18 @@ _mesa_new_linked_shader(gl_shader_stage stage)
    return shader;
 }
 
+GLbitfield
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
+{
+   return 0;
+}
+
+char *
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
+{
+   return NULL;
+}
+
 void
 _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
 {
index a19eae28de62cd700140e0f6a485fa2eab3ff447..b56dd3e8707bf58c15b73ee9e19335b450f42e83 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <assert.h>
 #include "main/mtypes.h"
+#include "program/prog_statevars.h"
 
 extern "C" void
 _mesa_warning(struct gl_context *ctx, const char *fmtString, ... );
@@ -61,6 +62,13 @@ extern "C" void
 _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
                    const char *msg);
 
+extern "C" GLbitfield
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
+
+
+extern "C" char *
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
+
 static inline gl_shader_stage
 _mesa_shader_enum_to_shader_stage(GLenum v)
 {