summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Bouchoux <[email protected]>2015-02-16 09:43:23 +0100
committerAxel Davy <[email protected]>2015-04-29 08:28:10 +0200
commit5beb411bf753da4c86082c505929bcc9629c666c (patch)
tree5439a278701ae8834a96d17737ff2f6cd7499aa6
parent559342d01d4199e8fd475241a574a92c4ce63896 (diff)
st/nine: Fix computation of const_used_size
Was sometimes too large for PS. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 1f1f7c806fc..fd0f76e1118 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -27,6 +27,7 @@
#include "nine_debug.h"
#include "nine_state.h"
+#include "util/macros.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "pipe/p_shader_tokens.h"
@@ -3082,6 +3083,7 @@ nine_translate_shader(struct NineDevice9 *device, struct nine_shader_info *info)
HRESULT hr = D3D_OK;
const unsigned processor = tgsi_processor_from_type(info->type);
unsigned s, slot_max;
+ unsigned max_const_f;
user_assert(processor != ~0, D3DERR_INVALIDCALL);
@@ -3221,11 +3223,12 @@ nine_translate_shader(struct NineDevice9 *device, struct nine_shader_info *info)
if (tx->indirect_const_access) /* vs only */
info->const_float_slots = device->max_vs_const_f;
+ max_const_f = IS_VS ? device->max_vs_const_f : device->max_ps_const_f;
slot_max = info->const_bool_slots > 0 ?
- device->max_vs_const_f + NINE_MAX_CONST_I
- + info->const_bool_slots :
+ max_const_f + NINE_MAX_CONST_I
+ + DIV_ROUND_UP(info->const_bool_slots, 4) :
info->const_int_slots > 0 ?
- device->max_vs_const_f + info->const_int_slots :
+ max_const_f + info->const_int_slots :
info->const_float_slots;
info->const_used_size = sizeof(float[4]) * slot_max; /* slots start from 1 */