diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2011-10-07 12:26:50 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2011-10-18 11:38:39 -0700 |
commit | 2e5a1a254ed81b1d3efa6064f48183eefac784d0 (patch) | |
tree | 0aba873855392f49ad3123c91f97ac2b3789a8eb /src/mesa/drivers/dri/i915 | |
parent | 1b45d68c117d716adb488dcaac16e0834e2471ba (diff) | |
download | external_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.zip external_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.tar.gz external_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.tar.bz2 |
intel: Convert from GLboolean to 'bool' from stdbool.h.
I initially produced the patch using this bash command:
for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i
's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i
's/GL_FALSE/false/g' $file; done
Then I manually added #include <stdbool.h> to fix compilation errors,
and converted a few functions back to GLboolean that were used in core
Mesa's function pointer table to avoid "incompatible pointer" warnings.
Finally, I cleaned up some whitespace issues introduced by the change.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chad Versace <chad@chad-versace.us>
Acked-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_context.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_texblend.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_texstate.c | 20 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_vtbl.c | 22 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_context.c | 26 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_context.h | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_debug.c | 102 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_fragprog.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_texstate.c | 24 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_vtbl.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_render.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_tris.c | 14 |
14 files changed, 138 insertions, 142 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index d22118b..f801abc 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -48,7 +48,7 @@ i830InitDriverFunctions(struct dd_function_table *functions) extern const struct tnl_pipeline_stage *intel_pipeline[]; -GLboolean +bool i830CreateContext(const struct gl_config * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate) @@ -58,7 +58,7 @@ i830CreateContext(const struct gl_config * mesaVis, struct intel_context *intel = &i830->intel; struct gl_context *ctx = &intel->ctx; if (!i830) - return GL_FALSE; + return false; i830InitVtbl(i830); i830InitDriverFunctions(&functions); @@ -66,7 +66,7 @@ i830CreateContext(const struct gl_config * mesaVis, if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv, sharedContextPrivate, &functions)) { FREE(i830); - return GL_FALSE; + return false; } _math_matrix_ctr(&intel->ViewportMatrix); @@ -109,5 +109,5 @@ i830CreateContext(const struct gl_config * mesaVis, _tnl_allow_vertex_fog(ctx, 1); _tnl_allow_pixel_fog(ctx, 0); - return GL_TRUE; + return true; } diff --git a/src/mesa/drivers/dri/i915/i830_context.h b/src/mesa/drivers/dri/i915/i830_context.h index 4d568fc..4f15614 100644 --- a/src/mesa/drivers/dri/i915/i830_context.h +++ b/src/mesa/drivers/dri/i915/i830_context.h @@ -177,7 +177,7 @@ i830_state_draw_region(struct intel_context *intel, struct intel_region *depth_region); /* i830_context.c */ -extern GLboolean +extern bool i830CreateContext(const struct gl_config * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate); diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 8ca796f..434a352 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -846,7 +846,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state) case GL_STENCIL_TEST: { - GLboolean hw_stencil = GL_FALSE; + bool hw_stencil = false; if (ctx->DrawBuffer) { struct intel_renderbuffer *irbStencil = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c index 7e746c1..4332837 100644 --- a/src/mesa/drivers/dri/i915/i830_texblend.c +++ b/src/mesa/drivers/dri/i915/i830_texblend.c @@ -118,7 +118,7 @@ GetTexelOp(GLint unit) * environments are treated identically. * * \todo - * This function should return \c GLboolean. When \c GL_FALSE is returned, + * This function should return \c bool. When \c false is returned, * it means that an environment is selected that the hardware cannot do. This * is the way the Radeon and R200 drivers work. * @@ -144,7 +144,7 @@ i830SetTexEnvCombine(struct i830_context * i830, GLuint args_A[3]; GLuint rgb_shift; GLuint alpha_shift; - GLboolean need_factor = 0; + bool need_factor = 0; int i; unsigned used; static const GLuint tex_blend_rgb[3] = { @@ -387,7 +387,7 @@ i830SetTexEnvCombine(struct i830_context * i830, static void emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit, - GLboolean last_stage) + bool last_stage) { struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit]; GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz; @@ -413,7 +413,7 @@ emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit, i830->state.TexBlendWordsUsed[blendUnit] = tmp_sz; } - I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(blendUnit), GL_TRUE); + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(blendUnit), true); } static void @@ -433,7 +433,7 @@ emit_passthrough(struct i830_context *i830) i830->state.TexBlendWordsUsed[unit] = tmp_sz; } - I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(unit), GL_TRUE); + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(unit), true); } void @@ -442,7 +442,7 @@ i830EmitTextureBlend(struct i830_context *i830) struct gl_context *ctx = &i830->intel.ctx; GLuint unit, last_stage = 0, blendunit = 0; - I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, GL_FALSE); + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, false); if (ctx->Texture._EnabledUnits) { for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 7fb4c70..5f32b92 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -113,7 +113,7 @@ translate_wrap_mode(GLenum wrap) * efficient, but this has gotten complex enough that we need * something which is understandable and reliable. */ -static GLboolean +static bool i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) { struct gl_context *ctx = &intel->ctx; @@ -138,7 +138,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } if (!intel_finalize_mipmap_tree(intel, unit)) - return GL_FALSE; + return false; /* Get first image here, since intelObj->firstLevel will get set in * the intel_finalize_mipmap_tree() call above. @@ -221,7 +221,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) mipFilt = MIPFILTER_LINEAR; break; default: - return GL_FALSE; + return false; } if (sampler->MaxAnisotropy > 1.0) { @@ -237,7 +237,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) magFilt = FILTER_LINEAR; break; default: - return GL_FALSE; + return false; } } @@ -288,7 +288,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* 3D textures not available on i830 */ if (tObj->Target == GL_TEXTURE_3D) - return GL_FALSE; + return false; state[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD | MAP_UNIT(unit) | @@ -312,12 +312,12 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) border[1], border[2]); - I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE); + I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), true); /* memcmp was already disabled, but definitely won't work as the * region might now change and that wouldn't be detected: */ I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit)); - return GL_TRUE; + return true; } @@ -327,7 +327,7 @@ void i830UpdateTextureState(struct intel_context *intel) { struct i830_context *i830 = i830_context(&intel->ctx); - GLboolean ok = GL_TRUE; + bool ok = true; GLuint i; for (i = 0; i < I830_TEX_UNITS && ok; i++) { @@ -343,7 +343,7 @@ i830UpdateTextureState(struct intel_context *intel) case 0:{ struct i830_context *i830 = i830_context(&intel->ctx); if (i830->state.active & I830_UPLOAD_TEX(i)) - I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE); + I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), false); if (i830->state.tex_buffer[i] != NULL) { drm_intel_bo_unreference(i830->state.tex_buffer[i]); @@ -353,7 +353,7 @@ i830UpdateTextureState(struct intel_context *intel) } case TEXTURE_3D_BIT: default: - ok = GL_FALSE; + ok = false; break; } } diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index e8045e3..d29f979 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -41,8 +41,8 @@ #define FILE_DEBUG_FLAG DEBUG_STATE -static GLboolean i830_check_vertex_size(struct intel_context *intel, - GLuint expected); +static bool i830_check_vertex_size(struct intel_context *intel, + GLuint expected); #define SZ_TO_HW(sz) ((sz-2)&0x3) #define EMIT_SZ(sz) (EMIT_1F + (sz) - 1) @@ -236,7 +236,7 @@ i830_reduced_primitive_state(struct intel_context *intel, GLenum rprim) /* Pull apart the vertex format registers and figure out how large a * vertex is supposed to be. */ -static GLboolean +static bool i830_check_vertex_size(struct intel_context *intel, GLuint expected) { struct i830_context *i830 = i830_context(&intel->ctx); @@ -783,34 +783,34 @@ i830_update_draw_buffer(struct intel_context *intel) } if (!colorRegions[0]) { - FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE); + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, true); } else { - FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, false); } /* Check for depth fallback. */ if (irbDepth && irbDepth->region) { - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, false); depthRegion = irbDepth->region; } else if (irbDepth && !irbDepth->region) { - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_TRUE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, true); depthRegion = NULL; } else { /* !irbDepth */ /* No fallback is needed because there is no depth buffer. */ - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, false); depthRegion = NULL; } /* Check for stencil fallback. */ if (irbStencil && irbStencil->region) { assert(irbStencil->Base.Format == MESA_FORMAT_S8_Z24); - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } else if (irbStencil && !irbStencil->region) { - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, true); } else { /* !irbStencil */ /* No fallback is needed because there is no stencil buffer. */ - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } /* If we have a (packed) stencil buffer attached but no depth buffer, diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index e807281..ca03ad0 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -91,7 +91,7 @@ i915InitDriverFunctions(struct dd_function_table *functions) extern const struct tnl_pipeline_stage *intel_pipeline[]; -GLboolean +bool i915CreateContext(int api, const struct gl_config * mesaVis, __DRIcontext * driContextPriv, @@ -103,7 +103,7 @@ i915CreateContext(int api, struct gl_context *ctx = &intel->ctx; if (!i915) - return GL_FALSE; + return false; i915InitVtbl(i915); @@ -112,7 +112,7 @@ i915CreateContext(int api, if (!intelInitContext(intel, api, mesaVis, driContextPriv, sharedContextPrivate, &functions)) { FREE(i915); - return GL_FALSE; + return false; } _math_matrix_ctr(&intel->ViewportMatrix); @@ -180,23 +180,23 @@ i915CreateContext(int api, ctx->Const.FragmentProgram.LowInt = ctx->Const.FragmentProgram.HighInt = ctx->Const.FragmentProgram.MediumInt; - ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; + ctx->FragmentProgram._MaintainTexEnvProgram = true; /* FINISHME: Are there other options that should be enabled for software * FINISHME: vertex shaders? */ - ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = GL_TRUE; + ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitCondCodes = true; struct gl_shader_compiler_options *const fs_options = & ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT]; fs_options->MaxIfDepth = 0; - fs_options->EmitNoNoise = GL_TRUE; - fs_options->EmitNoPow = GL_TRUE; - fs_options->EmitNoMainReturn = GL_TRUE; - fs_options->EmitNoIndirectInput = GL_TRUE; - fs_options->EmitNoIndirectOutput = GL_TRUE; - fs_options->EmitNoIndirectUniform = GL_TRUE; - fs_options->EmitNoIndirectTemp = GL_TRUE; + fs_options->EmitNoNoise = true; + fs_options->EmitNoPow = true; + fs_options->EmitNoMainReturn = true; + fs_options->EmitNoIndirectInput = true; + fs_options->EmitNoIndirectOutput = true; + fs_options->EmitNoIndirectUniform = true; + fs_options->EmitNoIndirectTemp = true; ctx->Const.MaxDrawBuffers = 1; @@ -213,5 +213,5 @@ i915CreateContext(int api, _tnl_allow_vertex_fog(ctx, 0); _tnl_allow_pixel_fog(ctx, 1); - return GL_TRUE; + return true; } diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 577a01e..8167137 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -139,10 +139,10 @@ struct i915_fragment_program { struct gl_fragment_program FragProg; - GLboolean translated; - GLboolean params_uptodate; - GLboolean on_hardware; - GLboolean error; /* If program is malformed for any reason. */ + bool translated; + bool params_uptodate; + bool on_hardware; + bool error; /* If program is malformed for any reason. */ /** Record of which phases R registers were last written in. */ GLuint register_phases[16]; @@ -194,7 +194,7 @@ struct i915_fragment_program /* Helpers for i915_fragprog.c: */ GLuint wpos_tex; - GLboolean depth_written; + bool depth_written; struct { @@ -318,10 +318,10 @@ do { \ /*====================================================================== * i915_context.c */ -extern GLboolean i915CreateContext(int api, - const struct gl_config * mesaVis, - __DRIcontext * driContextPriv, - void *sharedContextPrivate); +extern bool i915CreateContext(int api, + const struct gl_config * mesaVis, + __DRIcontext * driContextPriv, + void *sharedContextPrivate); /*====================================================================== diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index 4569fb9..53f9c1a 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -31,7 +31,8 @@ #include "i915_context.h" #include "i915_debug.h" -static GLboolean debug( struct debug_stream *stream, const char *name, GLuint len ) +static bool +debug(struct debug_stream *stream, const char *name, GLuint len) { GLuint i; GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); @@ -39,7 +40,7 @@ static GLboolean debug( struct debug_stream *stream, const char *name, GLuint le if (len == 0) { printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); - return GL_FALSE; + return false; } if (stream->print_addresses) @@ -53,7 +54,7 @@ static GLboolean debug( struct debug_stream *stream, const char *name, GLuint le stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } @@ -76,9 +77,9 @@ static const char *get_prim_name( GLuint val ) } } -static GLboolean debug_prim( struct debug_stream *stream, const char *name, - GLboolean dump_floats, - GLuint len ) +static bool +debug_prim(struct debug_stream *stream, const char *name, + bool dump_floats, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); const char *prim = get_prim_name( ptr[0] ); @@ -100,20 +101,21 @@ static GLboolean debug_prim( struct debug_stream *stream, const char *name, stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } -static GLboolean debug_program( struct debug_stream *stream, const char *name, GLuint len ) +static bool +debug_program(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); if (len == 0) { printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); - return GL_FALSE; + return false; } if (stream->print_addresses) @@ -123,11 +125,12 @@ static GLboolean debug_program( struct debug_stream *stream, const char *name, G i915_disassemble_program( ptr, len ); stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } -static GLboolean debug_chain( struct debug_stream *stream, const char *name, GLuint len ) +static bool +debug_chain(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint old_offset = stream->offset + len * sizeof(GLuint); @@ -147,11 +150,12 @@ static GLboolean debug_chain( struct debug_stream *stream, const char *name, GLu old_offset, stream->offset ); - return GL_TRUE; + return true; } -static GLboolean debug_variable_length_prim( struct debug_stream *stream ) +static bool +debug_variable_length_prim(struct debug_stream *stream) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); const char *prim = get_prim_name( ptr[0] ); @@ -169,7 +173,7 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) printf("\n"); stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } @@ -198,9 +202,8 @@ do { \ } \ } while (0) -static GLboolean debug_load_immediate( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_load_immediate(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint bits = (ptr[0] >> 4) & 0xff; @@ -300,14 +303,13 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } -static GLboolean debug_load_indirect( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_load_indirect(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint bits = (ptr[0] >> 8) & 0x3f; @@ -360,7 +362,7 @@ static GLboolean debug_load_indirect( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); - return GL_TRUE; + return true; } static void BR13( struct debug_stream *stream, @@ -428,9 +430,8 @@ static void BR16( struct debug_stream *stream, printf("\t0x%08x -- color\n", val); } -static GLboolean debug_copy_blit( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_copy_blit(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -448,12 +449,11 @@ static GLboolean debug_copy_blit( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_color_blit( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_color_blit(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -469,12 +469,11 @@ static GLboolean debug_color_blit( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_modes4( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_modes4(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -490,12 +489,11 @@ static GLboolean debug_modes4( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_map_state( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_map_state(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -542,12 +540,11 @@ static GLboolean debug_map_state( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_sampler_state( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_sampler_state(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -602,12 +599,11 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_dest_vars( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_dest_vars(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -637,12 +633,11 @@ static GLboolean debug_dest_vars( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean debug_buf_info( struct debug_stream *stream, - const char *name, - GLuint len ) +static bool +debug_buf_info(struct debug_stream *stream, const char *name, GLuint len) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; @@ -667,10 +662,11 @@ static GLboolean debug_buf_info( struct debug_stream *stream, stream->offset += len * sizeof(GLuint); assert(j == len); - return GL_TRUE; + return true; } -static GLboolean i915_debug_packet( struct debug_stream *stream ) +static bool +i915_debug_packet(struct debug_stream *stream) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint cmd = *ptr; @@ -686,7 +682,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) return debug(stream, "MI_FLUSH", 1); case 0xA: debug(stream, "MI_BATCH_BUFFER_END", 1); - return GL_FALSE; + return false; case 0x22: return debug(stream, "MI_LOAD_REGISTER_IMM", 3); case 0x31: @@ -822,7 +818,7 @@ i915_dump_batchbuffer( GLuint *start, { struct debug_stream stream; GLuint bytes = (end - start) * 4; - GLboolean done = GL_FALSE; + bool done = false; printf("\n\nBATCH: (%d)\n", bytes / 4); diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index e155d16..063e155 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -1285,7 +1285,7 @@ i915IsProgramNative(struct gl_context * ctx, GLenum target, struct gl_program *p return !p->error; } else - return GL_TRUE; + return true; } static GLboolean @@ -1300,7 +1300,7 @@ i915ProgramStringNotify(struct gl_context * ctx, (void) _tnl_program_string(ctx, target, prog); /* XXX check if program is legal, within limits */ - return GL_TRUE; + return true; } void diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index cd2fb31..9022548 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -131,7 +131,7 @@ translate_wrap_mode(GLenum wrap) * efficient, but this has gotten complex enough that we need * something which is understandable and reliable. */ -static GLboolean +static bool i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) { struct gl_context *ctx = &intel->ctx; @@ -156,7 +156,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } if (!intel_finalize_mipmap_tree(intel, unit)) - return GL_FALSE; + return false; /* Get first image here, since intelObj->firstLevel will get set in * the intel_finalize_mipmap_tree() call above. @@ -222,7 +222,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) mipFilt = MIPFILTER_LINEAR; break; default: - return GL_FALSE; + return false; } if (sampler->MaxAnisotropy > 1.0) { @@ -242,7 +242,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) magFilt = FILTER_LINEAR; break; default: - return GL_FALSE; + return false; } } @@ -265,7 +265,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) if (sampler->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && tObj->Target != GL_TEXTURE_3D) { if (tObj->Target == GL_TEXTURE_1D) - return GL_FALSE; + return false; state[I915_TEXREG_SS2] |= (SS2_SHADOW_ENABLE | @@ -309,7 +309,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) wr == GL_CLAMP || ws == GL_CLAMP_TO_BORDER || wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER)) - return GL_FALSE; + return false; /* Only support TEXCOORDMODE_CLAMP_EDGE and TEXCOORDMODE_CUBE (not * used) when using cube map texture coordinates @@ -317,7 +317,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB && (((ws != GL_CLAMP) && (ws != GL_CLAMP_TO_EDGE)) || ((wt != GL_CLAMP) && (wt != GL_CLAMP_TO_EDGE)))) - return GL_FALSE; + return false; state[I915_TEXREG_SS3] = ss3; /* SS3_NORMALIZED_COORDS */ @@ -356,7 +356,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } - I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE); + I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), true); /* memcmp was already disabled, but definitely won't work as the * region might now change and that wouldn't be detected: */ @@ -372,7 +372,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) DBG(TEXTURE, "state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]); #endif - return GL_TRUE; + return true; } @@ -381,7 +381,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) void i915UpdateTextureState(struct intel_context *intel) { - GLboolean ok = GL_TRUE; + bool ok = true; GLuint i; for (i = 0; i < I915_TEX_UNITS && ok; i++) { @@ -398,7 +398,7 @@ i915UpdateTextureState(struct intel_context *intel) case 0:{ struct i915_context *i915 = i915_context(&intel->ctx); if (i915->state.active & I915_UPLOAD_TEX(i)) - I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), GL_FALSE); + I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), false); if (i915->state.tex_buffer[i] != NULL) { drm_intel_bo_unreference(i915->state.tex_buffer[i]); @@ -408,7 +408,7 @@ i915UpdateTextureState(struct intel_context *intel) break; } default: - ok = GL_FALSE; + ok = false; break; } } diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index e09c787..072a692 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -98,7 +98,7 @@ i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim) /* Pull apart the vertex format registers and figure out how large a * vertex is supposed to be. */ -static GLboolean +static bool i915_check_vertex_size(struct intel_context *intel, GLuint expected) { struct i915_context *i915 = i915_context(&intel->ctx); @@ -159,7 +159,7 @@ i915_check_vertex_size(struct intel_context *intel, GLuint expected) break; default: fprintf(stderr, "bad texcoord fmt %d\n", i); - return GL_FALSE; + return false; } lis2 >>= S2_TEXCOORD_FMT1_SHIFT; } @@ -761,26 +761,26 @@ i915_update_draw_buffer(struct intel_context *intel) /* Check for depth fallback. */ if (irbDepth && irbDepth->region) { - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, false); depthRegion = irbDepth->region; } else if (irbDepth && !irbDepth->region) { - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_TRUE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, true); depthRegion = NULL; } else { /* !irbDepth */ /* No fallback is needed because there is no depth buffer. */ - FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, false); depthRegion = NULL; } /* Check for stencil fallback. */ if (irbStencil && irbStencil->region) { assert(irbStencil->Base.Format == MESA_FORMAT_S8_Z24); - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } else if (irbStencil && !irbStencil->region) { - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, true); } else { /* !irbStencil */ /* No fallback is needed because there is no stencil buffer. */ - FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } /* If we have a (packed) stencil buffer attached but no depth buffer, diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index 2d361ca..432fc7a 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -166,7 +166,7 @@ do { \ /* Heuristic to choose between the two render paths: */ -static GLboolean +static bool choose_render(struct intel_context *intel, struct vertex_buffer *VB) { int vertsz = intel->vertex_size; @@ -209,9 +209,9 @@ choose_render(struct intel_context *intel, struct vertex_buffer *VB) cost_render, cost_fallback); if (cost_render > cost_fallback) - return GL_FALSE; + return false; - return GL_TRUE; + return true; } @@ -229,7 +229,7 @@ intel_run_render(struct gl_context * ctx, struct tnl_pipeline_stage *stage) */ if (intel->RenderIndex != 0 || !intel_validate_render(ctx, VB) || !choose_render(intel, VB)) { - return GL_TRUE; + return true; } tnl->clipspace.new_inputs |= VERT_BIT_POS; @@ -252,7 +252,7 @@ intel_run_render(struct gl_context * ctx, struct tnl_pipeline_stage *stage) INTEL_FIREVERTICES(intel); - return GL_FALSE; /* finished the pipe */ + return false; /* finished the pipe */ } static const struct tnl_pipeline_stage _intel_render_stage = { diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 0b7b087..eb7fb60 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -92,7 +92,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) intel->vtbl.emit_state(intel); - intel->no_batch_wrap = GL_TRUE; + intel->no_batch_wrap = true; /*printf("%s *", __progname);*/ @@ -108,7 +108,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) OUT_BATCH(0); ADVANCE_BATCH(); - intel->no_batch_wrap = GL_FALSE; + intel->no_batch_wrap = false; /* printf(">"); */ } @@ -232,7 +232,7 @@ void intel_flush_prim(struct intel_context *intel) * depends on the state just emitted. emit_state should be making sure we * have the space for this. */ - intel->no_batch_wrap = GL_TRUE; + intel->no_batch_wrap = true; #if 0 printf("emitting %d..%d=%d vertices size %d\n", offset, @@ -306,7 +306,7 @@ void intel_flush_prim(struct intel_context *intel) ADVANCE_BATCH(); } - intel->no_batch_wrap = GL_FALSE; + intel->no_batch_wrap = false; drm_intel_bo_unreference(vb_bo); } @@ -655,7 +655,7 @@ do { \ struct intel_context *intel = intel_context(ctx); \ GLuint color[n] = { 0, }, spec[n] = { 0, }; \ GLuint coloroffset = intel->coloroffset; \ - GLboolean specoffset = intel->specoffset; \ + bool specoffset = intel->specoffset; \ (void) color; (void) spec; (void) coloroffset; (void) specoffset; @@ -946,7 +946,7 @@ intelChooseRenderState(struct gl_context * ctx) struct intel_context *intel = intel_context(ctx); GLuint flags = ctx->_TriangleCaps; const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current; - GLboolean have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS)); + bool have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS)); GLuint index = 0; if (INTEL_DEBUG & DEBUG_STATE) @@ -1211,7 +1211,7 @@ getFallbackString(GLuint bit) * \param bit one of INTEL_FALLBACK_x flags. */ void -intelFallback(struct intel_context *intel, GLbitfield bit, GLboolean mode) +intelFallback(struct intel_context *intel, GLbitfield bit, bool mode) { struct gl_context *ctx = &intel->ctx; TNLcontext *tnl = TNL_CONTEXT(ctx); |