diff options
author | Axel Davy <[email protected]> | 2016-09-17 14:16:41 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-10-10 23:43:49 +0200 |
commit | 3bf02d383fe94a69dfec3ff54ede3e3b2e9dff6b (patch) | |
tree | fc45cd758c5ceffcbe95f053430a1a778ecf9c8f /src/gallium/state_trackers/nine/vertexshader9.h | |
parent | f8c8f4424405c4789a044470e64df810720358c8 (diff) |
st/nine: Partial software vertex processing support
Software Vertex Processing allows:
. Less limitations for shaders (more loops, etc)
. Less limitations for ff (more enabled lights, 255
matrices for VertexBlend)
In particular shaders can get more constants.
This patch implements support for this (not using software
rendering, but hardware rendering, as llvmpipe and dx10+ hw
have the same limits...)
This is considered a second class path. Even apps asking for
"Mixed Vertex processing" (ie the ability to switch to swvp
on demand) do not use the feature much. Some just initialize
more constants than the normal limit at the start of the
application, but never use more than the normal limit.
When the apps do not need the software vertex processing
features, they do not seem to turn it on. This means it is
ok if that path is slow.
Thus no care has been made to make the path optimized.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/vertexshader9.h')
-rw-r--r-- | src/gallium/state_trackers/nine/vertexshader9.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/vertexshader9.h b/src/gallium/state_trackers/nine/vertexshader9.h index 3c9db7990a0..823c71aa85e 100644 --- a/src/gallium/state_trackers/nine/vertexshader9.h +++ b/src/gallium/state_trackers/nine/vertexshader9.h @@ -26,6 +26,7 @@ #include "util/u_half.h" #include "iunknown.h" +#include "device9.h" #include "nine_helpers.h" #include "nine_shader.h" #include "nine_state.h" @@ -50,6 +51,7 @@ struct NineVertexShader9 boolean position_t; /* if true, disable vport transform */ boolean point_size; /* if true, set rasterizer.point_size_per_vertex to 1 */ + boolean swvp_only; unsigned const_used_size; /* in bytes */ @@ -73,8 +75,9 @@ NineVertexShader9( void *data ) static inline BOOL NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs, - struct nine_state *state ) + struct NineDevice9 *device ) { + struct nine_state *state = &(device->state); uint8_t samplers_shadow; uint64_t key; BOOL res; @@ -84,7 +87,8 @@ NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs, key = samplers_shadow; if (vs->byte_code.version < 0x30) - key |= (uint32_t) (state->rs[D3DRS_FOGENABLE] << 8); + key |= (uint32_t) ((!!state->rs[D3DRS_FOGENABLE]) << 8); + key |= (uint32_t) (device->swvp << 9); /* We want to use a 64 bits key for performance. * Use compressed float16 values for the pointsize min/max in the key. |