[Mesa-dev] [PATCH 2/3] glsl_to_tgsi: follow SHADER_CAP_INTEGERS with per-stage granularity
Brian Paul
brian.e.paul at gmail.com
Thu Jul 5 06:35:51 PDT 2012
On Tue, Jul 3, 2012 at 6:35 PM, Marek Olšák <maraeo at gmail.com> wrote:
> Some drivers support integers only in vertex shaders (e.g. those which use
> Draw).
>
> Const.NativeIntegers is now useless for Gallium.
> ---
> src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 28 ++++++++++++++++++++++++++--
> 1 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index b6abe84..9fa298f 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4742,6 +4742,22 @@ out:
> }
> /* ----------------------------- End TGSI code ------------------------------ */
>
> +static unsigned
> +gl_shader_to_pipe_shader(unsigned gl_shader)
> +{
> + switch (gl_shader) {
> + case GL_VERTEX_SHADER:
> + return PIPE_SHADER_VERTEX;
> + case GL_GEOMETRY_SHADER:
> + return PIPE_SHADER_GEOMETRY;
> + case GL_FRAGMENT_SHADER:
> + return PIPE_SHADER_FRAGMENT;
> + default:
> + assert(!"should not be reached");
How about assert(!"bad shader type in gl_shader_to_pipe_shader()");
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list