summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2019-07-04 14:41:00 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2019-07-22 22:13:51 -0400
commitaffb2da0f862e0a604a9a075f2b45d57038797d5 (patch)
treec4c731eefe87d800f79ab05e3907daa90aab1fd6 /src
parent0e30c6b8a7e84211bb417362ec73f24ef134ae34 (diff)
gallium: remove boolean from state tracker APIs
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/state_tracker/graw.h8
-rw-r--r--src/gallium/include/state_tracker/st_api.h73
-rw-r--r--src/gallium/include/state_tracker/sw_winsys.h5
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c34
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.h6
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c8
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.c24
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.h2
-rw-r--r--src/gallium/state_trackers/hgl/hgl.c14
-rw-r--r--src/gallium/state_trackers/osmesa/osmesa.c8
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c14
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.h2
-rw-r--r--src/gallium/targets/graw-null/graw_util.c14
-rw-r--r--src/gallium/winsys/sw/dri/dri_sw_winsys.c12
-rw-r--r--src/gallium/winsys/sw/gdi/gdi_sw_winsys.c10
-rw-r--r--src/gallium/winsys/sw/hgl/hgl_sw_winsys.c8
-rw-r--r--src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c12
-rw-r--r--src/gallium/winsys/sw/null/null_sw_winsys.c8
-rw-r--r--src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c10
-rw-r--r--src/gallium/winsys/sw/xlib/xlib_sw_winsys.c14
-rw-r--r--src/mesa/state_tracker/st_manager.c50
-rw-r--r--src/mesa/state_tracker/st_manager.h2
22 files changed, 168 insertions, 170 deletions
diff --git a/src/gallium/include/state_tracker/graw.h b/src/gallium/include/state_tracker/graw.h
index 78ddf0a87f7..af81cc8871b 100644
--- a/src/gallium/include/state_tracker/graw.h
+++ b/src/gallium/include/state_tracker/graw.h
@@ -79,7 +79,7 @@ PUBLIC void *graw_parse_fragment_shader( struct pipe_context *pipe,
* If an option has been successfully parsed, argi is updated
* to point just after the option and return TRUE.
*/
-PUBLIC boolean graw_parse_args(int *argi, int argc, char *argv[]);
+PUBLIC bool graw_parse_args(int *argi, int argc, char *argv[]);
/* Saves surface contents to a file.
*
@@ -89,8 +89,8 @@ PUBLIC boolean graw_parse_args(int *argi, int argc, char *argv[]);
*
* Returns TRUE if the surface has been saved.
*/
-PUBLIC boolean graw_save_surface_to_file(struct pipe_context *pipe,
- struct pipe_surface *surface,
- const char *filename);
+PUBLIC bool graw_save_surface_to_file(struct pipe_context *pipe,
+ struct pipe_surface *surface,
+ const char *filename);
#endif
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 2b63b8a3d2a..b2b81b6ebc4 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -27,7 +27,6 @@
#ifndef _ST_API_H_
#define _ST_API_H_
-#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
/**
@@ -218,19 +217,19 @@ struct st_visual
*/
struct st_config_options
{
- boolean disable_blend_func_extended;
- boolean disable_glsl_line_continuations;
- boolean force_glsl_extensions_warn;
+ bool disable_blend_func_extended;
+ bool disable_glsl_line_continuations;
+ bool force_glsl_extensions_warn;
unsigned force_glsl_version;
- boolean allow_glsl_extension_directive_midshader;
- boolean allow_glsl_builtin_const_expression;
- boolean allow_glsl_relaxed_es;
- boolean allow_glsl_builtin_variable_redeclaration;
- boolean allow_higher_compat_version;
- boolean glsl_zero_init;
- boolean force_glsl_abs_sqrt;
- boolean allow_glsl_cross_stage_interpolation_mismatch;
- boolean allow_glsl_layout_qualifier_on_function_parameters;
+ bool allow_glsl_extension_directive_midshader;
+ bool allow_glsl_builtin_const_expression;
+ bool allow_glsl_relaxed_es;
+ bool allow_glsl_builtin_variable_redeclaration;
+ bool allow_higher_compat_version;
+ bool glsl_zero_init;
+ bool force_glsl_abs_sqrt;
+ bool allow_glsl_cross_stage_interpolation_mismatch;
+ bool allow_glsl_layout_qualifier_on_function_parameters;
unsigned char config_options_sha1[20];
};
@@ -319,9 +318,9 @@ struct st_framebuffer_iface
*
* @att is one of the front buffer attachments.
*/
- boolean (*flush_front)(struct st_context_iface *stctx,
- struct st_framebuffer_iface *stfbi,
- enum st_attachment_type statt);
+ bool (*flush_front)(struct st_context_iface *stctx,
+ struct st_framebuffer_iface *stfbi,
+ enum st_attachment_type statt);
/**
* The state tracker asks for the textures it needs.
@@ -340,13 +339,13 @@ struct st_framebuffer_iface
* the last call might be destroyed. This behavior might change in the
* future.
*/
- boolean (*validate)(struct st_context_iface *stctx,
- struct st_framebuffer_iface *stfbi,
- const enum st_attachment_type *statts,
- unsigned count,
- struct pipe_resource **out);
- boolean (*flush_swapbuffers) (struct st_context_iface *stctx,
- struct st_framebuffer_iface *stfbi);
+ bool (*validate)(struct st_context_iface *stctx,
+ struct st_framebuffer_iface *stfbi,
+ const enum st_attachment_type *statts,
+ unsigned count,
+ struct pipe_resource **out);
+ bool (*flush_swapbuffers) (struct st_context_iface *stctx,
+ struct st_framebuffer_iface *stfbi);
};
/**
@@ -394,10 +393,10 @@ struct st_context_iface
*
* This function is optional.
*/
- boolean (*teximage)(struct st_context_iface *stctxi,
- enum st_texture_type target,
- int level, enum pipe_format internal_format,
- struct pipe_resource *tex, boolean mipmap);
+ bool (*teximage)(struct st_context_iface *stctxi,
+ enum st_texture_type target,
+ int level, enum pipe_format internal_format,
+ struct pipe_resource *tex, bool mipmap);
/**
* Used to implement glXCopyContext.
@@ -408,8 +407,8 @@ struct st_context_iface
/**
* Used to implement wglShareLists.
*/
- boolean (*share)(struct st_context_iface *stctxi,
- struct st_context_iface *stsrci);
+ bool (*share)(struct st_context_iface *stctxi,
+ struct st_context_iface *stsrci);
/**
* Start the thread if the API has a worker thread.
@@ -451,9 +450,9 @@ struct st_manager
*
* This function is optional.
*/
- boolean (*get_egl_image)(struct st_manager *smapi,
- void *egl_image,
- struct st_egl_image *out);
+ bool (*get_egl_image)(struct st_manager *smapi,
+ void *egl_image,
+ struct st_egl_image *out);
/**
* Query an manager param.
@@ -537,10 +536,10 @@ struct st_api
* The framebuffers might be NULL, or might have different visuals than the
* context does.
*/
- boolean (*make_current)(struct st_api *stapi,
- struct st_context_iface *stctxi,
- struct st_framebuffer_iface *stdrawi,
- struct st_framebuffer_iface *streadi);
+ bool (*make_current)(struct st_api *stapi,
+ struct st_context_iface *stctxi,
+ struct st_framebuffer_iface *stdrawi,
+ struct st_framebuffer_iface *streadi);
/**
* Get the currently bound context in the calling thread.
@@ -558,7 +557,7 @@ struct st_api
/**
* Return true if the visual has the specified buffers.
*/
-static inline boolean
+static inline bool
st_visual_have_buffers(const struct st_visual *visual, unsigned mask)
{
return ((visual->buffer_mask & mask) == mask);
diff --git a/src/gallium/include/state_tracker/sw_winsys.h b/src/gallium/include/state_tracker/sw_winsys.h
index cd5838ad1d8..43a73830f6b 100644
--- a/src/gallium/include/state_tracker/sw_winsys.h
+++ b/src/gallium/include/state_tracker/sw_winsys.h
@@ -35,7 +35,6 @@
#define SW_WINSYS_H
-#include "pipe/p_compiler.h" /* for boolean */
#include "pipe/p_format.h"
#include "state_tracker/winsys_handle.h"
@@ -67,7 +66,7 @@ struct sw_winsys
void
(*destroy)( struct sw_winsys *ws );
- boolean
+ bool
(*is_displaytarget_format_supported)( struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format );
@@ -104,7 +103,7 @@ struct sw_winsys
/**
* Used to implement texture_get_handle.
*/
- boolean
+ bool
(*displaytarget_get_handle)( struct sw_winsys *ws,
struct sw_displaytarget *dt,
struct winsys_handle *whandle );
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index c1de3bed9dd..f27396195ec 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -43,7 +43,7 @@ static uint32_t drifb_ID = 0;
static void
swap_fences_unref(struct dri_drawable *draw);
-static boolean
+static bool
dri_st_framebuffer_validate(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
const enum st_attachment_type *statts,
@@ -55,7 +55,7 @@ dri_st_framebuffer_validate(struct st_context_iface *stctx,
(struct dri_drawable *) stfbi->st_manager_private;
struct dri_screen *screen = dri_screen(drawable->sPriv);
unsigned statt_mask, new_mask;
- boolean new_stamp;
+ bool new_stamp;
int i;
unsigned int lastStamp;
struct pipe_resource **textures =
@@ -96,16 +96,16 @@ dri_st_framebuffer_validate(struct st_context_iface *stctx,
} while (lastStamp != drawable->dPriv->lastStamp);
if (!out)
- return TRUE;
+ return true;
/* Set the window-system buffers for the state tracker. */
for (i = 0; i < count; i++)
pipe_resource_reference(&out[i], textures[statts[i]]);
- return TRUE;
+ return true;
}
-static boolean
+static bool
dri_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
@@ -117,13 +117,13 @@ dri_st_framebuffer_flush_front(struct st_context_iface *stctx,
/* XXX remove this and just set the correct one on the framebuffer */
drawable->flush_frontbuffer(ctx, drawable, statt);
- return TRUE;
+ return true;
}
/**
* The state tracker framebuffer interface flush_swapbuffers callback
*/
-static boolean
+static bool
dri_st_framebuffer_flush_swapbuffers(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi)
{
@@ -134,16 +134,16 @@ dri_st_framebuffer_flush_swapbuffers(struct st_context_iface *stctx,
if (drawable->flush_swapbuffers)
drawable->flush_swapbuffers(ctx, drawable);
- return TRUE;
+ return true;
}
/**
* This is called when we need to set up GL rendering to a new X window.
*/
-boolean
+bool
dri_create_buffer(__DRIscreen * sPriv,
__DRIdrawable * dPriv,
- const struct gl_config * visual, boolean isPixmap)
+ const struct gl_config * visual, bool isPixmap)
{
struct dri_screen *screen = sPriv->driverPrivate;
struct dri_drawable *drawable = NULL;
@@ -176,10 +176,10 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.ID = p_atomic_inc_return(&drifb_ID);
drawable->base.state_manager = &screen->base;
- return GL_TRUE;
+ return true;
fail:
FREE(drawable);
- return GL_FALSE;
+ return false;
}
void
@@ -281,7 +281,7 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
ctx->st->teximage(ctx->st,
(target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
- 0, internal_format, pt, FALSE);
+ 0, internal_format, pt, false);
}
}
@@ -480,7 +480,7 @@ dri_flush(__DRIcontext *cPriv,
struct dri_drawable *drawable = dri_drawable(dPriv);
struct st_context_iface *st;
unsigned flush_flags;
- boolean swap_msaa_buffers = FALSE;
+ bool swap_msaa_buffers = false;
if (!ctx) {
assert(0);
@@ -496,7 +496,7 @@ dri_flush(__DRIcontext *cPriv,
if (drawable->flushing)
return;
- drawable->flushing = TRUE;
+ drawable->flushing = true;
}
else {
flags &= ~__DRI2_FLUSH_DRAWABLE;
@@ -516,7 +516,7 @@ dri_flush(__DRIcontext *cPriv,
if (drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT] &&
drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]) {
- swap_msaa_buffers = TRUE;
+ swap_msaa_buffers = true;
}
/* FRONT_LEFT is resolved in drawable->flush_frontbuffer. */
@@ -582,7 +582,7 @@ dri_flush(__DRIcontext *cPriv,
}
if (drawable) {
- drawable->flushing = FALSE;
+ drawable->flushing = false;
}
/* Swap the MSAA front and back buffers, so that reading
diff --git a/src/gallium/state_trackers/dri/dri_drawable.h b/src/gallium/state_trackers/dri/dri_drawable.h
index 7c45004ba64..3a142144f44 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/dri_drawable.h
@@ -65,7 +65,7 @@ struct dri_drawable
unsigned int head;
unsigned int tail;
unsigned int desired_fences;
- boolean flushing; /* prevents recursion in dri_flush */
+ bool flushing; /* prevents recursion in dri_flush */
/* used only by DRISW */
struct pipe_surface *drisw_surface;
@@ -99,10 +99,10 @@ dri_drawable(__DRIdrawable * driDrawPriv)
/***********************************************************************
* dri_drawable.c
*/
-boolean
+bool
dri_create_buffer(__DRIscreen * sPriv,
__DRIdrawable * dPriv,
- const struct gl_config * visual, boolean isPixmap);
+ const struct gl_config * visual, bool isPixmap);
void dri_destroy_buffer(__DRIdrawable * dPriv);
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 82a0988a634..2aed6ad3f12 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -164,9 +164,9 @@ dri_fill_in_modes(struct dri_screen *screen)
unsigned msaa_samples_max;
unsigned i;
struct pipe_screen *p_screen = screen->base.screen;
- boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32;
- boolean mixed_color_depth;
- boolean allow_rgb10;
+ bool pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32;
+ bool mixed_color_depth;
+ bool allow_rgb10;
static const GLenum back_buffer_modes[] = {
__DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED,
@@ -416,7 +416,7 @@ dri_fill_st_visual(struct st_visual *stvis,
/* let the state tracker allocate the accum buffer */
}
-static boolean
+static bool
dri_get_egl_image(struct st_manager *smapi,
void *egl_image,
struct st_egl_image *stimg)
diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c
index 2fa80f4da28..4fe7b57f24c 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_st.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_st.c
@@ -57,7 +57,7 @@ xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi)
/**
* Display (present) an attachment to the xlib_drawable of the framebuffer.
*/
-static boolean
+static bool
xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
{
@@ -66,7 +66,7 @@ xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
struct pipe_resource *pres;
if (!ptex)
- return TRUE;
+ return true;
pres = xstfb->display_resource;
/* (re)allocate the surface for the texture to be displayed */
@@ -76,7 +76,7 @@ xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
}
xstfb->screen->flush_frontbuffer(xstfb->screen, pres, 0, 0, &xstfb->buffer->ws, NULL);
- return TRUE;
+ return true;
}
@@ -113,7 +113,7 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
* Remove outdated textures and create the requested ones.
* This is a helper used during framebuffer validation.
*/
-boolean
+bool
xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
unsigned width, unsigned height,
unsigned mask)
@@ -183,7 +183,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
xstfb->texture_height = height;
xstfb->texture_mask = mask;
- return TRUE;
+ return true;
}
@@ -196,7 +196,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
* \param count number of framebuffer attachments in statts[]
* \param out returns resources for each of the attachments
*/
-static boolean
+static bool
xmesa_st_framebuffer_validate(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
const enum st_attachment_type *statts,
@@ -205,8 +205,8 @@ xmesa_st_framebuffer_validate(struct st_context_iface *stctx,
{
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
unsigned statt_mask, new_mask, i;
- boolean resized;
- boolean ret;
+ bool resized;
+ bool ret;
/* build mask of ST_ATTACHMENT bits */
statt_mask = 0x0;
@@ -250,20 +250,20 @@ xmesa_st_framebuffer_validate(struct st_context_iface *stctx,
for (i = 0; i < count; i++)
pipe_resource_reference(&out[i], xstfb->textures[statts[i]]);
- return TRUE;
+ return true;
}
/**
* Called via st_framebuffer_iface::flush_front()
*/
-static boolean
+static bool
xmesa_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
{
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
- boolean ret;
+ bool ret;
ret = xmesa_st_framebuffer_display(stfbi, statt);
@@ -345,7 +345,7 @@ void
xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
{
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
- boolean ret;
+ bool ret;
ret = xmesa_st_framebuffer_display(stfbi, ST_ATTACHMENT_BACK_LEFT);
if (ret) {
diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.h b/src/gallium/state_trackers/glx/xlib/xm_st.h
index e95d7e0d574..0a15afcd77c 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_st.h
+++ b/src/gallium/state_trackers/glx/xlib/xm_st.h
@@ -59,7 +59,7 @@ xmesa_get_attachment(struct st_framebuffer_iface *stfbi,
struct pipe_context*
xmesa_get_context(struct st_framebuffer_iface* stfbi);
-boolean
+bool
xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
unsigned width, unsigned height,
unsigned mask);
diff --git a/src/gallium/state_trackers/hgl/hgl.c b/src/gallium/state_trackers/hgl/hgl.c
index bbc477a978c..57e0e7695c8 100644
--- a/src/gallium/state_trackers/hgl/hgl.c
+++ b/src/gallium/state_trackers/hgl/hgl.c
@@ -55,7 +55,7 @@ hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
}
-static boolean
+static bool
hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
struct st_framebuffer_iface* stfbi, enum st_attachment_type statt)
{
@@ -73,11 +73,11 @@ hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
stw_framebuffer_present_locked(...);
#endif
- return TRUE;
+ return true;
}
-static boolean
+static bool
hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
unsigned width, unsigned height, unsigned mask)
{
@@ -138,7 +138,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
buffer->height = height;
buffer->mask = mask;
- return TRUE;
+ return true;
}
@@ -146,7 +146,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
* Called by the st manager to validate the framebuffer (allocate
* its resources).
*/
-static boolean
+static bool
hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts,
unsigned count, struct pipe_resource **out)
@@ -155,7 +155,7 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
struct hgl_buffer* buffer;
unsigned stAttachmentMask, newMask;
unsigned i;
- boolean resized;
+ bool resized;
CALLED();
@@ -196,7 +196,7 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
for (i = 0; i < count; i++)
pipe_resource_reference(&out[i], buffer->textures[statts[i]]);
- return TRUE;
+ return true;
}
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index e70c391a905..41ff9216fc6 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -304,7 +304,7 @@ stfbi_to_osbuffer(struct st_framebuffer_iface *stfbi)
* Called via glFlush/glFinish. This is where we copy the contents
* of the driver's color buffer into the user-specified buffer.
*/
-static boolean
+static bool
osmesa_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
@@ -373,7 +373,7 @@ osmesa_st_framebuffer_flush_front(struct st_context_iface *stctx,
pipe->transfer_unmap(pipe, transfer);
- return TRUE;
+ return true;
}
@@ -381,7 +381,7 @@ osmesa_st_framebuffer_flush_front(struct st_context_iface *stctx,
* Called by the st manager to validate the framebuffer (allocate
* its resources).
*/
-static boolean
+static bool
osmesa_st_framebuffer_validate(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
const enum st_attachment_type *statts,
@@ -438,7 +438,7 @@ osmesa_st_framebuffer_validate(struct st_context_iface *stctx,
screen->resource_create(screen, &templat);
}
- return TRUE;
+ return true;
}
static uint32_t osmesa_fb_ID = 0;
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index 2445c33a293..2f686a1d6ad 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -140,7 +140,7 @@ stw_st_framebuffer_validate_locked(struct st_framebuffer_iface *stfb,
stwfb->texture_mask = mask;
}
-static boolean
+static bool
stw_st_framebuffer_validate(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfb,
const enum st_attachment_type *statts,
@@ -167,13 +167,13 @@ stw_st_framebuffer_validate(struct st_context_iface *stctx,
stw_framebuffer_unlock(stwfb->fb);
- return TRUE;
+ return true;
}
/**
* Present an attachment of the framebuffer.
*/
-static boolean
+static bool
stw_st_framebuffer_present_locked(HDC hdc,
struct st_framebuffer_iface *stfb,
enum st_attachment_type statt)
@@ -193,16 +193,16 @@ stw_st_framebuffer_present_locked(HDC hdc,
assert(!stw_own_mutex(&stwfb->fb->mutex));
- return TRUE;
+ return true;
}
-static boolean
+static bool
stw_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfb,
enum st_attachment_type statt)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
- boolean ret;
+ bool ret;
HDC hDC;
stw_framebuffer_lock(stwfb->fb);
@@ -267,7 +267,7 @@ stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb)
/**
* Swap the buffers of the given framebuffer.
*/
-boolean
+bool
stw_st_swap_framebuffer_locked(HDC hdc, struct st_framebuffer_iface *stfb)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
diff --git a/src/gallium/state_trackers/wgl/stw_st.h b/src/gallium/state_trackers/wgl/stw_st.h
index 3b9ae75a0dc..6bc218285a7 100644
--- a/src/gallium/state_trackers/wgl/stw_st.h
+++ b/src/gallium/state_trackers/wgl/stw_st.h
@@ -46,7 +46,7 @@ stw_st_create_framebuffer(struct stw_framebuffer *fb);
void
stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb);
-boolean
+bool
stw_st_swap_framebuffer_locked(HDC hdc, struct st_framebuffer_iface *stfb);
struct pipe_resource *
diff --git a/src/gallium/targets/graw-null/graw_util.c b/src/gallium/targets/graw-null/graw_util.c
index bf7f258f3cc..6d4d960d297 100644
--- a/src/gallium/targets/graw-null/graw_util.c
+++ b/src/gallium/targets/graw-null/graw_util.c
@@ -59,26 +59,26 @@ graw_parse_fragment_shader(struct pipe_context *pipe,
static char out_filename[256] = "";
-PUBLIC boolean
+PUBLIC bool
graw_parse_args(int *argi,
int argc,
char *argv[])
{
if (strcmp(argv[*argi], "-o") == 0) {
if (*argi + 1 >= argc) {
- return FALSE;
+ return false;
}
strncpy(out_filename, argv[*argi + 1], sizeof(out_filename) - 1);
out_filename[sizeof(out_filename) - 1] = '\0';
*argi += 2;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-PUBLIC boolean
+PUBLIC bool
graw_save_surface_to_file(struct pipe_context *pipe,
struct pipe_surface *surface,
const char *filename)
@@ -86,12 +86,12 @@ graw_save_surface_to_file(struct pipe_context *pipe,
if (!filename || !*filename) {
filename = out_filename;
if (!filename || !*filename) {
- return FALSE;
+ return false;
}
}
/* XXX: Make that working in release builds.
*/
debug_dump_surface_bmp(pipe, filename, surface);
- return TRUE;
+ return true;
}
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
index eacee295ee1..761f5d19f54 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
@@ -77,13 +77,13 @@ dri_sw_winsys( struct sw_winsys *ws )
}
-static boolean
+static bool
dri_sw_is_displaytarget_format_supported( struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format )
{
/* TODO: check visuals or other sensible thing here */
- return TRUE;
+ return true;
}
#ifdef HAVE_SYS_SHM_H
@@ -214,7 +214,7 @@ dri_sw_displaytarget_from_handle(struct sw_winsys *winsys,
return NULL;
}
-static boolean
+static bool
dri_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
@@ -223,12 +223,12 @@ dri_sw_displaytarget_get_handle(struct sw_winsys *winsys,
if (whandle->type == WINSYS_HANDLE_TYPE_SHMID) {
if (dri_sw_dt->shmid < 0)
- return FALSE;
+ return false;
whandle->handle = dri_sw_dt->shmid;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
diff --git a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
index 16f641833c6..675da401329 100644
--- a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
+++ b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
@@ -69,7 +69,7 @@ gdi_sw_displaytarget( struct sw_displaytarget *buf )
}
-static boolean
+static bool
gdi_sw_is_displaytarget_format_supported( struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format )
@@ -77,13 +77,13 @@ gdi_sw_is_displaytarget_format_supported( struct sw_winsys *ws,
switch(format) {
case PIPE_FORMAT_B8G8R8X8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
- return TRUE;
+ return true;
/* TODO: Support other formats possible with BMPs, as described in
* http://msdn.microsoft.com/en-us/library/dd183376(VS.85).aspx */
default:
- return FALSE;
+ return false;
}
}
@@ -182,13 +182,13 @@ gdi_sw_displaytarget_from_handle(struct sw_winsys *winsys,
}
-static boolean
+static bool
gdi_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
assert(0);
- return FALSE;
+ return false;
}
diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c
index f7bc907ea5c..9d37c5aacae 100644
--- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c
+++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c
@@ -81,12 +81,12 @@ hgl_winsys_destroy(struct sw_winsys* winsys)
}
-static boolean
+static bool
hgl_winsys_is_displaytarget_format_supported(struct sw_winsys* winsys,
unsigned textureUsage, enum pipe_format format)
{
// TODO STUB
- return TRUE;
+ return true;
}
static color_space
@@ -164,11 +164,11 @@ hgl_winsys_displaytarget_from_handle(struct sw_winsys* winsys,
}
-static boolean
+static bool
hgl_winsys_displaytarget_get_handle(struct sw_winsys* winsys,
struct sw_displaytarget* displayTarget, struct winsys_handle* whandle)
{
- return FALSE;
+ return false;
}
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index d9b417dc4da..e3108367ec9 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -114,13 +114,13 @@ kms_sw_winsys( struct sw_winsys *ws )
}
-static boolean
+static bool
kms_sw_is_displaytarget_format_supported( struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format )
{
/* TODO: check visuals or other sensible thing here */
- return TRUE;
+ return true;
}
static struct kms_sw_plane *get_plane(struct kms_sw_displaytarget *kms_sw_dt,
@@ -429,7 +429,7 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
return NULL;
}
-static boolean
+static bool
kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
@@ -443,20 +443,20 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
whandle->handle = kms_sw_dt->handle;
whandle->stride = plane->stride;
whandle->offset = plane->offset;
- return TRUE;
+ return true;
case WINSYS_HANDLE_TYPE_FD:
if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle,
DRM_CLOEXEC, (int*)&whandle->handle)) {
whandle->stride = plane->stride;
whandle->offset = plane->offset;
- return TRUE;
+ return true;
}
/* fallthrough */
default:
whandle->handle = 0;
whandle->stride = 0;
whandle->offset = 0;
- return FALSE;
+ return false;
}
}
diff --git a/src/gallium/winsys/sw/null/null_sw_winsys.c b/src/gallium/winsys/sw/null/null_sw_winsys.c
index 10ce2508507..e897f246d26 100644
--- a/src/gallium/winsys/sw/null/null_sw_winsys.c
+++ b/src/gallium/winsys/sw/null/null_sw_winsys.c
@@ -43,12 +43,12 @@
#include "null_sw_winsys.h"
-static boolean
+static bool
null_sw_is_displaytarget_format_supported(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format )
{
- return FALSE;
+ return false;
}
@@ -102,13 +102,13 @@ null_sw_displaytarget_from_handle(struct sw_winsys *winsys,
}
-static boolean
+static bool
null_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
assert(0);
- return FALSE;
+ return false;
}
diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
index 31b00e87321..37c499b9485 100644
--- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
+++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
@@ -84,7 +84,7 @@ wrapper_sw_displaytarget(struct sw_displaytarget *dt)
*/
-static boolean
+static bool
wsw_is_dt_format_supported(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format)
@@ -97,7 +97,7 @@ wsw_is_dt_format_supported(struct sw_winsys *ws,
PIPE_BIND_DISPLAY_TARGET);
}
-static boolean
+static bool
wsw_dt_get_stride(struct wrapper_sw_displaytarget *wdt, unsigned *stride)
{
struct pipe_context *pipe = wdt->winsys->pipe;
@@ -109,14 +109,14 @@ wsw_dt_get_stride(struct wrapper_sw_displaytarget *wdt, unsigned *stride)
PIPE_TRANSFER_READ_WRITE,
0, 0, wdt->tex->width0, wdt->tex->height0, &tr);
if (!map)
- return FALSE;
+ return false;
*stride = tr->stride;
wdt->stride = tr->stride;
pipe->transfer_unmap(pipe, tr);
- return TRUE;
+ return true;
}
static struct sw_displaytarget *
@@ -193,7 +193,7 @@ wsw_dt_from_handle(struct sw_winsys *ws,
return wsw_dt_wrap_texture(wsw, tex, stride);
}
-static boolean
+static bool
wsw_dt_get_handle(struct sw_winsys *ws,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
index a4c1d50453b..c14c9de4350 100644
--- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
+++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
@@ -49,7 +49,7 @@
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
-DEBUG_GET_ONCE_BOOL_OPTION(xlib_no_shm, "XLIB_NO_SHM", FALSE)
+DEBUG_GET_ONCE_BOOL_OPTION(xlib_no_shm, "XLIB_NO_SHM", false)
/**
* Display target for Xlib winsys.
@@ -219,13 +219,13 @@ alloc_ximage(struct xlib_displaytarget *xlib_dt,
8, 0);
}
-static boolean
+static bool
xlib_is_displaytarget_format_supported(struct sw_winsys *ws,
unsigned tex_usage,
enum pipe_format format)
{
/* TODO: check visuals or other sensible thing here */
- return TRUE;
+ return true;
}
@@ -296,8 +296,8 @@ static void
xlib_sw_display(struct xlib_drawable *xlib_drawable,
struct sw_displaytarget *dt)
{
- static boolean no_swap = 0;
- static boolean firsttime = 1;
+ static bool no_swap = false;
+ static bool firsttime = true;
struct xlib_displaytarget *xlib_dt = xlib_displaytarget(dt);
Display *display = xlib_dt->display;
XImage *ximage;
@@ -446,13 +446,13 @@ xlib_displaytarget_from_handle(struct sw_winsys *winsys,
}
-static boolean
+static bool
xlib_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
assert(0);
- return FALSE;
+ return false;
}
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index ff0bec8f569..4ef5429c58b 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -208,7 +208,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
uint width, height;
unsigned i;
- boolean changed = FALSE;
+ bool changed = false;
int32_t new_stamp;
new_stamp = p_atomic_read(&stfb->iface->stamp);
@@ -257,7 +257,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
st_set_ws_renderbuffer_surface(strb, ps);
pipe_surface_reference(&ps, NULL);
- changed = TRUE;
+ changed = true;
width = strb->Base.Width;
height = strb->Base.Height;
@@ -303,13 +303,13 @@ st_framebuffer_update_attachments(struct st_framebuffer *stfb)
* Add a renderbuffer to the framebuffer. The framebuffer is one that
* corresponds to a window and is not a user-created FBO.
*/
-static boolean
+static bool
st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
gl_buffer_index idx, bool prefer_srgb)
{
struct gl_renderbuffer *rb;
enum pipe_format format;
- boolean sw;
+ bool sw;
assert(_mesa_is_winsys_fbo(&stfb->Base));
@@ -320,30 +320,30 @@ st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
switch (idx) {
case BUFFER_DEPTH:
format = stfb->iface->visual->depth_stencil_format;
- sw = FALSE;
+ sw = false;
break;
case BUFFER_ACCUM:
format = stfb->iface->visual->accum_format;
- sw = TRUE;
+ sw = true;
break;
default:
format = stfb->iface->visual->color_format;
if (prefer_srgb)
format = util_format_srgb(format);
- sw = FALSE;
+ sw = false;
break;
}
if (format == PIPE_FORMAT_NONE)
- return FALSE;
+ return false;
rb = st_new_renderbuffer_fb(format, stfb->iface->visual->samples, sw);
if (!rb)
- return FALSE;
+ return false;
if (idx != BUFFER_DEPTH) {
_mesa_attach_and_own_rb(&stfb->Base, idx, rb);
- return TRUE;
+ return true;
}
bool rb_ownership_taken = false;
@@ -359,7 +359,7 @@ st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
_mesa_attach_and_own_rb(&stfb->Base, BUFFER_STENCIL, rb);
}
- return TRUE;
+ return true;
}
@@ -546,7 +546,7 @@ st_framebuffer_iface_equal(const void *a, const void *b)
}
-static boolean
+static bool
st_framebuffer_iface_lookup(struct st_manager *smapi,
const struct st_framebuffer_iface *stfbi)
{
@@ -565,7 +565,7 @@ st_framebuffer_iface_lookup(struct st_manager *smapi,
}
-static boolean
+static bool
st_framebuffer_iface_insert(struct st_manager *smapi,
struct st_framebuffer_iface *stfbi)
{
@@ -690,11 +690,11 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
st->gfx_shaders_may_be_dirty = true;
}
-static boolean
+static bool
st_context_teximage(struct st_context_iface *stctxi,
enum st_texture_type tex_type,
int level, enum pipe_format pipe_format,
- struct pipe_resource *tex, boolean mipmap)
+ struct pipe_resource *tex, bool mipmap)
{
struct st_context *st = (struct st_context *) stctxi;
struct gl_context *ctx = st->ctx;
@@ -778,7 +778,7 @@ st_context_teximage(struct st_context_iface *stctxi,
_mesa_dirty_texobj(ctx, texObj);
_mesa_unlock_texture(ctx, texObj);
- return TRUE;
+ return true;
}
@@ -793,7 +793,7 @@ st_context_copy(struct st_context_iface *stctxi,
}
-static boolean
+static bool
st_context_share(struct st_context_iface *stctxi,
struct st_context_iface *stsrci)
{
@@ -1053,14 +1053,14 @@ st_framebuffer_reuse_or_create(struct st_context *st,
}
-static boolean
+static bool
st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi,
struct st_framebuffer_iface *stdrawi,
struct st_framebuffer_iface *streadi)
{
struct st_context *st = (struct st_context *) stctxi;
struct st_framebuffer *stdraw, *stread;
- boolean ret;
+ bool ret;
if (st) {
/* reuse or create the draw fb */
@@ -1208,7 +1208,7 @@ st_manager_flush_swapbuffers(void)
* Add a color renderbuffer on demand. The FBO must correspond to a window,
* not a user-created FBO.
*/
-boolean
+bool
st_manager_add_color_renderbuffer(struct st_context *st,
struct gl_framebuffer *fb,
gl_buffer_index idx)
@@ -1217,12 +1217,12 @@ st_manager_add_color_renderbuffer(struct st_context *st,
/* FBO */
if (!stfb)
- return FALSE;
+ return false;
assert(_mesa_is_winsys_fbo(fb));
if (stfb->Base.Attachment[idx].Renderbuffer)
- return TRUE;
+ return true;
switch (idx) {
case BUFFER_FRONT_LEFT:
@@ -1231,12 +1231,12 @@ st_manager_add_color_renderbuffer(struct st_context *st,
case BUFFER_BACK_RIGHT:
break;
default:
- return FALSE;
+ return false;
}
if (!st_framebuffer_add_renderbuffer(stfb, idx,
stfb->Base.Visual.sRGBCapable))
- return FALSE;
+ return false;
st_framebuffer_update_attachments(stfb);
@@ -1250,7 +1250,7 @@ st_manager_add_color_renderbuffer(struct st_context *st,
st_invalidate_buffers(st);
- return TRUE;
+ return true;
}
diff --git a/src/mesa/state_tracker/st_manager.h b/src/mesa/state_tracker/st_manager.h
index 581e858229b..0a98d506bbe 100644
--- a/src/mesa/state_tracker/st_manager.h
+++ b/src/mesa/state_tracker/st_manager.h
@@ -44,7 +44,7 @@ st_manager_flush_frontbuffer(struct st_context *st);
void
st_manager_validate_framebuffers(struct st_context *st);
-boolean
+bool
st_manager_add_color_renderbuffer(struct st_context *st, struct gl_framebuffer *fb,
gl_buffer_index idx);