[Mesa-dev] [PATCH 05/13] i965 vs: Move brw_set_access_mode() call into generate_code().

Paul Berry stereotype441 at gmail.com
Wed Nov 16 11:07:12 PST 2011


Previously, vec4_visitor::run() called brw_set_access_mode() right
before calling vec4_visitor::generate_code().  It seems clearer to put
the call inside generate_code(), since the purpose of
brw_set_access_mode() is to set up the proper state for code
generation.

This helps pave the way for separating the IR visiting parts of
vec4_visitor (which include run()) from the code generation parts
(which include generate_code()), by avoiding the need for run() to
access the brw_compile structure.
---
 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 3219fe4..81e7ab7 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -662,8 +662,6 @@ vec4_visitor::run()
    if (failed)
       return false;
 
-   brw_set_access_mode(p, BRW_ALIGN_16);
-
    generate_code();
 
    return !failed;
@@ -683,6 +681,7 @@ vec4_visitor::generate_code()
    int *if_depth_in_loop =
       rzalloc_array(this->mem_ctx, int, loop_stack_array_size);
 
+   brw_set_access_mode(p, BRW_ALIGN_16);
 
    if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
       printf("Native code for vertex shader %d:\n", prog->Name);
-- 
1.7.6.4



More information about the mesa-dev mailing list