[Mesa-dev] [PATCH] mesa: fix texture updates for ATI_fragment_shader

Ian Romanick idr at freedesktop.org
Thu Sep 28 02:51:12 UTC 2017


On 09/27/2017 05:06 PM, Marek Olšák wrote:
> It fixes a crash with an apitrace that I have. Other than that, no
> tests. Yes, it should be tagged for stable.

Ok.  Adding a test would be cool, but I won't bust your chops. :)

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> Marek
> 
> On Thu, Sep 28, 2017 at 1:34 AM, Ian Romanick <idr at freedesktop.org> wrote:
>> This looks right... at least it makes ATI_fragment_shader behave like
>> ARB_fragment_program.  I don't suppose there are any tests that exercise
>> this problem?  Should this be tagged for stable?
>>
>> On 09/27/2017 08:39 AM, Marek Olšák wrote:
>>> From: Marek Olšák <marek.olsak at amd.com>
>>>
>>> ---
>>>  src/mesa/main/texstate.c | 8 +++++---
>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
>>> index 269e291..edd2253 100644
>>> --- a/src/mesa/main/texstate.c
>>> +++ b/src/mesa/main/texstate.c
>>> @@ -833,23 +833,25 @@ update_ff_texture_state(struct gl_context *ctx,
>>>  void
>>>  _mesa_update_texture_state(struct gl_context *ctx)
>>>  {
>>>     struct gl_program *prog[MESA_SHADER_STAGES];
>>>     int i;
>>>     int old_max_unit = ctx->Texture._MaxEnabledTexImageUnit;
>>>     BITSET_DECLARE(enabled_texture_units, MAX_COMBINED_TEXTURE_IMAGE_UNITS);
>>>
>>>     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 */
>>>     ctx->NewState |= _NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE;
>>>
>>>     ctx->Texture._GenFlags = 0x0;
>>>     ctx->Texture._TexMatEnabled = 0x0;
>>>     ctx->Texture._TexGenEnabled = 0x0;
>>>     ctx->Texture._MaxEnabledTexImageUnit = -1;
>>>     ctx->Texture._EnabledCoordUnits = 0x0;
>>>
>>
> 



More information about the mesa-dev mailing list