diff options
author | Stéphane Marchesin <[email protected]> | 2011-10-08 23:54:53 -0700 |
---|---|---|
committer | Stéphane Marchesin <[email protected]> | 2011-10-08 23:54:53 -0700 |
commit | 8a22064d316efcdc0d0107fe227a2ed5a746c4f8 (patch) | |
tree | 75781f971736cb5ba4d7a024c8bfd41037f5e26d /src/gallium/drivers/i915/i915_screen.c | |
parent | e125786be8e19a9606afb91cd7e8bc37d035b63f (diff) |
i915g: Implement vertex textures.
Diffstat (limited to 'src/gallium/drivers/i915/i915_screen.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_screen.c | 129 |
1 files changed, 69 insertions, 60 deletions
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index cc818351577..7d9b8653ea6 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -100,6 +100,69 @@ i915_get_name(struct pipe_screen *screen) } static int +i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap cap) +{ + switch(shader) { + case PIPE_SHADER_VERTEX: + switch (cap) { + case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: + if (debug_get_bool_option("DRAW_USE_LLVM", TRUE)) + return PIPE_MAX_VERTEX_SAMPLERS; + else + return 0; + default: + return draw_get_shader_param(shader, cap); + } + case PIPE_SHADER_FRAGMENT: + /* XXX: these are just shader model 2.0 values, fix this! */ + switch(cap) { + case PIPE_SHADER_CAP_MAX_INSTRUCTIONS: + return 96; + case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS: + return 64; + case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: + return 32; + case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: + return 8; + case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: + return 0; + case PIPE_SHADER_CAP_MAX_INPUTS: + return 10; + case PIPE_SHADER_CAP_MAX_CONSTS: + return 32; + case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: + return 1; + case PIPE_SHADER_CAP_MAX_TEMPS: + return 12; /* XXX: 12 -> 32 ? */ + case PIPE_SHADER_CAP_MAX_ADDRS: + return 0; + case PIPE_SHADER_CAP_MAX_PREDS: + return 0; + case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: + return 0; + case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR: + case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR: + case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR: + case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR: + return 1; + case PIPE_SHADER_CAP_SUBROUTINES: + return 0; + case PIPE_SHADER_CAP_INTEGERS: + return 0; + case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: + return 8; + default: + debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); + return 0; + } + break; + default: + return 0; + } + +} + +static int i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) { struct i915_screen *is = i915_screen(screen); @@ -143,7 +206,12 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) /* Texturing. */ case PIPE_CAP_MAX_COMBINED_SAMPLERS: - return 8; + return i915_get_shader_param(screen, + PIPE_SHADER_VERTEX, + PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) + + i915_get_shader_param(screen, + PIPE_SHADER_FRAGMENT, + PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS); case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: return I915_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: @@ -172,65 +240,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) } } -static int -i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap cap) -{ - switch(shader) { - case PIPE_SHADER_VERTEX: - switch (cap) { - case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: - return 0; - default: - return draw_get_shader_param(shader, cap); - } - case PIPE_SHADER_FRAGMENT: - /* XXX: these are just shader model 2.0 values, fix this! */ - switch(cap) { - case PIPE_SHADER_CAP_MAX_INSTRUCTIONS: - return 96; - case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS: - return 64; - case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: - return 32; - case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: - return 8; - case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: - return 0; - case PIPE_SHADER_CAP_MAX_INPUTS: - return 10; - case PIPE_SHADER_CAP_MAX_CONSTS: - return 32; - case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: - return 1; - case PIPE_SHADER_CAP_MAX_TEMPS: - return 12; /* XXX: 12 -> 32 ? */ - case PIPE_SHADER_CAP_MAX_ADDRS: - return 0; - case PIPE_SHADER_CAP_MAX_PREDS: - return 0; - case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: - return 0; - case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR: - case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR: - case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR: - case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR: - return 1; - case PIPE_SHADER_CAP_SUBROUTINES: - return 0; - case PIPE_SHADER_CAP_INTEGERS: - return 0; - case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: - return 8; - default: - debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); - return 0; - } - default: - return 0; - } - -} - static float i915_get_paramf(struct pipe_screen *screen, enum pipe_cap cap) { |