From: José Fonseca Date: Sun, 14 Feb 2010 23:54:22 +0000 (+0000) Subject: util: Avoid dumping masked state. Other minor improvements. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d70c76907519592b723df915e8a71a7bf88c1197;p=mesa.git util: Avoid dumping masked state. Other minor improvements. --- diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index cad0b355585..379f18ef38b 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -51,6 +51,11 @@ extern "C" { struct os_stream; +/* Duplicated here for convenience */ +extern struct os_stream * +os_log_stream; + + /* * p_defines.h * diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index 5ba91369982..eaf4ec90f25 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -450,8 +450,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_member_begin(stream, "depth"); util_dump_struct_begin(stream, "pipe_depth_state"); util_dump_member(stream, bool, &state->depth, enabled); - util_dump_member(stream, bool, &state->depth, writemask); - util_dump_member(stream, uint, &state->depth, func); + if (state->depth.enabled) { + util_dump_member(stream, bool, &state->depth, writemask); + util_dump_member(stream, enum_func, &state->depth, func); + } util_dump_struct_end(stream); util_dump_member_end(stream); @@ -461,12 +463,14 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_elem_begin(stream); util_dump_struct_begin(stream, "pipe_stencil_state"); util_dump_member(stream, bool, &state->stencil[i], enabled); - util_dump_member(stream, enum_func, &state->stencil[i], func); - util_dump_member(stream, uint, &state->stencil[i], fail_op); - util_dump_member(stream, uint, &state->stencil[i], zpass_op); - util_dump_member(stream, uint, &state->stencil[i], zfail_op); - util_dump_member(stream, uint, &state->stencil[i], valuemask); - util_dump_member(stream, uint, &state->stencil[i], writemask); + if (state->stencil[i].enabled) { + util_dump_member(stream, enum_func, &state->stencil[i], func); + util_dump_member(stream, uint, &state->stencil[i], fail_op); + util_dump_member(stream, uint, &state->stencil[i], zpass_op); + util_dump_member(stream, uint, &state->stencil[i], zfail_op); + util_dump_member(stream, uint, &state->stencil[i], valuemask); + util_dump_member(stream, uint, &state->stencil[i], writemask); + } util_dump_struct_end(stream); util_dump_elem_end(stream); } @@ -476,8 +480,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream *stream, const struct pipe_ util_dump_member_begin(stream, "alpha"); util_dump_struct_begin(stream, "pipe_alpha_state"); util_dump_member(stream, bool, &state->alpha, enabled); - util_dump_member(stream, enum_func, &state->alpha, func); - util_dump_member(stream, float, &state->alpha, ref_value); + if (state->alpha.enabled) { + util_dump_member(stream, enum_func, &state->alpha, func); + util_dump_member(stream, float, &state->alpha, ref_value); + } util_dump_struct_end(stream); util_dump_member_end(stream); @@ -490,14 +496,15 @@ util_dump_rt_blend_state(struct os_stream *stream, const struct pipe_rt_blend_st util_dump_struct_begin(stream, "pipe_rt_blend_state"); util_dump_member(stream, uint, state, blend_enable); - - util_dump_member(stream, enum_blend_func, state, rgb_func); - util_dump_member(stream, enum_blend_factor, state, rgb_src_factor); - util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor); - - util_dump_member(stream, enum_blend_func, state, alpha_func); - util_dump_member(stream, enum_blend_factor, state, alpha_src_factor); - util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor); + if (state->blend_enable) { + util_dump_member(stream, enum_blend_func, state, rgb_func); + util_dump_member(stream, enum_blend_factor, state, rgb_src_factor); + util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor); + + util_dump_member(stream, enum_blend_func, state, alpha_func); + util_dump_member(stream, enum_blend_factor, state, alpha_src_factor); + util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor); + } util_dump_member(stream, uint, state, colormask); @@ -519,15 +526,18 @@ util_dump_blend_state(struct os_stream *stream, const struct pipe_blend_state *s util_dump_member(stream, bool, state, dither); util_dump_member(stream, bool, state, logicop_enable); - util_dump_member(stream, enum_func, state, logicop_func); - - util_dump_member(stream, bool, state, independent_blend_enable); - - util_dump_member_begin(stream, "rt"); - if (state->independent_blend_enable) - valid_entries = PIPE_MAX_COLOR_BUFS; - util_dump_struct_array(stream, rt_blend_state, state->rt, valid_entries); - util_dump_member_end(stream); + if (state->logicop_enable) { + util_dump_member(stream, enum_func, state, logicop_func); + } + else { + util_dump_member(stream, bool, state, independent_blend_enable); + + util_dump_member_begin(stream, "rt"); + if (state->independent_blend_enable) + valid_entries = PIPE_MAX_COLOR_BUFS; + util_dump_struct_array(stream, rt_blend_state, state->rt, valid_entries); + util_dump_member_end(stream); + } util_dump_struct_end(stream); } @@ -595,7 +605,7 @@ util_dump_sampler_state(struct os_stream *stream, const struct pipe_sampler_stat util_dump_member(stream, uint, state, min_mip_filter); util_dump_member(stream, uint, state, mag_img_filter); util_dump_member(stream, uint, state, compare_mode); - util_dump_member(stream, uint, state, compare_func); + util_dump_member(stream, enum_func, state, compare_func); util_dump_member(stream, bool, state, normalized_coords); util_dump_member(stream, uint, state, max_anisotropy); util_dump_member(stream, float, state, lod_bias);