diff options
-rw-r--r-- | fontconfig/src/fcxml.c | 4 | ||||
-rw-r--r-- | mesalib/configs/current.in | 23 | ||||
-rw-r--r-- | mesalib/configs/default | 18 | ||||
-rw-r--r-- | mesalib/configure.ac | 91 | ||||
-rw-r--r-- | mesalib/scons/custom.py | 25 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/common/meta.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/fbobject.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/pack.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom.c | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom.h | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_sampler.c | 26 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_texture.c | 36 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_bitmap.c | 11 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_context.c | 15 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_context.h | 13 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 |
16 files changed, 132 insertions, 148 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 8c0d1f2ba..7d1d6f1ad 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1591,7 +1591,7 @@ FcParseAlias (FcConfigParse *parse) case FcVStackFamily: if (family) { - FcConfigMessage (parse, FcSevereWarning, "Having multiple <family> in <alias> isn't supported and may not works as expected"); + FcConfigMessage (parse, FcSevereWarning, "Having multiple <family> in <alias> isn't supported and may not work as expected"); new = FcExprCreateOp (parse->config, vstack->u.expr, FcOpComma, family); if (!new) FcConfigMessage (parse, FcSevereError, "out of memory"); @@ -2228,7 +2228,7 @@ FcParseTest (FcConfigParse *parse) } if (expr->op == FcOpComma) { - FcConfigMessage (parse, FcSevereWarning, "Having multiple values in <test> isn't supported and may not works as expected"); + FcConfigMessage (parse, FcSevereWarning, "Having multiple values in <test> isn't supported and may not work as expected"); } test = FcTestCreate (parse, kind, qual, name, FC_OP (compare, flags), expr); if (!test) diff --git a/mesalib/configs/current.in b/mesalib/configs/current.in index c4f3f4df9..c49084210 100644 --- a/mesalib/configs/current.in +++ b/mesalib/configs/current.in @@ -20,7 +20,6 @@ CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \ CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@ CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@ LDFLAGS = @LDFLAGS@ -EXTRA_LIB_PATH = @EXTRA_LIB_PATH@ RADEON_CFLAGS = @RADEON_CFLAGS@ RADEON_LIBS = @RADEON_LIBS@ NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@ @@ -129,22 +128,22 @@ GLW_SOURCES = @GLW_SOURCES@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ # Library/program dependencies -GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@ +GL_LIB_DEPS = @GL_LIB_DEPS@ OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \ - $(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@ -EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@ + @OSMESA_LIB_DEPS@ +EGL_LIB_DEPS = @EGL_LIB_DEPS@ GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \ - $(EXTRA_LIB_PATH) @GLU_LIB_DEPS@ + @GLU_LIB_DEPS@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \ - $(EXTRA_LIB_PATH) @GLW_LIB_DEPS@ -GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@ -GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@ -VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@ -GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@ + @GLW_LIB_DEPS@ +GLESv1_CM_LIB_DEPS = @GLESv1_CM_LIB_DEPS@ +GLESv2_LIB_DEPS = @GLESv2_LIB_DEPS@ +VG_LIB_DEPS = @VG_LIB_DEPS@ +GLAPI_LIB_DEPS = @GLAPI_LIB_DEPS@ # DRI dependencies -DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@ -GALLIUM_DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @GALLIUM_DRI_LIB_DEPS@ +DRI_LIB_DEPS = @DRI_LIB_DEPS@ +GALLIUM_DRI_LIB_DEPS = @GALLIUM_DRI_LIB_DEPS@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ LIBDRM_LIB = @LIBDRM_LIBS@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ diff --git a/mesalib/configs/default b/mesalib/configs/default index 8a8d8f8d2..ea026e632 100644 --- a/mesalib/configs/default +++ b/mesalib/configs/default @@ -113,15 +113,15 @@ EGL_CLIENT_APIS = $(GL_LIB) # Library dependencies #EXTRA_LIB_PATH ?= -GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread -OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 -GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread -GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread -VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread -GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread +GL_LIB_DEPS = -lX11 -lXext -lm -lpthread +EGL_LIB_DEPS = -ldl -lpthread +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 +GLESv1_CM_LIB_DEPS = -lpthread +GLESv2_LIB_DEPS = -lpthread +VG_LIB_DEPS = -lpthread +GLAPI_LIB_DEPS = -lpthread # Program dependencies - specific GL libraries added in Makefiles X11_LIBS = -lX11 diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 0329bad80..7dac091b0 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -146,15 +146,9 @@ dnl LIB_DIR - library basename LIB_DIR=`echo $libdir | $SED 's%.*/%%'` AC_SUBST([LIB_DIR]) -dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later +dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later _SAVE_LDFLAGS="$LDFLAGS" -AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker]) -AC_SUBST([EXTRA_LIB_PATH]) - -dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later _SAVE_CPPFLAGS="$CPPFLAGS" -AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers]) -AC_SUBST([X11_INCLUDES]) dnl Compiler macros DEFINES="" @@ -878,32 +872,8 @@ if test "x$enable_dri" = xyes; then fi fi -dnl -dnl Find out if X is available. The variable have_x is set if libX11 is -dnl found to mimic AC_PATH_XTRA. -dnl -if test -n "$PKG_CONFIG"; then - AC_MSG_CHECKING([pkg-config files for X11 are available]) - PKG_CHECK_EXISTS([x11],[ - x11_pkgconfig=yes - have_x=yes - ],[ - x11_pkgconfig=no - ]) - AC_MSG_RESULT([$x11_pkgconfig]) -else - x11_pkgconfig=no -fi -dnl Use the autoconf macro if no pkg-config files -if test "$x11_pkgconfig" = yes; then - PKG_CHECK_MODULES([X11], [x11]) -else - AC_PATH_XTRA - test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS" - test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11" - AC_SUBST([X11_CFLAGS]) - AC_SUBST([X11_LIBS]) -fi +dnl Find out if X is available. +PKG_CHECK_MODULES([X11], [x11]) dnl Try to tell the user that the --x-* options are only used when dnl pkg-config is not available. This must be right after AC_PATH_XTRA. @@ -947,18 +917,10 @@ dnl case "x$enable_glx$enable_xlib_glx" in xyesyes) # Xlib-based GLX - if test "$x11_pkgconfig" = yes; then - PKG_CHECK_MODULES([XLIBGL], [x11 xext]) - GL_PC_REQ_PRIV="x11 xext" - X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" - GL_LIB_DEPS="$XLIBGL_LIBS" - else - # should check these... - X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" - GL_LIB_DEPS="$X_LIBS -lX11 -lXext" - GL_PC_LIB_PRIV="$GL_LIB_DEPS" - GL_PC_CFLAGS="$X11_INCLUDES" - fi + PKG_CHECK_MODULES([XLIBGL], [x11 xext]) + GL_PC_REQ_PRIV="x11 xext" + X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" + GL_LIB_DEPS="$XLIBGL_LIBS" GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS" GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" ;; @@ -975,38 +937,19 @@ xyesno) fi # find the DRI deps for libGL - if test "$x11_pkgconfig" = yes; then - PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx >= 1.8.1]) - dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx" - - # add xf86vidmode if available - PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) - if test "$HAVE_XF86VIDMODE" = yes ; then - dri_modules="$dri_modules xxf86vm" - fi + dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1" - PKG_CHECK_MODULES([DRIGL], [$dri_modules]) - GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" - X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" - GL_LIB_DEPS="$DRIGL_LIBS" - else - # should check these... - X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" - if test "x$HAVE_XF86VIDMODE" == xyes; then - GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes" - else - GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes" - fi - GL_PC_LIB_PRIV="$GL_LIB_DEPS" - GL_PC_CFLAGS="$X11_INCLUDES" - - # XCB can only be used from pkg-config - PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx >= 1.8.1]) - GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx" - X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS" - GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS" + # add xf86vidmode if available + PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) + if test "$HAVE_XF86VIDMODE" = yes ; then + dri_modules="$dri_modules xxf86vm" fi + PKG_CHECK_MODULES([DRIGL], [$dri_modules]) + GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" + X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" + GL_LIB_DEPS="$DRIGL_LIBS" + # need DRM libs, -lpthread, etc. GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" diff --git a/mesalib/scons/custom.py b/mesalib/scons/custom.py index 43e7727aa..277c05b67 100644 --- a/mesalib/scons/custom.py +++ b/mesalib/scons/custom.py @@ -236,8 +236,13 @@ def parse_source_list(env, filename, names=None): parser = source_list.SourceListParser() src = env.File(filename).srcnode() - parser.add_symbol('top_srcdir', env.Dir('#').abspath) - parser.add_symbol('top_builddir', env['build_dir']) + cur_srcdir = env.Dir('.').srcnode().abspath + top_srcdir = env.Dir('#').abspath + top_builddir = os.path.join(top_srcdir, env['build_dir']) + + # Populate the symbol table of the Makefile parser. + parser.add_symbol('top_srcdir', top_srcdir) + parser.add_symbol('top_builddir', top_builddir) sym_table = parser.parse(src.abspath) @@ -253,7 +258,21 @@ def parse_source_list(env, filename, names=None): src_lists = {} for sym in symbols: val = sym_table[sym] - src_lists[sym] = [f for f in val.split(' ') if f] + srcs = [] + for f in val.split(): + if f: + # Process source paths + if f.startswith(top_builddir + '/src'): + # Automake puts build output on a `src` subdirectory, bue + # SCons does no, so strip it here. + f = top_builddir + f[len(top_builddir + '/src'):] + if f.startswith(cur_srcdir + '/'): + # Prefer relative source paths, as absolute files tend to + # cause duplicate actions. + f = f[len(cur_srcdir + '/'):] + srcs.append(f) + + src_lists[sym] = srcs # if names are given, concatenate the lists if names: diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index ca01a3301..db49d90ea 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -3162,7 +3162,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, static GLenum get_temp_image_type(struct gl_context *ctx, gl_format format) { - GLenum baseFormat, type; + GLenum baseFormat; baseFormat = _mesa_get_format_base_format(format); diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index aa8ba1882..792a92da3 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2564,6 +2564,8 @@ _mesa_GenerateMipmapEXT(GLenum target) srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel); if (!srcImage) { _mesa_unlock_texture(ctx, texObj); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGenerateMipmap(zero size base image)"); return; } diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c index 7aebd45ea..4c99199d9 100644 --- a/mesalib/src/mesa/main/pack.c +++ b/mesalib/src/mesa/main/pack.c @@ -926,7 +926,7 @@ _mesa_pack_rgba_span_from_ints(struct gl_context *ctx, GLuint n, GLint rgba[][4] break; case GL_INT: /* No conversion necessary. */ - pack_uint_from_uint_rgba(ctx, dstAddr, dstFormat, rgba, n); + pack_uint_from_uint_rgba(ctx, dstAddr, dstFormat, (GLuint (*)[4]) rgba, n); break; case GL_UNSIGNED_SHORT: pack_ushort_from_int_rgba(ctx, dstAddr, dstFormat, rgba, n); diff --git a/mesalib/src/mesa/state_tracker/st_atom.c b/mesalib/src/mesa/state_tracker/st_atom.c index e6fc114f1..102fee93b 100644 --- a/mesalib/src/mesa/state_tracker/st_atom.c +++ b/mesalib/src/mesa/state_tracker/st_atom.c @@ -57,7 +57,8 @@ static const struct st_tracked_state *atoms[] = &st_update_blend, &st_update_sampler, &st_update_vertex_texture, - &st_update_texture, + &st_update_fragment_texture, + &st_update_geometry_texture, &st_update_framebuffer, &st_update_msaa, &st_update_vs_constants, diff --git a/mesalib/src/mesa/state_tracker/st_atom.h b/mesalib/src/mesa/state_tracker/st_atom.h index 703bc2ab3..6c7d09fba 100644 --- a/mesalib/src/mesa/state_tracker/st_atom.h +++ b/mesalib/src/mesa/state_tracker/st_atom.h @@ -60,8 +60,9 @@ extern const struct st_tracked_state st_update_scissor; extern const struct st_tracked_state st_update_blend; extern const struct st_tracked_state st_update_msaa; extern const struct st_tracked_state st_update_sampler; -extern const struct st_tracked_state st_update_texture; +extern const struct st_tracked_state st_update_fragment_texture; extern const struct st_tracked_state st_update_vertex_texture; +extern const struct st_tracked_state st_update_geometry_texture; extern const struct st_tracked_state st_finalize_textures; extern const struct st_tracked_state st_update_fs_constants; extern const struct st_tracked_state st_update_gs_constants; diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c index f39fd7551..adcc7b505 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c +++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c @@ -253,24 +253,24 @@ update_samplers(struct st_context *st) PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, ctx->Const.MaxTextureImageUnits, - st->state.fragment_samplers, - &st->state.num_fragment_samplers); + st->state.samplers[PIPE_SHADER_FRAGMENT], + &st->state.num_samplers[PIPE_SHADER_FRAGMENT]); update_shader_samplers(st, PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, ctx->Const.MaxVertexTextureImageUnits, - st->state.vertex_samplers, - &st->state.num_vertex_samplers); - -/* - update_shader_samplers(st, - PIPE_SHADER_GEOMETRY, - &ctx->GeometryProgram._Current->Base, - ctx->Const.MaxGeometryTextureImageUnits, - st->state.geometry_samplers, - &st->state.num_geometry_samplers); -*/ + st->state.samplers[PIPE_SHADER_VERTEX], + &st->state.num_samplers[PIPE_SHADER_VERTEX]); + + if (ctx->GeometryProgram._Current) { + update_shader_samplers(st, + PIPE_SHADER_GEOMETRY, + &ctx->GeometryProgram._Current->Base, + ctx->Const.MaxGeometryTextureImageUnits, + st->state.samplers[PIPE_SHADER_GEOMETRY], + &st->state.num_samplers[PIPE_SHADER_GEOMETRY]); + } } diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c index e88675d4e..6e2efd960 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_texture.c +++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c @@ -312,8 +312,8 @@ update_vertex_textures(struct st_context *st) PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, ctx->Const.MaxVertexTextureImageUnits, - st->state.vertex_sampler_views, - &st->state.num_vertex_textures); + st->state.sampler_views[PIPE_SHADER_VERTEX], + &st->state.num_sampler_views[PIPE_SHADER_VERTEX]); } } @@ -327,12 +327,28 @@ update_fragment_textures(struct st_context *st) PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, ctx->Const.MaxTextureImageUnits, - st->state.fragment_sampler_views, - &st->state.num_fragment_textures); + st->state.sampler_views[PIPE_SHADER_FRAGMENT], + &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]); } -const struct st_tracked_state st_update_texture = { +static void +update_geometry_textures(struct st_context *st) +{ + const struct gl_context *ctx = st->ctx; + + if (ctx->GeometryProgram._Current) { + update_textures(st, + PIPE_SHADER_GEOMETRY, + &ctx->GeometryProgram._Current->Base, + ctx->Const.MaxTextureImageUnits, + st->state.sampler_views[PIPE_SHADER_GEOMETRY], + &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]); + } +} + + +const struct st_tracked_state st_update_fragment_texture = { "st_update_texture", /* name */ { /* dirty */ _NEW_TEXTURE, /* mesa */ @@ -352,6 +368,16 @@ const struct st_tracked_state st_update_vertex_texture = { }; +const struct st_tracked_state st_update_geometry_texture = { + "st_update_geometry_texture", /* name */ + { /* dirty */ + _NEW_TEXTURE, /* mesa */ + ST_NEW_GEOMETRY_PROGRAM, /* st */ + }, + update_geometry_textures /* update */ +}; + + static void finalize_textures(struct st_context *st) diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c index 7d9ccc1e5..dbd778b4f 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c @@ -481,10 +481,11 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, /* user samplers, plus our bitmap sampler */ { struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS]; - uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_fragment_samplers); + uint num = MAX2(fpv->bitmap_sampler + 1, + st->state.num_samplers[PIPE_SHADER_FRAGMENT]); uint i; - for (i = 0; i < st->state.num_fragment_samplers; i++) { - samplers[i] = &st->state.fragment_samplers[i]; + for (i = 0; i < st->state.num_samplers[PIPE_SHADER_FRAGMENT]; i++) { + samplers[i] = &st->state.samplers[PIPE_SHADER_FRAGMENT][i]; } samplers[fpv->bitmap_sampler] = &st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT]; @@ -496,8 +497,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, { struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; uint num = MAX2(fpv->bitmap_sampler + 1, - st->state.num_fragment_textures); - memcpy(sampler_views, st->state.fragment_sampler_views, + st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]); + memcpy(sampler_views, st->state.sampler_views[PIPE_SHADER_FRAGMENT], sizeof(sampler_views)); sampler_views[fpv->bitmap_sampler] = sv; cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views); diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c index 2f9516178..7735eee4f 100644 --- a/mesalib/src/mesa/state_tracker/st_context.c +++ b/mesalib/src/mesa/state_tracker/st_context.c @@ -237,7 +237,7 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe, static void st_destroy_context_priv( struct st_context *st ) { - uint i; + uint shader, i; st_destroy_atoms( st ); st_destroy_draw( st ); @@ -248,14 +248,11 @@ static void st_destroy_context_priv( struct st_context *st ) st_destroy_drawpix(st); st_destroy_drawtex(st); - for (i = 0; i < Elements(st->state.fragment_sampler_views); i++) { - pipe_sampler_view_release(st->pipe, - &st->state.fragment_sampler_views[i]); - } - - for (i = 0; i < Elements(st->state.vertex_sampler_views); i++) { - pipe_sampler_view_release(st->pipe, - &st->state.vertex_sampler_views[i]); + for (shader = 0; shader < Elements(st->state.sampler_views); shader++) { + for (i = 0; i < Elements(st->state.sampler_views[0]); i++) { + pipe_sampler_view_release(st->pipe, + &st->state.sampler_views[shader][i]); + } } if (st->default_texture) { diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h index 0dfd81c1b..47d3af520 100644 --- a/mesalib/src/mesa/state_tracker/st_context.h +++ b/mesalib/src/mesa/state_tracker/st_context.h @@ -98,25 +98,20 @@ struct st_context struct pipe_blend_state blend; struct pipe_depth_stencil_alpha_state depth_stencil; struct pipe_rasterizer_state rasterizer; - struct pipe_sampler_state fragment_samplers[PIPE_MAX_SAMPLERS]; - struct pipe_sampler_state vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS]; + struct pipe_sampler_state samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; + GLuint num_samplers[PIPE_SHADER_TYPES]; + struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; + GLuint num_sampler_views[PIPE_SHADER_TYPES]; struct pipe_clip_state clip; struct { void *ptr; unsigned size; } constants[PIPE_SHADER_TYPES]; struct pipe_framebuffer_state framebuffer; - struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS]; - struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS]; struct pipe_scissor_state scissor; struct pipe_viewport_state viewport; unsigned sample_mask; - GLuint num_fragment_samplers; - GLuint num_vertex_samplers; - GLuint num_fragment_textures; - GLuint num_vertex_textures; - GLuint poly_stipple[32]; /**< In OpenGL's bottom-to-top order */ GLuint fb_orientation; diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 39717b6fd..9146f24f3 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -4028,7 +4028,7 @@ dst_register(struct st_translate *t, static struct ureg_src src_register(struct st_translate *t, gl_register_file file, - GLuint index) + GLint index) { switch(file) { case PROGRAM_UNDEFINED: @@ -4036,7 +4036,7 @@ src_register(struct st_translate *t, case PROGRAM_TEMPORARY: assert(index >= 0); - assert(index < Elements(t->temps)); + assert(index < (int) Elements(t->temps)); if (ureg_dst_is_undef(t->temps[index])) t->temps[index] = ureg_DECL_local_temporary(t->ureg); return ureg_src(t->temps[index]); @@ -4069,7 +4069,7 @@ src_register(struct st_translate *t, return ureg_src(t->address[index]); case PROGRAM_SYSTEM_VALUE: - assert(index < Elements(t->systemValues)); + assert(index < (int) Elements(t->systemValues)); return t->systemValues[index]; default: |