Revert "i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6"
[mesa.git] / src / glsl / standalone_scaffolding.h
index 096b2f114c7ed219b2c13538543bb249231c2176..df783afdb44bc5baf18de60dc9d1d57760b1e3b2 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef STANDALONE_SCAFFOLDING_H
 #define STANDALONE_SCAFFOLDING_H
 
+#include <assert.h>
 #include "main/mtypes.h"
 
 extern "C" void
@@ -44,9 +45,27 @@ extern "C" struct gl_shader *
 _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
 
 extern "C" void
-_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint id,
+_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
                    const char *msg, int len);
 
+static inline gl_shader_stage
+_mesa_shader_enum_to_shader_stage(GLenum v)
+{
+   switch (v) {
+   case GL_VERTEX_SHADER:
+      return MESA_SHADER_VERTEX;
+   case GL_FRAGMENT_SHADER:
+      return MESA_SHADER_FRAGMENT;
+   case GL_GEOMETRY_SHADER:
+      return MESA_SHADER_GEOMETRY;
+   case GL_COMPUTE_SHADER:
+      return MESA_SHADER_COMPUTE;
+   default:
+      assert(!"bad value in _mesa_shader_enum_to_shader_stage()");
+      return MESA_SHADER_VERTEX;
+   }
+}
+
 /**
  * Initialize the given gl_context structure to a reasonable set of
  * defaults representing the minimum capabilities required by the