mesa: Set UsesDFdy appropriately for assembly programs.
authorPaul Berry <stereotype441@gmail.com>
Wed, 20 Jun 2012 19:33:06 +0000 (12:33 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 19 Jul 2012 17:02:19 +0000 (10:02 -0700)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/program/arbprogparse.c
src/mesa/program/program_parse.y
src/mesa/program/program_parser.h

index dffc8ab..72e51dd 100644 (file)
@@ -120,6 +120,7 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
    program->PixelCenterInteger = state.option.PixelCenterInteger;
 
    program->UsesKill            = state.fragment.UsesKill;
+   program->UsesDFdy            = state.fragment.UsesDFdy;
 
    if (program->Base.Instructions)
       free(program->Base.Instructions);
index 4f958a9..54b1731 100644 (file)
@@ -382,6 +382,8 @@ ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg
 
 VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg
        {
+          if ($1.Opcode == OPCODE_DDY)
+             state->fragment.UsesDFdy = 1;
           $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
        }
        ;
index bc75614..ca36bb6 100644 (file)
@@ -214,6 +214,7 @@ struct asm_parser_state {
 
    struct {
       unsigned UsesKill:1;
+      unsigned UsesDFdy:1;
    } fragment;
 };