summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965/brw_screen.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-05 20:50:50 +0200
committerLuca Barbieri <[email protected]>2010-09-14 06:07:41 +0200
commita508d2dddcc67d0f92cc36b9ed6f36a9bbfc579d (patch)
tree54e2cd38f19fdd1b47bbbe5c6d913fcf2e894d77 /src/gallium/drivers/i965/brw_screen.c
parent309cd4115b7cba669a0bf858e7809cb6dae90ddf (diff)
gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)
Changes in v3: - Also change trace, which I forgot about Changes in v2: - No longer adds tessellation shaders Currently each shader cap has FS and VS versions. However, we want a version of them for geometry, tessellation control, and tessellation evaluation shaders, and want to be able to easily query a given cap type for a given shader stage. Since having 5 duplicates of each shader cap is unmanageable, add a new get_shader_param function that takes both a shader cap from a new enum and a shader stage. Drivers with non-unified shaders will first switch on the shader and, within each case, switch on the cap. Drivers with unified shaders instead first check whether the shader is supported, and then switch on the cap. MAX_CONST_BUFFERS is now per-stage. The geometry shader cap is removed in favor of checking whether the limit of geometry shader instructions is greater than 0, which is also used for tessellation shaders. WARNING: all drivers changed and compiled but only nvfx tested
Diffstat (limited to 'src/gallium/drivers/i965/brw_screen.c')
-rw-r--r--src/gallium/drivers/i965/brw_screen.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c
index bdfead73cc8..23599806197 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -197,6 +197,49 @@ brw_get_param(struct pipe_screen *screen, enum pipe_cap param)
}
}
+static int
+brw_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param)
+{
+ switch(shader) {
+ case PIPE_SHADER_VERTEX:
+ case PIPE_SHADER_FRAGMENT:
+ case PIPE_SHADER_GEOMETRY:
+ break;
+ default:
+ return 0;
+ }
+
+ /* XXX: these are just shader model 4.0 values, fix this! */
+ switch(param) {
+ case PIPE_SHADER_CAP_MAX_INSTRUCTIONS:
+ return 65536;
+ case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS:
+ return 65536;
+ case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS:
+ return 65536;
+ case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS:
+ return 65536;
+ case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
+ return 65536;
+ case PIPE_SHADER_CAP_MAX_INPUTS:
+ return 32;
+ case PIPE_SHADER_CAP_MAX_CONSTS:
+ return 4096;
+ case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
+ return PIPE_MAX_CONSTANT_BUFFERS;
+ case PIPE_SHADER_CAP_MAX_TEMPS:
+ return 4096;
+ case PIPE_SHADER_CAP_MAX_ADDRS:
+ return 0;
+ case PIPE_SHADER_CAP_MAX_PREDS:
+ return 0;
+ case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
+ return 1;
+ default:
+ break;
+ }
+}
+
static float
brw_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
{
@@ -410,6 +453,7 @@ brw_screen_create(struct brw_winsys_screen *sws)
bscreen->base.get_name = brw_get_name;
bscreen->base.get_vendor = brw_get_vendor;
bscreen->base.get_param = brw_get_param;
+ bscreen->base.get_shader_param = brw_get_shader_param;
bscreen->base.get_paramf = brw_get_paramf;
bscreen->base.is_format_supported = brw_is_format_supported;
bscreen->base.context_create = brw_create_context;