diff options
author | Dave Airlie <[email protected]> | 2015-04-05 14:45:25 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-04-23 10:11:27 +1000 |
commit | 6cc49c4ce1dcb06528bfa2d6e650c26721355ae1 (patch) | |
tree | d1c2afe40a0b4d334d769735f614b07d84a2b52a /src/mesa/state_tracker/st_format.c | |
parent | 782e71cc078308dddd5d6f9505bff0cb8e67f455 (diff) |
st/mesa: add ARB_texture_stencil8 support (v4)
if we support stencil texturing, enable texture_stencil8
there is no requirement to support native S8 for this,
the texture can be converted to x24s8 fine.
v2: fold fixes from Marek in:
a) put S8 last in the list
b) fix renderable to always test for d/s renderable
fixup the texture case to use a stencil only format
for picking the format for the texture view.
v3: hit fallback for getteximage
v4: put s8 back in front, it shouldn't get picked now (Ilia)
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_format.c')
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 72dbf3bd4c0..181465dd81b 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -1942,11 +1942,6 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target, GLint internalFormat, GLenum format, GLenum type) { - const boolean want_renderable = - internalFormat == 3 || internalFormat == 4 || - internalFormat == GL_RGB || internalFormat == GL_RGBA || - internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 || - internalFormat == GL_BGRA; struct st_context *st = st_context(ctx); enum pipe_format pFormat; unsigned bindings; @@ -1962,15 +1957,17 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target, } /* GL textures may wind up being render targets, but we don't know - * that in advance. Specify potential render target flags now. + * that in advance. Specify potential render target flags now for formats + * that we know should always be renderable. */ bindings = PIPE_BIND_SAMPLER_VIEW; - if (want_renderable) { - if (_mesa_is_depth_or_stencil_format(internalFormat)) - bindings |= PIPE_BIND_DEPTH_STENCIL; - else + if (_mesa_is_depth_or_stencil_format(internalFormat)) + bindings |= PIPE_BIND_DEPTH_STENCIL; + else if (internalFormat == 3 || internalFormat == 4 || + internalFormat == GL_RGB || internalFormat == GL_RGBA || + internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 || + internalFormat == GL_BGRA) bindings |= PIPE_BIND_RENDER_TARGET; - } /* GLES allows the driver to choose any format which matches * the format+type combo, because GLES only supports unsized internal |