* doesn't need to be elsewhere, because all the instructions
* accessing the constants directly are VS1, and swvp
* is VS >= 2 */
- if (IS_VS && tx->info->swvp_on && idx >= 4096) {
+ if (tx->info->swvp_on && idx >= 4096) {
/* TODO: swvp rel is broken if many constants are used */
src = ureg_src_register(TGSI_FILE_CONSTANT, idx - 4096);
src = ureg_src_dimension(src, 1);
{
struct ureg_src src;
- if (IS_VS && tx->info->swvp_on) {
+ if (tx->info->swvp_on) {
src = ureg_src_register(TGSI_FILE_CONSTANT, idx);
src = ureg_src_dimension(src, 2);
} else {
char r = idx / 4;
char s = idx & 3;
- if (IS_VS && tx->info->swvp_on) {
+ if (tx->info->swvp_on) {
src = ureg_src_register(TGSI_FILE_CONSTANT, r);
src = ureg_src_dimension(src, 3);
} else {
return E_OUTOFMEMORY;
tx_ctor(tx, info);
+ assert(IS_VS || !info->swvp_on);
+
if (((tx->version.major << 16) | tx->version.minor) > 0x00030000) {
hr = D3DERR_INVALIDCALL;
DBG("Unsupported shader version: %u.%u !\n",
tx->num_constb_allowed = NINE_MAX_CONST_B;
}
- if (IS_VS && tx->version.major >= 2 && info->swvp_on) {
+ if (info->swvp_on && tx->version.major >= 2) {
tx->num_constf_allowed = 8192;
tx->num_consti_allowed = 2048;
tx->num_constb_allowed = 2048;
/* r500 */
if (info->const_float_slots > device->max_vs_const_f &&
(info->const_int_slots || info->const_bool_slots) &&
- (!IS_VS || !info->swvp_on))
+ !info->swvp_on)
ERR("Overlapping constant slots. The shader is likely to be buggy\n");
if (tx->indirect_const_access) /* vs only */
info->const_float_slots = device->max_vs_const_f;
- if (!IS_VS || !info->swvp_on) {
+ if (!info->swvp_on) {
unsigned s, slot_max;
unsigned max_const_f = IS_VS ? device->max_vs_const_f : device->max_ps_const_f;
info.add_constants_defs.int_const_added = NULL;
info.add_constants_defs.bool_const_added = NULL;
info.process_vertices = false;
+ info.swvp_on = false;
pipe = nine_context_get_pipe_acquire(device);
hr = nine_translate_shader(device, &info, pipe);
info.add_constants_defs.int_const_added = &This->int_slots_used;
info.add_constants_defs.bool_const_added = &This->bool_slots_used;
info.process_vertices = false;
+ info.swvp_on = false;
hr = nine_translate_shader(This->base.device, &info, pipe);
if (FAILED(hr))