aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-27 08:17:50 +0200
committermarha <marha@users.sourceforge.net>2012-08-27 08:17:50 +0200
commitb3462c12542a69eeaa3fe90fddfbb15d30c18158 (patch)
tree294230cca0e59ee250cd70060ba3f8c3742b4023 /mesalib/src/mesa/state_tracker
parente91ed68959d63f79e3b4973bc80c7ebcd07ed021 (diff)
downloadvcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.tar.gz
vcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.tar.bz2
vcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.zip
xwininfo fontconfig libX11 libXau libXext libxcb mesa pixman
xkeyboard-config git update 27 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.c10
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.h5
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.c12
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.h3
-rw-r--r--mesalib/src/mesa/state_tracker/st_manager.c10
7 files changed, 32 insertions, 12 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index a7c732bd7..3de96adf3 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -1299,7 +1299,7 @@ st_AllocTextureStorage(struct gl_context *ctx,
GLsizei levels, GLsizei width,
GLsizei height, GLsizei depth)
{
- const GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
struct st_context *st = st_context(ctx);
struct st_texture_object *stObj = st_texture_object(texObj);
GLuint ptWidth, ptHeight, ptDepth, ptLayers, bindings;
diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c
index 2e14da211..aa3534125 100644
--- a/mesalib/src/mesa/state_tracker/st_context.c
+++ b/mesalib/src/mesa/state_tracker/st_context.c
@@ -114,12 +114,15 @@ st_get_msaa(void)
static struct st_context *
-st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe )
+st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
+ const struct st_config_options *options)
{
struct pipe_screen *screen = pipe->screen;
uint i;
struct st_context *st = ST_CALLOC_STRUCT( st_context );
+ st->options = *options;
+
ctx->st = st;
st->ctx = ctx;
@@ -207,7 +210,8 @@ static void st_init_driver_flags(struct gl_driver_flags *f)
struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
const struct gl_config *visual,
- struct st_context *share)
+ struct st_context *share,
+ const struct st_config_options *options)
{
struct gl_context *ctx;
struct gl_context *shareCtx = share ? share->ctx : NULL;
@@ -234,7 +238,7 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
if (debug_get_option_mesa_mvp_dp4())
_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
- return st_create_context_priv(ctx, pipe);
+ return st_create_context_priv(ctx, pipe, options);
}
diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h
index 47d3af520..c85d09cb5 100644
--- a/mesalib/src/mesa/state_tracker/st_context.h
+++ b/mesalib/src/mesa/state_tracker/st_context.h
@@ -194,6 +194,8 @@ struct st_context
int32_t draw_stamp;
int32_t read_stamp;
+
+ struct st_config_options options;
};
@@ -266,7 +268,8 @@ st_get_msaa(void);
extern struct st_context *
st_create_context(gl_api api, struct pipe_context *pipe,
const struct gl_config *visual,
- struct st_context *share);
+ struct st_context *share,
+ const struct st_config_options *options);
extern void
st_destroy_context(struct st_context *st);
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index 2f034cb28..5e482d9f7 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -646,4 +646,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.ARB_draw_instanced) {
ctx->Extensions.ARB_transform_feedback_instanced = GL_TRUE;
}
+ if (st->options.force_glsl_extensions_warn)
+ ctx->Const.ForceGLSLExtensionsWarn = 1;
}
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c
index 962b09250..302b58c7b 100644
--- a/mesalib/src/mesa/state_tracker/st_format.c
+++ b/mesalib/src/mesa/state_tracker/st_format.c
@@ -1631,7 +1631,8 @@ st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
* Called via ctx->Driver.ChooseTextureFormat().
*/
gl_format
-st_ChooseTextureFormat(struct gl_context *ctx, GLint internalFormat,
+st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
+ GLint internalFormat,
GLenum format, GLenum type)
{
boolean want_renderable =
@@ -1640,6 +1641,15 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLint internalFormat,
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);
}
diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h
index 7cf92eb41..2eef2c0d4 100644
--- a/mesalib/src/mesa/state_tracker/st_format.h
+++ b/mesalib/src/mesa/state_tracker/st_format.h
@@ -63,7 +63,8 @@ st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
GLenum format, GLenum type, GLboolean renderable);
extern gl_format
-st_ChooseTextureFormat(struct gl_context * ctx, GLint internalFormat,
+st_ChooseTextureFormat(struct gl_context * ctx, GLenum target,
+ GLint internalFormat,
GLenum format, GLenum type);
diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c
index 5142eb2dd..df73d0e1b 100644
--- a/mesalib/src/mesa/state_tracker/st_manager.c
+++ b/mesalib/src/mesa/state_tracker/st_manager.c
@@ -468,7 +468,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
static boolean
st_context_teximage(struct st_context_iface *stctxi,
- enum st_texture_type target,
+ enum st_texture_type tex_type,
int level, enum pipe_format internal_format,
struct pipe_resource *tex, boolean mipmap)
{
@@ -481,8 +481,9 @@ st_context_teximage(struct st_context_iface *stctxi,
struct st_texture_image *stImage;
GLenum internalFormat;
GLuint width, height, depth;
+ GLenum target;
- switch (target) {
+ switch (tex_type) {
case ST_TEXTURE_1D:
target = GL_TEXTURE_1D;
break;
@@ -497,7 +498,6 @@ st_context_teximage(struct st_context_iface *stctxi,
break;
default:
return FALSE;
- break;
}
texObj = _mesa_select_tex_object(ctx, texUnit, target);
@@ -533,7 +533,7 @@ st_context_teximage(struct st_context_iface *stctxi,
else
internalFormat = GL_RGB;
- texFormat = st_ChooseTextureFormat(ctx, internalFormat,
+ texFormat = st_ChooseTextureFormat(ctx, target, internalFormat,
GL_BGRA, GL_UNSIGNED_BYTE);
_mesa_init_teximage_fields(ctx, texImage,
@@ -637,7 +637,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
}
st_visual_to_context_mode(&attribs->visual, &mode);
- st = st_create_context(api, pipe, &mode, shared_ctx);
+ st = st_create_context(api, pipe, &mode, shared_ctx, &attribs->options);
if (!st) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;
pipe->destroy(pipe);