From 6dddd184803da5f67f69e7c243dbb596b4dd4b9d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 12 Jul 2012 20:47:20 +0100 Subject: draw,gallivm: Fix draw_get_shader_param. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use LLVM limits when LLVM is being used, instead of TGSI limits - Provide draw_get_shader_param_no_llvm for when llvm is never used (softpipe) - Eliminate several of the hacks around draw shader caps in several drivers Unfortunately the hack for PIPE_MAX_VERTEX_SAMPLERS is still necessary. Reviewed-by: Marek Olšák --- src/gallium/drivers/i915/i915_screen.c | 2 -- src/gallium/drivers/llvmpipe/lp_screen.c | 6 +----- src/gallium/drivers/softpipe/sp_screen.c | 18 ++++++------------ 3 files changed, 7 insertions(+), 19 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 88c826085c1..35b343e0de8 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -110,8 +110,6 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha return PIPE_MAX_VERTEX_SAMPLERS; else return 0; - case PIPE_SHADER_CAP_INTEGERS: - return 1; default: return draw_get_shader_param(shader, cap); } diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 930a9ee16af..61aa1925eec 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -222,10 +222,8 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe { case PIPE_SHADER_FRAGMENT: switch (param) { - case PIPE_SHADER_CAP_INTEGERS: - return 0; default: - return tgsi_exec_get_shader_param(param); + return gallivm_get_shader_param(param); } case PIPE_SHADER_VERTEX: case PIPE_SHADER_GEOMETRY: @@ -239,8 +237,6 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe return PIPE_MAX_VERTEX_SAMPLERS; else return 0; - case PIPE_SHADER_CAP_INTEGERS: - return 0; default: return draw_get_shader_param(shader, param); } diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 684f0358955..5588611edcf 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -177,9 +177,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) static int softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param) { -#ifdef HAVE_LLVM struct softpipe_screen *sp_screen = softpipe_screen(screen); -#endif switch(shader) { case PIPE_SHADER_FRAGMENT: @@ -188,20 +186,16 @@ softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe case PIPE_SHADER_GEOMETRY: switch (param) { case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: -#ifdef HAVE_LLVM if (sp_screen->use_llvm) /* Softpipe doesn't yet know how to tell draw/llvm about textures */ return 0; -#endif - return PIPE_MAX_VERTEX_SAMPLERS; - case PIPE_SHADER_CAP_INTEGERS: -#ifdef HAVE_LLVM /* gallivm doesn't support integers yet */ - if (sp_screen->use_llvm) - return 0; -#endif - /* fallthrough */ + else + return PIPE_MAX_VERTEX_SAMPLERS; default: - return draw_get_shader_param(shader, param); + if (sp_screen->use_llvm) + return draw_get_shader_param(shader, param); + else + return draw_get_shader_param_no_llvm(shader, param); } default: return 0; -- cgit v1.2.3