From: Ian R. <id...@fr...> - 2010-03-04 23:21:25
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Vinson Lee wrote: > Module: Mesa > Branch: master > Commit: a05fdbcb719ac64e6be842372813f0f4ca2f4f93 > URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a05fdbcb719ac64e6be842372813f0f4ca2f4f93 > > Author: Vinson Lee <vl...@vm...> > Date: Mon Feb 15 02:01:20 2010 -0800 > > mesa: Remove pointless comparison of unsigned integer with a negative constant. > > --- > > src/mesa/shader/prog_execute.c | 13 ++++--------- > 1 files changed, 4 insertions(+), 9 deletions(-) > > diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c > index aea4b07..ee422e7 100644 > --- a/src/mesa/shader/prog_execute.c > +++ b/src/mesa/shader/prog_execute.c > @@ -1780,15 +1780,10 @@ _mesa_execute_program(GLcontext * ctx, > break; > case OPCODE_PRINT: > { > - if (inst->SrcReg[0].File != -1) { > - GLfloat a[4]; > - fetch_vector4(&inst->SrcReg[0], machine, a); > - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, > - a[0], a[1], a[2], a[3]); > - } > - else { > - _mesa_printf("%s\n", (const char *) inst->Data); > - } > + GLfloat a[4]; > + fetch_vector4(&inst->SrcReg[0], machine, a); > + _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, > + a[0], a[1], a[2], a[3]); I don't think this is correct. The shader assembler used to set the register file to -1 to note the difference between the following two instructions: PRINT "Hello, world"; PRINT "vertex color", color; Even if comparing with -1 isn't entirely correct, removing the code altogether is clearly wrong. > } > break; > case OPCODE_END: -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuQQEoACgkQX1gOwKyEAw+muQCfW7svf52FFKJZQmmj9l9FKmsA qMoAn0iToPAecT/vhsrmqutoXm0h2ZXI =nSOS -----END PGP SIGNATURE----- |
From: Vinson L. <vl...@vm...> - 2010-03-04 23:52:19
|
> -----Original Message----- > > > > > mesa: Remove pointless comparison of unsigned integer with a negative > constant. > > > > --- > > > > src/mesa/shader/prog_execute.c | 13 ++++--------- > > 1 files changed, 4 insertions(+), 9 deletions(-) > > > > diff --git a/src/mesa/shader/prog_execute.c > b/src/mesa/shader/prog_execute.c > > index aea4b07..ee422e7 100644 > > --- a/src/mesa/shader/prog_execute.c > > +++ b/src/mesa/shader/prog_execute.c > > @@ -1780,15 +1780,10 @@ _mesa_execute_program(GLcontext * ctx, > > break; > > case OPCODE_PRINT: > > { > > - if (inst->SrcReg[0].File != -1) { > > - GLfloat a[4]; > > - fetch_vector4(&inst->SrcReg[0], machine, a); > > - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst- > >Data, > > - a[0], a[1], a[2], a[3]); > > - } > > - else { > > - _mesa_printf("%s\n", (const char *) inst->Data); > > - } > > + GLfloat a[4]; > > + fetch_vector4(&inst->SrcReg[0], machine, a); > > + _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst- > >Data, > > + a[0], a[1], a[2], a[3]); > > I don't think this is correct. The shader assembler used to set the > register file to -1 to note the difference between the following two > instructions: > > PRINT "Hello, world"; > PRINT "vertex color", color; > > Even if comparing with -1 isn't entirely correct, removing the code > altogether is clearly wrong. > > > } > > break; > > case OPCODE_END: > Where is the set of the register file to -1? Should the -1 comparison been against PROGRAM_FILE_MAX or PROGRAM_UNDEFINED instead? |
From: Brian P. <br...@vm...> - 2010-03-05 00:00:50
|
Vinson Lee wrote: >> -----Original Message----- >> >>> mesa: Remove pointless comparison of unsigned integer with a negative >> constant. >>> --- >>> >>> src/mesa/shader/prog_execute.c | 13 ++++--------- >>> 1 files changed, 4 insertions(+), 9 deletions(-) >>> >>> diff --git a/src/mesa/shader/prog_execute.c >> b/src/mesa/shader/prog_execute.c >>> index aea4b07..ee422e7 100644 >>> --- a/src/mesa/shader/prog_execute.c >>> +++ b/src/mesa/shader/prog_execute.c >>> @@ -1780,15 +1780,10 @@ _mesa_execute_program(GLcontext * ctx, >>> break; >>> case OPCODE_PRINT: >>> { >>> - if (inst->SrcReg[0].File != -1) { >>> - GLfloat a[4]; >>> - fetch_vector4(&inst->SrcReg[0], machine, a); >>> - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst- >>> Data, >>> - a[0], a[1], a[2], a[3]); >>> - } >>> - else { >>> - _mesa_printf("%s\n", (const char *) inst->Data); >>> - } >>> + GLfloat a[4]; >>> + fetch_vector4(&inst->SrcReg[0], machine, a); >>> + _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst- >>> Data, >>> + a[0], a[1], a[2], a[3]); >> I don't think this is correct. The shader assembler used to set the >> register file to -1 to note the difference between the following two >> instructions: >> >> PRINT "Hello, world"; >> PRINT "vertex color", color; >> >> Even if comparing with -1 isn't entirely correct, removing the code >> altogether is clearly wrong. >> >>> } >>> break; >>> case OPCODE_END: > > Where is the set of the register file to -1? At nvvertparse.c:1099 it's set to zero. I don't see where it's set to -1 either. > Should the -1 comparison been against PROGRAM_FILE_MAX or PROGRAM_UNDEFINED instead? The assignment above should probably use PROGRAM_UNDEFINED instead of 0. -Brian |