diff options
author | Axel Davy <[email protected]> | 2015-08-16 14:59:52 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-08-21 22:21:47 +0200 |
commit | fcca7ff38a6ba923abd910f50a8e2bcf6560e6ae (patch) | |
tree | 49c56659c35db49997019161b5c01a7b5892143e /src | |
parent | 8f39ffc11e8b6fdf7c940f9c1853a362a886977a (diff) |
st/nine: Revert to userbuf path when needed
Automatically switch to userbuf path when
we would need to upload fog or bumpmat
constants
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index 53efa56d081..e185b025134 100644 --- a/src/gallium/state_trackers/nine/nine_state.c +++ b/src/gallium/state_trackers/nine/nine_state.c @@ -61,6 +61,9 @@ prepare_rasterizer(struct NineDevice9 *device) device->state.commit |= NINE_STATE_COMMIT_RASTERIZER; } +static void +prepare_ps_constants_userbuf(struct NineDevice9 *device); + #define DO_UPLOAD_CONST_F(buf,p,c,d) \ do { \ DBG("upload ConstantF [%u .. %u]\n", x, (x) + (c) - 1); \ @@ -122,6 +125,14 @@ upload_constants(struct NineDevice9 *device, unsigned shader_type) device->state.changed.group &= ~NINE_STATE_VS_CONST; } else { DBG("PS\n"); + /* features only implemented on the userbuf path */ + if (device->state.ps->bumpenvmat_needed || ( + device->state.ps->byte_code.version < 0x30 && + device->state.rs[D3DRS_FOGENABLE])) { + device->prefer_user_constbuf = TRUE; + prepare_ps_constants_userbuf(device); + return; + } buf = device->constbuf_ps; const_f = device->state.ps_const_f; |