diff options
author | Christoph Bumiller <[email protected]> | 2011-10-20 18:32:23 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-10-21 23:00:36 +0200 |
commit | 65303c49d1efc996f5cc9dafa2768d0225b76f1c (patch) | |
tree | 69aa62aab75db3f90e7ff0d919c7d7cf6724f711 /src/gallium/state_trackers/d3d1x/d3d1xshader | |
parent | 6b72eded19398f9599d76ebd4cbaec52fc7a252d (diff) |
d3d1x: switch to TGSI SAMPLE opcodes
We don't want to clutter the code or handicap new hardware for
the sake of ancient GPUs on which d3d1x won't ever be used,
much less be fully compliant, anyway.
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/d3d1xshader')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h | 11 | ||||
-rw-r--r-- | src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp | 64 |
2 files changed, 0 insertions, 75 deletions
diff --git a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h index d3ca2742a9e..1db6bab3a39 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xshader/include/sm4.h @@ -366,15 +366,6 @@ struct sm4_program */ std::vector<int> cf_insn_linked; - /* NOTE: sampler 0 is the unnormalized nearest sampler for LD/LD_MS, while - * sampler 1 is user-specified sampler 0 - */ - bool resource_sampler_slots_assigned; - std::vector<int> slot_to_resource; - std::vector<int> slot_to_sampler; - std::map<std::pair<int, int>, int> resource_sampler_to_slot; - std::map<int, int> resource_to_slot; - bool labels_found; std::vector<int> label_to_insn_num; @@ -382,7 +373,6 @@ struct sm4_program { memset(&version, 0, sizeof(version)); labels_found = false; - resource_sampler_slots_assigned = false; } ~sm4_program() @@ -404,7 +394,6 @@ sm4_program* sm4_parse(void* tokens, int size); bool sm4_link_cf_insns(sm4_program& program); bool sm4_find_labels(sm4_program& program); -bool sm4_allocate_resource_sampler_pairs(sm4_program& program); #endif /* SM4_H_ */ diff --git a/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp b/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp index 7903d547f14..ac7bfdc21a4 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp +++ b/src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_analyze.cpp @@ -120,67 +120,3 @@ bool sm4_find_labels(sm4_program& program) program.labels_found = true; return true; } - -bool sm4_allocate_resource_sampler_pairs(sm4_program& program) -{ - if(program.resource_sampler_slots_assigned) - return true; - - std::set<std::pair<int, int> > pairs; - std::set<int> resinfos; - - for(unsigned insn_num = 0; insn_num < program.insns.size(); ++insn_num) - { - int resource = -1; - int sampler = -2; - for(unsigned i = 0; i < program.insns[insn_num]->num_ops; ++i) - { - sm4_op* op = program.insns[insn_num]->ops[i].get(); - if(op) - { - if(op->file == SM4_FILE_RESOURCE) - { - if(!op->has_simple_index() || resource >= 0) - return false; - resource = (int)op->indices[0].disp; - } - if(op->file == SM4_FILE_SAMPLER) - { - if(!op->has_simple_index() || sampler >= 0) - return false; - sampler = (int)op->indices[0].disp; - } - } - } - - unsigned opcode = program.insns[insn_num]->opcode; - if(opcode == SM4_OPCODE_LD || opcode == SM4_OPCODE_LD_MS) - sampler = -1; - if(sampler >= -1 && resource >= 0) - pairs.insert(std::make_pair(resource, sampler)); - if(opcode == SM4_OPCODE_RESINFO) - resinfos.insert(resource); - } - - for(std::set<std::pair<int, int> >::iterator i = pairs.begin(); i != pairs.end(); ++i) - { - program.resource_sampler_to_slot[*i] = program.slot_to_resource.size(); - if(!program.resource_to_slot.count(i->first)) - { - program.resource_to_slot[i->first] = program.slot_to_resource.size(); - resinfos.erase(i->first); - } - program.slot_to_resource.push_back(i->first); - program.slot_to_sampler.push_back(i->second); - } - - for(std::set<int>::iterator i = resinfos.begin(); i != resinfos.end(); ++i) - { - program.resource_sampler_to_slot[std::make_pair(*i, -1)] = program.slot_to_resource.size(); - program.resource_to_slot[*i] = program.slot_to_resource.size(); - program.slot_to_resource.push_back(*i); - program.slot_to_sampler.push_back(-1); - } - program.resource_sampler_slots_assigned = true; - return true; -} |