Re: [Mesa-dev] [PATCH] mesa: remove unused functions in program.c

2015-10-13 Thread Matt Turner
On Tue, Oct 13, 2015 at 7:16 PM, Brian Paul  wrote:
> replace_registers() and adjust_param_indexes() were unused.
> ---

Yep, noticed this too. Found it strange that someone would have
managed to find and delete unused functions that gcc doesn't warn
about while leaving in place functions that it does...

Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: remove unused functions in program.c

2015-10-13 Thread Brian Paul
replace_registers() and adjust_param_indexes() were unused.
---
 src/mesa/program/program.c | 51 --
 1 file changed, 51 deletions(-)

diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index c35a89b..86de5e9 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -450,57 +450,6 @@ _mesa_delete_instructions(struct gl_program *prog, GLuint 
start, GLuint count)
 
 
 /**
- * Search instructions for registers that match (oldFile, oldIndex),
- * replacing them with (newFile, newIndex).
- */
-static void
-replace_registers(struct prog_instruction *inst, GLuint numInst,
-  GLuint oldFile, GLuint oldIndex,
-  GLuint newFile, GLuint newIndex)
-{
-   GLuint i, j;
-   for (i = 0; i < numInst; i++) {
-  /* src regs */
-  for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
- if (inst[i].SrcReg[j].File == oldFile &&
- inst[i].SrcReg[j].Index == oldIndex) {
-inst[i].SrcReg[j].File = newFile;
-inst[i].SrcReg[j].Index = newIndex;
- }
-  }
-  /* dst reg */
-  if (inst[i].DstReg.File == oldFile && inst[i].DstReg.Index == oldIndex) {
- inst[i].DstReg.File = newFile;
- inst[i].DstReg.Index = newIndex;
-  }
-   }
-}
-
-
-/**
- * Search instructions for references to program parameters.  When found,
- * increment the parameter index by 'offset'.
- * Used when combining programs.
- */
-static void
-adjust_param_indexes(struct prog_instruction *inst, GLuint numInst,
- GLuint offset)
-{
-   GLuint i, j;
-   for (i = 0; i < numInst; i++) {
-  for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
- GLuint f = inst[i].SrcReg[j].File;
- if (f == PROGRAM_CONSTANT ||
- f == PROGRAM_UNIFORM ||
- f == PROGRAM_STATE_VAR) {
-inst[i].SrcReg[j].Index += offset;
- }
-  }
-   }
-}
-
-
-/**
  * Populate the 'used' array with flags indicating which registers (TEMPs,
  * INPUTs, OUTPUTs, etc, are used by the given program.
  * \param file  type of register to scan for
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev