diff options
author | Vadim Girlin <[email protected]> | 2013-05-02 07:56:32 +0400 |
---|---|---|
committer | Vadim Girlin <[email protected]> | 2013-05-03 16:53:41 +0400 |
commit | e16ef1f454905252f9986bd2714fd6ae37a5aa75 (patch) | |
tree | 2faaa4328ba4a8cdeda11b568caaff89fa84eb94 /src/gallium/drivers/r600/sb/sb_shader.cpp | |
parent | a6fe055fa77e42e35f25272bdd5ca7213b436a1a (diff) |
r600g/sb: fix allocation of indirectly addressed input arrays
Some inputs may be preloaded into predefined GPRs,
so we can't reallocate arrays with such inputs.
Fixes issues with webgl demo: http://oos.moxiecode.com/js_webgl/snake/
Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/sb/sb_shader.cpp')
-rw-r--r-- | src/gallium/drivers/r600/sb/sb_shader.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_shader.cpp b/src/gallium/drivers/r600/sb/sb_shader.cpp index 6dd3678e66a..3fd6ea49f54 100644 --- a/src/gallium/drivers/r600/sb/sb_shader.cpp +++ b/src/gallium/drivers/r600/sb/sb_shader.cpp @@ -61,7 +61,7 @@ bool shader::assign_slot(alu_node* n, alu_node *slots[5]) { return true; } -void shader::add_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask, +void shader::add_pinned_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask, bool src) { unsigned chan = 0; while (comp_mask) { @@ -72,6 +72,11 @@ void shader::add_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask, v->gpr = v->pin_gpr = v->select; v->fix(); } + if (v->array && !v->array->gpr) { + // if pinned value can be accessed with indirect addressing + // pin the entire array to its original location + v->array->gpr = v->array->base_gpr; + } vec.push_back(v); } comp_mask >>= 1; @@ -199,7 +204,7 @@ void shader::add_input(unsigned gpr, bool preloaded, unsigned comp_mask) { i.comp_mask = comp_mask; if (preloaded) { - add_gpr_values(root->dst, gpr, comp_mask, true); + add_pinned_gpr_values(root->dst, gpr, comp_mask, true); } } @@ -217,9 +222,9 @@ void shader::init_call_fs(cf_node* cf) { for(inputs_vec::const_iterator I = inputs.begin(), E = inputs.end(); I != E; ++I, ++gpr) { if (!I->preloaded) - add_gpr_values(cf->dst, gpr, I->comp_mask, false); + add_pinned_gpr_values(cf->dst, gpr, I->comp_mask, false); else - add_gpr_values(cf->src, gpr, I->comp_mask, true); + add_pinned_gpr_values(cf->src, gpr, I->comp_mask, true); } } |