i965/vs: Move struct brw_compile (p) entirely inside vec4_generator.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 08:16:05 +0000 (00:16 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 29 Nov 2012 02:16:01 +0000 (18:16 -0800)
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields.  These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.

This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
src/mesa/drivers/dri/i965/brw_vs.h

index d705235ab33eb5864d6cf5e6d67cb6e425bebbe2..34c34d79399de11b5671fb572144dcd498ed28e6 100644 (file)
@@ -1136,8 +1136,6 @@ brw_vs_emit(struct brw_context *brw,
    bool start_busy = false;
    float start_time = 0;
 
-   brw_init_compile(brw, &c->func, mem_ctx);
-
    if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
       start_busy = (intel->batch.last_bo &&
                     drm_intel_bo_busy(intel->batch.last_bo));
index c033804f438ae7371c94cb56ede13a31bb705612..12694e268461275637554ce76e86d48d6ca9df3e 100644 (file)
@@ -140,7 +140,9 @@ vec4_generator::vec4_generator(struct brw_context *brw,
 {
    intel = &brw->intel;
    vp = &c->vp->program;
-   p = &c->func;
+
+   p = rzalloc(mem_ctx, struct brw_compile);
+   brw_init_compile(brw, p, mem_ctx);
 }
 
 vec4_generator::~vec4_generator()
index 7ac1775c83e32e6453db39faa2394337bbb61bd2..75c8a5f8c98b68cdd150b96d4b05980b883922ae 100644 (file)
@@ -94,7 +94,6 @@ struct brw_vs_prog_key {
 
 
 struct brw_vs_compile {
-   struct brw_compile func;
    struct brw_vs_prog_key key;
    struct brw_vs_prog_data prog_data;