[Mesa-dev] [PATCH 1/2] mesa/marshal: extract ClearBuffer helpers

Grigori Goronzy greg at chown.ath.cx
Sun Jul 9 22:26:23 UTC 2017


On 2017-07-09 18:52, Matt Turner wrote:
>> +static inline size_t buffer_to_size(GLenum buffer)
>> +{
>> +   switch (buffer) {
>> +   case GL_COLOR:
>> +      return 4;
>> +   case GL_DEPTH_STENCIL:
>> +      return 2;
>> +   case GL_STENCIL:
>> +   case GL_DEPTH:
>> +      return 1;
>> +   default:
>> +      return 0;
>> +   }
>> +}
>> +
>> +static inline bool clear_buffer_add_command(struct gl_context *ctx, 
>> uint16_t id,
> 
> Please don't use 'inline'. The compiler is capable of making this
> decision for itself, based on the data it has available.

Well, it's just a hint. If the compiler believes inlining is not 
beneficial, it does not have to do it. The GL frontend and no_error code 
uses inline quite a bit, so I figured it's acceptable in this place, but 
I can remove it as well.

Grigori

> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list