From a0f7b869592013b24a5bacf0ceb2bdb1e9146378 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Wed, 20 Jun 2012 12:33:06 -0700 Subject: [PATCH] mesa: Set UsesDFdy appropriately for assembly programs. Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/mesa/program/arbprogparse.c | 1 + src/mesa/program/program_parse.y | 2 ++ src/mesa/program/program_parser.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c index dffc8abf735..72e51dd0ffe 100644 --- a/src/mesa/program/arbprogparse.c +++ b/src/mesa/program/arbprogparse.c @@ -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); diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index 4f958a99388..54b17314a3a 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -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); } ; diff --git a/src/mesa/program/program_parser.h b/src/mesa/program/program_parser.h index bc756148a20..ca36bb6dc77 100644 --- a/src/mesa/program/program_parser.h +++ b/src/mesa/program/program_parser.h @@ -214,6 +214,7 @@ struct asm_parser_state { struct { unsigned UsesKill:1; + unsigned UsesDFdy:1; } fragment; }; -- 2.30.2