summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-05-12 14:10:50 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-05-12 14:11:28 +0100
commit686215d9e5c87ace953b11559ec8ca24f5a3b4e4 (patch)
tree19ce2b7d9588ea383100e7dbd16192d68faafa25 /src
parenta1b3ca6a142a2ad4f819de2b554872c9b8e8f237 (diff)
svga: Advertise shader limits.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 580340b237..2c3c3f5220 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -177,6 +177,57 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
return 0;
+ /*
+ * Fragment shader limits
+ */
+
+ case PIPE_CAP_MAX_FS_INSTRUCTIONS:
+ case PIPE_CAP_MAX_FS_ALU_INSTRUCTIONS:
+ case PIPE_CAP_MAX_FS_TEX_INSTRUCTIONS:
+ case PIPE_CAP_MAX_FS_TEX_INDIRECTIONS:
+ return svgascreen->use_ps30 ? 512 : 96;
+ case PIPE_CAP_MAX_FS_CONTROL_FLOW_DEPTH:
+ return SVGA3D_MAX_NESTING_LEVEL;
+ case PIPE_CAP_MAX_FS_INPUTS:
+ return 10;
+ case PIPE_CAP_MAX_FS_CONSTS:
+ return svgascreen->use_vs30 ? 224 : 16;
+ case PIPE_CAP_MAX_FS_TEMPS:
+ if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS, &result))
+ return svgascreen->use_ps30 ? 32 : 12;
+ return result.u;
+ case PIPE_CAP_MAX_FS_ADDRS:
+ return svgascreen->use_ps30 ? 1 : 0;
+ case PIPE_CAP_MAX_FS_PREDS:
+ return svgascreen->use_ps30 ? 1 : 0;
+
+ /*
+ * Vertex shader limits
+ */
+ case PIPE_CAP_MAX_VS_INSTRUCTIONS:
+ case PIPE_CAP_MAX_VS_ALU_INSTRUCTIONS:
+ if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS, &result))
+ return svgascreen->use_vs30 ? 512 : 256;
+ return result.u;
+ case PIPE_CAP_MAX_VS_TEX_INSTRUCTIONS:
+ case PIPE_CAP_MAX_VS_TEX_INDIRECTIONS:
+ /* XXX: until we have vertex texture support */
+ return 0;
+ case PIPE_CAP_MAX_VS_CONTROL_FLOW_DEPTH:
+ return SVGA3D_MAX_NESTING_LEVEL;
+ case PIPE_CAP_MAX_VS_INPUTS:
+ return 16;
+ case PIPE_CAP_MAX_VS_CONSTS:
+ return 256;
+ case PIPE_CAP_MAX_VS_TEMPS:
+ if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS, &result))
+ return svgascreen->use_vs30 ? 32 : 12;
+ return result.u;
+ case PIPE_CAP_MAX_VS_ADDRS:
+ return svgascreen->use_vs30 ? 1 : 0;
+ case PIPE_CAP_MAX_VS_PREDS:
+ return svgascreen->use_vs30 ? 1 : 0;
+
default:
return 0;
}