Re: [Mesa-dev] [PATCH 01/13] mesa: make _mesa_reference_sampler_object() an inline function
The series looks good AFAICT. Joe - Original Message - > To make the no-change case faster, as we do for the other > object-reference > functions. > --- > src/mesa/main/samplerobj.c |9 - > src/mesa/main/samplerobj.h | 12 +++- > 2 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c > index 7cf0654..5d1b2ad 100644 > --- a/src/mesa/main/samplerobj.c > +++ b/src/mesa/main/samplerobj.c > @@ -55,12 +55,11 @@ _mesa_lookup_samplerobj(struct gl_context *ctx, > GLuint name) > * Handle reference counting. > */ > void > -_mesa_reference_sampler_object(struct gl_context *ctx, > - struct gl_sampler_object **ptr, > - struct gl_sampler_object *samp) > +_mesa_reference_sampler_object_(struct gl_context *ctx, > +struct gl_sampler_object **ptr, > +struct gl_sampler_object *samp) > { > - if (*ptr == samp) > - return; > + assert(*ptr != samp); /* The inline wrapper should prevent no-op > calls */ > > if (*ptr) { >/* Unreference the old sampler */ > diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h > index fe7d5a7..c22d025 100644 > --- a/src/mesa/main/samplerobj.h > +++ b/src/mesa/main/samplerobj.h > @@ -38,9 +38,19 @@ _mesa_get_samplerobj(struct gl_context *ctx, > GLuint unit) > } > > extern void > +_mesa_reference_sampler_object_(struct gl_context *ctx, > +struct gl_sampler_object **ptr, > +struct gl_sampler_object *samp); > + > +static inline void > _mesa_reference_sampler_object(struct gl_context *ctx, > struct gl_sampler_object **ptr, > - struct gl_sampler_object *samp); > + struct gl_sampler_object *samp) > +{ > + if (*ptr != samp) > + _mesa_reference_sampler_object_(ctx, ptr, samp); > +} > + > > extern void > _mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint > name); > -- > 1.7.3.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Doing 8.0.1 release?
- Original Message - > Please make sure to include python-generated C files in the 8.0.2 > tarball. They were not there in 8.0.1's: > > python -t -O -O main/es_generator.py -S main/APIspec.xml -V GLES1.1 > > main/api_exec_es1.c > Traceback (most recent call last): > File "main/es_generator.py", line 26, in > import APIspecutil as apiutil > File > > "/private/tmp/X11libs_trunk.roots/X11libs_trunk~obj/mesa/Mesa-8.0.1/src/mesa/main/APIspecutil.py", > line 28, in > import libxml2 > ImportError: No module named libxml2 Isn't this similar to requiring flex/bison or do we ship those generated c files with the tarballs? Anybody feels like doing a patch, I'll do it later if not. Cheers, Jakob. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
On Sat, Mar 17, 2012 at 11:36 PM, Matt Turner wrote: > On Fri, Mar 16, 2012 at 4:29 PM, Kristian Høgsberg wrote: >> This fixes a build problem where EGL links to libgbm.la, which encodes >> a relative path to it's libglapi.so dependency. The relative path >> breaks when the linker tries to resolve it from src/egl/main instead >> of src/gbm. Typically we silently fall back to the system >> libglapi.so, which is wrong and break when there isn't one. >> >> Morale of the story: don't mix mklib and libtool. >> --- >> configure.ac | 2 + >> src/egl/main/Makefile.am | 1 - >> src/gbm/Makefile.am | 4 +- >> src/glx/Makefile.am | 2 +- >> src/mapi/Android.mk | 4 +- >> src/mapi/es1api/Makefile | 4 +- >> src/mapi/glapi/Makefile | 8 ++-- >> src/mapi/mapi/sources.mak | 42 >> src/mapi/shared-glapi/Makefile | 65 >> - >> src/mapi/shared-glapi/Makefile.am | 23 + >> src/mapi/vgapi/Makefile | 4 +- >> 11 files changed, 59 insertions(+), 100 deletions(-) >> delete mode 100644 src/mapi/shared-glapi/Makefile >> create mode 100644 src/mapi/shared-glapi/Makefile.am >> >> diff --git a/configure.ac b/configure.ac >> index c0d81c9..519662b 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -702,6 +702,7 @@ if test "x$enable_shared_glapi" = xyes; then >> # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to >> use >> # the remap table) >> DEFINES="$DEFINES -DIN_DRI_DRIVER" >> + SRC_DIRS="$SRC_DIRS mapi/shared-glapi" >> fi >> AC_SUBST([SHARED_GLAPI]) >> AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1) >> @@ -1985,6 +1986,7 @@ AC_CONFIG_FILES([configs/autoconf >> src/egl/wayland/wayland-egl/wayland-egl.pc >> src/egl/wayland/wayland-drm/Makefile >> src/glx/Makefile >> + src/mapi/shared-glapi/Makefile >> src/mesa/drivers/dri/dri.pc >> src/mesa/drivers/dri/Makefile >> src/mesa/drivers/dri/common/Makefile >> diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am >> index a8072c1..9c3935b 100644 >> --- a/src/egl/main/Makefile.am >> +++ b/src/egl/main/Makefile.am >> @@ -93,7 +93,6 @@ endif >> if HAVE_EGL_PLATFORM_DRM >> AM_CFLAGS += -DHAVE_DRM_PLATFORM >> libEGL_la_LIBADD += ../../gbm/libgbm.la >> -libEGL_la_LIBADD += ../../gbm/libgbm.la >> endif >> >> if HAVE_EGL_PLATFORM_FBDEV >> diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am >> index 1dbc9d1..dede5bc 100644 >> --- a/src/gbm/Makefile.am >> +++ b/src/gbm/Makefile.am >> @@ -31,8 +31,8 @@ libgbm_dri_la_CFLAGS = \ >> -DDEFAULT_DRIVER_DIR='"$(DRI_DRIVER_SEARCH_DIR)"' \ >> $(LIBDRM_CFLAGS) >> >> -libgbm_la_LDFLAGS += -L$(top_builddir)/$(LIB_DIR) >> -libgbm_la_LIBADD += libgbm_dri.la -lglapi >> +libgbm_la_LIBADD += \ >> + libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la >> endif >> >> all-local: libgbm.la >> diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am >> index 79dc405..a11bd3f 100644 >> --- a/src/glx/Makefile.am >> +++ b/src/glx/Makefile.am >> @@ -21,7 +21,7 @@ >> >> if HAVE_SHARED_GLAPI >> SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI >> -SHARED_GLAPI_LIBS = -L$(top_builddir)/$(LIB_DIR) -lglapi >> +SHARED_GLAPI_LIBS = $(top_builddir)/src/mapi/shared-glapi/libglapi.la >> endif >> >> GLAPI_LIB = ../mapi/glapi/libglapi.a >> diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk >> index fe9e40e..b75361f 100644 >> --- a/src/mapi/Android.mk >> +++ b/src/mapi/Android.mk >> @@ -25,7 +25,7 @@ >> >> LOCAL_PATH := $(call my-dir) >> >> -# get MAPI_GLAPI_SOURCES >> +# get MAPI_GLAPI_FILES >> include $(LOCAL_PATH)/mapi/sources.mak >> >> mapi_abi_headers := >> @@ -38,7 +38,7 @@ include $(CLEAR_VARS) >> >> abi_header := shared-glapi/glapi_mapi_tmp.h >> >> -LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_SOURCES)) >> +LOCAL_SRC_FILES := $(MAPI_GLAPI_FILES) >> >> LOCAL_CFLAGS := \ >> -DMAPI_MODE_GLAPI \ >> diff --git a/src/mapi/es1api/Makefile b/src/mapi/es1api/Makefile >> index 0a0449b..2545dd0 100644 >> --- a/src/mapi/es1api/Makefile >> +++ b/src/mapi/es1api/Makefile >> @@ -41,8 +41,8 @@ esapi_CPPFLAGS := \ >> -DMAPI_ABI_HEADER=\"$(ESAPI)/glapi_mapi_tmp.h\" >> >> include $(MAPI)/sources.mak >> -esapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES)) >> -esapi_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o) >> +esapi_SOURCES := $(MAPI_BRIDGE_FILES) >> +esapi_OBJECTS := $(esapi_SOURCES:.c=.o) >> esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE >> >> esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS) >> diff --git a/src/mapi/glapi/Makefile b/src/mapi/glapi/Makefile >> index bb4ed65..bca2432 100644 >> --- a/src/mapi/glapi/Makefile >> +++ b/src/mapi/glapi/Makefile >> @@ -19,18 +19,18 @@ ifeq ($(SHARED_GLAPI),1) >> glapi_CPPFLAGS += \ >>
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
> I don't see that here, I can remove glapi_mapi_tmp.h and make will > rebuild it with the python script. A full autogen should generate the > new dep rules (though ./config.status depfiles may be enough). I did not find that to be the case. Attached is a patch which adds BUILT_SOURCES and the -no-undefined libtool flag, which you may wish to squash into you patch before pushing. Otherwise, Reviewed-by: Jon TURNEY From 27d0e18f44b2c3647d33bdc707eaf135520ceb5b Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 19 Mar 2012 15:18:23 + Subject: [PATCH] shared-glapi: Convert to automake fixes Signed-off-by: Jon TURNEY --- src/mapi/shared-glapi/Makefile.am |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am index d24a57e..c879997 100644 --- a/src/mapi/shared-glapi/Makefile.am +++ b/src/mapi/shared-glapi/Makefile.am @@ -6,6 +6,7 @@ include $(top_srcdir)/src/mapi/mapi/sources.mak lib_LTLIBRARIES = libglapi.la libglapi_la_SOURCES = $(MAPI_GLAPI_FILES) +libglapi_la_LDFLAGS = -no-undefined include $(GLAPI)/gen/glapi_gen.mk glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) @@ -21,3 +22,5 @@ AM_CPPFLAGS = \ all-local: libglapi.la $(MKDIR_P) $(top_builddir)/$(LIB_DIR) ln -f .libs/libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so + +BUILT_SOURCES = glapi_mapi_tmp.h -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
On Mon, Mar 19, 2012 at 11:23 AM, Jon TURNEY wrote: >> I don't see that here, I can remove glapi_mapi_tmp.h and make will >> rebuild it with the python script. A full autogen should generate the >> new dep rules (though ./config.status depfiles may be enough). > > I did not find that to be the case. Yeah, I think what happened was that when I wrote the original patch I had the generated file already there, and then today when I tested the dep rule for generating the file I had already added the BUILT_SOURCES line as per Erics suggestion. > Attached is a patch which adds BUILT_SOURCES and the -no-undefined libtool > flag, which you may wish to squash into you patch before pushing. Ok, I pushed with the BUILT_SOURCES line, but didn't add -no-undefined. thanks, Kristian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 02/13] mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
On 03/18/2012 09:49 AM, Brian Paul wrote: --- src/mesa/main/texobj.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5905948..def09e2 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -465,9 +465,9 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, maxLevels = ctx->Const.MaxTextureLevels; } else if (t->Target == GL_TEXTURE_3D) { - GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2)); + maxLog2 = MAX3(t->Image[0][baseLevel]->WidthLog2, + t->Image[0][baseLevel]->HeightLog2, + t->Image[0][baseLevel]->DepthLog2); maxLevels = ctx->Const.Max3DTextureLevels; } else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { Doesn't this need a (GLint) on DepthLog2 to avoid warnings? (I haven't tried it myself, but it seems like it would...) Either way, Reviewed-by: Kenneth Graunke ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Doing 8.0.1 release?
On Mar 19, 2012, at 5:18 AM, Jakob Bornecrantz wrote: > - Original Message - >> Please make sure to include python-generated C files in the 8.0.2 >> tarball. They were not there in 8.0.1's: >> >> python -t -O -O main/es_generator.py -S main/APIspec.xml -V GLES1.1 > >> main/api_exec_es1.c >> Traceback (most recent call last): >> File "main/es_generator.py", line 26, in >>import APIspecutil as apiutil >> File >> >> "/private/tmp/X11libs_trunk.roots/X11libs_trunk~obj/mesa/Mesa-8.0.1/src/mesa/main/APIspecutil.py", >> line 28, in >>import libxml2 >> ImportError: No module named libxml2 > > Isn't this similar to requiring flex/bison or do we > ship those generated c files with the tarballs? > > Anybody feels like doing a patch, I'll do it later if not. The flex/bison generated source files are included in the tarball. Also, the python-generated files were included in 7.11.2, so it seems like something accidentally changed with 8.0. Perhaps they're just being included if they were present in the git checkout when making the tarball. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
On Mon, Mar 19, 2012 at 11:50 AM, Kristian Høgsberg wrote: > Ok, I pushed with the BUILT_SOURCES line, but didn't add -no-undefined. I think no undefined is important for Windows, and I know it would have caught some problems for me in the past. Matt ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
I didn't know that --no-undefined . It seems quite nice, but more for Linux than Windows, as on windows all DLLs are linked work as if --no-undefined is set -- no undefined symbols are ever allowed. Jose - Original Message - > On Mon, Mar 19, 2012 at 11:50 AM, Kristian Høgsberg > wrote: > > Ok, I pushed with the BUILT_SOURCES line, but didn't add > > -no-undefined. > > I think no undefined is important for Windows, and I know it would > have caught some problems for me in the past. > > Matt > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] shared-glapi: Convert to automake
On Mon, Mar 19, 2012 at 3:52 PM, Jose Fonseca wrote: > I didn't know that --no-undefined . It seems quite nice, but more for Linux > than Windows, as on windows all DLLs are linked work as if --no-undefined is > set -- no undefined symbols are ever allowed. Right, I think that's why Jon suggests using it -- so that when we're testing on Linux we'll get undefined references we would otherwise not notice but that would break Windows builds. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Doing 8.0.1 release?
- Original Message - > > On Mar 19, 2012, at 5:18 AM, Jakob Bornecrantz > wrote: > > > - Original Message - > >> Please make sure to include python-generated C files in the 8.0.2 > >> tarball. They were not there in 8.0.1's: > >> > >> python -t -O -O main/es_generator.py -S main/APIspec.xml -V > >> GLES1.1 > > >> main/api_exec_es1.c > >> Traceback (most recent call last): > >> File "main/es_generator.py", line 26, in > >>import APIspecutil as apiutil > >> File > >> > >> "/private/tmp/X11libs_trunk.roots/X11libs_trunk~obj/mesa/Mesa-8.0.1/src/mesa/main/APIspecutil.py", > >> line 28, in > >>import libxml2 > >> ImportError: No module named libxml2 > > > > Isn't this similar to requiring flex/bison or do we > > ship those generated c files with the tarballs? > > > > Anybody feels like doing a patch, I'll do it later if not. > > The flex/bison generated source files are included in the tarball. > Also, the python-generated files were included in 7.11.2, so it > seems like something accidentally changed with 8.0. Perhaps they're > just being included if they were present in the git checkout when > making the tarball. Fair enough, I'll make sure they are included. I got a bit sidetracked today, you should have the release in the morning. Cheers, Jakob. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 02/13] mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
On 03/19/2012 12:29 PM, Kenneth Graunke wrote: On 03/18/2012 09:49 AM, Brian Paul wrote: --- src/mesa/main/texobj.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5905948..def09e2 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -465,9 +465,9 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, maxLevels = ctx->Const.MaxTextureLevels; } else if (t->Target == GL_TEXTURE_3D) { - GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2)); + maxLog2 = MAX3(t->Image[0][baseLevel]->WidthLog2, + t->Image[0][baseLevel]->HeightLog2, + t->Image[0][baseLevel]->DepthLog2); maxLevels = ctx->Const.Max3DTextureLevels; } else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { Doesn't this need a (GLint) on DepthLog2 to avoid warnings? (I haven't tried it myself, but it seems like it would...) I haven't seen any warnings (on Linux). The MAX3() code is pretty much the same as the preceeding MAX2() code and no casts are used there. The cast was needed before because we were comparing int/unsigned. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Initial Haswell support
This series adds basic Haswell support to the i965 driver. Many piglit tests pass (though I have yet to try it on real hardware). The series is also available in the 'haswell' branch of the main repository. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/8] i965: Add initial IS_HASWELL() macros.
For now, these all return 0, as I don't yet want to enable Haswell support. Eventually they will be filled in with proper PCI IDs. Also add an is_haswell field similar to is_g4x to make it easy to distinguish Gen7 and Gen7.5. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/intel/intel_chipset.h |9 - src/mesa/drivers/dri/intel/intel_context.c |9 + src/mesa/drivers/dri/intel/intel_context.h |1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index 2e9fb2d..eefb430 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -151,7 +151,14 @@ #define IS_IVYBRIDGE(devid) (IS_IVB_GT1(devid) || IS_IVB_GT2(devid)) -#define IS_GEN7(devid) IS_IVYBRIDGE(devid) +#define IS_GEN7(devid) (IS_IVYBRIDGE(devid) || \ +IS_HASWELL(devid)) + +#define IS_HSW_GT1(devid) 0 +#define IS_HSW_GT2(devid) 0 + +#define IS_HASWELL(devid) (IS_HSW_GT1(devid) || \ +IS_HSW_GT2(devid)) #define IS_965(devid) (IS_GEN4(devid) || \ IS_G4X(devid) || \ diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index c39d9ce..370e902 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -609,15 +609,16 @@ intelInitContext(struct intel_context *intel, intel->gen = intelScreen->gen; const int devID = intelScreen->deviceID; - - if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID)) + if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID) || IS_HSW_GT1(devID)) intel->gt = 1; - else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID)) + else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID) || IS_HSW_GT2(devID)) intel->gt = 2; else intel->gt = 0; - if (IS_G4X(devID)) { + if (IS_HASWELL(devID)) { + intel->is_haswell = true; + } else if (IS_G4X(devID)) { intel->is_g4x = true; } else if (IS_945(devID)) { intel->is_945 = true; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index bfe5f94..8ba7270 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -208,6 +208,7 @@ struct intel_context int gen; int gt; bool needs_ff_sync; + bool is_haswell; bool is_g4x; bool is_945; bool has_separate_stencil; -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/8] i965: Disable HiZ on Haswell for now.
Getting HiZ working means updating all the state packets for resolves and clears. It's not worth doing until we get the basics working. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/intel/intel_context.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) This patch won't apply cleanly without Eric's patch that makes HiZ support a driconf option rather than an environment variable. I figure that will get cleaned up and land first. diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 370e902..20f6fbc 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -630,7 +630,7 @@ intelInitContext(struct intel_context *intel, intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil; intel->must_use_separate_stencil = intel->intelScreen->hw_must_use_separate_stencil; - intel->has_hiz = intel->gen >= 6; + intel->has_hiz = intel->gen >= 6 && !intel->is_haswell; intel->has_llc = intel->intelScreen->hw_has_llc; intel->has_swizzling = intel->intelScreen->hw_has_swizzling; -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/8] i965: Update max VS/PS threads shift offsets for Haswell.
These now start at bit 23 instead of bit 24/25. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_defines.h |4 +++- src/mesa/drivers/dri/i965/gen7_hiz.c |2 +- src/mesa/drivers/dri/i965/gen7_vs_state.c |4 +++- src/mesa/drivers/dri/i965/gen7_wm_state.c |4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 38ce5d7..41534b6 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1047,6 +1047,7 @@ enum brw_message_target { # define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 4 /* DW5 */ # define GEN6_VS_MAX_THREADS_SHIFT 25 +# define HSW_VS_MAX_THREADS_SHIFT 23 # define GEN6_VS_STATISTICS_ENABLE (1 << 10) # define GEN6_VS_CACHE_DISABLE (1 << 1) # define GEN6_VS_ENABLE(1 << 0) @@ -1390,7 +1391,8 @@ enum brw_wm_barycentric_interp_mode { # define GEN7_PS_FLOATING_POINT_MODE_ALT (1 << 16) /* DW3: scratch space */ /* DW4 */ -# define GEN7_PS_MAX_THREADS_SHIFT 24 +# define IVB_PS_MAX_THREADS_SHIFT 24 +# define HSW_PS_MAX_THREADS_SHIFT 23 # define GEN7_PS_PUSH_CONSTANT_ENABLE (1 << 11) # define GEN7_PS_ATTRIBUTE_ENABLE (1 << 10) # define GEN7_PS_OMASK_TO_RENDER_TARGET(1 << 9) diff --git a/src/mesa/drivers/dri/i965/gen7_hiz.c b/src/mesa/drivers/dri/i965/gen7_hiz.c index 50c265e..18c178e 100644 --- a/src/mesa/drivers/dri/i965/gen7_hiz.c +++ b/src/mesa/drivers/dri/i965/gen7_hiz.c @@ -314,7 +314,7 @@ gen7_hiz_exec(struct intel_context *intel, OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); - OUT_BATCH(((brw->max_wm_threads - 1) << GEN7_PS_MAX_THREADS_SHIFT) | + OUT_BATCH(((brw->max_wm_threads - 1) << IVB_PS_MAX_THREADS_SHIFT) | GEN7_PS_32_DISPATCH_ENABLE); OUT_BATCH(0); OUT_BATCH(0); diff --git a/src/mesa/drivers/dri/i965/gen7_vs_state.c b/src/mesa/drivers/dri/i965/gen7_vs_state.c index 73822e3..e8be4f2 100644 --- a/src/mesa/drivers/dri/i965/gen7_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_vs_state.c @@ -34,6 +34,8 @@ upload_vs_state(struct brw_context *brw) { struct intel_context *intel = &brw->intel; uint32_t floating_point_mode = 0; + const int max_threads_shift = brw->intel.is_haswell ? + HSW_VS_MAX_THREADS_SHIFT : GEN6_VS_MAX_THREADS_SHIFT; gen7_emit_vs_workaround_flush(intel); @@ -99,7 +101,7 @@ upload_vs_state(struct brw_context *brw) (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); - OUT_BATCH(((brw->max_vs_threads - 1) << GEN6_VS_MAX_THREADS_SHIFT) | + OUT_BATCH(((brw->max_vs_threads - 1) << max_threads_shift) | GEN6_VS_STATISTICS_ENABLE | GEN6_VS_ENABLE); ADVANCE_BATCH(); diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index 265ca49..773598f 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -98,6 +98,8 @@ upload_ps_state(struct brw_context *brw) { struct intel_context *intel = &brw->intel; uint32_t dw2, dw4, dw5; + const int max_threads_shift = brw->intel.is_haswell ? + HSW_PS_MAX_THREADS_SHIFT : IVB_PS_MAX_THREADS_SHIFT; /* BRW_NEW_PS_BINDING_TABLE */ BEGIN_BATCH(2); @@ -153,7 +155,7 @@ upload_ps_state(struct brw_context *brw) if (intel->ctx.Shader.CurrentFragmentProgram == NULL) dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT; - dw4 |= (brw->max_wm_threads - 1) << GEN7_PS_MAX_THREADS_SHIFT; + dw4 |= (brw->max_wm_threads - 1) << max_threads_shift; /* CACHE_NEW_WM_PROG */ if (brw->wm.prog_data->nr_params > 0) -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/8] i965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.
Apparently this needs to be the same as in 3DSTATE_WM. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_defines.h |2 ++ src/mesa/drivers/dri/i965/gen7_sf_state.c |3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 41534b6..a093112 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1210,6 +1210,8 @@ enum brw_message_target { */ /* GEN7/DW1: */ # define GEN7_SF_DEPTH_BUFFER_SURFACE_FORMAT_SHIFT 12 +/* GEN7/DW2: */ +# define HSW_SF_LINE_STIPPLE_ENABLE14 #define _3DSTATE_SBE 0x781F /* GEN7+ */ /* DW1 */ diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c index c8f4393..5c51abc 100644 --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -249,6 +249,9 @@ upload_sf_state(struct brw_context *brw) dw2 |= GEN6_SF_LINE_AA_MODE_TRUE; dw2 |= GEN6_SF_LINE_END_CAP_WIDTH_1_0; } + if (ctx->Line.StippleFlag && intel->is_haswell) { + dw2 |= HSW_SF_LINE_STIPPLE_ENABLE; + } /* FINISHME: Last Pixel Enable? Vertex Sub Pixel Precision Select? * FINISHME: AA Line Distance Mode? -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 5/8] i965: Set "Stencil Buffer Enable" bit on Haswell.
Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/gen7_misc_state.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_misc_state.c b/src/mesa/drivers/dri/i965/gen7_misc_state.c index d0ce542..d3458e0 100644 --- a/src/mesa/drivers/dri/i965/gen7_misc_state.c +++ b/src/mesa/drivers/dri/i965/gen7_misc_state.c @@ -139,9 +139,12 @@ static void emit_depthbuffer(struct brw_context *brw) OUT_BATCH(0); ADVANCE_BATCH(); } else { + const int enabled = intel->is_haswell ? (1 << 31) : 0; + BEGIN_BATCH(3); OUT_BATCH(GEN7_3DSTATE_STENCIL_BUFFER << 16 | (3 - 2)); - OUT_BATCH(stencil_mt->region->pitch * stencil_mt->region->cpp - 1); + OUT_BATCH(enabled | + (stencil_mt->region->pitch * stencil_mt->region->cpp - 1)); OUT_RELOC(stencil_mt->region->bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 6/8] i965: Fill in Sample Mask in Haswell's 3DSTATE_PS.
We only need one sample, since we don't support multisampling yet. --- src/mesa/drivers/dri/i965/gen7_wm_state.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index 773598f..a4c0e01 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -155,6 +155,9 @@ upload_ps_state(struct brw_context *brw) if (intel->ctx.Shader.CurrentFragmentProgram == NULL) dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT; + if (intel->is_haswell) + dw4 |= (1 << 12); /* Sample Mask: 1 sample for now */ + dw4 |= (brw->max_wm_threads - 1) << max_threads_shift; /* CACHE_NEW_WM_PROG */ -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 7/8] i965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.
These can be used to implement EXT_texture_swizzle without baking state-dependent swizzle instructions into the shader and forcing recompiles. For now, just set them to pass-through mode, so everything continues to work as it did on Ivybridge. We can optimize this later. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_defines.h |8 src/mesa/drivers/dri/i965/brw_structs.h |9 - src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 14 ++ 3 files changed, 30 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index a093112..812052d 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -464,6 +464,14 @@ #define BRW_SURFACE_Y_OFFSET_SHIFT 20 #define BRW_SURFACE_Y_OFFSET_MASK INTEL_MASK(23, 20) +/* Surface state DW7 */ +#define HSW_SCS_ZERO 0 +#define HSW_SCS_ONE 1 +#define HSW_SCS_RED 4 +#define HSW_SCS_GREEN5 +#define HSW_SCS_BLUE 6 +#define HSW_SCS_ALPHA7 + #define BRW_TEXCOORDMODE_WRAP0 #define BRW_TEXCOORDMODE_MIRROR 1 #define BRW_TEXCOORDMODE_CLAMP 2 diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 8283abf..41c88d0 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -860,7 +860,14 @@ struct gen7_surface_state struct { GLuint resource_min_lod:12; - GLuint pad0:16; + + /* Only on Haswell */ + GLuint pad0:4; + GLuint shader_chanel_select_a:3; + GLuint shader_chanel_select_b:3; + GLuint shader_chanel_select_g:3; + GLuint shader_chanel_select_r:3; + GLuint alpha_clear_color:1; GLuint blue_clear_color:1; GLuint green_clear_color:1; diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c index c52f6aa..91cc5d1 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c @@ -121,6 +121,13 @@ gen7_update_texture_surface(struct gl_context *ctx, GLuint unit) * - cache_control */ + if (brw->intel.is_haswell) { + surf->ss7.shader_chanel_select_r = HSW_SCS_RED; + surf->ss7.shader_chanel_select_g = HSW_SCS_GREEN; + surf->ss7.shader_chanel_select_b = HSW_SCS_BLUE; + surf->ss7.shader_chanel_select_a = HSW_SCS_ALPHA; + } + /* Emit relocation to surface contents */ drm_intel_bo_emit_reloc(brw->intel.batch.bo, brw->wm.surf_offset[surf_index] + @@ -249,6 +256,13 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, gen7_set_surface_tiling(surf, region->tiling); surf->ss3.pitch = (region->pitch * region->cpp) - 1; + if (intel->is_haswell) { + surf->ss7.shader_chanel_select_r = HSW_SCS_RED; + surf->ss7.shader_chanel_select_g = HSW_SCS_GREEN; + surf->ss7.shader_chanel_select_b = HSW_SCS_BLUE; + surf->ss7.shader_chanel_select_a = HSW_SCS_ALPHA; + } + drm_intel_bo_emit_reloc(brw->intel.batch.bo, brw->wm.surf_offset[unit] + offsetof(struct gen7_surface_state, ss1), -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 8/8] intel: Add some PCI IDs for Haswell.
Signed-off-by: Kenneth Graunke --- include/pci_ids/i965_pci_ids.h |5 + src/mesa/drivers/dri/intel/intel_chipset.h | 13 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/pci_ids/i965_pci_ids.h b/include/pci_ids/i965_pci_ids.h index d37a2ee..a291509 100644 --- a/include/pci_ids/i965_pci_ids.h +++ b/include/pci_ids/i965_pci_ids.h @@ -25,3 +25,8 @@ CHIPSET(0x0162, IVYBRIDGE_GT2, ivb_gt2) CHIPSET(0x0156, IVYBRIDGE_M_GT1, ivb_gt1) CHIPSET(0x0166, IVYBRIDGE_M_GT2, ivb_gt2) CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1) +CHIPSET(0x0402, HASWELL_GT1, hsw_gt1) +CHIPSET(0x0412, HASWELL_GT2, hsw_gt2) +CHIPSET(0x0406, HASWELL_M_GT1, hsw_gt1) +CHIPSET(0x0416, HASWELL_M_GT2, hsw_gt2) +CHIPSET(0x0A16, HASWELL_M_ULT_GT2, hsw_gt2) diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index eefb430..424c70c 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -86,6 +86,12 @@ #define PCI_CHIP_IVYBRIDGE_M_GT20x0166 #define PCI_CHIP_IVYBRIDGE_S_GT10x015a /* Server */ +#define PCI_CHIP_HASWELL_GT10x0402 /* Desktop */ +#define PCI_CHIP_HASWELL_GT20x0412 +#define PCI_CHIP_HASWELL_M_GT1 0x0406 /* Mobile */ +#define PCI_CHIP_HASWELL_M_GT2 0x0416 +#define PCI_CHIP_HASWELL_M_ULT_GT2 0x0A16 /* Mobile ULT */ + #define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I915_GM || \ devid == PCI_CHIP_I945_GM || \ @@ -154,8 +160,11 @@ #define IS_GEN7(devid) (IS_IVYBRIDGE(devid) || \ IS_HASWELL(devid)) -#define IS_HSW_GT1(devid) 0 -#define IS_HSW_GT2(devid) 0 +#define IS_HSW_GT1(devid) (devid == PCI_CHIP_HASWELL_GT1 || \ +devid == PCI_CHIP_HASWELL_M_GT1) +#define IS_HSW_GT2(devid) (devid == PCI_CHIP_HASWELL_GT2 || \ +devid == PCI_CHIP_HASWELL_M_GT2 || \ +devid == PCI_CHIP_HASWELL_M_ULT_GT2) #define IS_HASWELL(devid) (IS_HSW_GT1(devid) || \ IS_HSW_GT2(devid)) -- 1.7.7.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/6] glx: Convert to automake.
On Wed, Feb 8, 2012 at 9:09 PM, Eric Anholt wrote: > --- > configure.ac | 4 ++ > src/glx/.gitignore | 5 ++ > src/glx/Makefile | 119 - > src/glx/Makefile.am | 122 > +++ > src/mesa/Makefile | 2 - > 5 files changed, 131 insertions(+), 121 deletions(-) > create mode 100644 src/glx/.gitignore > delete mode 100644 src/glx/Makefile > create mode 100644 src/glx/Makefile.am > > diff --git a/configure.ac b/configure.ac > index b2b1ab8..389cdb0 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -379,6 +379,7 @@ fi > AC_SUBST([GL_LIB]) > AC_SUBST([GLU_LIB]) > AC_SUBST([OSMESA_LIB]) > +AM_CONDITIONAL(HAVE_MANGLED_GL, test $GL_LIB = MangledGL) > > dnl > dnl potentially-infringing-but-nobody-knows-for-sure stuff > @@ -700,6 +701,7 @@ if test "x$enable_shared_glapi" = xyes; then > SHARED_GLAPI="1" > fi > AC_SUBST([SHARED_GLAPI]) > +AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1) > > dnl > dnl Driver configuration. Options are xlib, dri and osmesa right now. > @@ -1037,6 +1039,7 @@ esac > # builds. > AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT, > test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes) > +AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes) > > GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" > GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" > @@ -1935,6 +1938,7 @@ AC_CONFIG_FILES([configs/autoconf > src/egl/wayland/wayland-egl/Makefile > src/egl/wayland/wayland-egl/wayland-egl.pc > src/egl/wayland/wayland-drm/Makefile > + src/glx/Makefile > src/mesa/drivers/dri/dri.pc > src/mesa/drivers/dri/Makefile > src/mesa/drivers/dri/common/Makefile > diff --git a/src/glx/.gitignore b/src/glx/.gitignore > new file mode 100644 > index 000..ea7b611 > --- /dev/null > +++ b/src/glx/.gitignore > @@ -0,0 +1,5 @@ > +.deps > +.libs > +Makefile > +Makefile.in > +libGL.la > diff --git a/src/glx/Makefile b/src/glx/Makefile > deleted file mode 100644 > index f702f95..000 > --- a/src/glx/Makefile > +++ /dev/null > @@ -1,119 +0,0 @@ > -TOP = ../.. > -include $(TOP)/configs/current > - > -ifeq ($(HAVE_XF86VIDMODE),yes) > -EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE > -endif > - > -EXTRA_DEFINES = $(EXTRA_DEFINES_XF86VIDMODE) -D_REENTRANT \ > - -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" > - > -SOURCES = \ > - clientattrib.c \ > - clientinfo.c \ > - compsize.c \ > - create_context.c \ > - eval.c \ > - glxconfig.c \ > - glxcmds.c \ > - glxcurrent.c \ > - glx_error.c \ > - glxext.c \ > - glxextensions.c \ > - indirect_glx.c \ > - indirect.c \ > - indirect_init.c \ > - indirect_size.c \ > - indirect_window_pos.c \ > - indirect_texture_compression.c \ > - indirect_transpose_matrix.c \ > - indirect_vertex_array.c \ > - indirect_vertex_program.c \ > - pixel.c \ > - pixelstore.c \ > - render2.c \ > - renderpix.c \ > - single2.c \ > - singlepix.c \ > - vertarr.c \ > - xfont.c \ > - glx_pbuffer.c \ > - glx_query.c \ > - drisw_glx.c \ > - dri_common.c \ > - dri_glx.c \ > - XF86dri.c \ > - glxhash.c \ > - dri2_glx.c \ > - dri2.c \ > - applegl_glx.c > - > - > -ifeq ($(SHARED_GLAPI),1) > -GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS) > -EXTRA_DEFINES += -DGLX_SHARED_GLAPI > -endif > - > -# override GLAPI_LIB > -GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a > - > -OBJECTS = $(SOURCES:.c=.o) > - > -INCLUDES = -I. \ > - -I$(TOP)/include \ > - -I$(TOP)/include/GL/internal \ > - -I$(TOP)/src/mesa \ > - -I$(TOP)/src/mapi \ > - -I$(TOP)/src/mapi/glapi \ > - $(LIBDRM_CFLAGS) \ > - $(DRI2PROTO_CFLAGS) \ > - $(GLPROTO_CFLAGS) \ > - $(X11_INCLUDES) > - > - > -# RULES # > - > -.c.o: > - $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ > - > -.S.o: > - $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ > - > -# TARGETS # > - > -default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) > - > -libglx.a: $(OBJECTS) > - $(MKLIB) -cplusplus -o glx -static $(OBJECTS) > - > -# Make libGL > -$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): libglx.a $(OBJECTS) $(GLAPI_LIB) Makefile > - $(MKLIB) -o $(GL_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ > - -major 1 -minor 2 \ > - -cplusplus $(MKLIB_OPTIONS) \ > - -install $(TOP)/$(LIB_DIR) -id > $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \ > - $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB) > - > -$(GLAPI_LIB): > - @$(MAKE) -C $(TOP)/src/mapi/glapi > - > -depend: $(SOU
Re: [Mesa-dev] [PATCH v3 2/2] GLX_TLS: use TLS macros when define those TLS variables.
Hi Brian, Have you tried those testings(osmesa, static lib builds, etc) already and any new comments for the previous patchset. Thanks. > -Original Message- > From: > mesa-dev-bounces+zhigang.gong=linux.intel@lists.freedesktop.org > [mailto:mesa-dev-bounces+zhigang.gong=linux.intel.com@lists.freedeskto > p.org] On Behalf Of Brian Paul > Sent: Thursday, February 16, 2012 10:38 PM > To: Kenneth Graunke > Cc: mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [PATCH v3 2/2] GLX_TLS: use TLS macros when > define those TLS variables. > > On 02/16/2012 01:42 AM, Kenneth Graunke wrote: > > On 02/15/2012 04:58 AM, tf (mobile) wrote: > >> Personally i don't care much about non-autoconf builds, but as this > >> relies on a -DTLS= setting during configuration time, it will break > >> non-ac builds (which need tls), no? > >> > >> Other than that, LGTM. > >> > >> -tom > > > > That's okay, we've already broken non-automake builds. They're going > > away at last. We should just go ahead and delete the old configs at > > some point. > > Please don't do that w/out fair warning. I'd like to verify a few things with > automake (osmesa, static lib builds, etc.) first. I'll try to do that in my > spare time, but I haven't had much lately. > > -Brian > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will make a segment failed. Signed-off-by: Wang YanQing --- src/glx/dri_common.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index e7dba5a..6122d32 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -376,6 +376,12 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) pdraw = psc->driScreen->createDrawable(psc, glxDrawable, glxDrawable, gc->config); + + if (pdraw == NULL) { + fprintf(stderr, "failed to create drawable\n"); + return NULL; + } + if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) { (*pdraw->destroyDrawable) (pdraw); return NULL; -- 1.7.9.2.315.g25a78 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glsl: Don't require gl_Position to be written in GLSL 1.40.
--- src/glsl/linker.cpp | 35 ++- 1 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 39169aa..471525e 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -258,11 +258,36 @@ validate_vertex_shader_executable(struct gl_shader_program *prog, if (shader == NULL) return true; - find_assignment_visitor find("gl_Position"); - find.run(shader->ir); - if (!find.variable_found()) { - linker_error(prog, "vertex shader does not write to `gl_Position'\n"); - return false; + /* From the GLSL 1.10 spec, page 48: +* +* "The variable gl_Position is available only in the vertex +* language and is intended for writing the homogeneous vertex +* position. All executions of a well-formed vertex shader +* executable must write a value into this variable. [...] The +* variable gl_Position is available only in the vertex +* language and is intended for writing the homogeneous vertex +* position. All executions of a well-formed vertex shader +* executable must write a value into this variable." +* +* while in GLSL 1.40 this text is changed to: +* +* "The variable gl_Position is available only in the vertex +* language and is intended for writing the homogeneous vertex +* position. It can be written at any time during shader +* execution. It may also be read back by a vertex shader +* after being written. This value will be used by primitive +* assembly, clipping, culling, and other fixed functionality +* operations, if present, that operate on primitives after +* vertex processing has occurred. Its value is undefined if +* the vertex shader executable does not write gl_Position." +*/ + if (prog->Version < 140) { + find_assignment_visitor find("gl_Position"); + find.run(shader->ir); + if (!find.variable_found()) { +linker_error(prog, "vertex shader does not write to `gl_Position'\n"); +return false; + } } prog->Vert.ClipDistanceArraySize = 0; -- 1.7.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 08/13] mesa: rewrite/consolidate code in _mesa_test_texobj_completeness()
On Sun, 18 Mar 2012 10:49:24 -0600, Brian Paul wrote: > Merge the mipmap level checking code that was separate cases for 1D, > 2D, 3D and CUBE before. > - if (img->_BaseFormat == GL_DEPTH_COMPONENT) { > - incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D > tex"); > - return; > - } [...] > - /* Don't support GL_DEPTH_COMPONENT for cube maps */ > - if (ctx->VersionMajor < 3 && > !ctx->Extensions.EXT_gpu_shader4) { > - if (t->Image[face][i]->_BaseFormat == > GL_DEPTH_COMPONENT) { > -incomplete(t, "GL_DEPTH_COMPONENT only works with > 1/2D tex"); > -return; > - } > - } It was a surprise tosee these two blocks be dropped. However, it looks totally safe: texture image creation already errors out in these cases, so we shouldn't have any reason to check for it at completeness time. > - /* check that all six images have same size */ > - if (t->Image[face][i]->Width2 != width || > - t->Image[face][i]->Height2 != height) { > + > + /* Extra checks for cube textures */ > + if (face > 0) { > + /* check that cube faces are the same size */ > + if (img->Width2 != t->Image[0][i]->Width2 || > + img->Height2 != t->Image[0][i]->Height2) { >incomplete(t, "CubeMap Image[n][i] bad size"); >return; > } I thought this testing might be wrong, since we're not checking that cube faces have width == height. That's also tested at image creation time, though, so it's true at this point (and so, technically, we wouldn't even need to test for Height2s matching up) pgp5B8wTjiHKV.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev