mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
Add ir_dereference constructor for structure field dereferences
This commit is contained in:
parent
8f755dcb67
commit
7ee79fb6b7
2 changed files with 10 additions and 0 deletions
8
ir.cpp
8
ir.cpp
|
|
@ -246,6 +246,14 @@ ir_dereference::ir_dereference(ir_instruction *var,
|
|||
this->selector.array_index = array_index;
|
||||
}
|
||||
|
||||
ir_dereference::ir_dereference(ir_instruction *variable, const char *field)
|
||||
: mode(ir_reference_record), var(variable)
|
||||
{
|
||||
this->selector.field = field;
|
||||
this->type = (var != NULL)
|
||||
? var->type->field_type(field) : glsl_type::error_type;
|
||||
}
|
||||
|
||||
bool
|
||||
ir_dereference::is_lvalue()
|
||||
{
|
||||
|
|
|
|||
2
ir.h
2
ir.h
|
|
@ -749,6 +749,8 @@ public:
|
|||
|
||||
ir_dereference(ir_instruction *variable, ir_rvalue *array_index);
|
||||
|
||||
ir_dereference(ir_instruction *variable, const char *field);
|
||||
|
||||
virtual ir_dereference *as_dereference()
|
||||
{
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue