mesa: Remove EmitCondCodes.
authorMatt Turner <mattst88@gmail.com>
Sat, 27 Feb 2016 19:23:32 +0000 (11:23 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 1 Mar 2016 19:41:29 +0000 (11:41 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
docs/shading.html
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i965/brw_compiler.c
src/mesa/main/mtypes.h
src/mesa/program/ir_to_mesa.cpp

index df23694ea8970f83e68aa513d287f8912121b098..cf989ce9029a6a420ef55f94419d7ec37b8c165d 100644 (file)
@@ -209,34 +209,6 @@ The final vertex and fragment programs may be interpreted in software
 (see drivers/dri/i915/i915_fragprog.c for example).
 </p>
 
-<h3>Code Generation Options</h3>
-
-<p>
-Internally, there are several options that control the compiler's code
-generation and instruction selection.
-These options are seen in the gl_shader_state struct and may be set
-by the device driver to indicate its preferences:
-
-<pre>
-struct gl_shader_state
-{
-   ...
-   /** Driver-selectable options: */
-   GLboolean EmitCondCodes;
-};
-</pre>
-
-<dl>
-<dt>EmitCondCodes</dt>
-<dd>
-If set, condition codes (ala GL_NV_fragment_program) will be used for
-branching and looping.
-Otherwise, ordinary registers will be used (the IF instruction will
-examine the first operand's X component and do the if-part if non-zero).
-</dd>
-</dl>
-
-
 <h2 id="validation">Compiler Validation</h2>
 
 <p>
index 57b033c07ea3a40c8778349de197163eb3104bcd..83aaf9ea5a61de25afc1195b8c0f0a8a093471f6 100644 (file)
@@ -254,7 +254,6 @@ i915CreateContext(int api,
    /* FINISHME: Are there other options that should be enabled for software
     * FINISHME: vertex shaders?
     */
-   ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true;
    ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoIndirectSampler =
       true;
 
index 1489207569c82040b17091fd1749e182b7b4fb0b..2f05a26e0e03103d87aec4cfdbb40bab0dab8d55 100644 (file)
@@ -143,7 +143,6 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
       compiler->glsl_compiler_options[i].MaxIfDepth =
          devinfo->gen < 6 ? 16 : UINT_MAX;
 
-      compiler->glsl_compiler_options[i].EmitCondCodes = true;
       compiler->glsl_compiler_options[i].EmitNoNoise = true;
       compiler->glsl_compiler_options[i].EmitNoMainReturn = true;
       compiler->glsl_compiler_options[i].EmitNoIndirectInput = true;
index 12d3863719b95228fa0f7718e3fad8eb8860e9bd..d5f0b628d92ea28915ba01df18abac6bae129f71 100644 (file)
@@ -2946,7 +2946,6 @@ struct gl_pipeline_shader_state
 struct gl_shader_compiler_options
 {
    /** Driver-selectable options: */
-   GLboolean EmitCondCodes;             /**< Use condition codes? */
    GLboolean EmitNoLoops;
    GLboolean EmitNoFunctions;
    GLboolean EmitNoCont;                  /**< Emit CONT opcode? */
index 4db62504ac7251d8dc9280a4cfbfdfadabbcffb4..6d33b1b071a5bedd25325ee600efc247f7dbebaa 100644 (file)
@@ -2124,32 +2124,12 @@ ir_to_mesa_visitor::visit(ir_discard *ir)
 void
 ir_to_mesa_visitor::visit(ir_if *ir)
 {
-   ir_to_mesa_instruction *cond_inst, *if_inst;
-   ir_to_mesa_instruction *prev_inst;
-
-   prev_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
+   ir_to_mesa_instruction *if_inst;
 
    ir->condition->accept(this);
    assert(this->result.file != PROGRAM_UNDEFINED);
 
-   if (this->options->EmitCondCodes) {
-      cond_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
-
-      /* See if we actually generated any instruction for generating
-       * the condition.  If not, then cook up a move to a temp so we
-       * have something to set cond_update on.
-       */
-      if (cond_inst == prev_inst) {
-        src_reg temp = get_temp(glsl_type::bool_type);
-        cond_inst = emit(ir->condition, OPCODE_MOV, dst_reg(temp), result);
-      }
-      cond_inst->cond_update = GL_TRUE;
-
-      if_inst = emit(ir->condition, OPCODE_IF);
-      if_inst->dst.cond_mask = COND_NE;
-   } else {
-      if_inst = emit(ir->condition, OPCODE_IF, undef_dst, this->result);
-   }
+   if_inst = emit(ir->condition, OPCODE_IF, undef_dst, this->result);
 
    this->instructions.push_tail(if_inst);