mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
ir_function_cloning_visitor: Add support for ir_texture.
This commit is contained in:
parent
8331d48948
commit
b97efa5db5
2 changed files with 23 additions and 3 deletions
2
ir.h
2
ir.h
|
|
@ -770,7 +770,7 @@ enum ir_texture_opcode {
|
|||
class ir_texture : public ir_rvalue {
|
||||
public:
|
||||
ir_texture(enum ir_texture_opcode op)
|
||||
: op(op)
|
||||
: op(op), projector(NULL), shadow_comparitor(NULL)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,8 +201,28 @@ ir_function_cloning_visitor::visit(ir_expression *ir)
|
|||
void
|
||||
ir_function_cloning_visitor::visit(ir_texture *ir)
|
||||
{
|
||||
// FINISHME: Do stuff with texture lookups
|
||||
(void) ir;
|
||||
ir_texture *tex = new ir_texture(ir->op);
|
||||
|
||||
ir->sampler->accept(this);
|
||||
tex->set_sampler(this->result->as_dereference());
|
||||
|
||||
ir->coordinate->accept(this);
|
||||
tex->coordinate = this->result->as_rvalue();
|
||||
|
||||
if (ir->projector != NULL) {
|
||||
ir->projector->accept(this);
|
||||
tex->projector = this->result->as_rvalue();
|
||||
}
|
||||
|
||||
if (ir->shadow_comparitor != NULL) {
|
||||
ir->shadow_comparitor->accept(this);
|
||||
tex->shadow_comparitor = this->result->as_rvalue();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
tex->offsets[i] = ir->offsets[i];
|
||||
|
||||
tex->lod_info = ir->lod_info;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue