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 dffc8abf7358254a107c92b1ab9957a965206afd..72e51dd0ffe559571f67053fc40b7fa9b01f8b4e 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 4f958a9938877db44428b46722b8cb7616d8d347..54b17314a3ac648504424677c5494add524f8baa 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 bc756148a202ee8152ef3d31d1a9fc152e0ab43c..ca36bb6dc77b7af1f919b6bf4b06d14208055a7d 100644 (file)
@@ -214,6 +214,7 @@ struct asm_parser_state {
 
    struct {
       unsigned UsesKill:1;
+      unsigned UsesDFdy:1;
    } fragment;
 };