summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-05 16:36:41 +0200
committerErik Faye-Lund <[email protected]>2019-07-10 15:50:51 +0200
commit39e7fbf24a69c3ca9293ee8c4f9bba97d2f81ed4 (patch)
treed52dee6ab15dea24d3b31bd135941cfb9c092dae /src/gallium/state_trackers
parent21de1bf24ba6d65f1566c3b8b742636587c39697 (diff)
gallium: get rid of PIPE_CAP_SM3
PIPE_CAP_SM3 has always been an odd one out of all our caps. While most other caps are fine-grained and single-purpose, this cap encode several features in one. And since OpenGL cares more about single features, it'd be nice to get rid of this one. As it turns, this is now relatively simple. We only really care about three features using this cap, and those already got their own caps. So we can remove it, and make sure all current drivers just give the same response to all of them. The only place we *really* care about SM3 is in nine, and there we can instead just re-construct the information based on the finer-grained caps. This avoids DX9 semantics from needlessly leaking into all of the drivers, most of who doesn't care a whole lot about DX9 specifically. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/adapter9.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index 7ed27de3070..52ea8bff569 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -34,6 +34,14 @@
#define DBG_CHANNEL DBG_ADAPTER
+static bool
+has_sm3(struct pipe_screen *hal)
+{
+ return hal->get_param(hal, PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD) &&
+ hal->get_param(hal, PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES) &&
+ hal->get_param(hal, PIPE_CAP_VERTEX_SHADER_SATURATE);
+}
+
HRESULT
NineAdapter9_ctor( struct NineAdapter9 *This,
struct NineUnknownParams *pParams,
@@ -65,7 +73,7 @@ NineAdapter9_ctor( struct NineAdapter9 *This,
* as these are very old, we choose to drop support for them */
/* checks minimum requirements, most are vs3/ps3 strict requirements */
- if (!hal->get_param(hal, PIPE_CAP_SM3) ||
+ if (!has_sm3(hal) ||
hal->get_shader_param(hal, PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE) < 256 * sizeof(float[4]) ||
hal->get_shader_param(hal, PIPE_SHADER_FRAGMENT,