glsl: Copy _mesa_shader_type_to_index() to standalone scaffolding.
We can't include shaderobj.h from the standalone utilities, so we unfortunately have to copy this function. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#ifndef STANDALONE_SCAFFOLDING_H
|
#ifndef STANDALONE_SCAFFOLDING_H
|
||||||
#define STANDALONE_SCAFFOLDING_H
|
#define STANDALONE_SCAFFOLDING_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include "main/mtypes.h"
|
#include "main/mtypes.h"
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
@@ -47,6 +48,22 @@ 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);
|
const char *msg, int len);
|
||||||
|
|
||||||
|
static inline gl_shader_type
|
||||||
|
_mesa_shader_type_to_index(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;
|
||||||
|
default:
|
||||||
|
assert(!"bad value in _mesa_shader_type_to_index()");
|
||||||
|
return MESA_SHADER_TYPES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the given gl_context structure to a reasonable set of
|
* Initialize the given gl_context structure to a reasonable set of
|
||||||
* defaults representing the minimum capabilities required by the
|
* defaults representing the minimum capabilities required by the
|
||||||
|
Reference in New Issue
Block a user