diff options
author | Marek Olšák <[email protected]> | 2012-07-07 23:23:49 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-12 02:08:30 +0200 |
commit | 76db2c121c5436dc37a66d398fcaa9b26478c5ec (patch) | |
tree | e3fa95ccb1ab2b432f0b13230e2708014aa89d54 /src/mesa/state_tracker | |
parent | a730838a42c62b7729691b518a134017ff2d3b42 (diff) |
gallium: add util_format_stencil_only helper function
used for stencil sampler views.
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 2bcbada4f38..10eaa84db79 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1165,27 +1165,8 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, * The stencil is written using the shader stencil export * functionality. */ if (write_stencil) { - enum pipe_format stencil_format = PIPE_FORMAT_NONE; - - switch (pt->format) { - case PIPE_FORMAT_Z24_UNORM_S8_UINT: - case PIPE_FORMAT_X24S8_UINT: - stencil_format = PIPE_FORMAT_X24S8_UINT; - break; - case PIPE_FORMAT_S8_UINT_Z24_UNORM: - case PIPE_FORMAT_S8X24_UINT: - stencil_format = PIPE_FORMAT_S8X24_UINT; - break; - case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: - case PIPE_FORMAT_X32_S8X24_UINT: - stencil_format = PIPE_FORMAT_X32_S8X24_UINT; - break; - case PIPE_FORMAT_S8_UINT: - stencil_format = PIPE_FORMAT_S8_UINT; - break; - default: - assert(0); - } + enum pipe_format stencil_format = + util_format_stencil_only(pt->format); sv[1] = st_create_texture_sampler_view_format(st->pipe, pt, stencil_format); |