glsl: Calcluate Mesa state slots in front-end instead of back-end

This should be the last bit of infrastructure changes before
generating GLSL IR for assembly shaders.

This commit leaves some odd code formatting in ir_to_mesa and brw_fs.
This was done to minimize whitespace changes / reindentation in some
loops.  The following commit will restore formatting sanity.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
This commit is contained in:
Ian Romanick
2011-01-25 10:41:20 -08:00
parent 92e412e788
commit 89d81ab16c
6 changed files with 117 additions and 73 deletions

View File

@@ -53,6 +53,18 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
var->origin_upper_left = this->origin_upper_left;
var->pixel_center_integer = this->pixel_center_integer;
var->explicit_location = this->explicit_location;
var->num_state_slots = this->num_state_slots;
if (this->state_slots) {
/* FINISHME: This really wants to use something like talloc_reference, but
* FINISHME: ralloc doesn't have any similar function.
*/
var->state_slots = ralloc_array(var, ir_state_slot,
this->num_state_slots);
memcpy(var->state_slots, this->state_slots,
sizeof(this->state_slots[0]) * var->num_state_slots);
}
if (this->explicit_location)
var->location = this->location;