diff options
author | Brian Paul <brianp@vmware.com> | 2016-02-16 10:22:32 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2016-02-16 10:22:32 -0700 |
commit | ffa1a1dd21a18534a044aa7e26f297c9f372ea4f (patch) | |
tree | 3cd76ece1ff82b5184e7eb51563f3b356ce3b40d /src/gallium/auxiliary/cso_cache/cso_context.c | |
parent | 223ffd8a0899ddfdd084d3854ab28e2e2e438382 (diff) | |
download | external_mesa3d-ffa1a1dd21a18534a044aa7e26f297c9f372ea4f.zip external_mesa3d-ffa1a1dd21a18534a044aa7e26f297c9f372ea4f.tar.gz external_mesa3d-ffa1a1dd21a18534a044aa7e26f297c9f372ea4f.tar.bz2 |
cso: make most of the cso_save/restore_x() functions static
Users of the CSO save/restore facility all use the new
cso_save/restore_state() functions instead.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/cso_cache/cso_context.c')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 108 |
1 files changed, 70 insertions, 38 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index a386de6..8cfb674 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -437,13 +437,15 @@ enum pipe_error cso_set_blend(struct cso_context *ctx, return PIPE_OK; } -void cso_save_blend(struct cso_context *ctx) +static void +cso_save_blend(struct cso_context *ctx) { assert(!ctx->blend_saved); ctx->blend_saved = ctx->blend; } -void cso_restore_blend(struct cso_context *ctx) +static void +cso_restore_blend(struct cso_context *ctx) { if (ctx->blend != ctx->blend_saved) { ctx->blend = ctx->blend_saved; @@ -500,13 +502,15 @@ cso_set_depth_stencil_alpha(struct cso_context *ctx, return PIPE_OK; } -void cso_save_depth_stencil_alpha(struct cso_context *ctx) +static void +cso_save_depth_stencil_alpha(struct cso_context *ctx) { assert(!ctx->depth_stencil_saved); ctx->depth_stencil_saved = ctx->depth_stencil; } -void cso_restore_depth_stencil_alpha(struct cso_context *ctx) +static void +cso_restore_depth_stencil_alpha(struct cso_context *ctx) { if (ctx->depth_stencil != ctx->depth_stencil_saved) { ctx->depth_stencil = ctx->depth_stencil_saved; @@ -559,13 +563,15 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx, return PIPE_OK; } -void cso_save_rasterizer(struct cso_context *ctx) +static void +cso_save_rasterizer(struct cso_context *ctx) { assert(!ctx->rasterizer_saved); ctx->rasterizer_saved = ctx->rasterizer; } -void cso_restore_rasterizer(struct cso_context *ctx) +static void +cso_restore_rasterizer(struct cso_context *ctx) { if (ctx->rasterizer != ctx->rasterizer_saved) { ctx->rasterizer = ctx->rasterizer_saved; @@ -593,13 +599,15 @@ void cso_delete_fragment_shader(struct cso_context *ctx, void *handle ) ctx->pipe->delete_fs_state(ctx->pipe, handle); } -void cso_save_fragment_shader(struct cso_context *ctx) +static void +cso_save_fragment_shader(struct cso_context *ctx) { assert(!ctx->fragment_shader_saved); ctx->fragment_shader_saved = ctx->fragment_shader; } -void cso_restore_fragment_shader(struct cso_context *ctx) +static void +cso_restore_fragment_shader(struct cso_context *ctx) { if (ctx->fragment_shader_saved != ctx->fragment_shader) { ctx->pipe->bind_fs_state(ctx->pipe, ctx->fragment_shader_saved); @@ -627,13 +635,15 @@ void cso_delete_vertex_shader(struct cso_context *ctx, void *handle ) ctx->pipe->delete_vs_state(ctx->pipe, handle); } -void cso_save_vertex_shader(struct cso_context *ctx) +static void +cso_save_vertex_shader(struct cso_context *ctx) { assert(!ctx->vertex_shader_saved); ctx->vertex_shader_saved = ctx->vertex_shader; } -void cso_restore_vertex_shader(struct cso_context *ctx) +static void +cso_restore_vertex_shader(struct cso_context *ctx) { if (ctx->vertex_shader_saved != ctx->vertex_shader) { ctx->pipe->bind_vs_state(ctx->pipe, ctx->vertex_shader_saved); @@ -652,12 +662,14 @@ void cso_set_framebuffer(struct cso_context *ctx, } } -void cso_save_framebuffer(struct cso_context *ctx) +static void +cso_save_framebuffer(struct cso_context *ctx) { util_copy_framebuffer_state(&ctx->fb_saved, &ctx->fb); } -void cso_restore_framebuffer(struct cso_context *ctx) +static void +cso_restore_framebuffer(struct cso_context *ctx) { if (memcmp(&ctx->fb, &ctx->fb_saved, sizeof(ctx->fb))) { util_copy_framebuffer_state(&ctx->fb, &ctx->fb_saved); @@ -694,13 +706,15 @@ cso_set_viewport_dims(struct cso_context *ctx, cso_set_viewport(ctx, &vp); } -void cso_save_viewport(struct cso_context *ctx) +static void +cso_save_viewport(struct cso_context *ctx) { ctx->vp_saved = ctx->vp; } -void cso_restore_viewport(struct cso_context *ctx) +static void +cso_restore_viewport(struct cso_context *ctx) { if (memcmp(&ctx->vp, &ctx->vp_saved, sizeof(ctx->vp))) { ctx->vp = ctx->vp_saved; @@ -726,12 +740,14 @@ void cso_set_sample_mask(struct cso_context *ctx, unsigned sample_mask) } } -void cso_save_sample_mask(struct cso_context *ctx) +static void +cso_save_sample_mask(struct cso_context *ctx) { ctx->sample_mask_saved = ctx->sample_mask; } -void cso_restore_sample_mask(struct cso_context *ctx) +static void +cso_restore_sample_mask(struct cso_context *ctx) { cso_set_sample_mask(ctx, ctx->sample_mask_saved); } @@ -744,12 +760,14 @@ void cso_set_min_samples(struct cso_context *ctx, unsigned min_samples) } } -void cso_save_min_samples(struct cso_context *ctx) +static void +cso_save_min_samples(struct cso_context *ctx) { ctx->min_samples_saved = ctx->min_samples; } -void cso_restore_min_samples(struct cso_context *ctx) +static void +cso_restore_min_samples(struct cso_context *ctx) { cso_set_min_samples(ctx, ctx->min_samples_saved); } @@ -763,13 +781,15 @@ void cso_set_stencil_ref(struct cso_context *ctx, } } -void cso_save_stencil_ref(struct cso_context *ctx) +static void +cso_save_stencil_ref(struct cso_context *ctx) { ctx->stencil_ref_saved = ctx->stencil_ref; } -void cso_restore_stencil_ref(struct cso_context *ctx) +static void +cso_restore_stencil_ref(struct cso_context *ctx) { if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved, sizeof(ctx->stencil_ref))) { @@ -794,14 +814,16 @@ void cso_set_render_condition(struct cso_context *ctx, } } -void cso_save_render_condition(struct cso_context *ctx) +static void +cso_save_render_condition(struct cso_context *ctx) { ctx->render_condition_saved = ctx->render_condition; ctx->render_condition_cond_saved = ctx->render_condition_cond; ctx->render_condition_mode_saved = ctx->render_condition_mode; } -void cso_restore_render_condition(struct cso_context *ctx) +static void +cso_restore_render_condition(struct cso_context *ctx) { cso_set_render_condition(ctx, ctx->render_condition_saved, ctx->render_condition_cond_saved, @@ -828,7 +850,8 @@ void cso_delete_geometry_shader(struct cso_context *ctx, void *handle) ctx->pipe->delete_gs_state(ctx->pipe, handle); } -void cso_save_geometry_shader(struct cso_context *ctx) +static void +cso_save_geometry_shader(struct cso_context *ctx) { if (!ctx->has_geometry_shader) { return; @@ -838,7 +861,8 @@ void cso_save_geometry_shader(struct cso_context *ctx) ctx->geometry_shader_saved = ctx->geometry_shader; } -void cso_restore_geometry_shader(struct cso_context *ctx) +static void +cso_restore_geometry_shader(struct cso_context *ctx) { if (!ctx->has_geometry_shader) { return; @@ -871,7 +895,8 @@ void cso_delete_tessctrl_shader(struct cso_context *ctx, void *handle) ctx->pipe->delete_tcs_state(ctx->pipe, handle); } -void cso_save_tessctrl_shader(struct cso_context *ctx) +static void +cso_save_tessctrl_shader(struct cso_context *ctx) { if (!ctx->has_tessellation) { return; @@ -881,7 +906,8 @@ void cso_save_tessctrl_shader(struct cso_context *ctx) ctx->tessctrl_shader_saved = ctx->tessctrl_shader; } -void cso_restore_tessctrl_shader(struct cso_context *ctx) +static void +cso_restore_tessctrl_shader(struct cso_context *ctx) { if (!ctx->has_tessellation) { return; @@ -914,7 +940,8 @@ void cso_delete_tesseval_shader(struct cso_context *ctx, void *handle) ctx->pipe->delete_tes_state(ctx->pipe, handle); } -void cso_save_tesseval_shader(struct cso_context *ctx) +static void +cso_save_tesseval_shader(struct cso_context *ctx) { if (!ctx->has_tessellation) { return; @@ -924,7 +951,8 @@ void cso_save_tesseval_shader(struct cso_context *ctx) ctx->tesseval_shader_saved = ctx->tesseval_shader; } -void cso_restore_tesseval_shader(struct cso_context *ctx) +static void +cso_restore_tesseval_shader(struct cso_context *ctx) { if (!ctx->has_tessellation) { return; @@ -1017,7 +1045,8 @@ cso_set_vertex_elements(struct cso_context *ctx, return PIPE_OK; } -void cso_save_vertex_elements(struct cso_context *ctx) +static void +cso_save_vertex_elements(struct cso_context *ctx) { struct u_vbuf *vbuf = ctx->vbuf; @@ -1030,7 +1059,8 @@ void cso_save_vertex_elements(struct cso_context *ctx) ctx->velements_saved = ctx->velements; } -void cso_restore_vertex_elements(struct cso_context *ctx) +static void +cso_restore_vertex_elements(struct cso_context *ctx) { struct u_vbuf *vbuf = ctx->vbuf; @@ -1082,7 +1112,8 @@ void cso_set_vertex_buffers(struct cso_context *ctx, ctx->pipe->set_vertex_buffers(ctx->pipe, start_slot, count, buffers); } -void cso_save_aux_vertex_buffer_slot(struct cso_context *ctx) +static void +cso_save_aux_vertex_buffer_slot(struct cso_context *ctx) { struct u_vbuf *vbuf = ctx->vbuf; @@ -1097,7 +1128,8 @@ void cso_save_aux_vertex_buffer_slot(struct cso_context *ctx) sizeof(struct pipe_vertex_buffer)); } -void cso_restore_aux_vertex_buffer_slot(struct cso_context *ctx) +static void +cso_restore_aux_vertex_buffer_slot(struct cso_context *ctx) { struct u_vbuf *vbuf = ctx->vbuf; @@ -1215,7 +1247,7 @@ cso_set_samplers(struct cso_context *ctx, return error; } -void +static void cso_save_fragment_samplers(struct cso_context *ctx) { struct sampler_info *info = &ctx->samplers[PIPE_SHADER_FRAGMENT]; @@ -1226,7 +1258,7 @@ cso_save_fragment_samplers(struct cso_context *ctx) } -void +static void cso_restore_fragment_samplers(struct cso_context *ctx) { struct sampler_info *info = &ctx->samplers[PIPE_SHADER_FRAGMENT]; @@ -1273,7 +1305,7 @@ cso_set_sampler_views(struct cso_context *ctx, } -void +static void cso_save_fragment_sampler_views(struct cso_context *ctx) { unsigned i; @@ -1288,7 +1320,7 @@ cso_save_fragment_sampler_views(struct cso_context *ctx) } -void +static void cso_restore_fragment_sampler_views(struct cso_context *ctx) { unsigned i, nr_saved = ctx->nr_fragment_views_saved; @@ -1348,7 +1380,7 @@ cso_set_stream_outputs(struct cso_context *ctx, ctx->nr_so_targets = num_targets; } -void +static void cso_save_stream_outputs(struct cso_context *ctx) { uint i; @@ -1365,7 +1397,7 @@ cso_save_stream_outputs(struct cso_context *ctx) } } -void +static void cso_restore_stream_outputs(struct cso_context *ctx) { struct pipe_context *pipe = ctx->pipe; |