mesa: fix texture updates for ATI_fragment_shader
authorMarek Olšák <marek.olsak@amd.com>
Wed, 27 Sep 2017 11:17:21 +0000 (13:17 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 28 Sep 2017 15:48:33 +0000 (17:48 +0200)
Cc: 17.1 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/texstate.c

index 269e29194d691027986bfcb15d08e354d407969f..edd22537319b1673ffc824e8a44b244ea0b25c35 100644 (file)
@@ -840,9 +840,11 @@ _mesa_update_texture_state(struct gl_context *ctx)
 
    memcpy(prog, ctx->_Shader->CurrentProgram, sizeof(prog));
 
-   if (prog[MESA_SHADER_FRAGMENT] == NULL &&
-       _mesa_arb_fragment_program_enabled(ctx)) {
-      prog[MESA_SHADER_FRAGMENT] = ctx->FragmentProgram.Current;
+   if (prog[MESA_SHADER_FRAGMENT] == NULL) {
+      if (_mesa_arb_fragment_program_enabled(ctx))
+         prog[MESA_SHADER_FRAGMENT] = ctx->FragmentProgram.Current;
+      else if (_mesa_ati_fragment_shader_enabled(ctx))
+         prog[MESA_SHADER_FRAGMENT] = ctx->ATIFragmentShader.Current->Program;
    }
 
    /* TODO: only set this if there are actual changes */