i965/fs: Move struct brw_compile (p) entirely inside fs_generator.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 21 Nov 2012 03:26:52 +0000 (19:26 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 03:52:34 +0000 (19:52 -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.

v2: rzalloc p, as suggested by Eric.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_emit.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_wm.h

index a57082917715ddbb3c21663580cee6f37ae57cec..f19f2752e7ae8650a67e507eacae1f5d8601209c 100644 (file)
@@ -2133,8 +2133,6 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
    bool start_busy = false;
    float start_time = 0;
 
-   brw_init_compile(brw, &c->func, c);
-
    if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
       start_busy = (intel->batch.last_bo &&
                     drm_intel_bo_busy(intel->batch.last_bo));
index 8e03255356b85064a5aeae0e7bbe4845abca504d..9a1f360f86a9b288235e19c3d3dde10c2365f67e 100644 (file)
@@ -45,13 +45,15 @@ fs_generator::fs_generator(struct brw_context *brw,
 
    : brw(brw), c(c), prog(prog), fp(fp), dual_source_output(dual_source_output)
 {
-   p = &c->func;
    intel = &brw->intel;
    ctx = &intel->ctx;
 
    shader = prog ? prog->_LinkedShaders[MESA_SHADER_FRAGMENT] : NULL;
 
    mem_ctx = c;
+
+   p = rzalloc(mem_ctx, struct brw_compile);
+   brw_init_compile(brw, p, mem_ctx);
 }
 
 fs_generator::~fs_generator()
index aa1a441a4e479544404f2c8f088685396da979ab..d5487093dc75dd5335375d64c537c961c39f1b79 100644 (file)
@@ -2182,7 +2182,6 @@ fs_visitor::fs_visitor(struct brw_context *brw,
    : dispatch_width(dispatch_width)
 {
    this->c = c;
-   this->p = &c->func;
    this->brw = brw;
    this->fp = fp;
    this->prog = prog;
index 0abc6671134ee800ada5b0ea727bfb7a2195d08b..46fe570364f60710f4ddbec0da00c0177852e3dc 100644 (file)
@@ -41,7 +41,6 @@ public:
    struct brw_context *brw;
    struct intel_context *intel;
    struct gl_context *ctx;
-   struct brw_compile *p;
    struct brw_shader *shader;
    struct gl_shader_program *prog;
 
index f0a2417fe45a8a762c3a076b7275147904a63cc6..908d7d8825dab4cf66f54e14e6c179e5587209c8 100644 (file)
@@ -215,6 +215,7 @@ public:
    const struct gl_vertex_program *vp;
    struct brw_vs_compile *c;
    struct brw_vs_prog_data *prog_data;
+   struct brw_compile *p;
 
    char *fail_msg;
    bool failed;
index 478be866fa1315572e5c9d773d10e1b3453808ed..a4ac3f146f779bf76cc1a42064287c990e826d80 100644 (file)
@@ -77,7 +77,6 @@ struct brw_wm_prog_key {
 };
 
 struct brw_wm_compile {
-   struct brw_compile func;
    struct brw_wm_prog_key key;
    struct brw_wm_prog_data prog_data;