st/mesa: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0dc6b72455
commit
164b3cd757
|
@ -48,7 +48,7 @@ struct st_buffer_object
|
||||||
|
|
||||||
|
|
||||||
/** cast wrapper */
|
/** cast wrapper */
|
||||||
static INLINE struct st_buffer_object *
|
static inline struct st_buffer_object *
|
||||||
st_buffer_object(struct gl_buffer_object *obj)
|
st_buffer_object(struct gl_buffer_object *obj)
|
||||||
{
|
{
|
||||||
return (struct st_buffer_object *) obj;
|
return (struct st_buffer_object *) obj;
|
||||||
|
|
|
@ -102,7 +102,7 @@ st_destroy_clear(struct st_context *st)
|
||||||
/**
|
/**
|
||||||
* Helper function to set the fragment shaders.
|
* Helper function to set the fragment shaders.
|
||||||
*/
|
*/
|
||||||
static INLINE void
|
static inline void
|
||||||
set_fragment_shader(struct st_context *st)
|
set_fragment_shader(struct st_context *st)
|
||||||
{
|
{
|
||||||
if (!st->clear.fs)
|
if (!st->clear.fs)
|
||||||
|
@ -118,7 +118,7 @@ set_fragment_shader(struct st_context *st)
|
||||||
/**
|
/**
|
||||||
* Helper function to set the vertex shader.
|
* Helper function to set the vertex shader.
|
||||||
*/
|
*/
|
||||||
static INLINE void
|
static inline void
|
||||||
set_vertex_shader(struct st_context *st)
|
set_vertex_shader(struct st_context *st)
|
||||||
{
|
{
|
||||||
/* vertex shader - still required to provide the linkage between
|
/* vertex shader - still required to provide the linkage between
|
||||||
|
@ -381,7 +381,7 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers)
|
||||||
/**
|
/**
|
||||||
* Return if the scissor must be enabled during the clear.
|
* Return if the scissor must be enabled during the clear.
|
||||||
*/
|
*/
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
{
|
{
|
||||||
return (ctx->Scissor.EnableFlags & 1) &&
|
return (ctx->Scissor.EnableFlags & 1) &&
|
||||||
|
@ -395,7 +395,7 @@ is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
/**
|
/**
|
||||||
* Return if all of the color channels are masked.
|
* Return if all of the color channels are masked.
|
||||||
*/
|
*/
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_color_disabled(struct gl_context *ctx, int i)
|
is_color_disabled(struct gl_context *ctx, int i)
|
||||||
{
|
{
|
||||||
return !ctx->Color.ColorMask[i][0] &&
|
return !ctx->Color.ColorMask[i][0] &&
|
||||||
|
@ -408,7 +408,7 @@ is_color_disabled(struct gl_context *ctx, int i)
|
||||||
/**
|
/**
|
||||||
* Return if any of the color channels are masked.
|
* Return if any of the color channels are masked.
|
||||||
*/
|
*/
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_color_masked(struct gl_context *ctx, int i)
|
is_color_masked(struct gl_context *ctx, int i)
|
||||||
{
|
{
|
||||||
return !ctx->Color.ColorMask[i][0] ||
|
return !ctx->Color.ColorMask[i][0] ||
|
||||||
|
@ -421,7 +421,7 @@ is_color_masked(struct gl_context *ctx, int i)
|
||||||
/**
|
/**
|
||||||
* Return if all of the stencil bits are masked.
|
* Return if all of the stencil bits are masked.
|
||||||
*/
|
*/
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_stencil_disabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
is_stencil_disabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
{
|
{
|
||||||
const GLuint stencilMax = 0xff;
|
const GLuint stencilMax = 0xff;
|
||||||
|
@ -434,7 +434,7 @@ is_stencil_disabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
/**
|
/**
|
||||||
* Return if any of the stencil bits are masked.
|
* Return if any of the stencil bits are masked.
|
||||||
*/
|
*/
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_stencil_masked(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
is_stencil_masked(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||||
{
|
{
|
||||||
const GLuint stencilMax = 0xff;
|
const GLuint stencilMax = 0xff;
|
||||||
|
|
|
@ -65,7 +65,7 @@ struct st_renderbuffer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct st_renderbuffer *
|
static inline struct st_renderbuffer *
|
||||||
st_renderbuffer(struct gl_renderbuffer *rb)
|
st_renderbuffer(struct gl_renderbuffer *rb)
|
||||||
{
|
{
|
||||||
return (struct st_renderbuffer *) rb;
|
return (struct st_renderbuffer *) rb;
|
||||||
|
|
|
@ -69,7 +69,7 @@ struct feedback_stage
|
||||||
* GL Feedback functions
|
* GL Feedback functions
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
static INLINE struct feedback_stage *
|
static inline struct feedback_stage *
|
||||||
feedback_stage( struct draw_stage *stage )
|
feedback_stage( struct draw_stage *stage )
|
||||||
{
|
{
|
||||||
return (struct feedback_stage *)stage;
|
return (struct feedback_stage *)stage;
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
|
|
||||||
/** Check if we have a front color buffer and if it's been drawn to. */
|
/** Check if we have a front color buffer and if it's been drawn to. */
|
||||||
static INLINE GLboolean
|
static inline GLboolean
|
||||||
is_front_buffer_dirty(struct st_context *st)
|
is_front_buffer_dirty(struct st_context *st)
|
||||||
{
|
{
|
||||||
struct gl_framebuffer *fb = st->ctx->DrawBuffer;
|
struct gl_framebuffer *fb = st->ctx->DrawBuffer;
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct st_query_object
|
||||||
/**
|
/**
|
||||||
* Cast wrapper
|
* Cast wrapper
|
||||||
*/
|
*/
|
||||||
static INLINE struct st_query_object *
|
static inline struct st_query_object *
|
||||||
st_query_object(struct gl_query_object *q)
|
st_query_object(struct gl_query_object *q)
|
||||||
{
|
{
|
||||||
return (struct st_query_object *) q;
|
return (struct st_query_object *) q;
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct rastpos_stage
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct rastpos_stage *
|
static inline struct rastpos_stage *
|
||||||
rastpos_stage( struct draw_stage *stage )
|
rastpos_stage( struct draw_stage *stage )
|
||||||
{
|
{
|
||||||
return (struct rastpos_stage *) stage;
|
return (struct rastpos_stage *) stage;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
* We'll only return non-null for window system framebuffers.
|
* We'll only return non-null for window system framebuffers.
|
||||||
* Note that this function may fail.
|
* Note that this function may fail.
|
||||||
*/
|
*/
|
||||||
static INLINE struct st_framebuffer *
|
static inline struct st_framebuffer *
|
||||||
st_ws_framebuffer(struct gl_framebuffer *fb)
|
st_ws_framebuffer(struct gl_framebuffer *fb)
|
||||||
{
|
{
|
||||||
/* FBO cannot be casted. See st_new_framebuffer */
|
/* FBO cannot be casted. See st_new_framebuffer */
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct st_transform_feedback_object {
|
||||||
struct pipe_stream_output_target *draw_count;
|
struct pipe_stream_output_target *draw_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
static INLINE struct st_transform_feedback_object *
|
static inline struct st_transform_feedback_object *
|
||||||
st_transform_feedback_object(struct gl_transform_feedback_object *obj)
|
st_transform_feedback_object(struct gl_transform_feedback_object *obj)
|
||||||
{
|
{
|
||||||
return (struct st_transform_feedback_object *) obj;
|
return (struct st_transform_feedback_object *) obj;
|
||||||
|
|
|
@ -214,7 +214,7 @@ struct st_context
|
||||||
|
|
||||||
/* Need this so that we can implement Mesa callbacks in this module.
|
/* Need this so that we can implement Mesa callbacks in this module.
|
||||||
*/
|
*/
|
||||||
static INLINE struct st_context *st_context(struct gl_context *ctx)
|
static inline struct st_context *st_context(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
return ctx->st;
|
return ctx->st;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ void st_invalidate_state(struct gl_context * ctx, GLuint new_state);
|
||||||
#define Y_0_TOP 1
|
#define Y_0_TOP 1
|
||||||
#define Y_0_BOTTOM 2
|
#define Y_0_BOTTOM 2
|
||||||
|
|
||||||
static INLINE GLuint
|
static inline GLuint
|
||||||
st_fb_orientation(const struct gl_framebuffer *fb)
|
st_fb_orientation(const struct gl_framebuffer *fb)
|
||||||
{
|
{
|
||||||
if (fb && _mesa_is_winsys_fbo(fb)) {
|
if (fb && _mesa_is_winsys_fbo(fb)) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ extern int ST_DEBUG;
|
||||||
|
|
||||||
void st_debug_init( void );
|
void st_debug_init( void );
|
||||||
|
|
||||||
static INLINE void
|
static inline void
|
||||||
ST_DBG( unsigned flag, const char *fmt, ... )
|
ST_DBG( unsigned flag, const char *fmt, ... )
|
||||||
{
|
{
|
||||||
if (ST_DEBUG & flag)
|
if (ST_DEBUG & flag)
|
||||||
|
|
|
@ -76,7 +76,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
|
||||||
* This function is basically a cast wrapper to avoid warnings when building
|
* This function is basically a cast wrapper to avoid warnings when building
|
||||||
* in 64-bit mode.
|
* in 64-bit mode.
|
||||||
*/
|
*/
|
||||||
static INLINE unsigned
|
static inline unsigned
|
||||||
pointer_to_offset(const void *ptr)
|
pointer_to_offset(const void *ptr)
|
||||||
{
|
{
|
||||||
return (unsigned) (((GLsizeiptr) ptr) & 0xffffffffUL);
|
return (unsigned) (((GLsizeiptr) ptr) & 0xffffffffUL);
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
* We'll only return non-null for window system framebuffers.
|
* We'll only return non-null for window system framebuffers.
|
||||||
* Note that this function may fail.
|
* Note that this function may fail.
|
||||||
*/
|
*/
|
||||||
static INLINE struct st_framebuffer *
|
static inline struct st_framebuffer *
|
||||||
st_ws_framebuffer(struct gl_framebuffer *fb)
|
st_ws_framebuffer(struct gl_framebuffer *fb)
|
||||||
{
|
{
|
||||||
/* FBO cannot be casted. See st_new_framebuffer */
|
/* FBO cannot be casted. See st_new_framebuffer */
|
||||||
|
@ -73,7 +73,7 @@ st_ws_framebuffer(struct gl_framebuffer *fb)
|
||||||
/**
|
/**
|
||||||
* Map an attachment to a buffer index.
|
* Map an attachment to a buffer index.
|
||||||
*/
|
*/
|
||||||
static INLINE gl_buffer_index
|
static inline gl_buffer_index
|
||||||
attachment_to_buffer_index(enum st_attachment_type statt)
|
attachment_to_buffer_index(enum st_attachment_type statt)
|
||||||
{
|
{
|
||||||
gl_buffer_index index;
|
gl_buffer_index index;
|
||||||
|
@ -109,7 +109,7 @@ attachment_to_buffer_index(enum st_attachment_type statt)
|
||||||
/**
|
/**
|
||||||
* Map a buffer index to an attachment.
|
* Map a buffer index to an attachment.
|
||||||
*/
|
*/
|
||||||
static INLINE enum st_attachment_type
|
static inline enum st_attachment_type
|
||||||
buffer_index_to_attachment(gl_buffer_index index)
|
buffer_index_to_attachment(gl_buffer_index index)
|
||||||
{
|
{
|
||||||
enum st_attachment_type statt;
|
enum st_attachment_type statt;
|
||||||
|
|
|
@ -208,26 +208,26 @@ struct st_geometry_program
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct st_fragment_program *
|
static inline struct st_fragment_program *
|
||||||
st_fragment_program( struct gl_fragment_program *fp )
|
st_fragment_program( struct gl_fragment_program *fp )
|
||||||
{
|
{
|
||||||
return (struct st_fragment_program *)fp;
|
return (struct st_fragment_program *)fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct st_vertex_program *
|
static inline struct st_vertex_program *
|
||||||
st_vertex_program( struct gl_vertex_program *vp )
|
st_vertex_program( struct gl_vertex_program *vp )
|
||||||
{
|
{
|
||||||
return (struct st_vertex_program *)vp;
|
return (struct st_vertex_program *)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE struct st_geometry_program *
|
static inline struct st_geometry_program *
|
||||||
st_geometry_program( struct gl_geometry_program *gp )
|
st_geometry_program( struct gl_geometry_program *gp )
|
||||||
{
|
{
|
||||||
return (struct st_geometry_program *)gp;
|
return (struct st_geometry_program *)gp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void
|
static inline void
|
||||||
st_reference_vertprog(struct st_context *st,
|
st_reference_vertprog(struct st_context *st,
|
||||||
struct st_vertex_program **ptr,
|
struct st_vertex_program **ptr,
|
||||||
struct st_vertex_program *prog)
|
struct st_vertex_program *prog)
|
||||||
|
@ -237,7 +237,7 @@ st_reference_vertprog(struct st_context *st,
|
||||||
(struct gl_program *) prog);
|
(struct gl_program *) prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void
|
static inline void
|
||||||
st_reference_geomprog(struct st_context *st,
|
st_reference_geomprog(struct st_context *st,
|
||||||
struct st_geometry_program **ptr,
|
struct st_geometry_program **ptr,
|
||||||
struct st_geometry_program *prog)
|
struct st_geometry_program *prog)
|
||||||
|
@ -247,7 +247,7 @@ st_reference_geomprog(struct st_context *st,
|
||||||
(struct gl_program *) prog);
|
(struct gl_program *) prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void
|
static inline void
|
||||||
st_reference_fragprog(struct st_context *st,
|
st_reference_fragprog(struct st_context *st,
|
||||||
struct st_fragment_program **ptr,
|
struct st_fragment_program **ptr,
|
||||||
struct st_fragment_program *prog)
|
struct st_fragment_program *prog)
|
||||||
|
@ -260,7 +260,7 @@ st_reference_fragprog(struct st_context *st,
|
||||||
/**
|
/**
|
||||||
* This defines mapping from Mesa VARYING_SLOTs to TGSI GENERIC slots.
|
* This defines mapping from Mesa VARYING_SLOTs to TGSI GENERIC slots.
|
||||||
*/
|
*/
|
||||||
static INLINE unsigned
|
static inline unsigned
|
||||||
st_get_generic_varying_index(struct st_context *st, GLuint attr)
|
st_get_generic_varying_index(struct st_context *st, GLuint attr)
|
||||||
{
|
{
|
||||||
if (attr >= VARYING_SLOT_VAR0) {
|
if (attr >= VARYING_SLOT_VAR0) {
|
||||||
|
|
|
@ -117,32 +117,32 @@ struct st_texture_object
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct st_texture_image *
|
static inline struct st_texture_image *
|
||||||
st_texture_image(struct gl_texture_image *img)
|
st_texture_image(struct gl_texture_image *img)
|
||||||
{
|
{
|
||||||
return (struct st_texture_image *) img;
|
return (struct st_texture_image *) img;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE const struct st_texture_image *
|
static inline const struct st_texture_image *
|
||||||
st_texture_image_const(const struct gl_texture_image *img)
|
st_texture_image_const(const struct gl_texture_image *img)
|
||||||
{
|
{
|
||||||
return (const struct st_texture_image *) img;
|
return (const struct st_texture_image *) img;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE struct st_texture_object *
|
static inline struct st_texture_object *
|
||||||
st_texture_object(struct gl_texture_object *obj)
|
st_texture_object(struct gl_texture_object *obj)
|
||||||
{
|
{
|
||||||
return (struct st_texture_object *) obj;
|
return (struct st_texture_object *) obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE const struct st_texture_object *
|
static inline const struct st_texture_object *
|
||||||
st_texture_object_const(const struct gl_texture_object *obj)
|
st_texture_object_const(const struct gl_texture_object *obj)
|
||||||
{
|
{
|
||||||
return (const struct st_texture_object *) obj;
|
return (const struct st_texture_object *) obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct pipe_resource *
|
static inline struct pipe_resource *
|
||||||
st_get_texobj_resource(struct gl_texture_object *texObj)
|
st_get_texobj_resource(struct gl_texture_object *texObj)
|
||||||
{
|
{
|
||||||
struct st_texture_object *stObj = st_texture_object(texObj);
|
struct st_texture_object *stObj = st_texture_object(texObj);
|
||||||
|
@ -150,14 +150,14 @@ st_get_texobj_resource(struct gl_texture_object *texObj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct pipe_resource *
|
static inline struct pipe_resource *
|
||||||
st_get_stobj_resource(struct st_texture_object *stObj)
|
st_get_stobj_resource(struct st_texture_object *stObj)
|
||||||
{
|
{
|
||||||
return stObj ? stObj->pt : NULL;
|
return stObj ? stObj->pt : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct pipe_sampler_view *
|
static inline struct pipe_sampler_view *
|
||||||
st_create_texture_sampler_view_format(struct pipe_context *pipe,
|
st_create_texture_sampler_view_format(struct pipe_context *pipe,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
enum pipe_format format)
|
enum pipe_format format)
|
||||||
|
@ -169,7 +169,7 @@ st_create_texture_sampler_view_format(struct pipe_context *pipe,
|
||||||
return pipe->create_sampler_view(pipe, texture, &templ);
|
return pipe->create_sampler_view(pipe, texture, &templ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE struct pipe_sampler_view *
|
static inline struct pipe_sampler_view *
|
||||||
st_create_texture_sampler_view(struct pipe_context *pipe,
|
st_create_texture_sampler_view(struct pipe_context *pipe,
|
||||||
struct pipe_resource *texture)
|
struct pipe_resource *texture)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue