[Mesa-dev] [PATCH 02/18] mesa: Add _mesa_set_sampler_filters method

Ian Romanick idr at freedesktop.org
Mon Jan 11 15:08:42 PST 2016


On 01/09/2016 12:49 PM, Jason Ekstrand wrote:
> 
> On Jan 8, 2016 6:59 PM, "Ian Romanick" <idr at freedesktop.org
> <mailto:idr at freedesktop.org>> wrote:
>>
>> From: Ian Romanick <ian.d.romanick at intel.com
> <mailto:ian.d.romanick at intel.com>>
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com
> <mailto:ian.d.romanick at intel.com>>
>> ---
>>  src/mesa/main/samplerobj.c | 12 ++++++++++++
>>  src/mesa/main/samplerobj.h |  5 +++++
>>  2 files changed, 17 insertions(+)
>>
>> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
>> index 17b3400..3f48ab9f 100644
>> --- a/src/mesa/main/samplerobj.c
>> +++ b/src/mesa/main/samplerobj.c
>> @@ -509,6 +509,18 @@ set_sampler_wrap_r(struct gl_context *ctx, struct
> gl_sampler_object *samp,
>>     return INVALID_PARAM;
>>  }
>>
>> +void
>> +_mesa_set_sampler_filters(struct gl_context *ctx,
>> +                          struct gl_sampler_object *samp,
>> +                          GLenum min_filter, GLenum mag_filter)
>> +{
> 
> Maybe add asserts like you did on the others?

I added it the other place because it was easy, and I didn't add it here
because I was lazy. :)  It's a good suggestion, so I went ahead and
added it.

>> +   if (samp->MinFilter == min_filter && samp->MagFilter == mag_filter)
>> +      return;
>> +
>> +   flush(ctx);
>> +   samp->MinFilter = min_filter;
>> +   samp->MagFilter = mag_filter;
>> +}
>>
>>  static GLuint
>>  set_sampler_min_filter(struct gl_context *ctx, struct
> gl_sampler_object *samp,
>> diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
>> index 1817c1a..c35052e 100644
>> --- a/src/mesa/main/samplerobj.h
>> +++ b/src/mesa/main/samplerobj.h
>> @@ -84,6 +84,11 @@ extern void
>>  _mesa_set_sampler_wrap(struct gl_context *ctx, struct
> gl_sampler_object *samp,
>>                         GLenum s, GLenum t, GLenum r);
>>
>> +extern void
>> +_mesa_set_sampler_filters(struct gl_context *ctx,
>> +                          struct gl_sampler_object *samp,
>> +                          GLenum min_filter, GLenum mag_filter);
>> +
>>  void GLAPIENTRY
>>  _mesa_GenSamplers(GLsizei count, GLuint *samplers);
>>  void GLAPIENTRY
>> --
>> 2.5.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>>mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>>http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> <http://lists.freedesktop.org/mailman/listinfo/mesa-dev>
> 



More information about the mesa-dev mailing list