summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_caps.c27
-rw-r--r--src/gallium/auxiliary/util/u_caps.h4
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h1
3 files changed, 21 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/util/u_caps.c b/src/gallium/auxiliary/util/u_caps.c
index 94d5bd3027..f6a87869c7 100644
--- a/src/gallium/auxiliary/util/u_caps.c
+++ b/src/gallium/auxiliary/util/u_caps.c
@@ -75,6 +75,13 @@ util_check_caps_out(struct pipe_screen *screen, const unsigned *list, int *out)
return FALSE;
}
break;
+ case UTIL_CAPS_CHECK_SHADER:
+ tmpi = screen->get_shader_param(screen, list[i] >> 24, list[i] & ((1 << 24) - 1));
+ ++i;
+ if (tmpi < (int)list[i++]) {
+ *out = i - 3;
+ return FALSE;
+ }
case UTIL_CAPS_CHECK_UNIMPLEMENTED:
*out = i - 1;
return FALSE;
@@ -188,17 +195,17 @@ static unsigned caps_opengl_2_1[] = {
/* Shader Model 3 */
static unsigned caps_sm3[] = {
- UTIL_CHECK_INT(MAX_FS_INSTRUCTIONS, 512),
- UTIL_CHECK_INT(MAX_FS_INPUTS, 10),
- UTIL_CHECK_INT(MAX_FS_TEMPS, 32),
- UTIL_CHECK_INT(MAX_FS_ADDRS, 1),
- UTIL_CHECK_INT(MAX_FS_CONSTS, 224),
+ UTIL_CHECK_SHADER(FRAGMENT, MAX_INSTRUCTIONS, 512),
+ UTIL_CHECK_SHADER(FRAGMENT, MAX_INPUTS, 10),
+ UTIL_CHECK_SHADER(FRAGMENT, MAX_TEMPS, 32),
+ UTIL_CHECK_SHADER(FRAGMENT, MAX_ADDRS, 1),
+ UTIL_CHECK_SHADER(FRAGMENT, MAX_CONSTS, 224),
- UTIL_CHECK_INT(MAX_VS_INSTRUCTIONS, 512),
- UTIL_CHECK_INT(MAX_VS_INPUTS, 16),
- UTIL_CHECK_INT(MAX_VS_TEMPS, 32),
- UTIL_CHECK_INT(MAX_VS_ADDRS, 2),
- UTIL_CHECK_INT(MAX_VS_CONSTS, 256),
+ UTIL_CHECK_SHADER(VERTEX, MAX_INSTRUCTIONS, 512),
+ UTIL_CHECK_SHADER(VERTEX, MAX_INPUTS, 16),
+ UTIL_CHECK_SHADER(VERTEX, MAX_TEMPS, 32),
+ UTIL_CHECK_SHADER(VERTEX, MAX_ADDRS, 2),
+ UTIL_CHECK_SHADER(VERTEX, MAX_CONSTS, 256),
UTIL_CHECK_TERMINATE
};
diff --git a/src/gallium/auxiliary/util/u_caps.h b/src/gallium/auxiliary/util/u_caps.h
index b1074f9eb2..7bd2380041 100644
--- a/src/gallium/auxiliary/util/u_caps.h
+++ b/src/gallium/auxiliary/util/u_caps.h
@@ -38,6 +38,7 @@ enum u_caps_check_enum {
UTIL_CAPS_CHECK_INT,
UTIL_CAPS_CHECK_FLOAT,
UTIL_CAPS_CHECK_FORMAT,
+ UTIL_CAPS_CHECK_SHADER,
UTIL_CAPS_CHECK_UNIMPLEMENTED,
};
@@ -54,6 +55,9 @@ enum u_caps_check_enum {
#define UTIL_CHECK_FORMAT(format) \
UTIL_CAPS_CHECK_FORMAT, PIPE_FORMAT_##format
+#define UTIL_CHECK_SHADER(shader, cap, higher) \
+ UTIL_CAPS_CHECK_SHADER, (PIPE_SHADER_##shader << 24) | PIPE_SHADER_CAP_##cap, (unsigned)(higher)
+
#define UTIL_CHECK_UNIMPLEMENTED \
UTIL_CAPS_CHECK_UNIMPLEMENTED
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 78473bf35a..6ed39561fb 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -399,7 +399,6 @@ static INLINE boolean util_get_offset(
}
}
-
#ifdef __cplusplus
}
#endif