Mesa (master): st/mesa: merge st_ChooseTextureFormat_renderable() into st_ChooseTextureFormat()
Brian Paul
brianp at kemper.freedesktop.org
Mon Feb 4 15:31:55 UTC 2013
Module: Mesa
Branch: master
Commit: 5f81549f6cac6f5d3c8322bc6e50ffb061274fc3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f81549f6cac6f5d3c8322bc6e50ffb061274fc3
Author: Brian Paul <brianp at vmware.com>
Date: Fri Feb 1 11:44:35 2013 -0700
st/mesa: merge st_ChooseTextureFormat_renderable() into st_ChooseTextureFormat()
That was the only place it was being called from.
---
src/mesa/state_tracker/st_format.c | 55 +++++++++++++----------------------
src/mesa/state_tracker/st_format.h | 4 --
2 files changed, 21 insertions(+), 38 deletions(-)
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 15fe055..2169bed 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1586,22 +1586,37 @@ st_choose_renderbuffer_format(struct pipe_screen *screen,
}
+/**
+ * Called via ctx->Driver.ChooseTextureFormat().
+ */
gl_format
-st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
- GLenum format, GLenum type, GLboolean renderable)
+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 pipe_screen *screen = st_context(ctx)->pipe->screen;
enum pipe_format pFormat;
- uint bindings;
+ unsigned bindings;
- (void) format;
- (void) type;
+ if (target == GL_TEXTURE_1D || target == GL_TEXTURE_1D_ARRAY) {
+ /* We don't do compression for these texture targets because of
+ * difficulty with sub-texture updates on non-block boundaries, etc.
+ * So change the internal format request to an uncompressed format.
+ */
+ internalFormat =
+ _mesa_generic_compressed_format_to_uncompressed_format(internalFormat);
+ }
/* GL textures may wind up being render targets, but we don't know
* that in advance. Specify potential render target flags now.
*/
bindings = PIPE_BIND_SAMPLER_VIEW;
- if (renderable) {
+ if (want_renderable) {
if (_mesa_is_depth_or_stencil_format(internalFormat))
bindings |= PIPE_BIND_DEPTH_STENCIL;
else
@@ -1630,34 +1645,6 @@ st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
/**
* Called via ctx->Driver.ChooseTextureFormat().
*/
-gl_format
-st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
- GLint internalFormat,
- GLenum format, GLenum type)
-{
- boolean want_renderable =
- internalFormat == 3 || internalFormat == 4 ||
- internalFormat == GL_RGB || internalFormat == GL_RGBA ||
- internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 ||
- internalFormat == GL_BGRA;
-
- if (target == GL_TEXTURE_1D || target == GL_TEXTURE_1D_ARRAY) {
- /* We don't do compression for these texture targets because of
- * difficulty with sub-texture updates on non-block boundaries, etc.
- * So change the internal format request to an uncompressed format.
- */
- internalFormat =
- _mesa_generic_compressed_format_to_uncompressed_format(internalFormat);
- }
-
- return st_ChooseTextureFormat_renderable(ctx, internalFormat,
- format, type, want_renderable);
-}
-
-
-/**
- * Called via ctx->Driver.ChooseTextureFormat().
- */
size_t
st_QuerySamplesForFormat(struct gl_context *ctx, GLenum internalFormat,
int samples[16])
diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h
index eac3cfb..50588d8 100644
--- a/src/mesa/state_tracker/st_format.h
+++ b/src/mesa/state_tracker/st_format.h
@@ -58,10 +58,6 @@ st_choose_renderbuffer_format(struct pipe_screen *screen,
GLenum internalFormat, unsigned sample_count);
-gl_format
-st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
- GLenum format, GLenum type, GLboolean renderable);
-
extern gl_format
st_ChooseTextureFormat(struct gl_context * ctx, GLenum target,
GLint internalFormat,
More information about the mesa-commit
mailing list