summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-05 20:50:50 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-14 06:07:41 +0200
commita508d2dddcc67d0f92cc36b9ed6f36a9bbfc579d (patch)
tree54e2cd38f19fdd1b47bbbe5c6d913fcf2e894d77 /src/gallium/include
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/include')
-rw-r--r--src/gallium/include/pipe/p_compiler.h1
-rw-r--r--src/gallium/include/pipe/p_defines.h46
-rw-r--r--src/gallium/include/pipe/p_screen.h6
3 files changed, 23 insertions, 30 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 0a5be43f6b..5020599591 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -35,6 +35,7 @@
#include <string.h>
#include <stddef.h>
#include <stdarg.h>
+#include <limits.h>
#if defined(_WIN32) && !defined(__WIN32__)
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 627b5ae538..8b4663742f 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -449,16 +449,12 @@ enum pipe_cap {
PIPE_CAP_TEXTURE_MIRROR_CLAMP,
PIPE_CAP_TEXTURE_MIRROR_REPEAT,
PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS,
- PIPE_CAP_TGSI_CONT_SUPPORTED,
PIPE_CAP_BLEND_EQUATION_SEPARATE,
PIPE_CAP_SM3, /*< Shader Model, supported */
PIPE_CAP_STREAM_OUTPUT,
- PIPE_CAP_MAX_PREDICATE_REGISTERS,
/** Maximum texture image units accessible from vertex and fragment shaders
* combined */
PIPE_CAP_MAX_COMBINED_SAMPLERS,
- PIPE_CAP_MAX_CONST_BUFFERS,
- PIPE_CAP_MAX_CONST_BUFFER_SIZE, /*< In bytes */
/** blend enables and write masks per rendertarget */
PIPE_CAP_INDEP_BLEND_ENABLE,
/** different blend funcs per rendertarget */
@@ -468,35 +464,25 @@ enum pipe_cap {
PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT,
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER,
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER,
-
- /*
- * Shader limits.
- */
- PIPE_CAP_MAX_FS_INSTRUCTIONS,
- PIPE_CAP_MAX_FS_ALU_INSTRUCTIONS,
- PIPE_CAP_MAX_FS_TEX_INSTRUCTIONS,
- PIPE_CAP_MAX_FS_TEX_INDIRECTIONS,
- PIPE_CAP_MAX_FS_CONTROL_FLOW_DEPTH,
- PIPE_CAP_MAX_FS_INPUTS,
- PIPE_CAP_MAX_FS_CONSTS,
- PIPE_CAP_MAX_FS_TEMPS,
- PIPE_CAP_MAX_FS_ADDRS,
- PIPE_CAP_MAX_FS_PREDS,
- PIPE_CAP_MAX_VS_INSTRUCTIONS,
- PIPE_CAP_MAX_VS_ALU_INSTRUCTIONS,
- PIPE_CAP_MAX_VS_TEX_INSTRUCTIONS,
- PIPE_CAP_MAX_VS_TEX_INDIRECTIONS,
- PIPE_CAP_MAX_VS_CONTROL_FLOW_DEPTH,
- PIPE_CAP_MAX_VS_INPUTS,
- PIPE_CAP_MAX_VS_CONSTS,
- PIPE_CAP_MAX_VS_TEMPS,
- PIPE_CAP_MAX_VS_ADDRS,
- PIPE_CAP_MAX_VS_PREDS,
-
- PIPE_CAP_GEOMETRY_SHADER4,
PIPE_CAP_DEPTH_CLAMP
};
+/* Shader caps not specific to any single stage */
+enum pipe_shader_cap
+{
+ PIPE_SHADER_CAP_MAX_INSTRUCTIONS, /* if 0, it means the stage is unsupported */
+ PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS,
+ PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS,
+ PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS,
+ PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH,
+ PIPE_SHADER_CAP_MAX_INPUTS,
+ PIPE_SHADER_CAP_MAX_CONSTS,
+ PIPE_SHADER_CAP_MAX_CONST_BUFFERS,
+ PIPE_SHADER_CAP_MAX_TEMPS,
+ PIPE_SHADER_CAP_MAX_ADDRS,
+ PIPE_SHADER_CAP_MAX_PREDS,
+ PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED,
+};
/**
* Referenced query flags.
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 21f428ed4a..912631242f 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -86,6 +86,12 @@ struct pipe_screen {
*/
float (*get_paramf)( struct pipe_screen *, enum pipe_cap param );
+ /**
+ * Query a per-shader-stage integer-valued capability/parameter/limit
+ * \param param one of PIPE_CAP_x
+ */
+ int (*get_shader_param)( struct pipe_screen *, unsigned shader, enum pipe_shader_cap param );
+
struct pipe_context * (*context_create)( struct pipe_screen *,
void *priv );