[Mesa-dev] [Bug 84145] UE4: Realistic Rendering Demo render blue
https://bugs.freedesktop.org/show_bug.cgi?id=84145 --- Comment #7 from Tapani Pälli lem...@gmail.com --- IMO this not a Mesa core bug as the demo renders correctly on Intel. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 11/15] radeonsi: don't snoop currently-bound GS shader when compiling ES
On 20.09.2014 05:17, Marek Olšák wrote: + assert(0 unreachable); You can use: assert(!unreachable); Either way though, the series is Reviewed-by: Michel Dänzer michel.daen...@amd.com -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 04/17] auxiliary/vl: split out into a separate static library
Am 22.09.2014 um 01:44 schrieb Emil Velikov: Avoid building the relatively large object every time and forcing on the non-vl targets. This gives us the following size improvement textdata bss dec hex filename 5898697 189212 1977864 8065773 7b12ed before/nouveau_dri.so 5771203 189228 391176 6351607 60eaf7 after/nouveau_dri.so Other targets (gbm, xa) are likely to exhibit similar savings. v2: Fix the 'pipe-loader' targets. Signed-off-by: Emil Velikov emil.l.veli...@gmail.com That's exactly how I always wanted to do it, just never found the time to actually look into it. Thanks a lot for doing this, patch is Reviewed-by: Christian König christian.koe...@amd.com --- configure.ac | 15 --- src/gallium/auxiliary/Makefile.am| 23 src/gallium/auxiliary/Makefile.sources | 39 +--- src/gallium/state_trackers/omx/Makefile.am | 3 ++- src/gallium/state_trackers/vdpau/Makefile.am | 4 ++- src/gallium/state_trackers/xvmc/Makefile.am | 6 +++-- src/gallium/targets/omx/Makefile.am | 12 - src/gallium/targets/pipe-loader/Makefile.am | 11 ++-- src/gallium/targets/vdpau/Makefile.am| 13 -- src/gallium/targets/xvmc/Makefile.am | 11 +++- 10 files changed, 96 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index 0cfe970..7e15911 100644 --- a/configure.ac +++ b/configure.ac @@ -1413,23 +1413,30 @@ if test -n $with_gallium_drivers -a x$with_gallium_drivers != xswrast; then fi fi +if test x$enable_xvmc = xyes -o \ +x$enable_vdpau = xyes -o \ +x$enable_omx = xyes; then +PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED]) +need_gallium_vl=yes +fi +AM_CONDITIONAL(NEED_GALLIUM_VL, test x$need_gallium_vl = xyes) + if test x$enable_xvmc = xyes; then -PKG_CHECK_MODULES([XVMC], [xvmc = $XVMC_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED]) +PKG_CHECK_MODULES([XVMC], [xvmc = $XVMC_REQUIRED]) GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS xvmc enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_XVMC, test x$enable_xvmc = xyes) if test x$enable_vdpau = xyes; then -PKG_CHECK_MODULES([VDPAU], [vdpau = $VDPAU_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED], - [VDPAU_LIBS=`$PKG_CONFIG --libs x11-xcb xcb xcb-dri2`]) +PKG_CHECK_MODULES([VDPAU], [vdpau = $VDPAU_REQUIRED]) GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS vdpau enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_VDPAU, test x$enable_vdpau = xyes) if test x$enable_omx = xyes; then -PKG_CHECK_MODULES([OMX], [libomxil-bellagio = $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED]) +PKG_CHECK_MODULES([OMX], [libomxil-bellagio = $LIBOMXIL_BELLAGIO_REQUIRED]) GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS omx enable_gallium_loader=$enable_shared_pipe_drivers fi diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am index 4d8ba89..e9b027a 100644 --- a/src/gallium/auxiliary/Makefile.am +++ b/src/gallium/auxiliary/Makefile.am @@ -46,3 +46,26 @@ indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv $(AM_V_at)$(MKDIR_P) util $(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv $@ + + +if NEED_GALLIUM_VL + +noinst_LTLIBRARIES += libgalliumvl.la + +libgalliumvl_la_CFLAGS = \ + $(AM_CFLAGS) \ + $(VL_CFLAGS) \ + $(LIBDRM_CFLAGS) \ + $(GALLIUM_PIPE_LOADER_DEFINES) \ + -DPIPE_SEARCH_DIR=\$(libdir)/gallium-pipe\ + +if HAVE_GALLIUM_STATIC_TARGETS +libgalliumvl_la_CFLAGS += \ + -DGALLIUM_STATIC_TARGETS=1 + +endif # HAVE_GALLIUM_STATIC_TARGETS + +libgalliumvl_la_SOURCES = \ + $(VL_SOURCES) + +endif diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 58d8af7..5f99d24 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -143,20 +143,41 @@ C_SOURCES := \ util/u_transfer.c \ util/u_resource.c \ util/u_upload_mgr.c \ - util/u_vbuf.c \ - vl/vl_csc.c \ + util/u_vbuf.c + +VL_SOURCES := \ vl/vl_compositor.c \ + vl/vl_compositor.h \ + vl/vl_csc.c \ + vl/vl_csc.h \ + vl/vl_decoder.c \ + vl/vl_decoder.h \ + vl/vl_defines.h \ + vl/vl_deint_filter.c \ + vl/vl_deint_filter.h \ + vl/vl_idct.c \ + vl/vl_idct.h \ vl/vl_matrix_filter.c \ + vl/vl_matrix_filter.h \ + vl/vl_mc.c \ + vl/vl_mc.h \ vl/vl_median_filter.c \ -
Re: [Mesa-dev] [PATCH 12/17] gallium/r300, r600, radeonsi: add automake target 'templates'
Am 22.09.2014 um 01:44 schrieb Emil Velikov: Rather than duplicating the libdeps, extra define... all over the targets, define them only once and use when applicable. Signed-off-by: Emil Velikov emil.l.veli...@gmail.com Do I get it right that this also allows for relatively easy definition of specialized targets? E.g. what we might want to do is providing Ubuntu/Debian packages with only the AMD drivers compiled into a specialized dri_radeon.so etc... The patch itself looks good to be, but I'm not an expert on automake. So it is Acked-by: Christian König christian.koe...@amd.com --- src/gallium/drivers/r300/Automake.inc | 18 + src/gallium/drivers/r600/Automake.inc | 16 src/gallium/drivers/radeonsi/Automake.inc | 16 src/gallium/targets/dri/Makefile.am| 39 --- src/gallium/targets/egl-static/Makefile.am | 42 +- src/gallium/targets/gbm/Makefile.am| 37 -- src/gallium/targets/omx/Makefile.am| 34 +++- src/gallium/targets/vdpau/Makefile.am | 36 +++-- src/gallium/targets/xvmc/Makefile.am | 13 +++-- 9 files changed, 77 insertions(+), 174 deletions(-) create mode 100644 src/gallium/drivers/r300/Automake.inc create mode 100644 src/gallium/drivers/r600/Automake.inc create mode 100644 src/gallium/drivers/radeonsi/Automake.inc diff --git a/src/gallium/drivers/r300/Automake.inc b/src/gallium/drivers/r300/Automake.inc new file mode 100644 index 000..6a8d4a7 --- /dev/null +++ b/src/gallium/drivers/r300/Automake.inc @@ -0,0 +1,18 @@ +if HAVE_GALLIUM_R300 + +TARGET_DRIVERS += r300 +TARGET_CPPFLAGS += -DGALLIUM_R300 +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/drivers/r300/libr300.la \ + $(RADEON_LIBS) \ + $(INTEL_LIBS) + +if !HAVE_OPENGL +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/drivers/r300/libr300-helper.la +endif + +TARGET_RADEON_WINSYS ?= \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +endif diff --git a/src/gallium/drivers/r600/Automake.inc b/src/gallium/drivers/r600/Automake.inc new file mode 100644 index 000..014f415 --- /dev/null +++ b/src/gallium/drivers/r600/Automake.inc @@ -0,0 +1,16 @@ +if HAVE_GALLIUM_R600 + +TARGET_DRIVERS += r600 +TARGET_CPPFLAGS += -DGALLIUM_R600 +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/drivers/r600/libr600.la \ + $(RADEON_LIBS) \ + $(LIBDRM_LIBS) + +TARGET_RADEON_WINSYS ?= \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +TARGET_RADEON_COMMON ?= \ + $(top_builddir)/src/gallium/drivers/radeon/libradeon.la + +endif diff --git a/src/gallium/drivers/radeonsi/Automake.inc b/src/gallium/drivers/radeonsi/Automake.inc new file mode 100644 index 000..3f212b3 --- /dev/null +++ b/src/gallium/drivers/radeonsi/Automake.inc @@ -0,0 +1,16 @@ +if HAVE_GALLIUM_RADEONSI + +TARGET_DRIVERS += radeonsi +TARGET_CPPFLAGS += -DGALLIUM_RADEONSI +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \ + $(RADEON_LIBS) \ + $(LIBDRM_LIBS) + +TARGET_RADEON_WINSYS ?= \ + $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +TARGET_RADEON_COMMON ?= \ + $(top_builddir)/src/gallium/drivers/radeon/libradeon.la + +endif diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index cf4a025..0143694 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -74,39 +74,9 @@ include $(top_srcdir)/src/gallium/drivers/ilo/Automake.inc include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc -if NEED_RADEON_DRM_WINSYS -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la -endif - -if HAVE_GALLIUM_RADEON_COMMON -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/drivers/radeon/libradeon.la -endif - -if HAVE_GALLIUM_R300 -MEGADRIVERS += r300 -STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300 -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/drivers/r300/libr300.la \ - $(RADEON_LIBS) -endif - -if HAVE_GALLIUM_R600 -MEGADRIVERS += r600 -STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600 -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/drivers/r600/libr600.la \ - $(RADEON_LIBS) -endif - -if HAVE_GALLIUM_RADEONSI -MEGADRIVERS += radeonsi -STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \ - $(RADEON_LIBS) -endif +include $(top_srcdir)/src/gallium/drivers/r300/Automake.inc +include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc +include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc include $(top_srcdir)/src/gallium/drivers/svga/Automake.inc @@ -148,7 +118,8 @@ if HAVE_GALLIUM_STATIC_TARGETS
[Mesa-dev] [Bug 84145] UE4: Realistic Rendering Demo render blue
https://bugs.freedesktop.org/show_bug.cgi?id=84145 --- Comment #8 from Michel Dänzer mic...@daenzer.net --- (In reply to comment #7) IMO this not a Mesa core bug as the demo renders correctly on Intel. We're also using the 'Mesa core' component for Gallium state tracker bugs. The bisected commit only changes state tracker code, no driver specific code. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH RESEND2 v3 0/3] add KHR_debug for gles contexts
Resend no2... On 31/08/14 20:21, Matthew Waters wrote: v3: - fix up the EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR check v2: - replace = with |= - remove offset=assign from the api xml Matthew Waters (3): egl: rework handling EGL_CONTEXT_FLAGS for ES debug contexts glapi: add function pointers for KHR_debug for gles main/get: make KHR_debug enums available everywhere src/egl/main/eglcontext.c | 51 --- src/mapi/glapi/gen/KHR_debug.xml| 73 + src/mesa/drivers/dri/common/dri_util.c | 17 src/mesa/main/extensions.c | 2 +- src/mesa/main/get_hash_params.py| 24 +-- src/mesa/main/tests/dispatch_sanity.cpp | 25 +++ 6 files changed, 156 insertions(+), 36 deletions(-) signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radeonsi: fix CS tracing and remove excessive CS dumping
I'm afraid I don't really understand how this stuff works. I hope Jerome or someone else can review it. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] radeonsi/compute: directly emit CONTEXT_CONTROL
The series looks good to me, but Tom should probably take a look as well. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 84145] UE4: Realistic Rendering Demo render blue
https://bugs.freedesktop.org/show_bug.cgi?id=84145 --- Comment #9 from Tapani Pälli lem...@gmail.com --- (In reply to comment #8) (In reply to comment #7) IMO this not a Mesa core bug as the demo renders correctly on Intel. We're also using the 'Mesa core' component for Gallium state tracker bugs. The bisected commit only changes state tracker code, no driver specific code. ok cool -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 01/17] gallium/r300: remove obsolete declaration
Reviewed-by: Marek Olšák marek.ol...@amd.com Marek On Mon, Sep 22, 2014 at 1:43 AM, Emil Velikov emil.l.veli...@gmail.com wrote: The definition of rc_pair_regalloc_inputs_only() is no longer around so drop the declaration. Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- src/gallium/drivers/r300/compiler/radeon_program_pair.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gallium/drivers/r300/compiler/radeon_program_pair.h b/src/gallium/drivers/r300/compiler/radeon_program_pair.h index 085ff99..22a519a 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_pair.h +++ b/src/gallium/drivers/r300/compiler/radeon_program_pair.h @@ -132,7 +132,6 @@ struct radeon_pair_handler; void rc_pair_translate(struct radeon_compiler *cc, void *user); void rc_pair_schedule(struct radeon_compiler *cc, void *user); void rc_pair_regalloc(struct radeon_compiler *cc, void *user); -void rc_pair_regalloc_inputs_only(struct radeon_compiler *cc, void *user); void rc_pair_remove_dead_sources(struct radeon_compiler *c, void *user); /*@}*/ -- 2.1.0 ___ 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] mesa: Remove duplicate _mesa_{init, free}_shader_state prototypes.
Reviewed-by: Tapani Pälli tapani.pa...@intel.com On 09/21/2014 09:39 PM, Matt Turner wrote: --- src/mesa/main/shaderobj.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h index fae8be8..d72919c 100644 --- a/src/mesa/main/shaderobj.h +++ b/src/mesa/main/shaderobj.h @@ -94,13 +94,6 @@ _mesa_free_shader_program_data(struct gl_context *ctx, extern void _mesa_init_shader_object_functions(struct dd_function_table *driver); -extern void -_mesa_init_shader_state(struct gl_context *ctx); - -extern void -_mesa_free_shader_state(struct gl_context *ctx); - - static inline gl_shader_stage _mesa_shader_enum_to_shader_stage(GLenum v) { ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glsl: Structures must have same name to be considered same type.
From: Kalyan Kondapally kalyan.kondapa...@intel.com According to GLSL(4.2) and GLSL-ES (1.0, 3.0) spec, Structures must have the same name to be considered same type. We currently ignore the name check while checking if two records are same. This patch fixes this. Patch fixes failing tests in WebGL conformance test 'shaders-with-uniform-structs' when running Chrome on OpenGL ES. v2: Do not force name comparison with unnamed types (Tapani) Signed-off-by: Kalyan Kondapally kalyan.kondapa...@intel.com Signed-off-by: Tapani Pälli tapani.pa...@intel.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83934 --- src/glsl/glsl_types.cpp | 14 ++ src/glsl/glsl_types.h | 8 2 files changed, 22 insertions(+) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 66e9b13..4f8bb62 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -490,6 +490,20 @@ glsl_type::record_compare(const glsl_type *b) const if (this-interface_packing != b-interface_packing) return false; + /* From the GLSL 4.20 specification (Sec 4.2): +* +* Structures must have the same name, sequence of type names, and +* type definitions, and field names to be considered the same type. +* +* GLSL ES behaves the same (Ver 1.00 Sec 4.2.4, Ver 3.00 Sec 4.2.5). +* +* Note that we cannot force type name check when comparing unnamed +* structure types, these have a unique name assigned during parsing. +*/ + if (!(this-is_anonymous() b-is_anonymous())) + if (strcmp(this-name, b-name) != 0) + return false; + for (unsigned i = 0; i this-length; i++) { if (this-fields.structure[i].type != b-fields.structure[i].type) return false; diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index d545533..9693c80 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -486,6 +486,14 @@ struct glsl_type { } /** +* Query if a type is unnamed/anonymous (named by the parser) +*/ + bool is_anonymous() const + { + return !strncmp(name, #anon, 5); + } + + /** * Get the type stripped of any arrays * * \return -- 1.9.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 12/17] gallium/r300, r600, radeonsi: add automake target 'templates'
On 22/09/14 09:29, Christian König wrote: Am 22.09.2014 um 01:44 schrieb Emil Velikov: Rather than duplicating the libdeps, extra define... all over the targets, define them only once and use when applicable. Signed-off-by: Emil Velikov emil.l.veli...@gmail.com Do I get it right that this also allows for relatively easy definition of specialized targets? E.g. what we might want to do is providing Ubuntu/Debian packages with only the AMD drivers compiled into a specialized dri_radeon.so etc... This patch makes adding/removing driver support for a target a single liner, rather than 15+ lines of boilerplate. Ex. Want to add radeonsi support for xvmc ? Add the following line: include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc If you're wondering on a custom/updated dri_radeon, this series may be irrelevant as I assume that you'll enable only the relevant gallium drivers at configure time. Let me know if you're looking for something more elaborate and I'll see what can be done :) Thanks Emil The patch itself looks good to be, but I'm not an expert on automake. So it is Acked-by: Christian König christian.koe...@amd.com --- src/gallium/drivers/r300/Automake.inc | 18 + src/gallium/drivers/r600/Automake.inc | 16 src/gallium/drivers/radeonsi/Automake.inc | 16 src/gallium/targets/dri/Makefile.am| 39 --- src/gallium/targets/egl-static/Makefile.am | 42 +- src/gallium/targets/gbm/Makefile.am| 37 -- src/gallium/targets/omx/Makefile.am| 34 +++- src/gallium/targets/vdpau/Makefile.am | 36 +++-- src/gallium/targets/xvmc/Makefile.am | 13 +++-- 9 files changed, 77 insertions(+), 174 deletions(-) create mode 100644 src/gallium/drivers/r300/Automake.inc create mode 100644 src/gallium/drivers/r600/Automake.inc create mode 100644 src/gallium/drivers/radeonsi/Automake.inc diff --git a/src/gallium/drivers/r300/Automake.inc b/src/gallium/drivers/r300/Automake.inc new file mode 100644 index 000..6a8d4a7 --- /dev/null +++ b/src/gallium/drivers/r300/Automake.inc @@ -0,0 +1,18 @@ +if HAVE_GALLIUM_R300 + +TARGET_DRIVERS += r300 +TARGET_CPPFLAGS += -DGALLIUM_R300 +TARGET_LIB_DEPS += \ +$(top_builddir)/src/gallium/drivers/r300/libr300.la \ +$(RADEON_LIBS) \ +$(INTEL_LIBS) + +if !HAVE_OPENGL +TARGET_LIB_DEPS += \ +$(top_builddir)/src/gallium/drivers/r300/libr300-helper.la +endif + +TARGET_RADEON_WINSYS ?= \ +$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +endif diff --git a/src/gallium/drivers/r600/Automake.inc b/src/gallium/drivers/r600/Automake.inc new file mode 100644 index 000..014f415 --- /dev/null +++ b/src/gallium/drivers/r600/Automake.inc @@ -0,0 +1,16 @@ +if HAVE_GALLIUM_R600 + +TARGET_DRIVERS += r600 +TARGET_CPPFLAGS += -DGALLIUM_R600 +TARGET_LIB_DEPS += \ +$(top_builddir)/src/gallium/drivers/r600/libr600.la \ +$(RADEON_LIBS) \ +$(LIBDRM_LIBS) + +TARGET_RADEON_WINSYS ?= \ +$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +TARGET_RADEON_COMMON ?= \ +$(top_builddir)/src/gallium/drivers/radeon/libradeon.la + +endif diff --git a/src/gallium/drivers/radeonsi/Automake.inc b/src/gallium/drivers/radeonsi/Automake.inc new file mode 100644 index 000..3f212b3 --- /dev/null +++ b/src/gallium/drivers/radeonsi/Automake.inc @@ -0,0 +1,16 @@ +if HAVE_GALLIUM_RADEONSI + +TARGET_DRIVERS += radeonsi +TARGET_CPPFLAGS += -DGALLIUM_RADEONSI +TARGET_LIB_DEPS += \ +$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \ +$(RADEON_LIBS) \ +$(LIBDRM_LIBS) + +TARGET_RADEON_WINSYS ?= \ +$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la + +TARGET_RADEON_COMMON ?= \ +$(top_builddir)/src/gallium/drivers/radeon/libradeon.la + +endif diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index cf4a025..0143694 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -74,39 +74,9 @@ include $(top_srcdir)/src/gallium/drivers/ilo/Automake.inc include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc -if NEED_RADEON_DRM_WINSYS -STATIC_TARGET_LIB_DEPS += \ -$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la -endif - -if HAVE_GALLIUM_RADEON_COMMON -STATIC_TARGET_LIB_DEPS += \ -$(top_builddir)/src/gallium/drivers/radeon/libradeon.la -endif - -if HAVE_GALLIUM_R300 -MEGADRIVERS += r300 -STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300 -STATIC_TARGET_LIB_DEPS += \ -$(top_builddir)/src/gallium/drivers/r300/libr300.la \ -$(RADEON_LIBS) -endif - -if HAVE_GALLIUM_R600 -MEGADRIVERS += r600 -STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600 -STATIC_TARGET_LIB_DEPS += \ -
Re: [Mesa-dev] [PATCH 2/2] st/xa: silence unused variable warning
Thanks Brian. For both patches are Reviewed-by: Emil Velikov emil.l.veli...@gmail.com On 18/09/14 17:22, Brian Paul wrote: --- src/gallium/state_trackers/xa/xa_tracker.c |1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index 268d56b..f69ac8e 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.c +++ b/src/gallium/state_trackers/xa/xa_tracker.c @@ -148,6 +148,7 @@ xa_tracker_create(int drm_fd) #if GALLIUM_STATIC_TARGETS xa-screen = dd_create_screen(drm_fd); +(void) loader_fd; /* silence unused var warning */ #else loader_fd = dup(drm_fd); if (loader_fd == -1) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 84145] UE4: Realistic Rendering Demo render blue
https://bugs.freedesktop.org/show_bug.cgi?id=84145 --- Comment #10 from Ilia Mirkin imir...@alum.mit.edu --- (In reply to comment #6) Ilia, any ideas? Oh neat. I was seeing that render blue as well, but was assuming it was due to some spill errors that I had only semi-fixed. The interesting thing to note is that the commit in question doesn't actually enable ARB_texture_view on any driver, just sets the stage for it. My guess is that it's due to the st_format.c hunk, but I can't imagine why. Oh hrm. Perhaps this hunk, I can't remember what that did, but it seems potentially dodgy: @@ -970,7 +971,10 @@ st_GetTexImage(struct gl_context * ctx, * - Luminance alpha must be returned as (L,0,0,A). * - Intensity must be returned as (I,0,0,1) */ - src_format = util_format_linear(src-format); + if (stObj-surface_based) + src_format = util_format_linear(stObj-surface_format); + else + src_format = util_format_linear(src-format); src_format = util_format_luminance_to_red(src_format); src_format = util_format_intensity_to_red(src_format); -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/4] mesa: Add helper function to see if we have a float depth format.
Am 21.09.2014 16:40, schrieb Mathias Fröhlich: Hi, On Thursday, September 18, 2014 03:56:11 Roland Scheidegger wrote: I agree it is something which would be nice to have in mesa, however I'm not really a big proponent of implementing some half-baked bogus mess extension, which is further more completely different to what the only available implementation actually does. Me neither, I initially thought that it's just much more clear what to do. Just to make this clear, are you saying that blob really clamps all float depth values to [0,1] when - using teximage2d - writing depth from fragment shader - using interpolated depth (with depth_clamp enabled maybe?) I have never tried the teximage2d claims. But I have tried with and without writing the gl_FragDepth. I have now rechecked this on nvidia and the amd blob. I have to correct the claim somehow - I previously probably only tested gl_FragDepth clamping with depthrange set to [0, 1]. But actual behavior is even nicer, as NVidia does not make any difference between the two texture formats in its behavior. Everything is clamped to be within min(zNear, zFar) and max(zNear, zFar) of glDepthRangedNV(zNear, zFar). It does not matter if you write the gl_FragmentDepth or use the fixed function depth processing. And this is independent of the depth texture format being GL_DEPTH_COMPONENT32F or GL_DEPTH_COMPONENT32F_NV. This is what d3d10 specifies, so I guess this behavior isn't all that surprising. So I think I'm missing something why can you even clear the depth buffer to a value outside [0,1] then? The fixed function depth values are just routed through and they utilize in any case the whole range between near and far. Or, I may not get your question right ... Because you said the values are clamped to [0,1] in the depth buffer I thought it wouldn't make sense. But you clarified it that it is indeed just clamped to near/far range so yes this makes sense. In any case, I'm not really against this, though I'm not really the right person to judge this in any case. I think though at the very least there should probably be big warning comments in the code mentioning it doesn't actually implement what the extension says and why. It would probably be better though if nvidia would fix up their extension spec (or failing that, someone could make some proper non-vendor extension). I wonder what AMD is doing on their blob. I suspect though they just do the different non-clamping entry points... It took some work to convince piglit to think centos 6 is a recent enough system. I have now within piglit also done a test program to explore the behavior of the implementations. That's attached. So, it looks like the AMD blob changes it's behavior based on the internal format. The _NV variants behave the same like the nvidia driver treats them. The ARB internal formats, behave like if the glDepthRangedNV call had behaved like glDepthRange. There is a define in the attached test that makes either the amd or the nvidia variant succeed. The nvidia behavior is more like the last addition to the NV_ spec that tells that there should be no difference between the non _NV float formats. The AMD blob more tries to model one of the contradicting difference in the specs. The nvidia behavior looks like the least intrusive for the driver. You get the GL standard behavior in the case of the non NV API entry points since you are not able to go beyond [0, 1] in the depth range. But if you manage to get near and far values beyond [0, 1] into the driver by using glDepthRangedNV, you get everything clamped to these. Yes, that makes sense, except I believe it's not quite true. So, with ARB_depth_buffer_float, you can never get values outside [0,1] in the depth buffer no matter what. However, with NV_depth_buffer_float and clamping to near/far range this is not true even if you don't use the new entry points - e.g. polygonoffset could get you values outside [0,1] (*), as could TexImage2D and probably a million other things, thus this would break backward compatibility. Though reading the interaction with ARB_depth_buffer_float again (optionally relaxes the clamping behavior of ARB_depth_buffer_float when using the NV entry points) I'm really confused. Does that mean you only get the non-clamping behavior if you've used the new entry points (so the implementation switches behavior depending on if the last depthrange called was an nv one or not??? Now that would be just crazy). This is imho really a big big mess, and apparently amd interpreted it differently to nvidia. There doesn't seem to be a way to actually do it right. Maybe nvidia didn't care about backward compatibility (because with just the ARB extension, float depth buffers are kinda useless anyway, and of course with fixed function you still get clamping in any case). (*) according to OGL rules. I suspect though what nvidia actually does is d3d10 behavior, that
Re: [Mesa-dev] [PATCH 1/2] mesa: don't set ES versions to GLSLVersion in _mesa_init_constants
For both, Reviewed-by: Brian Paul bri...@vmware.com On 09/19/2014 01:03 PM, Marek Olšák wrote: From: Marek Olšák marek.ol...@amd.com No place in Mesa expects an ES version there. Drivers don't even set it like this. --- src/mesa/main/context.c | 12 ++-- src/mesa/main/mtypes.h | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 682b9c7..53fb9c6 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -642,16 +642,8 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api) consts-MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; /* Shading language version */ - if (api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) { - consts-GLSLVersion = 120; - _mesa_override_glsl_version(consts); - } - else if (api == API_OPENGLES2) { - consts-GLSLVersion = 100; - } - else if (api == API_OPENGLES) { - consts-GLSLVersion = 0; /* GLSL not supported */ - } + consts-GLSLVersion = 120; + _mesa_override_glsl_version(consts); /* GL_ARB_framebuffer_object */ consts-MaxSamples = 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 553a216..7c237bd 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3452,7 +3452,7 @@ struct gl_constants GLuint MaxGeometryOutputVertices; GLuint MaxGeometryTotalOutputComponents; - GLuint GLSLVersion; /** GLSL version supported (ex: 120 = 1.20) */ + GLuint GLSLVersion; /** Desktop GLSL version supported (ex: 120 = 1.20) */ /** * Changes default GLSL extension behavior from error to warn. It's out ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] st/mesa: drop dependence on API profile in st_init_extensions
This series looks good too. Reviewed-by: Brian Paul bri...@vmware.com On 09/19/2014 01:08 PM, Marek Olšák wrote: From: Marek Olšák marek.ol...@amd.com The extensions and limits being set in the conditional block are core-only anyway and don't have any effect on other profiles. --- src/mesa/state_tracker/st_context.c| 2 +- src/mesa/state_tracker/st_extensions.c | 20 +--- src/mesa/state_tracker/st_extensions.h | 1 - src/mesa/state_tracker/st_manager.c| 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 768a667..1723513 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -242,7 +242,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, /* GL limits and extensions */ st_init_limits(st-pipe-screen, ctx-Const, ctx-Extensions); - st_init_extensions(st-pipe-screen, ctx-API, ctx-Const, + st_init_extensions(st-pipe-screen, ctx-Const, ctx-Extensions, st-options, ctx-Mesa_DXTn); /* Enable shader-based fallbacks for ARB_color_buffer_float if needed. */ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index c7bc0ca..681723a 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -407,7 +407,6 @@ get_max_samples_for_formats(struct pipe_screen *screen, * Some fine tuning may still be needed. */ void st_init_extensions(struct pipe_screen *screen, -gl_api api, struct gl_constants *consts, struct gl_extensions *extensions, struct st_config_options *options, @@ -844,17 +843,16 @@ void st_init_extensions(struct pipe_screen *screen, consts-DisableVaryingPacking = GL_TRUE; } - if (api == API_OPENGL_CORE) { - consts-MaxViewports = screen-get_param(screen, PIPE_CAP_MAX_VIEWPORTS); - if (consts-MaxViewports = 16) { - consts-ViewportBounds.Min = -16384.0; - consts-ViewportBounds.Max = 16384.0; - extensions-ARB_viewport_array = GL_TRUE; - extensions-ARB_fragment_layer_viewport = GL_TRUE; - if (extensions-AMD_vertex_shader_layer) -extensions-AMD_vertex_shader_viewport_index = GL_TRUE; - } + consts-MaxViewports = screen-get_param(screen, PIPE_CAP_MAX_VIEWPORTS); + if (consts-MaxViewports = 16) { + consts-ViewportBounds.Min = -16384.0; + consts-ViewportBounds.Max = 16384.0; + extensions-ARB_viewport_array = GL_TRUE; + extensions-ARB_fragment_layer_viewport = GL_TRUE; + if (extensions-AMD_vertex_shader_layer) + extensions-AMD_vertex_shader_viewport_index = GL_TRUE; } + if (consts-MaxProgramTextureGatherComponents 0) extensions-ARB_texture_gather = GL_TRUE; diff --git a/src/mesa/state_tracker/st_extensions.h b/src/mesa/state_tracker/st_extensions.h index 8d2724d..faff11f 100644 --- a/src/mesa/state_tracker/st_extensions.h +++ b/src/mesa/state_tracker/st_extensions.h @@ -38,7 +38,6 @@ extern void st_init_limits(struct pipe_screen *screen, struct gl_extensions *extensions); extern void st_init_extensions(struct pipe_screen *screen, - gl_api api, struct gl_constants *consts, struct gl_extensions *extensions, struct st_config_options *options, diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 7bc3326..df6de73 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -928,7 +928,7 @@ static unsigned get_version(struct pipe_screen *screen, _mesa_init_extensions(extensions); st_init_limits(screen, consts, extensions); - st_init_extensions(screen, api, consts, extensions, options, GL_TRUE); + st_init_extensions(screen, consts, extensions, options, GL_TRUE); return _mesa_get_version(extensions, consts, api); } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glsl: use ptrdiff_t cast to silence g++ sign warning
--- src/glsl/link_uniforms.cpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 258d279..a6683a0 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -749,7 +749,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if (end == NULL) continue; - if (l != (end - begin)) + if ((ptrdiff_t) l != (end - begin)) continue; if (strncmp(var-name, begin, l) == 0) { -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] gallium: update comment for enum pipe_format
--- src/gallium/include/pipe/p_format.h |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index b007229..3f505f2 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -36,13 +36,8 @@ extern C { #include p_config.h /** - * Texture/surface image formats (preliminary) + * Formats for textures, surfaces and vertex data */ - -/* KW: Added lots of surface formats to support vertex element layout - * definitions, and eventually render-to-vertex-buffer. - */ - enum pipe_format { PIPE_FORMAT_NONE= 0, PIPE_FORMAT_B8G8R8A8_UNORM = 1, -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] gallium: replace pipe_type enum with tgsi_type enum
The only place the enum pipe_type was used is for the TGSI sampler view return type. So make it a TGSI type. --- src/gallium/auxiliary/tgsi/tgsi_build.c|8 src/gallium/auxiliary/tgsi/tgsi_strings.c |3 ++- src/gallium/auxiliary/tgsi/tgsi_strings.h |2 +- src/gallium/auxiliary/tgsi/tgsi_text.c |4 ++-- src/gallium/include/pipe/p_format.h|9 - src/gallium/include/pipe/p_shader_tokens.h | 17 + 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index bef5c75..ffc4c61 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -297,10 +297,10 @@ tgsi_default_declaration_sampler_view(void) struct tgsi_declaration_sampler_view dsv; dsv.Resource = TGSI_TEXTURE_BUFFER; - dsv.ReturnTypeX = PIPE_TYPE_UNORM; - dsv.ReturnTypeY = PIPE_TYPE_UNORM; - dsv.ReturnTypeZ = PIPE_TYPE_UNORM; - dsv.ReturnTypeW = PIPE_TYPE_UNORM; + dsv.ReturnTypeX = TGSI_TYPE_UNORM; + dsv.ReturnTypeY = TGSI_TYPE_UNORM; + dsv.ReturnTypeZ = TGSI_TYPE_UNORM; + dsv.ReturnTypeW = TGSI_TYPE_UNORM; return dsv; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c index 3c108a8..fb19893 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.c +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c @@ -125,7 +125,7 @@ const char *tgsi_property_names[TGSI_PROPERTY_COUNT] = VS_POSITION_WINDOW_SPACE }; -const char *tgsi_type_names[5] = +const char *tgsi_type_names[TGSI_TYPE_COUNT] = { UNORM, SNORM, @@ -195,6 +195,7 @@ tgsi_strings_check(void) STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT); STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX); STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT); + STATIC_ASSERT(Elements(tgsi_type_names) == TGSI_TYPE_COUNT); (void) tgsi_processor_type_names; (void) tgsi_type_names; (void) tgsi_immediate_type_names; diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.h b/src/gallium/auxiliary/tgsi/tgsi_strings.h index 1c37c29..1e96883 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.h +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.h @@ -46,7 +46,7 @@ extern const char *tgsi_texture_names[TGSI_TEXTURE_COUNT]; extern const char *tgsi_property_names[TGSI_PROPERTY_COUNT]; -extern const char *tgsi_type_names[5]; +extern const char *tgsi_type_names[TGSI_TYPE_COUNT]; extern const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT]; diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 7291145..296af2a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1258,7 +1258,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) ++cur; eat_opt_white( cur ); for (j = 0; j 4; ++j) { -for (i = 0; i PIPE_TYPE_COUNT; ++i) { +for (i = 0; i TGSI_TYPE_COUNT; ++i) { if (str_match_nocase_whole(cur, tgsi_type_names[i])) { switch (j) { case 0: @@ -1279,7 +1279,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) break; } } -if (i == PIPE_TYPE_COUNT) { +if (i == TGSI_TYPE_COUNT) { if (j == 0 || j 2) { report_error(ctx, Expected type name); return FALSE; diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 9c02464..b007229 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -35,15 +35,6 @@ extern C { #include p_config.h -enum pipe_type { - PIPE_TYPE_UNORM = 0, - PIPE_TYPE_SNORM, - PIPE_TYPE_SINT, - PIPE_TYPE_UINT, - PIPE_TYPE_FLOAT, - PIPE_TYPE_COUNT -}; - /** * Texture/surface image formats (preliminary) */ diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index 8ab1ea8..b37eb7b 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -192,12 +192,21 @@ struct tgsi_declaration_resource { unsigned Padding : 22; }; +enum tgsi_type { + TGSI_TYPE_UNORM = 0, + TGSI_TYPE_SNORM, + TGSI_TYPE_SINT, + TGSI_TYPE_UINT, + TGSI_TYPE_FLOAT, + TGSI_TYPE_COUNT +}; + struct tgsi_declaration_sampler_view { unsigned Resource: 8; /** one of TGSI_TEXTURE_ */ - unsigned ReturnTypeX : 6; /** one of enum pipe_type */ - unsigned ReturnTypeY : 6; /** one of enum pipe_type */ - unsigned ReturnTypeZ : 6; /** one of enum pipe_type */ - unsigned ReturnTypeW : 6; /** one of enum pipe_type */ + unsigned ReturnTypeX : 6; /** one of enum tgsi_type */ + unsigned ReturnTypeY : 6; /** one of enum
[Mesa-dev] [PATCH 1/3] tgsi: rename TGSI_TYPE_x - TGSI_OPCODE_TYPE_x
To avoid conflicts with coming TGSI_TYPE_x enums. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi.c| 26 - src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c| 57 ++-- src/gallium/auxiliary/tgsi/tgsi_info.c | 14 ++--- src/gallium/auxiliary/tgsi/tgsi_info.h | 12 ++--- src/gallium/drivers/ilo/shader/toy_tgsi.c | 12 ++--- src/gallium/drivers/radeon/radeon_llvm.h |8 +-- .../drivers/radeon/radeon_setup_tgsi_llvm.c|8 +-- 7 files changed, 69 insertions(+), 68 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c index 51cb54c..9464348 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c @@ -315,15 +315,15 @@ lp_build_emit_fetch( if (reg-Register.Absolute) { switch (stype) { - case TGSI_TYPE_FLOAT: - case TGSI_TYPE_DOUBLE: - case TGSI_TYPE_UNTYPED: + case TGSI_OPCODE_TYPE_FLOAT: + case TGSI_OPCODE_TYPE_DOUBLE: + case TGSI_OPCODE_TYPE_UNTYPED: /* modifiers on movs assume data is float */ res = lp_build_emit_llvm_unary(bld_base, TGSI_OPCODE_ABS, res); break; - case TGSI_TYPE_UNSIGNED: - case TGSI_TYPE_SIGNED: - case TGSI_TYPE_VOID: + case TGSI_OPCODE_TYPE_UNSIGNED: + case TGSI_OPCODE_TYPE_SIGNED: + case TGSI_OPCODE_TYPE_VOID: default: /* abs modifier is only legal on floating point types */ assert(0); @@ -333,20 +333,20 @@ lp_build_emit_fetch( if (reg-Register.Negate) { switch (stype) { - case TGSI_TYPE_FLOAT: - case TGSI_TYPE_UNTYPED: + case TGSI_OPCODE_TYPE_FLOAT: + case TGSI_OPCODE_TYPE_UNTYPED: /* modifiers on movs assume data is float */ res = lp_build_negate( bld_base-base, res ); break; - case TGSI_TYPE_DOUBLE: + case TGSI_OPCODE_TYPE_DOUBLE: /* no double build context */ assert(0); break; - case TGSI_TYPE_SIGNED: - case TGSI_TYPE_UNSIGNED: + case TGSI_OPCODE_TYPE_SIGNED: + case TGSI_OPCODE_TYPE_UNSIGNED: res = lp_build_negate( bld_base-int_bld, res ); break; - case TGSI_TYPE_VOID: + case TGSI_OPCODE_TYPE_VOID: default: assert(0); break; @@ -381,7 +381,7 @@ lp_build_emit_fetch_texoffset( struct tgsi_full_src_register reg; unsigned swizzle; LLVMValueRef res; - enum tgsi_opcode_type stype = TGSI_TYPE_SIGNED; + enum tgsi_opcode_type stype = TGSI_OPCODE_TYPE_SIGNED; /* convert offset register to ordinary register so can use normal emit funcs */ memset(reg, 0, sizeof(reg)); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index c0bd7be..d500116 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1148,18 +1148,18 @@ stype_to_fetch(struct lp_build_tgsi_context * bld_base, struct lp_build_context *bld_fetch; switch (stype) { - case TGSI_TYPE_FLOAT: - case TGSI_TYPE_UNTYPED: + case TGSI_OPCODE_TYPE_FLOAT: + case TGSI_OPCODE_TYPE_UNTYPED: bld_fetch = bld_base-base; break; - case TGSI_TYPE_UNSIGNED: + case TGSI_OPCODE_TYPE_UNSIGNED: bld_fetch = bld_base-uint_bld; break; - case TGSI_TYPE_SIGNED: + case TGSI_OPCODE_TYPE_SIGNED: bld_fetch = bld_base-int_bld; break; - case TGSI_TYPE_VOID: - case TGSI_TYPE_DOUBLE: + case TGSI_OPCODE_TYPE_VOID: + case TGSI_OPCODE_TYPE_DOUBLE: default: assert(0); bld_fetch = NULL; @@ -1271,7 +1271,7 @@ emit_fetch_constant( res = lp_build_broadcast_scalar(bld_base-base, scalar); } - if (stype == TGSI_TYPE_SIGNED || stype == TGSI_TYPE_UNSIGNED) { + if (stype == TGSI_OPCODE_TYPE_SIGNED || stype == TGSI_OPCODE_TYPE_UNSIGNED) { struct lp_build_context *bld_fetch = stype_to_fetch(bld_base, stype); res = LLVMBuildBitCast(builder, res, bld_fetch-vec_type, ); } @@ -1332,9 +1332,9 @@ emit_fetch_immediate( res = bld-immediates[reg-Register.Index][swizzle]; } - if (stype == TGSI_TYPE_UNSIGNED) { + if (stype == TGSI_OPCODE_TYPE_UNSIGNED) { res = LLVMBuildBitCast(builder, res, bld_base-uint_bld.vec_type, ); - } else if (stype == TGSI_TYPE_SIGNED) { + } else if (stype == TGSI_OPCODE_TYPE_SIGNED) { res = LLVMBuildBitCast(builder, res, bld_base-int_bld.vec_type, ); } return res; @@ -1389,9 +1389,9 @@ emit_fetch_input( assert(res); - if (stype == TGSI_TYPE_UNSIGNED) { + if (stype == TGSI_OPCODE_TYPE_UNSIGNED) { res = LLVMBuildBitCast(builder, res, bld_base-uint_bld.vec_type, ); - } else if (stype == TGSI_TYPE_SIGNED) { + } else if (stype == TGSI_OPCODE_TYPE_SIGNED) { res = LLVMBuildBitCast(builder, res, bld_base-int_bld.vec_type, );
[Mesa-dev] [PATCH 1/9] tgsi: add prolog() method to tgsi_transform_context
Called when the user can insert new decls, instructions. This could be used in a few places in the 'draw' module. --- src/gallium/auxiliary/tgsi/tgsi_transform.c |7 +++ src/gallium/auxiliary/tgsi/tgsi_transform.h |6 ++ 2 files changed, 13 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c index b16d296..93e5b98 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.c +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c @@ -109,6 +109,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, struct tgsi_transform_context *ctx) { uint procType; + boolean first_instruction = TRUE; /* input shader */ struct tgsi_parse_context parse; @@ -166,10 +167,16 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, struct tgsi_full_instruction *fullinst = parse.FullToken.FullInstruction; +if (first_instruction ctx-prolog) { + ctx-prolog(ctx); +} + if (ctx-transform_instruction) ctx-transform_instruction(ctx, fullinst); else ctx-emit_instruction(ctx, fullinst); + +first_instruction = FALSE; } break; diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h index 8b96664..5ec0719 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.h +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.h @@ -57,6 +57,12 @@ struct tgsi_transform_context struct tgsi_full_property *prop); /** +* Called after last declaration, before first instruction. This is +* where the user might insert new declarations and/or instructions. +*/ + void (*prolog)(struct tgsi_transform_context *ctx); + + /** * Called at end of input program to allow caller to append extra * instructions. Return number of tokens emitted. */ -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 7/9] draw: use new tgsi_transform inst/decl helpers in aaline code
--- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 87 ++--- 1 file changed, 21 insertions(+), 66 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index c8344dd..2f14efe 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -202,7 +202,6 @@ static void aa_transform_prolog(struct tgsi_transform_context *ctx) { struct aa_transform_context *aactx = (struct aa_transform_context *) ctx; - struct tgsi_full_declaration decl; uint i; /* find free sampler */ @@ -226,37 +225,16 @@ aa_transform_prolog(struct tgsi_transform_context *ctx) assert(aactx-texTemp = 0); /* declare new generic input/texcoord */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - /* XXX this could be linear... */ - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; - decl.Semantic.Index = aactx-maxGeneric + 1; - decl.Range.First = - decl.Range.Last = aactx-maxInput + 1; - decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; - ctx-emit_declaration(ctx, decl); + tgsi_transform_input_decl(ctx, aactx-maxInput + 1, + TGSI_SEMANTIC_GENERIC, aactx-maxGeneric + 1, + TGSI_INTERPOLATE_LINEAR); /* declare new sampler */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = - decl.Range.Last = aactx-freeSampler; - ctx-emit_declaration(ctx, decl); + tgsi_transform_sampler_decl(ctx, aactx-freeSampler); /* declare new temp regs */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-texTemp; - ctx-emit_declaration(ctx, decl); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-colorTemp; - ctx-emit_declaration(ctx, decl); + tgsi_transform_temp_decl(ctx, aactx-texTemp); + tgsi_transform_temp_decl(ctx, aactx-colorTemp); } @@ -270,48 +248,25 @@ aa_transform_epilog(struct tgsi_transform_context *ctx) if (aactx-colorOutput != -1) { /* insert texture sampling code for antialiasing. */ - struct tgsi_full_instruction newInst; - - /* TEX */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_TEX; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = aactx-texTemp; - newInst.Instruction.NumSrcRegs = 2; - newInst.Instruction.Texture = TRUE; - newInst.Texture.Texture = TGSI_TEXTURE_2D; - newInst.Src[0].Register.File = TGSI_FILE_INPUT; - newInst.Src[0].Register.Index = aactx-maxInput + 1; - newInst.Src[1].Register.File = TGSI_FILE_SAMPLER; - newInst.Src[1].Register.Index = aactx-freeSampler; - ctx-emit_instruction(ctx, newInst); + + /* TEX texTemp, input_coord, sampler */ + tgsi_transform_tex_2d_inst(ctx, + TGSI_FILE_TEMPORARY, aactx-texTemp, + TGSI_FILE_INPUT, aactx-maxInput + 1, + aactx-freeSampler); /* MOV rgb */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_MOV; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_OUTPUT; - newInst.Dst[0].Register.Index = aactx-colorOutput; - newInst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_XYZ; - newInst.Instruction.NumSrcRegs = 1; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = aactx-colorTemp; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op1_inst(ctx, TGSI_OPCODE_MOV, + TGSI_FILE_OUTPUT, aactx-colorOutput, + TGSI_WRITEMASK_XYZ, + TGSI_FILE_TEMPORARY, aactx-colorTemp); /* MUL alpha */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_MUL; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_OUTPUT; - newInst.Dst[0].Register.Index = aactx-colorOutput; - newInst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_W; - newInst.Instruction.NumSrcRegs = 2; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = aactx-colorTemp; - newInst.Src[1].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[1].Register.Index = aactx-texTemp; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op2_inst(ctx, TGSI_OPCODE_MUL, + TGSI_FILE_OUTPUT,
[Mesa-dev] [PATCH 9/9] draw: use new tgsi_transform inst/decl helpers in pstipple code
--- src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 87 +-- 1 file changed, 19 insertions(+), 68 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 7ef86a6..8f21c46 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -197,8 +197,6 @@ static void pstip_transform_prolog(struct tgsi_transform_context *ctx) { struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx; - struct tgsi_full_declaration decl; - struct tgsi_full_instruction newInst; uint i; int wincoordInput; @@ -226,47 +224,21 @@ pstip_transform_prolog(struct tgsi_transform_context *ctx) if (pctx-wincoordInput 0) { /* declare new position input reg */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_POSITION; - decl.Semantic.Index = 0; - decl.Range.First = - decl.Range.Last = wincoordInput; - decl.Interp.Interpolate = TGSI_INTERPOLATE_LINEAR; /* XXX? */ - ctx-emit_declaration(ctx, decl); + tgsi_transform_input_decl(ctx, wincoordInput, +TGSI_SEMANTIC_POSITION, 1, +TGSI_INTERPOLATE_LINEAR); } /* declare new sampler */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = - decl.Range.Last = pctx-freeSampler; - ctx-emit_declaration(ctx, decl); + tgsi_transform_sampler_decl(ctx, pctx-freeSampler); /* declare new temp regs */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = pctx-texTemp; - ctx-emit_declaration(ctx, decl); + tgsi_transform_temp_decl(ctx, pctx-texTemp); /* emit immediate = {1/32, 1/32, 1, 1} * The index/position of this immediate will be pctx-numImmed */ - { - static const float value[4] = { 1.0/32, 1.0/32, 1.0, 1.0 }; - struct tgsi_full_immediate immed; - uint size = 4; - immed = tgsi_default_full_immediate(); - immed.Immediate.NrTokens = 1 + size; /* one for the token itself */ - immed.u[0].Float = value[0]; - immed.u[1].Float = value[1]; - immed.u[2].Float = value[2]; - immed.u[3].Float = value[3]; - ctx-emit_immediate(ctx, immed); - } + tgsi_transform_immediate_decl(ctx, 1.0/32.0, 1.0/32.0, 1.0, 1.0); /* * Insert new MUL/TEX/KILL_IF instructions at start of program @@ -279,42 +251,21 @@ pstip_transform_prolog(struct tgsi_transform_context *ctx) */ /* MUL texTemp, INPUT[wincoord], 1/32; */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_MUL; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = pctx-texTemp; - newInst.Instruction.NumSrcRegs = 2; - newInst.Src[0].Register.File = TGSI_FILE_INPUT; - newInst.Src[0].Register.Index = wincoordInput; - newInst.Src[1].Register.File = TGSI_FILE_IMMEDIATE; - newInst.Src[1].Register.Index = pctx-numImmed; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op2_inst(ctx, TGSI_OPCODE_MUL, + TGSI_FILE_TEMPORARY, pctx-texTemp, + TGSI_WRITEMASK_XYZW, + TGSI_FILE_INPUT, wincoordInput, + TGSI_FILE_IMMEDIATE, pctx-numImmed); /* TEX texTemp, texTemp, sampler; */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_TEX; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = pctx-texTemp; - newInst.Instruction.NumSrcRegs = 2; - newInst.Instruction.Texture = TRUE; - newInst.Texture.Texture = TGSI_TEXTURE_2D; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = pctx-texTemp; - newInst.Src[1].Register.File = TGSI_FILE_SAMPLER; - newInst.Src[1].Register.Index = pctx-freeSampler; - ctx-emit_instruction(ctx, newInst); - - /* KILL_IF -texTemp; # if -texTemp 0, KILL fragment */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_KILL_IF; - newInst.Instruction.NumDstRegs = 0; - newInst.Instruction.NumSrcRegs = 1; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = pctx-texTemp; - newInst.Src[0].Register.Negate = 1; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_tex_2d_inst(ctx, + TGSI_FILE_TEMPORARY, pctx-texTemp, + TGSI_FILE_TEMPORARY, pctx-texTemp, + pctx-freeSampler); + +
[Mesa-dev] [PATCH 8/9] draw: use new tgsi_transform inst/decl helpers in aapoint code
--- src/gallium/auxiliary/draw/draw_pipe_aapoint.c | 256 +--- 1 file changed, 54 insertions(+), 202 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c index 3f2ef08..7feb49a 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c @@ -169,7 +169,6 @@ aa_transform_prolog(struct tgsi_transform_context *ctx) /* emit our new declarations before the first instruction */ struct aa_transform_context *aactx = (struct aa_transform_context *) ctx; struct tgsi_full_instruction newInst; - struct tgsi_full_declaration decl; const int texInput = aactx-maxInput + 1; int tmp0; uint i; @@ -192,30 +191,13 @@ aa_transform_prolog(struct tgsi_transform_context *ctx) tmp0 = aactx-tmp0; /* declare new generic input/texcoord */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - /* XXX this could be linear... */ - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; - decl.Semantic.Index = aactx-maxGeneric + 1; - decl.Range.First = - decl.Range.Last = texInput; - decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; - ctx-emit_declaration(ctx, decl); + tgsi_transform_input_decl(ctx, texInput, + TGSI_SEMANTIC_GENERIC, aactx-maxGeneric + 1, + TGSI_INTERPOLATE_LINEAR); /* declare new temp regs */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = tmp0; - ctx-emit_declaration(ctx, decl); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-colorTemp; - ctx-emit_declaration(ctx, decl); + tgsi_transform_temp_decl(ctx, tmp0); + tgsi_transform_temp_decl(ctx, aactx-colorTemp); /* * Emit code to compute fragment coverage, kill if outside point radius @@ -228,108 +210,45 @@ aa_transform_prolog(struct tgsi_transform_context *ctx) */ /* MUL t0.xy, tex, tex; # compute x^2, y^2 */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_MUL; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = tmp0; - newInst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_XY; - newInst.Instruction.NumSrcRegs = 2; - newInst.Src[0].Register.File = TGSI_FILE_INPUT; - newInst.Src[0].Register.Index = texInput; - newInst.Src[1].Register.File = TGSI_FILE_INPUT; - newInst.Src[1].Register.Index = texInput; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op2_inst(ctx, TGSI_OPCODE_MUL, + TGSI_FILE_TEMPORARY, tmp0, TGSI_WRITEMASK_XY, + TGSI_FILE_INPUT, texInput, + TGSI_FILE_INPUT, texInput); /* ADD t0.x, t0.x, t0.y; # x^2 + y^2 */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_ADD; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = tmp0; - newInst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_X; - newInst.Instruction.NumSrcRegs = 2; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = tmp0; - newInst.Src[0].Register.SwizzleX = TGSI_SWIZZLE_X; - newInst.Src[1].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[1].Register.Index = tmp0; - newInst.Src[1].Register.SwizzleX = TGSI_SWIZZLE_Y; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op2_swz_inst(ctx, TGSI_OPCODE_ADD, + TGSI_FILE_TEMPORARY, tmp0, TGSI_WRITEMASK_X, + TGSI_FILE_TEMPORARY, tmp0, TGSI_SWIZZLE_X, + TGSI_FILE_TEMPORARY, tmp0, TGSI_SWIZZLE_Y); #if NORMALIZE /* OPTIONAL normalization of length */ /* RSQ t0.x, t0.x; */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_RSQ; - newInst.Instruction.NumDstRegs = 1; - newInst.Dst[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Dst[0].Register.Index = tmp0; - newInst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_X; - newInst.Instruction.NumSrcRegs = 1; - newInst.Src[0].Register.File = TGSI_FILE_TEMPORARY; - newInst.Src[0].Register.Index = tmp0; - ctx-emit_instruction(ctx, newInst); + tgsi_transform_op1_inst(ctx, TGSI_OPCODE_RSQ, + TGSI_FILE_TEMPORARY, tmp0, TGSI_WRITEMASK_X, + TGSI_FILE_TEMPORARY, tmp0); /* RCP t0.x, t0.x; */ - newInst = tgsi_default_full_instruction(); - newInst.Instruction.Opcode = TGSI_OPCODE_RCP; - newInst.Instruction.NumDstRegs = 1; -
[Mesa-dev] [PATCH 5/9] draw: use tgsi transform prolog callback in polygon stipple code
--- src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 235 +++ 1 file changed, 110 insertions(+), 125 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index d216787..7ef86a6 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -129,7 +129,6 @@ struct pstip_transform_context { int freeSampler; /** an available sampler for the pstipple */ int texTemp; /** temp registers */ int numImmed; - boolean firstInstruction; }; @@ -192,147 +191,134 @@ free_bit(uint bitfield) /** - * TGSI instruction transform callback. - * Replace writes to result.color w/ a temp reg. - * Upon END instruction, insert texture sampling code for antialiasing. + * TGSI transform prolog callback. */ static void -pstip_transform_inst(struct tgsi_transform_context *ctx, - struct tgsi_full_instruction *inst) +pstip_transform_prolog(struct tgsi_transform_context *ctx) { struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx; + struct tgsi_full_declaration decl; + struct tgsi_full_instruction newInst; + uint i; + int wincoordInput; - if (pctx-firstInstruction) { - /* emit our new declarations before the first instruction */ + /* find free sampler */ + pctx-freeSampler = free_bit(pctx-samplersUsed); + if (pctx-freeSampler = PIPE_MAX_SAMPLERS) + pctx-freeSampler = PIPE_MAX_SAMPLERS - 1; - struct tgsi_full_declaration decl; - struct tgsi_full_instruction newInst; - uint i; - int wincoordInput; + if (pctx-wincoordInput 0) + wincoordInput = pctx-maxInput + 1; + else + wincoordInput = pctx-wincoordInput; - /* find free sampler */ - pctx-freeSampler = free_bit(pctx-samplersUsed); - if (pctx-freeSampler = PIPE_MAX_SAMPLERS) - pctx-freeSampler = PIPE_MAX_SAMPLERS - 1; - - if (pctx-wincoordInput 0) - wincoordInput = pctx-maxInput + 1; + /* find one free temp reg */ + for (i = 0; i 32; i++) { + if ((pctx-tempsUsed (1 i)) == 0) { + /* found a free temp */ + if (pctx-texTemp 0) + pctx-texTemp = i; else - wincoordInput = pctx-wincoordInput; - - /* find one free temp reg */ - for (i = 0; i 32; i++) { - if ((pctx-tempsUsed (1 i)) == 0) { -/* found a free temp */ -if (pctx-texTemp 0) - pctx-texTemp = i; -else - break; - } - } - assert(pctx-texTemp = 0); - - if (pctx-wincoordInput 0) { - /* declare new position input reg */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_POSITION; - decl.Semantic.Index = 0; - decl.Range.First = -decl.Range.Last = wincoordInput; - decl.Interp.Interpolate = TGSI_INTERPOLATE_LINEAR; /* XXX? */ - ctx-emit_declaration(ctx, decl); + break; } + } + assert(pctx-texTemp = 0); - /* declare new sampler */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = - decl.Range.Last = pctx-freeSampler; - ctx-emit_declaration(ctx, decl); - - /* declare new temp regs */ + if (pctx-wincoordInput 0) { + /* declare new position input reg */ decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Declaration.File = TGSI_FILE_INPUT; + decl.Declaration.Interpolate = 1; + decl.Declaration.Semantic = 1; + decl.Semantic.Name = TGSI_SEMANTIC_POSITION; + decl.Semantic.Index = 0; decl.Range.First = - decl.Range.Last = pctx-texTemp; + decl.Range.Last = wincoordInput; + decl.Interp.Interpolate = TGSI_INTERPOLATE_LINEAR; /* XXX? */ ctx-emit_declaration(ctx, decl); + } - /* emit immediate = {1/32, 1/32, 1, 1} - * The index/position of this immediate will be pctx-numImmed - */ - { - static const float value[4] = { 1.0/32, 1.0/32, 1.0, 1.0 }; - struct tgsi_full_immediate immed; - uint size = 4; - immed = tgsi_default_full_immediate(); - immed.Immediate.NrTokens = 1 + size; /* one for the token itself */ - immed.u[0].Float = value[0]; - immed.u[1].Float = value[1]; - immed.u[2].Float = value[2]; - immed.u[3].Float = value[3]; - ctx-emit_immediate(ctx, immed); - } - - pctx-firstInstruction = FALSE; - - - /* - * Insert new MUL/TEX/KILL_IF instructions at start of program - * Take gl_FragCoord, divide by 32 (stipple size), sample the - * texture and kill fragment if needed. - * -
[Mesa-dev] [PATCH 2/9] tgsi: fix tgsi transform's epilog callback
We want to call the caller's epilog callback when we find the TGSI END instruction, not after it. --- src/gallium/auxiliary/tgsi/tgsi_transform.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c index 93e5b98..5a5f56c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.c +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c @@ -171,10 +171,19 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, ctx-prolog(ctx); } -if (ctx-transform_instruction) - ctx-transform_instruction(ctx, fullinst); -else +if (fullinst-Instruction.Opcode == TGSI_OPCODE_END + ctx-epilog) { + /* Emit caller's epilog */ + ctx-epilog(ctx); + /* Emit END */ ctx-emit_instruction(ctx, fullinst); +} +else { + if (ctx-transform_instruction) + ctx-transform_instruction(ctx, fullinst); + else + ctx-emit_instruction(ctx, fullinst); +} first_instruction = FALSE; } @@ -220,10 +229,6 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, } } - if (ctx-epilog) { - ctx-epilog(ctx); - } - tgsi_parse_free (parse); return ctx-ti; -- 1.7.10.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/9] draw: use tgsi transform prolog/epilog callbacks in AA point code
This simplifies the code and makes it a little easier to understand. --- src/gallium/auxiliary/draw/draw_pipe_aapoint.c | 621 1 file changed, 316 insertions(+), 305 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c index 686776a..3f2ef08 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c @@ -121,7 +121,6 @@ struct aa_transform_context { int colorOutput; /** which output is the primary color */ int maxInput, maxGeneric; /** max input index found */ int tmp0, colorTemp; /** temp registers */ - boolean firstInstruction; }; @@ -161,325 +160,336 @@ aa_transform_decl(struct tgsi_transform_context *ctx, /** - * TGSI instruction transform callback. - * Replace writes to result.color w/ a temp reg. - * Upon END instruction, insert texture sampling code for antialiasing. + * TGSI transform callback. + * Insert new declarations and instructions before first instruction. */ static void -aa_transform_inst(struct tgsi_transform_context *ctx, - struct tgsi_full_instruction *inst) +aa_transform_prolog(struct tgsi_transform_context *ctx) { + /* emit our new declarations before the first instruction */ struct aa_transform_context *aactx = (struct aa_transform_context *) ctx; struct tgsi_full_instruction newInst; + struct tgsi_full_declaration decl; + const int texInput = aactx-maxInput + 1; + int tmp0; + uint i; - if (aactx-firstInstruction) { - /* emit our new declarations before the first instruction */ + /* find two free temp regs */ + for (i = 0; i 32; i++) { + if ((aactx-tempsUsed (1 i)) == 0) { + /* found a free temp */ + if (aactx-tmp0 0) +aactx-tmp0 = i; + else if (aactx-colorTemp 0) +aactx-colorTemp = i; + else +break; + } + } - struct tgsi_full_declaration decl; - const int texInput = aactx-maxInput + 1; - int tmp0; - uint i; + assert(aactx-colorTemp != aactx-tmp0); + + tmp0 = aactx-tmp0; + + /* declare new generic input/texcoord */ + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_INPUT; + /* XXX this could be linear... */ + decl.Declaration.Interpolate = 1; + decl.Declaration.Semantic = 1; + decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; + decl.Semantic.Index = aactx-maxGeneric + 1; + decl.Range.First = + decl.Range.Last = texInput; + decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; + ctx-emit_declaration(ctx, decl); + + /* declare new temp regs */ + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Range.First = + decl.Range.Last = tmp0; + ctx-emit_declaration(ctx, decl); + + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Range.First = + decl.Range.Last = aactx-colorTemp; + ctx-emit_declaration(ctx, decl); - /* find two free temp regs */ - for (i = 0; i 32; i++) { - if ((aactx-tempsUsed (1 i)) == 0) { -/* found a free temp */ -if (aactx-tmp0 0) - aactx-tmp0 = i; -else if (aactx-colorTemp 0) - aactx-colorTemp = i; -else - break; - } - } + /* +* Emit code to compute fragment coverage, kill if outside point radius +* +* Temp reg0 usage: +* t0.x = distance of fragment from center point +* t0.y = boolean, is t0.x 1.0, also misc temp usage +* t0.z = temporary for computing 1/(1-k) value +* t0.w = final coverage value +*/ - assert(aactx-colorTemp != aactx-tmp0); - - tmp0 = aactx-tmp0; - - /* declare new generic input/texcoord */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - /* XXX this could be linear... */ - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; - decl.Semantic.Index = aactx-maxGeneric + 1; - decl.Range.First = - decl.Range.Last = texInput; - decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; - ctx-emit_declaration(ctx, decl); - - /* declare new temp regs */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = tmp0; - ctx-emit_declaration(ctx, decl); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-colorTemp; - ctx-emit_declaration(ctx, decl); - - aactx-firstInstruction = FALSE; - - - /* - * Emit code to compute fragment coverage, kill if outside point radius - * - * Temp reg0 usage: - * t0.x =
[Mesa-dev] [PATCH 6/9] tgsi: add inst/decl helpers for tgsi_transform utility
--- src/gallium/auxiliary/tgsi/tgsi_transform.h | 333 +++ 1 file changed, 333 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h index 5ec0719..bfcdd56 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.h +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.h @@ -91,6 +91,339 @@ struct tgsi_transform_context }; +/** + * Helper for emitting temporary register declarations. + */ +static INLINE void +tgsi_transform_temp_decl(struct tgsi_transform_context *ctx, + unsigned index) +{ + struct tgsi_full_declaration decl; + + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Range.First = + decl.Range.Last = index; + ctx-emit_declaration(ctx, decl); +} + + +static INLINE void +tgsi_transform_input_decl(struct tgsi_transform_context *ctx, + unsigned index, + unsigned sem_name, unsigned sem_index, + unsigned interp) +{ + struct tgsi_full_declaration decl; + + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_INPUT; + decl.Declaration.Interpolate = 1; + decl.Declaration.Semantic = 1; + decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; + decl.Semantic.Index = sem_index; + decl.Range.First = + decl.Range.Last = index; + decl.Interp.Interpolate = interp; + + ctx-emit_declaration(ctx, decl); +} + + +static INLINE void +tgsi_transform_sampler_decl(struct tgsi_transform_context *ctx, +unsigned index) +{ + struct tgsi_full_declaration decl; + + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_SAMPLER; + decl.Range.First = + decl.Range.Last = index; + ctx-emit_declaration(ctx, decl); +} + + +static INLINE void +tgsi_transform_immediate_decl(struct tgsi_transform_context *ctx, + float x, float y, float z, float w) +{ + struct tgsi_full_immediate immed; + unsigned size = 4; + + immed = tgsi_default_full_immediate(); + immed.Immediate.NrTokens = 1 + size; /* one for the token itself */ + immed.u[0].Float = x; + immed.u[1].Float = y; + immed.u[2].Float = z; + immed.u[3].Float = w; + + ctx-emit_immediate(ctx, immed); +} + + +/** + * Helper for emitting 1-operand instructions. + */ +static INLINE void +tgsi_transform_op1_inst(struct tgsi_transform_context *ctx, +unsigned opcode, +unsigned dst_file, +unsigned dst_index, +unsigned dst_writemask, +unsigned src0_file, +unsigned src0_index) +{ + struct tgsi_full_instruction inst; + + inst = tgsi_default_full_instruction(); + inst.Instruction.Opcode = opcode; + inst.Instruction.NumDstRegs = 1; + inst.Dst[0].Register.File = dst_file, + inst.Dst[0].Register.Index = dst_index; + inst.Dst[0].Register.WriteMask = dst_writemask; + inst.Instruction.NumSrcRegs = 1; + inst.Src[0].Register.File = src0_file; + inst.Src[0].Register.Index = src0_index; + + ctx-emit_instruction(ctx, inst); +} + + +static INLINE void +tgsi_transform_op2_inst(struct tgsi_transform_context *ctx, +unsigned opcode, +unsigned dst_file, +unsigned dst_index, +unsigned dst_writemask, +unsigned src0_file, +unsigned src0_index, +unsigned src1_file, +unsigned src1_index) +{ + struct tgsi_full_instruction inst; + + inst = tgsi_default_full_instruction(); + inst.Instruction.Opcode = opcode; + inst.Instruction.NumDstRegs = 1; + inst.Dst[0].Register.File = dst_file, + inst.Dst[0].Register.Index = dst_index; + inst.Dst[0].Register.WriteMask = dst_writemask; + inst.Instruction.NumSrcRegs = 2; + inst.Src[0].Register.File = src0_file; + inst.Src[0].Register.Index = src0_index; + inst.Src[1].Register.File = src1_file; + inst.Src[1].Register.Index = src1_index; + + ctx-emit_instruction(ctx, inst); +} + + +static INLINE void +tgsi_transform_op1_swz_inst(struct tgsi_transform_context *ctx, +unsigned opcode, +unsigned dst_file, +unsigned dst_index, +unsigned dst_writemask, +unsigned src0_file, +unsigned src0_index, +unsigned src0_swizzle) +{ + struct tgsi_full_instruction inst; + + inst = tgsi_default_full_instruction(); + inst.Instruction.Opcode = opcode; + inst.Instruction.NumDstRegs = 1; + inst.Dst[0].Register.File = dst_file, + inst.Dst[0].Register.Index = dst_index; + inst.Dst[0].Register.WriteMask = dst_writemask; + inst.Instruction.NumSrcRegs = 1;
[Mesa-dev] [PATCH 4/9] draw: use tgsi transform prolog/epilog callbacks in AA line code
--- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 182 + 1 file changed, 92 insertions(+), 90 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 8955762..c8344dd 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -140,7 +140,6 @@ struct aa_transform_context { int freeSampler; /** an available sampler for the pstipple */ int maxInput, maxGeneric; /** max input index found */ int colorTemp, texTemp; /** temp registers */ - boolean firstInstruction; }; @@ -197,80 +196,80 @@ free_bit(uint bitfield) /** - * TGSI instruction transform callback. - * Replace writes to result.color w/ a temp reg. - * Upon END instruction, insert texture sampling code for antialiasing. + * TGSI transform prolog callback. */ static void -aa_transform_inst(struct tgsi_transform_context *ctx, - struct tgsi_full_instruction *inst) +aa_transform_prolog(struct tgsi_transform_context *ctx) { struct aa_transform_context *aactx = (struct aa_transform_context *) ctx; + struct tgsi_full_declaration decl; + uint i; - if (aactx-firstInstruction) { - /* emit our new declarations before the first instruction */ - - struct tgsi_full_declaration decl; - uint i; - - /* find free sampler */ - aactx-freeSampler = free_bit(aactx-samplersUsed); - if (aactx-freeSampler = PIPE_MAX_SAMPLERS) - aactx-freeSampler = PIPE_MAX_SAMPLERS - 1; - - /* find two free temp regs */ - for (i = 0; i 32; i++) { - if ((aactx-tempsUsed (1 i)) == 0) { -/* found a free temp */ -if (aactx-colorTemp 0) - aactx-colorTemp = i; -else if (aactx-texTemp 0) - aactx-texTemp = i; -else - break; - } + /* find free sampler */ + aactx-freeSampler = free_bit(aactx-samplersUsed); + if (aactx-freeSampler = PIPE_MAX_SAMPLERS) + aactx-freeSampler = PIPE_MAX_SAMPLERS - 1; + + /* find two free temp regs */ + for (i = 0; i 32; i++) { + if ((aactx-tempsUsed (1 i)) == 0) { + /* found a free temp */ + if (aactx-colorTemp 0) + aactx-colorTemp = i; + else if (aactx-texTemp 0) + aactx-texTemp = i; + else + break; } - assert(aactx-colorTemp = 0); - assert(aactx-texTemp = 0); - - /* declare new generic input/texcoord */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - /* XXX this could be linear... */ - decl.Declaration.Interpolate = 1; - decl.Declaration.Semantic = 1; - decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; - decl.Semantic.Index = aactx-maxGeneric + 1; - decl.Range.First = - decl.Range.Last = aactx-maxInput + 1; - decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; - ctx-emit_declaration(ctx, decl); - - /* declare new sampler */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = - decl.Range.Last = aactx-freeSampler; - ctx-emit_declaration(ctx, decl); - - /* declare new temp regs */ - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-texTemp; - ctx-emit_declaration(ctx, decl); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = - decl.Range.Last = aactx-colorTemp; - ctx-emit_declaration(ctx, decl); - - aactx-firstInstruction = FALSE; } + assert(aactx-colorTemp = 0); + assert(aactx-texTemp = 0); + + /* declare new generic input/texcoord */ + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_INPUT; + /* XXX this could be linear... */ + decl.Declaration.Interpolate = 1; + decl.Declaration.Semantic = 1; + decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; + decl.Semantic.Index = aactx-maxGeneric + 1; + decl.Range.First = + decl.Range.Last = aactx-maxInput + 1; + decl.Interp.Interpolate = TGSI_INTERPOLATE_PERSPECTIVE; + ctx-emit_declaration(ctx, decl); + + /* declare new sampler */ + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_SAMPLER; + decl.Range.First = + decl.Range.Last = aactx-freeSampler; + ctx-emit_declaration(ctx, decl); + + /* declare new temp regs */ + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Range.First = + decl.Range.Last = aactx-texTemp; + ctx-emit_declaration(ctx, decl); + + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_TEMPORARY; + decl.Range.First = + decl.Range.Last = aactx-colorTemp; + ctx-emit_declaration(ctx, decl); +} + -
[Mesa-dev] [PATCH] clover: Add support to mem objects for multiple destructor callbacks v2
The spec says that mem objects should maintain a stack of callbacks not just one. v2: - Remove stray printf. CC: 10.3 mesa-sta...@lists.freedesktop.org --- src/gallium/state_trackers/clover/core/memory.cpp | 10 ++ src/gallium/state_trackers/clover/core/memory.hpp | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp index ba6869d..905ebc0 100644 --- a/src/gallium/state_trackers/clover/core/memory.cpp +++ b/src/gallium/state_trackers/clover/core/memory.cpp @@ -29,14 +29,16 @@ using namespace clover; memory_obj::memory_obj(clover::context ctx, cl_mem_flags flags, size_t size, void *host_ptr) : context(ctx), _flags(flags), - _size(size), _host_ptr(host_ptr), - _destroy_notify([]{}) { + _size(size), _host_ptr(host_ptr) { if (flags (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) data.append((char *)host_ptr, size); } memory_obj::~memory_obj() { - _destroy_notify(); + while (_destroy_notify.size()) { + _destroy_notify.top()(); + _destroy_notify.pop(); + } } bool @@ -46,7 +48,7 @@ memory_obj::operator==(const memory_obj obj) const { void memory_obj::destroy_notify(std::functionvoid () f) { - _destroy_notify = f; + _destroy_notify.push(f); } cl_mem_flags diff --git a/src/gallium/state_trackers/clover/core/memory.hpp b/src/gallium/state_trackers/clover/core/memory.hpp index f649ca0..bd6da6b 100644 --- a/src/gallium/state_trackers/clover/core/memory.hpp +++ b/src/gallium/state_trackers/clover/core/memory.hpp @@ -26,6 +26,7 @@ #include functional #include map #include memory +#include stack #include core/object.hpp #include core/queue.hpp @@ -61,7 +62,7 @@ namespace clover { cl_mem_flags _flags; size_t _size; void *_host_ptr; - std::functionvoid () _destroy_notify; + std::stackstd::functionvoid () _destroy_notify; protected: std::string data; -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] radeonsi/compute: directly emit CONTEXT_CONTROL
On Sat, Sep 20, 2014 at 6:11 AM, Marek Olšák mar...@gmail.com wrote: From: Marek Olšák marek.ol...@amd.com Looks good. Tom should probably take a look as well. As a further improvement, it would be nice to be able to use the compute rings for compute rather than gfx, but I'm not sure how much additional effort it would take to clean that up. Reviewed-by: Alex Deucher alexander.deuc...@amd.com --- src/gallium/drivers/radeonsi/si_compute.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 4b2662d..3ad9182 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -168,6 +168,7 @@ static void si_launch_grid( uint32_t pc, const void *input) { struct si_context *sctx = (struct si_context*)ctx; + struct radeon_winsys_cs *cs = sctx-b.rings.gfx.cs; struct si_compute *program = sctx-cs_shader_state.program; struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state); struct r600_resource *input_buffer = program-input_buffer; @@ -184,8 +185,11 @@ static void si_launch_grid( unsigned lds_blocks; unsigned num_waves_for_scratch; + radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0) | PKT3_SHADER_TYPE_S(1)); + radeon_emit(cs, 0x8000); + radeon_emit(cs, 0x8000); + pm4-compute_pkt = true; - si_cmd_context_control(pm4); si_pm4_cmd_begin(pm4, PKT3_EVENT_WRITE); si_pm4_cmd_add(pm4, EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH) | -- 1.9.1 ___ 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] [Mesa-stable] [PATCH] clover: Add support to mem objects for multiple destructor callbacks v2
Thanks, looks good to me, Reviewed-by: Francisco Jerez curroje...@riseup.net Tom Stellard thomas.stell...@amd.com writes: The spec says that mem objects should maintain a stack of callbacks not just one. v2: - Remove stray printf. CC: 10.3 mesa-sta...@lists.freedesktop.org --- src/gallium/state_trackers/clover/core/memory.cpp | 10 ++ src/gallium/state_trackers/clover/core/memory.hpp | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp index ba6869d..905ebc0 100644 --- a/src/gallium/state_trackers/clover/core/memory.cpp +++ b/src/gallium/state_trackers/clover/core/memory.cpp @@ -29,14 +29,16 @@ using namespace clover; memory_obj::memory_obj(clover::context ctx, cl_mem_flags flags, size_t size, void *host_ptr) : context(ctx), _flags(flags), - _size(size), _host_ptr(host_ptr), - _destroy_notify([]{}) { + _size(size), _host_ptr(host_ptr) { if (flags (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) data.append((char *)host_ptr, size); } memory_obj::~memory_obj() { - _destroy_notify(); + while (_destroy_notify.size()) { + _destroy_notify.top()(); + _destroy_notify.pop(); + } } bool @@ -46,7 +48,7 @@ memory_obj::operator==(const memory_obj obj) const { void memory_obj::destroy_notify(std::functionvoid () f) { - _destroy_notify = f; + _destroy_notify.push(f); } cl_mem_flags diff --git a/src/gallium/state_trackers/clover/core/memory.hpp b/src/gallium/state_trackers/clover/core/memory.hpp index f649ca0..bd6da6b 100644 --- a/src/gallium/state_trackers/clover/core/memory.hpp +++ b/src/gallium/state_trackers/clover/core/memory.hpp @@ -26,6 +26,7 @@ #include functional #include map #include memory +#include stack #include core/object.hpp #include core/queue.hpp @@ -61,7 +62,7 @@ namespace clover { cl_mem_flags _flags; size_t _size; void *_host_ptr; - std::functionvoid () _destroy_notify; + std::stackstd::functionvoid () _destroy_notify; protected: std::string data; -- 1.8.5.5 ___ mesa-stable mailing list mesa-sta...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-stable pgpwSkLIQTpnw.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 82635] vmw_screen.h:100:4: error: unknown type name 'dev_t'
https://bugs.freedesktop.org/show_bug.cgi?id=82635 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- Should be resolved with commit 40bb6f93139971a459dadf88d6dfc05791071e37) configure: bail out if building svga without libdrm With recent commit we removed the NEED_NONNULL_WINSYS checks when selecting the hardware (inc svga) winsys. svga has only one winsys that explicitly requires libdrm (via it's bundled version of vmwgfx_drm.h) but configure.ac never really checks for it. Add the check early to prevent people from shooting themselves when they select the driver but lack libdrm. $ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm --with-dri-drivers=swrast --with-gallium-drivers=svga,swrast Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539 Cc: 10.2 10.3 mesa-sta...@lists.freedesktop.org Signed-off-by: Emil Velikov emil.l.veli...@gmail.com Feel free to reopen if the issue is still present in 10.2/10.3 or master. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 83381] dri_screen.c:72:10: error: expected '}'
https://bugs.freedesktop.org/show_bug.cgi?id=83381 --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- Vinson is this a regression, can you bisect please ? -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] r600g: Implement GL_ARB_sample_shading
On Wed, 17 Sep 2014 06:10:48 +0200, Alexandre Demers alexandre.f.dem...@gmail.com wrote: Tested with v3. I get the same result as before: everything is fine except the gs-atan-vec2 test. I don't know if this is of any value, but running the command manually in a shell gives the following: /home/ademers/projects/display/piglit/bin/shader_runner /home/ademers/projects/display/piglit/generated_tests/spec/glsl-1.50/execution/built-in-functions/gs-atan-vec4.shader_test -auto PIGLIT: {result: pass } I assume the test ran correctly, but not in the context of the piglit run, am I right? I can make this test pass or fail pseudo-randomly, depending on timing, on my 6670 regardless of if this patch is applied or not, so at least its not an actual regression. If i run it under valgrind it always passes. At least its not a regression... /Glenn ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 00/17] Split out aux/vl and makefiles de-duplication
I reviewed one trivial patch and skimmed the others, which looked reasonable to me. Thanks Emil, have an Acked-by: Matt Turner matts...@gmail.com for the test. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 61361] Version mismatch error. This is libtool 2.4.2, but the definition of this LT_INIT comes from libtool 2.2.8.
https://bugs.freedesktop.org/show_bug.cgi?id=61361 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEEDINFO|RESOLVED Resolution|--- |INVALID --- Comment #10 from Emil Velikov emil.l.veli...@gmail.com --- The glsl tests (and nearly all tests in that matter) are checking the integrity of the actual build, rather than the present functionality of the system/driver. (In reply to comment #6) the check fails at glsl. as far as i understand, the missing support for shaders is the reason. possibly i'm wrong. With that said, the above statement does not really make sense. The version missmatch happens as the binary tarball was distributed with with an older version of libtool than the one you have installed on your system. It's unfortunate but normal and to resolve it one needs to run the following: $ autoreconf -vfi Feel free to reopen if you're seeing the problem with latest mesa (10.2.8 or later) and the command does not help. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 61415] Clover ignores --with-opencl-libdir path
https://bugs.freedesktop.org/show_bug.cgi?id=61415 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |NOTABUG --- Comment #10 from Emil Velikov emil.l.veli...@gmail.com --- The description of the parameter states directory for auxiliary libraries used by the OpenCL implementation The parameter does not control where the OpenCL library is installed, but the modules used by it - i.e. the gallium pipe-drivers. Considering that the latter can be used with almost any target, and this configure option has been non functional for 2+ years we can just drop it. I'll send a patch in a bit. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 83636] [LLVM 3.5] Mesa32 build failure with LLVM 3.5.
https://bugs.freedesktop.org/show_bug.cgi?id=83636 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- Should be resolved with the following. Feel free to reopen if it's still an issue. commit f23d1160c24e16ced319d838ed3102b731c2ff03 Author: Roland Scheidegger srol...@vmware.com Date: Wed Apr 16 03:46:20 2014 +0200 gallivm: fix compilation with llvm 3.5 r206241+ Just adjust to the ever-changing API, pass in MCContext when creating the MCDisassembler. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 65676] Piglit: port remaining glean tests to piglit framework
https://bugs.freedesktop.org/show_bug.cgi?id=65676 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Assignee|mesa-dev@lists.freedesktop. |e...@anholt.net |org | QA Contact||e...@anholt.net Product|Mesa|piglit Version|git |unspecified Component|Other |tests --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- Moving to piglit bugzilla :) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 58446] src/glsl/glcpp/imports.h:161: undefined reference to `sqrtf'
https://bugs.freedesktop.org/show_bug.cgi?id=58446 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |NEEDINFO --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- I am inclined to put this as a compiler bug. The sad part is that afaict the Open64 compiler is not seeing much (any) activity recently. Do you have any reasonable use-case the use of the compiler or can we just close this as WONTFIX ? -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/3] gallium: replace pipe_type enum with tgsi_type enum
The series looks good to me, though could rename the (quite underused) pipe_type enum to tgsi_return_type instead and leave tgsi_type alone? Or for further clarity, rename both (to tgsi_opcode_type and tgsi_ret_type or something). Either way though looks ok to me. (That said, I don't understand what the tgsi return type is really good for. This is a d3d10-ism obviously, but even there I don't get it. What the hell does it do? The return type from sampling can't be something like unorm anyway, and I can't see why it makes sense to have to describe the pre-sampling channel type here, as that's going to be determined by the actual format anyway, so if this really would describe the pre-sampling channel type, it would mean you'd have to redeclare the shader if you want to sample float vs. unorm texture etc. which doesn't make much sense to me, is this really the case?. llvmpipe/gallivm certainly don't care about that channel type one bit.) Roland Am 22.09.2014 17:44, schrieb Brian Paul: The only place the enum pipe_type was used is for the TGSI sampler view return type. So make it a TGSI type. --- src/gallium/auxiliary/tgsi/tgsi_build.c|8 src/gallium/auxiliary/tgsi/tgsi_strings.c |3 ++- src/gallium/auxiliary/tgsi/tgsi_strings.h |2 +- src/gallium/auxiliary/tgsi/tgsi_text.c |4 ++-- src/gallium/include/pipe/p_format.h|9 - src/gallium/include/pipe/p_shader_tokens.h | 17 + 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index bef5c75..ffc4c61 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -297,10 +297,10 @@ tgsi_default_declaration_sampler_view(void) struct tgsi_declaration_sampler_view dsv; dsv.Resource = TGSI_TEXTURE_BUFFER; - dsv.ReturnTypeX = PIPE_TYPE_UNORM; - dsv.ReturnTypeY = PIPE_TYPE_UNORM; - dsv.ReturnTypeZ = PIPE_TYPE_UNORM; - dsv.ReturnTypeW = PIPE_TYPE_UNORM; + dsv.ReturnTypeX = TGSI_TYPE_UNORM; + dsv.ReturnTypeY = TGSI_TYPE_UNORM; + dsv.ReturnTypeZ = TGSI_TYPE_UNORM; + dsv.ReturnTypeW = TGSI_TYPE_UNORM; return dsv; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c index 3c108a8..fb19893 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.c +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c @@ -125,7 +125,7 @@ const char *tgsi_property_names[TGSI_PROPERTY_COUNT] = VS_POSITION_WINDOW_SPACE }; -const char *tgsi_type_names[5] = +const char *tgsi_type_names[TGSI_TYPE_COUNT] = { UNORM, SNORM, @@ -195,6 +195,7 @@ tgsi_strings_check(void) STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT); STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX); STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT); + STATIC_ASSERT(Elements(tgsi_type_names) == TGSI_TYPE_COUNT); (void) tgsi_processor_type_names; (void) tgsi_type_names; (void) tgsi_immediate_type_names; diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.h b/src/gallium/auxiliary/tgsi/tgsi_strings.h index 1c37c29..1e96883 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.h +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.h @@ -46,7 +46,7 @@ extern const char *tgsi_texture_names[TGSI_TEXTURE_COUNT]; extern const char *tgsi_property_names[TGSI_PROPERTY_COUNT]; -extern const char *tgsi_type_names[5]; +extern const char *tgsi_type_names[TGSI_TYPE_COUNT]; extern const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT]; diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 7291145..296af2a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1258,7 +1258,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) ++cur; eat_opt_white( cur ); for (j = 0; j 4; ++j) { -for (i = 0; i PIPE_TYPE_COUNT; ++i) { +for (i = 0; i TGSI_TYPE_COUNT; ++i) { if (str_match_nocase_whole(cur, tgsi_type_names[i])) { switch (j) { case 0: @@ -1279,7 +1279,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) break; } } -if (i == PIPE_TYPE_COUNT) { +if (i == TGSI_TYPE_COUNT) { if (j == 0 || j 2) { report_error(ctx, Expected type name); return FALSE; diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 9c02464..b007229 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -35,15 +35,6 @@ extern C { #include p_config.h -enum pipe_type { -
Re: [Mesa-dev] [PATCH 07/12] i965/fs: Use the var_from_vgrf helper function instead of doing it manually
On Fri, Sep 19, 2014 at 8:14 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Fri, Sep 19, 2014 at 5:16 PM, Matt Turner matts...@gmail.com wrote: On Fri, Sep 19, 2014 at 1:10 PM, Jason Ekstrand ja...@jlekstrand.net wrote: Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com --- src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp index 697b44a..036875f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp @@ -58,7 +58,7 @@ fs_visitor::dead_code_eliminate() int var = live_intervals-var_from_reg(inst-dst); result_live = BITSET_TEST(live, var); } else { - int var = live_intervals-var_from_vgrf[inst-dst.reg]; + int var = live_intervals-var_from_reg(inst-dst); for (int i = 0; i inst-regs_written; i++) { result_live = result_live || BITSET_TEST(live, var + i); This is wrong, isn't it? Before we get the base var and iterate 0 through regs_written. After we're getting the var of the register+offset and then iterating. No, in fact this hunk is what prompted me to make the change. If we write to vgrf3+2.0, then the previous version would tacitly assume that the offset is 0 and treat it as if we were writing to vgrf3+0.0. Not exactly. It just ORs the liveness for each register offset and uses that to determine whether it can remove the instruction writing to one offset. Changing that to remove the instruction based on the liveness of just the offset it's writing is probably fine, but that's a functional change, and this patch appears to be making non-functional changes. I'd want to split those into separate commits. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 08/12] i965/fs: Make null_reg_* const members of fs_visitor instead of globals
On Fri, Sep 19, 2014 at 8:16 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Fri, Sep 19, 2014 at 5:37 PM, Matt Turner matts...@gmail.com wrote: On Fri, Sep 19, 2014 at 1:10 PM, Jason Ekstrand ja...@jlekstrand.net wrote: We also set the register width equal to the dispatch width. Right now, this is effectively a no-op since we don't do anything with it. However, it will be important once we add an actual width field to fs_reg. I don't really see the point to be honest. We just wind up calling the constructor 1 time. I could see maybe see making them static members just to reduce their scope. The point is to get a null register with a width of dispatch_width. We need that later. Ah, okay. Reviewed-by: Matt Turner matts...@gmail.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] clover: Add support to mem objects for multiple destructor callbacks
The spec says that mem objects should maintain a stack of callbacks not just one. CC: 10.3 mesa-sta...@lists.freedesktop.org --- src/gallium/state_trackers/clover/core/memory.cpp | 11 +++ src/gallium/state_trackers/clover/core/memory.hpp | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp index ba6869d..134ba77 100644 --- a/src/gallium/state_trackers/clover/core/memory.cpp +++ b/src/gallium/state_trackers/clover/core/memory.cpp @@ -29,14 +29,17 @@ using namespace clover; memory_obj::memory_obj(clover::context ctx, cl_mem_flags flags, size_t size, void *host_ptr) : context(ctx), _flags(flags), - _size(size), _host_ptr(host_ptr), - _destroy_notify([]{}) { + _size(size), _host_ptr(host_ptr) { if (flags (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) data.append((char *)host_ptr, size); } memory_obj::~memory_obj() { - _destroy_notify(); + fprintf(stderr, Destroying Object\n); + while (_destroy_notify.size()) { + _destroy_notify.top()(); + _destroy_notify.pop(); + } } bool @@ -46,7 +49,7 @@ memory_obj::operator==(const memory_obj obj) const { void memory_obj::destroy_notify(std::functionvoid () f) { - _destroy_notify = f; + _destroy_notify.push(f); } cl_mem_flags diff --git a/src/gallium/state_trackers/clover/core/memory.hpp b/src/gallium/state_trackers/clover/core/memory.hpp index f649ca0..bd6da6b 100644 --- a/src/gallium/state_trackers/clover/core/memory.hpp +++ b/src/gallium/state_trackers/clover/core/memory.hpp @@ -26,6 +26,7 @@ #include functional #include map #include memory +#include stack #include core/object.hpp #include core/queue.hpp @@ -61,7 +62,7 @@ namespace clover { cl_mem_flags _flags; size_t _size; void *_host_ptr; - std::functionvoid () _destroy_notify; + std::stackstd::functionvoid () _destroy_notify; protected: std::string data; -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] radeonsi/compute: directly emit CONTEXT_CONTROL
On Monday 22 September 2014, 12:16:13, Alex Deucher wrote: On Sat, Sep 20, 2014 at 6:11 AM, Marek Olšák mar...@gmail.com wrote: From: Marek Olšák marek.ol...@amd.com Looks good. Tom should probably take a look as well. As a further improvement, it would be nice to be able to use the compute rings for compute rather than gfx, but I'm not sure how much additional effort it would take to clean that up. This is completely untested but now that we can detect compute contexts something like the attached patches might be sufficient... Reviewed-by: Alex Deucher alexander.deuc...@amd.com --- src/gallium/drivers/radeonsi/si_compute.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 4b2662d..3ad9182 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -168,6 +168,7 @@ static void si_launch_grid( uint32_t pc, const void *input) { struct si_context *sctx = (struct si_context*)ctx; + struct radeon_winsys_cs *cs = sctx-b.rings.gfx.cs; struct si_compute *program = sctx-cs_shader_state.program; struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state); struct r600_resource *input_buffer = program-input_buffer; @@ -184,8 +185,11 @@ static void si_launch_grid( unsigned lds_blocks; unsigned num_waves_for_scratch; + radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0) | PKT3_SHADER_TYPE_S(1)); + radeon_emit(cs, 0x8000); + radeon_emit(cs, 0x8000); + pm4-compute_pkt = true; - si_cmd_context_control(pm4); si_pm4_cmd_begin(pm4, PKT3_EVENT_WRITE); si_pm4_cmd_add(pm4, EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH) | -- 1.9.1 ___ 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 From 9714d3ee55ee0ddb0bcf63934b552df641b866a2 Mon Sep 17 00:00:00 2001 From: Niels Ole Salscheider niels_...@salscheider-online.de Date: Mon, 22 Sep 2014 19:41:20 +0200 Subject: [PATCH 1/2] radeon: submit compute packets to the compute ring They have been submitted to the gfx ring since 764502b481e2288cb5e751de739253fdee886e3e. Signed-off-by: Niels Ole Salscheider niels_...@salscheider-online.de --- src/gallium/drivers/radeon/r600_pipe_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index ae203b6..0d9ce17 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -174,6 +174,9 @@ static void r600_flush_from_st(struct pipe_context *ctx, if (flags PIPE_FLUSH_END_OF_FRAME) rflags |= RADEON_FLUSH_END_OF_FRAME; + if (rctx-flags R600_CONTEXT_FLAG_COMPUTE) + rflags |= RADEON_FLUSH_COMPUTE; + if (rctx-rings.dma.cs) { rctx-rings.dma.flush(rctx, rflags, NULL); } -- 2.1.0 From e578f9c067de68e9401f798a78c1ed785ceb1137 Mon Sep 17 00:00:00 2001 From: Niels Ole Salscheider niels_...@salscheider-online.de Date: Mon, 22 Sep 2014 19:57:52 +0200 Subject: [PATCH 2/2] r600: set R600_CONTEXT_FLAG_COMPUTE in compute_emit_cs Signed-off-by: Niels Ole Salscheider niels_...@salscheider-online.de --- src/gallium/drivers/r600/evergreen_compute.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 38b78c7..03118e1 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -420,7 +420,9 @@ static void compute_emit_cs(struct r600_context *ctx, const uint *block_layout, */ r600_emit_command_buffer(cs, ctx-start_compute_cs_cmd); - ctx-b.flags |= R600_CONTEXT_WAIT_3D_IDLE | R600_CONTEXT_FLUSH_AND_INV; + ctx-b.flags |= R600_CONTEXT_WAIT_3D_IDLE | + R600_CONTEXT_FLUSH_AND_INV | + R600_CONTEXT_FLAG_COMPUTE; r600_flush_emit(ctx); /* Emit colorbuffers. */ @@ -485,7 +487,8 @@ static void compute_emit_cs(struct r600_context *ctx, const uint *block_layout, */ ctx-b.flags |= R600_CONTEXT_INV_CONST_CACHE | R600_CONTEXT_INV_VERTEX_CACHE | - R600_CONTEXT_INV_TEX_CACHE; + R600_CONTEXT_INV_TEX_CACHE | + R600_CONTEXT_FLAG_COMPUTE; r600_flush_emit(ctx); ctx-b.flags = 0; -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 57702] Eliminate RTLD_GLOBAL glapi hacks after removing support for static libglapi
https://bugs.freedesktop.org/show_bug.cgi?id=57702 --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- I'm do not thing the lack of explicit link is our biggest issue. Afaick we aim to preserve compatibility different versions of mesa and the xserver. Up-to recently the server the second provider for those _glapi* symbols, thus the lack of explicit link, and the need to dlopen. Perhaps we can have a discussion at XDC at when we can say enough is enough and resolve these. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 38906] Mesa compilation failure if libudev development files are not installed.
https://bugs.freedesktop.org/show_bug.cgi?id=38906 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #11 from Emil Velikov emil.l.veli...@gmail.com --- I'm pretty sure that the original compilation failure is resolved now, yet feel free to reopen. Whereas for anyone that is not a fan of libudev, we have the equivalent information retrieved by sysfs, and even via libdrm. If there is further interest, which one should be build when let's discuss this in a separate thread/bugreport. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 48833] dri library path issue
https://bugs.freedesktop.org/show_bug.cgi?id=48833 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- Afaict the dri modules always were special as they are modules, and one should point to them via LIBGL_DRIVERS_PATH. For everything else that starts with lib LD_LIBRARY_PATH comes into play. For quite some releases mesa has stopped providing both libdricore and libglsl. As such I would close this as obsolete/wontfix. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [RFC PATCH 1/4] mesa: Unifdef _XBOX.
Inexplicably added in commit 36940429. --- src/mesa/main/imports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4afe156..b18603c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -532,7 +532,7 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, char * _mesa_getenv( const char *var ) { -#if defined(_XBOX) || defined(_WIN32_WCE) +#if defined(_WIN32_WCE) return NULL; #else return getenv(var); -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [RFC PATCH 3/4] mesa: Drop _mesa_bsearch() wrapper.
--- src/mapi/glapi/gen/gl_enums.py | 8 src/mesa/main/imports.c| 17 - src/mesa/main/imports.h| 4 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py index 0214932..35919d6 100644 --- a/src/mapi/glapi/gen/gl_enums.py +++ b/src/mapi/glapi/gen/gl_enums.py @@ -82,10 +82,10 @@ const char *_mesa_lookup_enum_by_nr( int nr ) STATIC_ASSERT(sizeof(enum_string_table) (1 16)); - elt = _mesa_bsearch( nr, enum_string_table_offsets, - Elements(enum_string_table_offsets), - sizeof(enum_string_table_offsets[0]), - (cfunc) compar_nr); + elt = bsearch( nr, enum_string_table_offsets, + Elements(enum_string_table_offsets), + sizeof(enum_string_table_offsets[0]), + (cfunc) compar_nr); if (elt != NULL) { return enum_string_table[elt-offset]; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 75db685..281fe25 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -489,23 +489,6 @@ _mesa_half_to_float(GLhalfARB val) /**/ -/** \name Sort Search */ -/*@{*/ - -/** - * Wrapper for bsearch(). - */ -void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ) -{ - return bsearch(key, base, nmemb, size, compar); -} - -/*@}*/ - - -/**/ /** \name Environment vars */ /*@{*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 59fd19c..bd44525 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -537,10 +537,6 @@ _mesa_half_is_negative(GLhalfARB h) return h 0x8000; } -extern void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ); - extern char * _mesa_getenv( const char *var ); -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [RFC PATCH 2/4] mesa: Unifdef _WIN32_WCE.
--- José: if you guys don't care about WinCE anymore, this will let us drop two wrapper functions (bsearch, getenv). src/gallium/auxiliary/util/u_snprintf.c | 9 - src/gallium/state_trackers/egl/x11/glcore.h | 2 -- src/mapi/glapi/gen/gl_gentable.py | 2 +- src/mapi/glapi/glapi_nop.c | 4 +--- src/mesa/main/compiler.h| 2 -- src/mesa/main/errors.c | 2 +- src/mesa/main/imports.c | 21 - 7 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c index a24b6ff..7a2bf2a 100644 --- a/src/gallium/auxiliary/util/u_snprintf.c +++ b/src/gallium/auxiliary/util/u_snprintf.c @@ -334,15 +334,6 @@ static void *mymemcpy(void *, void *, size_t); #endif /* HAVE_UINTPTR_T || defined(uintptr_t) */ #endif /* !defined(UINTPTR_T) */ -/* WinCE5.0 does not have uintptr_t defined */ -#if (_WIN32_WCE 600) -#ifdef UINTPTR_T -#undef UINTPTR_T -#endif -#define UINTPTR_T unsigned long int -#endif - - /* Support for ptrdiff_t. */ #ifndef PTRDIFF_T #if HAVE_PTRDIFF_T || defined(ptrdiff_t) diff --git a/src/gallium/state_trackers/egl/x11/glcore.h b/src/gallium/state_trackers/egl/x11/glcore.h index 547b111..99de6c0 100644 --- a/src/gallium/state_trackers/egl/x11/glcore.h +++ b/src/gallium/state_trackers/egl/x11/glcore.h @@ -31,9 +31,7 @@ * Silicon Graphics, Inc. */ -#if !defined(_WIN32_WCE) #include sys/types.h -#endif #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index ce9af99..deffcee 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -42,7 +42,7 @@ header = /* GLXEXT is the define used in the xserver when the GLX extension i #endif #if (defined(GLXEXT) defined(HAVE_BACKTRACE)) \\ - || (!defined(GLXEXT) defined(DEBUG) !defined(_WIN32_WCE) !defined(__CYGWIN__) !defined(__MINGW32__) !defined(__OpenBSD__) !defined(__NetBSD__) !defined(__DragonFly__)) + || (!defined(GLXEXT) defined(DEBUG) !defined(__CYGWIN__) !defined(__MINGW32__) !defined(__OpenBSD__) !defined(__NetBSD__) !defined(__DragonFly__)) #define USE_BACKTRACE #endif diff --git a/src/mapi/glapi/glapi_nop.c b/src/mapi/glapi/glapi_nop.c index 2597c8c..628276e 100644 --- a/src/mapi/glapi/glapi_nop.c +++ b/src/mapi/glapi/glapi_nop.c @@ -63,7 +63,7 @@ _glapi_set_warning_func(_glapi_proc func) static int Warn(const char *func) { -#if defined(DEBUG) !defined(_WIN32_WCE) +#if defined(DEBUG) if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) { fprintf(stderr, GL User Error: gl%s called without a rendering context\n, func); @@ -103,11 +103,9 @@ NoOpUnused(void) static int NoOpGeneric(void) { -#if !defined(_WIN32_WCE) if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) { fprintf(stderr, GL User Error: calling GL function without a rendering context\n); } -#endif return 0; } diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 813bf19..185c911 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -214,13 +214,11 @@ static inline GLuint CPU_TO_LE32(GLuint x) /** * ASSERT macro */ -#if !defined(_WIN32_WCE) #if defined(DEBUG) # define ASSERT(X) assert(X) #else # define ASSERT(X) #endif -#endif /* diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 9cde1e0..995fc82 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -1194,7 +1194,7 @@ output_if_debug(const char *prefixString, const char *outputString, fprintf(fout, \n); fflush(fout); -#if defined(_WIN32) !defined(_WIN32_WCE) +#if defined(_WIN32) /* stderr from windows applications without console is not usually * visible, so communicate with the debugger instead */ { diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b18603c..75db685 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -499,24 +499,7 @@ void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) ) { -#if defined(_WIN32_WCE) - void *mid; - int cmp; - while (nmemb) { - nmemb = 1; - mid = (char *)base + nmemb * size; - cmp = (*compar)(key, mid); - if (cmp == 0) -return mid; - if (cmp 0) { -base = (char *)mid + size; ---nmemb; - } - } - return NULL; -#else return bsearch(key, base, nmemb, size, compar); -#endif } /*@}*/ @@ -532,11 +515,7 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, char * _mesa_getenv( const char *var ) { -#if defined(_WIN32_WCE) - return NULL; -#else return getenv(var); -#endif } /*@}*/ -- 1.8.5.5 ___
[Mesa-dev] [RFC PATCH 4/4] mesa: Drop _mesa_getenv() wrapper.
--- src/gallium/state_trackers/glx/xlib/glx_api.c | 20 ++-- src/gallium/state_trackers/glx/xlib/xm_api.c | 4 ++-- src/mesa/drivers/x11/fakeglx.c| 20 ++-- src/mesa/drivers/x11/xm_api.c | 8 src/mesa/main/context.c | 6 +++--- src/mesa/main/debug.c | 4 ++-- src/mesa/main/errors.c| 6 +++--- src/mesa/main/extensions.c| 2 +- src/mesa/main/imports.c | 16 src/mesa/main/imports.h | 3 --- src/mesa/main/shaderapi.c | 2 +- src/mesa/math/m_debug_clip.c | 2 +- src/mesa/math/m_debug_norm.c | 2 +- src/mesa/math/m_debug_xform.c | 2 +- src/mesa/tnl/t_vertex.c | 2 +- src/mesa/x86-64/x86-64.c | 4 ++-- src/mesa/x86/common_x86.c | 10 +- 17 files changed, 47 insertions(+), 66 deletions(-) diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index d97cbd7..a4ed2c1 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -176,7 +176,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, if (dbFlag) { /* Check if the MESA_BACK_BUFFER env var is set */ - char *backbuffer = _mesa_getenv(MESA_BACK_BUFFER); + char *backbuffer = getenv(MESA_BACK_BUFFER); if (backbuffer) { if (backbuffer[0]=='p' || backbuffer[0]=='P') { ximageFlag = GL_FALSE; @@ -200,13 +200,13 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, /* Comparing IDs uses less memory but sometimes fails. */ /* XXX revisit this after 3.0 is finished. */ - if (_mesa_getenv(MESA_GLX_VISUAL_HACK)) + if (getenv(MESA_GLX_VISUAL_HACK)) comparePointers = GL_TRUE; else comparePointers = GL_FALSE; /* Force the visual to have an alpha channel */ - if (rgbFlag _mesa_getenv(MESA_GLX_FORCE_ALPHA)) + if (rgbFlag getenv(MESA_GLX_FORCE_ALPHA)) alphaFlag = GL_TRUE; /* First check if a matching visual is already in the list */ @@ -273,7 +273,7 @@ static GLint default_depth_bits(void) { int zBits; - const char *zEnv = _mesa_getenv(MESA_GLX_DEPTH_BITS); + const char *zEnv = getenv(MESA_GLX_DEPTH_BITS); if (zEnv) zBits = atoi(zEnv); else @@ -285,7 +285,7 @@ static GLint default_alpha_bits(void) { int aBits; - const char *aEnv = _mesa_getenv(MESA_GLX_ALPHA_BITS); + const char *aEnv = getenv(MESA_GLX_ALPHA_BITS); if (aEnv) aBits = atoi(aEnv); else @@ -433,11 +433,11 @@ get_env_visual(Display *dpy, int scr, const char *varname) int depth, xclass = -1; XVisualInfo *vis; - if (!_mesa_getenv( varname )) { + if (!getenv( varname )) { return NULL; } - strncpy( value, _mesa_getenv(varname), 100 ); + strncpy( value, getenv(varname), 100 ); value[99] = 0; sscanf( value, %s %d, type, depth ); @@ -1314,7 +1314,7 @@ glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ) if (b) { XMesaDestroyBuffer(b); } - else if (_mesa_getenv(MESA_DEBUG)) { + else if (getenv(MESA_DEBUG)) { _mesa_warning(NULL, Mesa: glXDestroyGLXPixmap: invalid pixmap\n); } } @@ -1392,7 +1392,7 @@ glXSwapBuffers( Display *dpy, GLXDrawable drawable ) if (buffer) { XMesaSwapBuffers(buffer); } - else if (_mesa_getenv(MESA_DEBUG)) { + else if (getenv(MESA_DEBUG)) { _mesa_warning(NULL, glXSwapBuffers: invalid drawable 0x%x\n, (int) drawable); } @@ -1410,7 +1410,7 @@ glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, if (buffer) { XMesaCopySubBuffer(buffer, x, y, width, height); } - else if (_mesa_getenv(MESA_DEBUG)) { + else if (getenv(MESA_DEBUG)) { _mesa_warning(NULL, Mesa: glXCopySubBufferMESA: invalid drawable\n); } } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 7836c61..1b77729 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -592,7 +592,7 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, * which can help Brian figure out what's going on when a user * reports bugs. */ - if (_mesa_getenv(MESA_INFO)) { + if (getenv(MESA_INFO)) { printf(X/Mesa visual = %p\n, (void *) v); printf(X/Mesa level = %d\n, v-mesa_visual.level); printf(X/Mesa depth = %d\n, v-visinfo-depth); @@ -686,7 +686,7 @@ XMesaVisual XMesaCreateVisual( Display *display, return NULL; /* For debugging only */ - if (_mesa_getenv(MESA_XSYNC)) { + if (getenv(MESA_XSYNC)) { /* This makes debugging X easier. * In your debugger, set a breakpoint on _XError to stop
[Mesa-dev] [Bug 54431] [build errors] (.text+0x324): undefined reference to `dlopen'
https://bugs.freedesktop.org/show_bug.cgi?id=54431 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Emil Velikov emil.l.veli...@gmail.com --- The osmesa/gallium-osmesa switches have been made mutually exclusive with commit c8111904304a878a3d5831b453255f04e1ddcf56 Author: Jon Severinsson j...@severinsson.net Date: Fri Aug 23 11:18:59 2013 +0200 gallium/osmesa: Make and install an osmesa.pc. As of 2f142d59 build: Add --enable-gallium-osmesa flag. the pkgconfig file from classic osmesa is no longer installed when building gallium osmesa, so copy it to gallium osmesa and install the copy instead. CC: 9.2 mesa-sta...@lists.freedesktop.org Reviewed-by: Matt Turner matts...@gmail.com Whereas for the undefined reference to dlopen, I'm pretty sure that one is resolved as well. Feel free to reopen if the issue is still present. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 19479] driCreateConfigs crashes Mesa compilation
https://bugs.freedesktop.org/show_bug.cgi?id=19479 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #6 from Emil Velikov emil.l.veli...@gmail.com --- Closing this as RESOLVED/INVALID based on comment 3 and 4. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 38688] Mesa 7.10.3 FTBFS (because libdrm?)
https://bugs.freedesktop.org/show_bug.cgi?id=38688 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #4 from Emil Velikov emil.l.veli...@gmail.com --- With the libdrm_nouveau experience long behind us, and latest mesa's correctly handling it, I believe we can close this :) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: use ptrdiff_t cast to silence g++ sign warning
This seems fine. But I don't get a warning here, and that seems a little odd. I'm a pretty old GCC... 4.7.2. What are you on? Either way, this patch is Reviewed-by: Ian Romanick ian.d.roman...@intel.com On 09/22/2014 08:44 AM, Brian Paul wrote: --- src/glsl/link_uniforms.cpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 258d279..a6683a0 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -749,7 +749,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if (end == NULL) continue; - if (l != (end - begin)) + if ((ptrdiff_t) l != (end - begin)) continue; if (strncmp(var-name, begin, l) == 0) { ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC PATCH 1/4] mesa: Unifdef _XBOX.
Assuming the VMware folks are okay with dropping WinCE support, this series is Reviewed-by: Ian Romanick ian.d.roman...@intel.com On 09/22/2014 11:22 AM, Matt Turner wrote: Inexplicably added in commit 36940429. --- src/mesa/main/imports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4afe156..b18603c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -532,7 +532,7 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, char * _mesa_getenv( const char *var ) { -#if defined(_XBOX) || defined(_WIN32_WCE) +#if defined(_WIN32_WCE) return NULL; #else return getenv(var); ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 47193] can't statically link libglsl and libdricore into drivers
https://bugs.freedesktop.org/show_bug.cgi?id=47193 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- We killed off libglsl.so and libdricore.so a few releases ago, as you already know. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/9] draw: use tgsi transform prolog/epilog callbacks in AA point code
This series looks good. One nit below. From: mesa-dev mesa-dev-boun...@lists.freedesktop.org on behalf of Brian Paul bri...@vmware.com Sent: Monday, September 22, 2014 8:44 AM To: mesa-dev@lists.freedesktop.org Subject: [Mesa-dev] [PATCH 3/9] draw: use tgsi transform prolog/epilog callbacks in AA point code This simplifies the code and makes it a little easier to understand. --- src/gallium/auxiliary/draw/draw_pipe_aapoint.c | 621 1 file changed, 316 insertions(+), 305 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c ... +/** + * TGSI transform callback. + * Insert new instructions before the END instruction. + */ +static void +aa_transform_epilog(struct tgsi_transform_context *ctx) +{ + /* emit our new declarations before the first instruction */ Please remove this comment. It's not relevant in aa_transform_epilog. Reviewed-by: Charmaine Lee charmai...@vmware.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-devk=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0Ar=iVNYIcCaC9TDvyNBQU%2F5q5NVsC01tSgJb3oX27T14ck%3D%0Am=WgIxyFTTxM%2BE0jPoNIA%2BgSV62SjHkS7A3w%2B0jxpKY08%3D%0As=c72fc3620bd437c978970304ed52bb176594a46d3730767e9ed7af9bb3374354 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 58925] compis/kwin crashes on nouveau due to msaa
https://bugs.freedesktop.org/show_bug.cgi?id=58925 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #4 from Emil Velikov emil.l.veli...@gmail.com --- Pretty sure that this one got resolved. Although as I cannot really point out to the commit that did it, and I've been using KDE for the last 6+ months I'll go with workforme :) Feel free to reopen if it's still an issue with latest mesa/kwin. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] replace file specific compiler optimization with inline attibute
On Fri, Sep 12, 2014 at 4:56 AM, Marc Dietrich marvi...@gmx.de wrote: File specific optimization as used for src/mesa/main/streaming-load-memcpy.c currently will cause problems with LTO in the future (see: https://bugs.freedesktop.org/show_bug.cgi?id=83669). Replace it with in-file target specification. This only works for gcc for now. The intel compiler has __attribute__((cpu_specific(cpuid))) with cpuid core_2_duo_sse4_1, but I'm not sure if mesa compiles with it and how it behaves on different platforms. V2: limit support for this optimization to gcc = 4.4 only Signed-off-by: Marc Dietrich marvi...@gmx.de --- This is the simplest solution I see for now. Drawback is that gcc 4.4 cannot make use of this single improvement anymore. Otherwise we would have to maintain a nightmare of version checks for different compilers and different pragmas. configure.ac | 10 ++ src/mesa/Makefile.am | 1 - src/mesa/main/streaming-load-memcpy.c | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 29cf32e..52ff00a 100644 --- a/configure.ac +++ b/configure.ac @@ -240,11 +240,13 @@ AC_SUBST([VISIBILITY_CXXFLAGS]) dnl dnl Optional flags, check for compiler support dnl -AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0]) This is the only use of AX_CHECK_COMPILE_FLAG, so we can remove m4/ax_check_compile_flag.m4. -if test x$SSE41_SUPPORTED = x1; then -DEFINES=$DEFINES -DUSE_SSE41 +if test 0$GCC_VERSION_MAJOR$GCC_VERSION_MINOR -ge 44; then +AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0]) +if test x$SSE41_SUPPORTED = x1; then +DEFINES=$DEFINES -DUSE_SSE41 +fi +AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1]) fi -AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1]) dnl Can't have static and shared libraries, default to static if user dnl explicitly requested. If both disabled, set to static since shared diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am index e71bccb..bbdb36f 100644 --- a/src/mesa/Makefile.am +++ b/src/mesa/Makefile.am @@ -152,7 +152,6 @@ libmesagallium_la_LIBADD = \ libmesa_sse41_la_SOURCES = \ main/streaming-load-memcpy.c -libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) -msse4.1 We don't need libmesa_sse41.la anymore, so just remove this by adding main/streaming-load-memcpy.c to libmesa.la's sources (pending figuring out how to handle clang support, see below). pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gl.pc diff --git a/src/mesa/main/streaming-load-memcpy.c b/src/mesa/main/streaming-load-memcpy.c index 8427149..94b0e0a 100644 --- a/src/mesa/main/streaming-load-memcpy.c +++ b/src/mesa/main/streaming-load-memcpy.c @@ -26,7 +26,7 @@ * */ -#ifdef __SSE4_1__ +#ifdef USE_SSE41 #include main/macros.h #include main/streaming-load-memcpy.h #include smmintrin.h This header can only be included when __SSE4_1__ is defined (which is enabled today when gcc is using an appropriate -march= setting or -msse4.1. How do you propose we work around that? I suppose #defining __SSE4_1__ before the inclusion is probably okay? @@ -34,7 +34,7 @@ /* Copies memory from src to dst, using SSE 4.1's MOVNTDQA to get streaming * read performance from uncached memory. */ -void +void __attribute__ ((target(sse4.1))) We need a configure check for support for __attribute__((target)). I'm going to send a series that adds support for this (and does the check for existing attribute uses, so once that goes in you can rebase this patch on that). It doesn't look like clang supports this though, which would be nice to support... don't know what to do. clang does support the existing -msse4.1 flag, so this would be a regression there. Any ideas for handling that? _mesa_streaming_load_memcpy(void *restrict dst, void *restrict src, size_t len) { char *restrict d = dst; -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 58446] src/glsl/glcpp/imports.h:161: undefined reference to `sqrtf'
https://bugs.freedesktop.org/show_bug.cgi?id=58446 --- Comment #2 from Ian Romanick i...@freedesktop.org --- Looking at the website, it doesn't seem like there has been much activity since 2011. This seems like it's either a bug in Open64 or we need more Open64-specific support in Mesa's build system. My preference would be WONTFIX... -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 04/12] ralloc: Mark ralloc functions with gcc's malloc attribute.
Cuts a few hundred bytes from the DRI drivers, so it must give gcc some extra information. --- configure.ac | 1 + src/util/macros.h | 6 ++ src/util/ralloc.h | 16 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 0aec6eb..024050e 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,7 @@ AX_GCC_BUILTIN([__builtin_unreachable]) AX_GCC_FUNC_ATTRIBUTE([flatten]) AX_GCC_FUNC_ATTRIBUTE([format]) +AX_GCC_FUNC_ATTRIBUTE([malloc]) AX_GCC_FUNC_ATTRIBUTE([packed]) AM_CONDITIONAL([GEN_ASM_OFFSETS], test x$GEN_ASM_OFFSETS = xyes) diff --git a/src/util/macros.h b/src/util/macros.h index a9867b4..40ebf02 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -87,6 +87,12 @@ do {\ #define PRINTFLIKE(f, a) #endif +#ifdef HAVE_FUNC_ATTRIBUTE_MALLOC +#define MALLOCLIKE __attribute__((__malloc__)) +#else +#define MALLOCLIKE +#endif + /* Used to optionally mark structures with misaligned elements or size as * packed, to trade off performance for space. */ diff --git a/src/util/ralloc.h b/src/util/ralloc.h index 4b88f32..f088a36 100644 --- a/src/util/ralloc.h +++ b/src/util/ralloc.h @@ -98,14 +98,14 @@ void *ralloc_context(const void *ctx); * simply allocates storage for \p size bytes and returns the pointer, * similar to \c malloc. */ -void *ralloc_size(const void *ctx, size_t size); +void *ralloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Allocate zero-initialized memory chained off of the given context. * * This is similar to \c calloc with a size of 1. */ -void *rzalloc_size(const void *ctx, size_t size); +void *rzalloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Resize a piece of ralloc-managed memory, preserving data. @@ -185,7 +185,7 @@ void *reralloc_size(const void *ctx, void *ptr, size_t size); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *ralloc_array_size(const void *ctx, size_t size, unsigned count); +void *ralloc_array_size(const void *ctx, size_t size, unsigned count) MALLOCLIKE; /** * Allocate a zero-initialized array chained off the given context. @@ -195,7 +195,7 @@ void *ralloc_array_size(const void *ctx, size_t size, unsigned count); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *rzalloc_array_size(const void *ctx, size_t size, unsigned count); +void *rzalloc_array_size(const void *ctx, size_t size, unsigned count) MALLOCLIKE; /** * Resize a ralloc-managed array, preserving data. @@ -257,7 +257,7 @@ void ralloc_set_destructor(const void *ptr, void(*destructor)(void *)); /** * Duplicate a string, allocating the memory from the given context. */ -char *ralloc_strdup(const void *ctx, const char *str); +char *ralloc_strdup(const void *ctx, const char *str) MALLOCLIKE; /** * Duplicate a string, allocating the memory from the given context. @@ -265,7 +265,7 @@ char *ralloc_strdup(const void *ctx, const char *str); * Like \c strndup, at most \p n characters are copied. If \p str is longer * than \p n characters, \p n are copied, and a termining \c '\0' byte is added. */ -char *ralloc_strndup(const void *ctx, const char *str, size_t n); +char *ralloc_strndup(const void *ctx, const char *str, size_t n) MALLOCLIKE; /** * Concatenate two strings, allocating the necessary space. @@ -302,7 +302,7 @@ bool ralloc_strncat(char **dest, const char *str, size_t n); * * \return The newly allocated string. */ -char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); +char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3) MALLOCLIKE; /** * Print to a string, given a va_list. @@ -312,7 +312,7 @@ char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); * * \return The newly allocated string. */ -char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args); +char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args) MALLOCLIKE; /** * Rewrite the tail of an existing string, starting at a given index. -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/12] mesa: Replace a priori knowledge of gcc builtins with configure tests.
Presumbly this will let clang and other compilers use the built-ins as well. Notice two changes specifically: - in _mesa_next_pow_two_64(), always use __builtin_clzll and add a static assertion that this is safe. - in macros.h, remove the clang-specific definition since it should be able to detect __builtin_unreachable in configure. --- configure.ac | 8 +++ src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 2 +- src/mesa/main/imports.c | 12 ++ src/mesa/main/imports.h | 35 +++- src/util/macros.h| 14 +++ 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 12f914e..6b0adbc 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,14 @@ fi dnl Check for compiler builtins AX_GCC_BUILTIN([__builtin_bswap32]) AX_GCC_BUILTIN([__builtin_bswap64]) +AX_GCC_BUILTIN([__builtin_clz]) +AX_GCC_BUILTIN([__builtin_clzll]) +AX_GCC_BUILTIN([__builtin_ctz]) +AX_GCC_BUILTIN([__builtin_ffs]) +AX_GCC_BUILTIN([__builtin_ffsll]) +AX_GCC_BUILTIN([__builtin_popcount]) +AX_GCC_BUILTIN([__builtin_popcountll]) +AX_GCC_BUILTIN([__builtin_unreachable]) AM_CONDITIONAL([GEN_ASM_OFFSETS], test x$GEN_ASM_OFFSETS = xyes) diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 105acdd..844f5e4 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1343,7 +1343,7 @@ brw_blorp_blit_program::single_to_blend() */ inline int count_trailing_one_bits(unsigned value) { -#if defined(__GNUC__) ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CTZ return __builtin_ctz(~value); #else return _mesa_bitcount(value ~(value + 1)); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c5a7d63..bbfaf54 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -217,7 +217,7 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, /*@{*/ -#ifndef __GNUC__ +#ifndef HAVE___BUILTIN_FFS /** * Find the first bit set in a word. */ @@ -246,8 +246,9 @@ ffs(int i) } return bit; } +#endif - +#ifndef HAVE___BUILTIN_FFSLL /** * Find position of first bit set in given value. * XXX Warning: this function can only be used on 64-bit systems! @@ -271,11 +272,10 @@ ffsll(long long int val) return 0; } -#endif /* __GNUC__ */ +#endif -#if !defined(__GNUC__) ||\ - ((__GNUC__ * 100 + __GNUC_MINOR__) 304) /* Not gcc 3.4 or later */ +#ifndef HAVE___BUILTIN_POPCOUNT /** * Return number of bits set in given GLuint. */ @@ -288,7 +288,9 @@ _mesa_bitcount(unsigned int n) } return bits; } +#endif +#ifndef HAVE___BUILTIN_POPCOUNTLL /** * Return number of bits set in given 64-bit uint. */ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 8dbcf83..967eebc 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -377,8 +377,7 @@ _mesa_is_pow_two(int x) static inline int32_t _mesa_next_pow_two_32(uint32_t x) { -#if defined(__GNUC__) \ - ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ uint32_t y = (x != 1); return (1 + y) ((__builtin_clz(x - y) ^ 31) ); #else @@ -396,13 +395,10 @@ _mesa_next_pow_two_32(uint32_t x) static inline int64_t _mesa_next_pow_two_64(uint64_t x) { -#if defined(__GNUC__) \ - ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZLL uint64_t y = (x != 1); - if (sizeof(x) == sizeof(long)) - return (1 + y) ((__builtin_clzl(x - y) ^ 63)); - else - return (1 + y) ((__builtin_clzll(x - y) ^ 63)); + STATIC_ASSERT(sizeof(x) == sizeof(long long)); + return (1 + y) ((__builtin_clzll(x - y) ^ 63)); #else x--; x |= x 1; @@ -423,8 +419,7 @@ _mesa_next_pow_two_64(uint64_t x) static inline GLuint _mesa_logbase2(GLuint n) { -#if defined(__GNUC__) \ - ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ return (31 - __builtin_clz(n | 1)); #else GLuint pos = 0; @@ -476,22 +471,30 @@ _mesa_exec_free( void *addr ); #ifndef FFS_DEFINED #define FFS_DEFINED 1 -#ifdef __GNUC__ +#ifdef HAVE___BUILTIN_FFS #define ffs __builtin_ffs -#define ffsll __builtin_ffsll #else extern int ffs(int i); +#endif + +#ifdef HAVE___BUILTIN_FFSLL +#define ffsll __builtin_ffsll +#else extern int ffsll(long long int i); -#endif /*__ GNUC__ */ +#endif #endif /* FFS_DEFINED */ -#if defined(__GNUC__) ((__GNUC__ * 100 + __GNUC_MINOR__) = 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_POPCOUNT #define _mesa_bitcount(i) __builtin_popcount(i) -#define _mesa_bitcount_64(i) __builtin_popcountll(i) #else extern unsigned int
[Mesa-dev] [PATCH 01/12] mesa: Use realloc() instead of _mesa_realloc() and remove the latter.
--- src/gallium/state_trackers/glx/xlib/glx_api.c | 3 +-- src/mesa/drivers/x11/fakeglx.c| 3 +-- src/mesa/main/imports.c | 14 -- src/mesa/main/imports.h | 3 --- src/mesa/main/shaderapi.c | 5 ++--- src/mesa/program/prog_instruction.c | 5 ++--- src/mesa/program/prog_parameter.c | 5 ++--- 7 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index d97cbd7..84b605a 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -248,8 +248,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis-vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) realloc( VisualTable, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index eba13ac..a47ad74 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -326,8 +326,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis-vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) realloc( VisualTable, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4afe156..c5a7d63 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -209,20 +209,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, #endif } - - -/** Reallocate memory */ -void * -_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) -{ - const size_t copySize = (oldSize newSize) ? oldSize : newSize; - void *newBuffer = malloc(newSize); - if (newBuffer oldBuffer copySize 0) - memcpy(newBuffer, oldBuffer, copySize); - free(oldBuffer); - return newBuffer; -} - /*@}*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 59fd19c..8dbcf83 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -473,9 +473,6 @@ _mesa_exec_malloc( GLuint size ); extern void _mesa_exec_free( void *addr ); -extern void * -_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); - #ifndef FFS_DEFINED #define FFS_DEFINED 1 diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 620cab3..dc8b255 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -272,9 +272,8 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader) /* grow list */ shProg-Shaders = (struct gl_shader **) - _mesa_realloc(shProg-Shaders, -n * sizeof(struct gl_shader *), -(n + 1) * sizeof(struct gl_shader *)); + realloc(shProg-Shaders, + (n + 1) * sizeof(struct gl_shader *)); if (!shProg-Shaders) { _mesa_error(ctx, GL_OUT_OF_MEMORY, glAttachShader); return; diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c index dc0a510..e2eadc3 100644 --- a/src/mesa/program/prog_instruction.c +++ b/src/mesa/program/prog_instruction.c @@ -90,9 +90,8 @@ _mesa_realloc_instructions(struct prog_instruction *oldInst, struct prog_instruction *newInst; newInst = (struct prog_instruction *) - _mesa_realloc(oldInst, -numOldInst * sizeof(struct prog_instruction), -numNewInst * sizeof(struct prog_instruction)); + realloc(oldInst, + numNewInst * sizeof(struct prog_instruction)); return newInst; } diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index f43deba..896c605 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -121,9 +121,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, /* realloc arrays */ paramList-Parameters = (struct gl_program_parameter *) -_mesa_realloc(paramList-Parameters, - oldNum * sizeof(struct gl_program_parameter), - paramList-Size * sizeof(struct gl_program_parameter)); + realloc(paramList-Parameters, + paramList-Size * sizeof(struct gl_program_parameter)); paramList-ParameterValues = (gl_constant_value (*)[4])
[Mesa-dev] [PATCH 03/12] mesa: Replace a priori knowledge of gcc attributes with configure tests.
Note that I had to add support for testing the packed attribute to m4/ax_gcc_func_attribute.m4. --- configure.ac | 4 + m4/ax_gcc_func_attribute.m4| 223 + src/mesa/drivers/dri/i965/intel_tex_subimage.c | 6 - src/util/macros.h | 11 +- 4 files changed, 234 insertions(+), 10 deletions(-) create mode 100644 m4/ax_gcc_func_attribute.m4 diff --git a/configure.ac b/configure.ac index 6b0adbc..0aec6eb 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,10 @@ AX_GCC_BUILTIN([__builtin_popcount]) AX_GCC_BUILTIN([__builtin_popcountll]) AX_GCC_BUILTIN([__builtin_unreachable]) +AX_GCC_FUNC_ATTRIBUTE([flatten]) +AX_GCC_FUNC_ATTRIBUTE([format]) +AX_GCC_FUNC_ATTRIBUTE([packed]) + AM_CONDITIONAL([GEN_ASM_OFFSETS], test x$GEN_ASM_OFFSETS = xyes) dnl Make sure the pkg-config macros are defined diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4 new file mode 100644 index 000..4e0ecbb --- /dev/null +++ b/m4/ax_gcc_func_attribute.m4 @@ -0,0 +1,223 @@ +# === +# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# === +# +# SYNOPSIS +# +# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) +# +# DESCRIPTION +# +# This macro checks if the compiler supports one of GCC's function +# attributes; many other compilers also provide function attributes with +# the same syntax. Compiler warnings are used to detect supported +# attributes as unsupported ones are ignored by default so quieting +# warnings when using this macro will yield false positives. +# +# The ATTRIBUTE parameter holds the name of the attribute to be checked. +# +# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_ATTRIBUTE. +# +# The macro caches its result in the ax_cv_have_func_attribute_attribute +# variable. +# +# The macro currently supports the following function attributes: +# +#alias +#aligned +#alloc_size +#always_inline +#artificial +#cold +#const +#constructor +#deprecated +#destructor +#dllexport +#dllimport +#error +#externally_visible +#flatten +#format +#format_arg +#gnu_inline +#hot +#ifunc +#leaf +#malloc +#noclone +#noinline +#nonnull +#noreturn +#nothrow +#optimize +#packed +#pure +#unused +#used +#visibility +#warning +#warn_unused_result +#weak +#weakref +# +# Unsuppored function attributes will be tested with a prototype returning +# an int and not accepting any arguments and the result of the check might +# be wrong or meaningless so use with care. +# +# LICENSE +# +# Copyright (c) 2013 Gabriele Svelto gabriele.sve...@gmail.com +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ +AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) + +AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ +m4_case([$1], +[alias], [ +int foo( void ) { return 0; } +int bar( void ) __attribute__(($1(foo))); +], +[aligned], [ +int foo( void ) __attribute__(($1(32))); +], +[alloc_size], [ +void *foo(int a) __attribute__(($1(1))); +], +[always_inline], [ +inline __attribute__(($1)) int foo( void ) { return 0; } +], +[artificial], [ +inline __attribute__(($1)) int foo( void ) { return 0; } +], +[cold], [ +int foo( void ) __attribute__(($1)); +], +[const], [ +int foo( void ) __attribute__(($1)); +], +[constructor], [ +int foo( void ) __attribute__(($1)); +], +[deprecated], [ +int foo( void ) __attribute__(($1())); +], +[destructor], [ +int foo( void ) __attribute__(($1)); +], +[dllexport], [ +__attribute__(($1)) int foo( void ) { return 0; } +], +[dllimport], [ +int foo( void ) __attribute__(($1)); +], +[error], [ +int foo( void ) __attribute__(($1())); +], +[externally_visible], [ +
[Mesa-dev] [PATCH 05/12] mesa: Consolidate used/visibility function attributes.
And check for them in configure. --- configure.ac | 2 ++ src/mapi/u_compiler.h| 11 --- src/mesa/main/compiler.h | 20 src/util/macros.h| 14 ++ 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index 024050e..2fe1539 100644 --- a/configure.ac +++ b/configure.ac @@ -145,6 +145,8 @@ AX_GCC_FUNC_ATTRIBUTE([flatten]) AX_GCC_FUNC_ATTRIBUTE([format]) AX_GCC_FUNC_ATTRIBUTE([malloc]) AX_GCC_FUNC_ATTRIBUTE([packed]) +AX_GCC_FUNC_ATTRIBUTE([used]) +AX_GCC_FUNC_ATTRIBUTE([visibility]) AM_CONDITIONAL([GEN_ASM_OFFSETS], test x$GEN_ASM_OFFSETS = xyes) diff --git a/src/mapi/u_compiler.h b/src/mapi/u_compiler.h index f376e97..b305beb 100644 --- a/src/mapi/u_compiler.h +++ b/src/mapi/u_compiler.h @@ -9,17 +9,6 @@ # define INLINE inline #endif -/* Function visibility */ -#ifndef PUBLIC -# if defined(__GNUC__) || (defined(__SUNPRO_C) (__SUNPRO_C = 0x590)) -#define PUBLIC __attribute__((visibility(default))) -# elif defined(_MSC_VER) -#define PUBLIC __declspec(dllexport) -# else -#define PUBLIC -# endif -#endif - #ifndef likely # if defined(__GNUC__) #define likely(x) __builtin_expect(!!(x), 1) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 813bf19..c1c1005 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -112,26 +112,6 @@ extern C { #endif -/** - * PUBLIC/USED macros - * - * If we build the library with gcc's -fvisibility=hidden flag, we'll - * use the PUBLIC macro to mark functions that are to be exported. - * - * We also need to define a USED attribute, so the optimizer doesn't - * inline a static function that we later use in an alias. - ajax - */ -#ifndef PUBLIC -# if (defined(__GNUC__) __GNUC__ = 4) || (defined(__SUNPRO_C) (__SUNPRO_C = 0x590)) -#define PUBLIC __attribute__((visibility(default))) -#define USED __attribute__((used)) -# else -#define PUBLIC -#define USED -# endif -#endif - - /* XXX: Use standard `__func__` instead */ #ifndef __FUNCTION__ # define __FUNCTION__ __func__ diff --git a/src/util/macros.h b/src/util/macros.h index 40ebf02..c65ce8a 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -102,6 +102,20 @@ do {\ #define PACKED #endif +#ifdef HAVE_FUNC_ATTRIBUTE_USED +#define USED __attribute__((__used__)) +#else +#define USED +#endif + +#ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY +#define PUBLIC __attribute__((__visibility__(default))) +#elif defined(_MSC_VER) +#define PUBLIC __declspec(dllexport) +#else +#define PUBLIC +#endif + #ifdef __cplusplus /** * Macro function that evaluates to true if T is a trivially -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 06/12] mesa: Consolidate likely/unlikely macros.
--- src/gallium/include/pipe/p_compiler.h | 45 +-- src/mapi/u_compiler.h | 10 --- src/mesa/drivers/dri/i915/intel_context.h | 10 --- src/util/macros.h | 32 ++ 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 939fb06..4ed6a4b 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -30,6 +30,7 @@ #include c99_compat.h /* inline, __func__, etc. */ +#include ../../../util/macros.h #include p_config.h @@ -204,50 +205,6 @@ void _ReadWriteBarrier(void); #endif - -/* You should use these macros to mark if blocks where the if condition - * is either likely to be true, or unlikely to be true. - * - * This will inform human readers of this fact, and will also inform - * the compiler, who will in turn inform the CPU. - * - * CPUs often start executing code inside the if or the else blocks - * without knowing whether the condition is true or not, and will have - * to throw the work away if they find out later they executed the - * wrong part of the if. - * - * If these macros are used, the CPU is more likely to correctly predict - * the right path, and will avoid speculatively executing the wrong branch, - * thus not throwing away work, resulting in better performance. - * - * In light of this, it is also a good idea to mark as likely a path - * which is not necessarily always more likely, but that will benefit much - * more from performance improvements since it is already much faster than - * the other path, or viceversa with unlikely. - * - * Example usage: - * if(unlikely(do_we_need_a_software_fallback())) - *do_software_fallback(); - * else - *render_with_gpu(); - * - * The macros follow the Linux kernel convention, and more examples can - * be found there. - * - * Note that profile guided optimization can offer better results, but - * needs an appropriate coverage suite and does not inform human readers. - */ -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - - /** * Static (compile-time) assertion. * Basically, use COND to dimension an array. If COND is false/zero the diff --git a/src/mapi/u_compiler.h b/src/mapi/u_compiler.h index b305beb..3364ecd 100644 --- a/src/mapi/u_compiler.h +++ b/src/mapi/u_compiler.h @@ -9,14 +9,4 @@ # define INLINE inline #endif -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - #endif /* _U_COMPILER_H_ */ diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index fccf821..0f315da 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -95,16 +95,6 @@ extern void intelFallback(struct intel_context *intel, GLbitfield bit, #define INTEL_WRITE_FULL 0x2 #define INTEL_READ0x4 -#ifndef likely -#ifdef __GNUC__ -#define likely(expr) (__builtin_expect(expr, 1)) -#define unlikely(expr) (__builtin_expect(expr, 0)) -#else -#define likely(expr) (expr) -#define unlikely(expr) (expr) -#endif -#endif - struct intel_sync_object { struct gl_sync_object Base; diff --git a/src/util/macros.h b/src/util/macros.h index c65ce8a..db5b31a 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -37,6 +37,38 @@ # define __builtin_expect(x, y) (x) #endif +/* You should use these macros to mark if blocks where the if condition + * is either likely to be true, or unlikely to be true. + * + * This will inform human readers of this fact, and will also inform + * the compiler, who will in turn inform the CPU. + * + * CPUs often start executing code inside the if or the else blocks + * without knowing whether the condition is true or not, and will have + * to throw the work away if they find out later they executed the + * wrong part of the if. + * + * If these macros are used, the CPU is more likely to correctly predict + * the right path, and will avoid speculatively executing the wrong branch, + * thus not throwing away work, resulting in better performance. + * + * In light of this, it is also a good idea to mark as likely a path + * which is not necessarily always more likely, but that will benefit much + * more from performance improvements since it is already much faster than + * the other path, or viceversa with unlikely. + * + * Example usage: + * if(unlikely(do_we_need_a_software_fallback())) + *do_software_fallback(); + * else + *render_with_gpu(); + * + * The macros follow the Linux kernel convention, and more examples can + * be found
[Mesa-dev] [PATCH 07/12] configure.ac: Use test -a, rather than another test.
--- configure.ac | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 2fe1539..3f4fbca 100644 --- a/configure.ac +++ b/configure.ac @@ -477,7 +477,7 @@ asm_arch= AC_MSG_CHECKING([whether to enable assembly]) test x$enable_asm = xno AC_MSG_RESULT([no]) # disable if cross compiling on x86/x86_64 since we must run gen_matypes -if test x$enable_asm = xyes test x$cross_compiling = xyes; then +if test x$enable_asm = xyes -a x$cross_compiling = xyes; then case $host_cpu in i?86 | x86_64 | amd64) enable_asm=no @@ -811,9 +811,9 @@ esac AM_CONDITIONAL(HAVE_DRICOMMON, test x$enable_dri = xyes ) AM_CONDITIONAL(HAVE_DRISW, test x$enable_dri = xyes ) -AM_CONDITIONAL(HAVE_DRI2, test x$enable_dri = xyes test x$dri_platform = xdrm ) -AM_CONDITIONAL(HAVE_DRI3, test x$enable_dri3 = xyes test x$dri_platform = xdrm ) -AM_CONDITIONAL(HAVE_APPLEDRI, test x$enable_dri = xyes test x$dri_platform = xapple ) +AM_CONDITIONAL(HAVE_DRI2, test x$enable_dri = xyes -a x$dri_platform = xdrm ) +AM_CONDITIONAL(HAVE_DRI3, test x$enable_dri3 = xyes -a x$dri_platform = xdrm ) +AM_CONDITIONAL(HAVE_APPLEDRI, test x$enable_dri = xyes -a x$dri_platform = xapple ) AC_ARG_ENABLE([shared-glapi], [AS_HELP_STRING([--enable-shared-glapi], @@ -1848,19 +1848,19 @@ gallium_check_st() { fi GALLIUM_WINSYS_DIRS=$GALLIUM_WINSYS_DIRS $2 -if test x$enable_dri = xyes test -n $3; then +if test x$enable_dri = xyes -a -n $3; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS $3 fi -if test x$enable_xa = xyes test -n $4; then +if test x$enable_xa = xyes -a -n $4; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS $4 fi -if test x$enable_xvmc = xyes test -n $5; then +if test x$enable_xvmc = xyes -a -n $5; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS $5 fi -if test x$enable_vdpau = xyes test -n $6; then +if test x$enable_vdpau = xyes -a -n $6; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS $6 fi -if test x$enable_omx = xyes test x$7 != x; then +if test x$enable_omx = xyes -a x$7 != x; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS $7 fi } @@ -2087,8 +2087,8 @@ AM_CONDITIONAL(HAVE_GALLIUM_VC4, test x$HAVE_GALLIUM_VC4 = xyes) AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test x$HAVE_GALLIUM_SVGA = xyes -o \ x$HAVE_GALLIUM_SOFTPIPE = xyes) -AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test x$HAVE_GALLIUM_SOFTPIPE = xyes \ - test x$MESA_LLVM = x1) +AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test x$HAVE_GALLIUM_SOFTPIPE = xyes -a \ + x$MESA_LLVM = x1) AM_CONDITIONAL(HAVE_GALLIUM_STATIC_TARGETS, test x$enable_shared_pipe_drivers = xno) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 12/12] configure.ac: Replace gallium_check_st with gallium_require_drm.
--- configure.ac | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 60b2164..1219a80 100644 --- a/configure.ac +++ b/configure.ac @@ -1810,7 +1810,7 @@ AC_SUBST([OPENCL_LIB_INSTALL_DIR]) dnl dnl Gallium helper functions dnl -gallium_check_st() { +gallium_require_drm() { if test x$have_libdrm != xyes; then AC_MSG_ERROR([$1 requires libdrm = $LIBDRM_REQUIRED]) fi @@ -1830,9 +1830,6 @@ gallium_require_drm_loader() { if test x$need_pci_id$have_pci_id = xyesno; then AC_MSG_ERROR([Gallium drm loader requires libudev = $LIBUDEV_REQUIRED or sysfs]) fi -if test x$have_libdrm != xyes; then -AC_MSG_ERROR([Gallium drm loader requires libdrm = $LIBDRM_REQUIRED]) -fi enable_gallium_drm_loader=yes fi } @@ -1878,31 +1875,32 @@ if test -n $with_gallium_drivers; then case x$driver in xsvga) HAVE_GALLIUM_SVGA=yes +gallium_require_drm svga gallium_require_drm_loader -gallium_check_st svga svga/drm dri/vmwgfx xa/vmwgfx ;; xi915) HAVE_GALLIUM_I915=yes PKG_CHECK_MODULES([INTEL], [libdrm_intel = $LIBDRM_INTEL_REQUIRED]) +gallium_require_drm Gallium i915 gallium_require_drm_loader -gallium_check_st Gallium i915 i915/drm dri/i915 xa/i915 ;; xilo) HAVE_GALLIUM_ILO=yes PKG_CHECK_MODULES([INTEL], [libdrm_intel = $LIBDRM_INTEL_REQUIRED]) +gallium_require_drm Gallium i965/ilo gallium_require_drm_loader -gallium_check_st Gallium i965/ilo intel/drm dri/ilo xa/ilo ;; xr300) HAVE_GALLIUM_R300=yes PKG_CHECK_MODULES([RADEON], [libdrm_radeon = $LIBDRM_RADEON_REQUIRED]) +gallium_require_drm Gallium R300 gallium_require_drm_loader gallium_require_llvm Gallium R300 -gallium_check_st Gallium R300 radeon/drm dri/r300 ;; xr600) HAVE_GALLIUM_R600=yes PKG_CHECK_MODULES([RADEON], [libdrm_radeon = $LIBDRM_RADEON_REQUIRED]) +gallium_require_drm Gallium R600 gallium_require_drm_loader if test x$enable_r600_llvm = xyes -o x$enable_opencl = xyes; then radeon_llvm_check r600g @@ -1914,27 +1912,26 @@ if test -n $with_gallium_drivers; then if test x$enable_opencl = xyes; then LLVM_COMPONENTS=${LLVM_COMPONENTS} bitreader asmparser fi -gallium_check_st Gallium R600 radeon/drm dri/r600 xvmc/r600 vdpau/r600 omx/r600 ;; xradeonsi) HAVE_GALLIUM_RADEONSI=yes PKG_CHECK_MODULES([RADEON], [libdrm_radeon = $LIBDRM_RADEON_REQUIRED]) +gallium_require_drm radeonsi gallium_require_drm_loader radeon_llvm_check radeonsi require_egl_drm radeonsi -gallium_check_st radeonsi radeon/drm dri/radeonsi vdpau/radeonsi omx/radeonsi ;; xnouveau) HAVE_GALLIUM_NOUVEAU=yes PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau = $LIBDRM_NOUVEAU_REQUIRED]) +gallium_require_drm nouveau gallium_require_drm_loader -gallium_check_st nouveau nouveau/drm dri/nouveau xa/nouveau xvmc/nouveau vdpau/nouveau omx/nouveau ;; xfreedreno) HAVE_GALLIUM_FREEDRENO=yes PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno = $LIBDRM_FREEDRENO_REQUIRED]) +gallium_require_drm freedreno gallium_require_drm_loader -gallium_check_st freedreno freedreno/drm dri/freedreno xa/freedreno ;; xswrast) HAVE_GALLIUM_SOFTPIPE=yes @@ -1944,8 +1941,8 @@ if test -n $with_gallium_drivers; then ;; xvc4) HAVE_GALLIUM_VC4=yes +gallium_require_drm vc4 gallium_require_drm_loader -gallium_check_st vc4 vc4/drm dri-vc4 case $host_cpu in i?86 | x86_64 | amd64) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/12] configure.ac: Stop checking for perl.
Added by commit a75c6163, but no longer used. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3f4fbca..fe96e7a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,8 +70,6 @@ AX_PROG_FLEX([], AS_IF([test ! -f $srcdir/src/glsl/glcpp/glcpp-lex.c], [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])])) -AC_PATH_PROG([PERL], [perl]) - AC_CHECK_PROG(INDENT, indent, indent, cat) if test x$INDENT != xcat; then AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool') -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 09/12] configure.ac: Use autoconf macro for GNU make.
--- configure.ac| 2 +- m4/ax_check_gnu_make.m4 | 78 + 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 m4/ax_check_gnu_make.m4 diff --git a/configure.ac b/configure.ac index fe96e7a..ebe329b 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ AC_PROG_CC AC_PROG_CXX AM_PROG_CC_C_O AM_PROG_AS -AC_CHECK_PROGS([MAKE], [gmake make]) +AX_CHECK_GNU_MAKE AC_CHECK_PROGS([PYTHON2], [python2 python]) AC_PROG_SED AC_PROG_MKDIR_P diff --git a/m4/ax_check_gnu_make.m4 b/m4/ax_check_gnu_make.m4 new file mode 100644 index 000..938aad7 --- /dev/null +++ b/m4/ax_check_gnu_make.m4 @@ -0,0 +1,78 @@ +# === +# http://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html +# === +# +# SYNOPSIS +# +# AX_CHECK_GNU_MAKE() +# +# DESCRIPTION +# +# This macro searches for a GNU version of make. If a match is found, the +# makefile variable `ifGNUmake' is set to the empty string, otherwise it +# is set to #. This is useful for including a special features in a +# Makefile, which cannot be handled by other versions of make. The +# variable _cv_gnu_make_command is set to the command to invoke GNU make +# if it exists, the empty string otherwise. +# +# Here is an example of its use: +# +# Makefile.in might contain: +# +# # A failsafe way of putting a dependency rule into a makefile +# $(DEPEND): +# $(CC) -MM $(srcdir)/*.c $(DEPEND) +# +# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) +# @ifGNUmake@ include $(DEPEND) +# @ifGNUmake@ endif +# +# Then configure.in would normally contain: +# +# AX_CHECK_GNU_MAKE() +# AC_OUTPUT(Makefile) +# +# Then perhaps to cause gnu make to override any other make, we could do +# something like this (note that GNU make always looks for GNUmakefile +# first): +# +# if ! test x$_cv_gnu_make_command = x ; then +# mv Makefile GNUmakefile +# echo .DEFAULT: Makefile ; +# echo \ $_cv_gnu_make_command \$@ Makefile; +# fi +# +# Then, if any (well almost any) other make is called, and GNU make also +# exists, then the other make wraps the GNU make. +# +# LICENSE +# +# Copyright (c) 2008 John Darrington j.darring...@elvis.murdoch.edu.au +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +AC_DEFUN([AX_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command, +_cv_gnu_make_command='' ; +dnl Search all the common names for GNU make +for a in $MAKE make gmake gnumake ; do +if test -z $a ; then continue ; fi ; +if ( sh -c $a --version 2 /dev/null | grep GNU 21 /dev/null ) ; then +_cv_gnu_make_command=$a ; +break; +fi +done ; +) ; +dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise +if test x$_cv_gnu_make_command != x ; then +ifGNUmake='' ; +else +ifGNUmake='#' ; +AC_MSG_RESULT(Not found); +fi +AC_SUBST(ifGNUmake) +] ) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 11/12] configure.ac: Drop gallium directory tracking.
Was only tracked to be printed at the end of configure, but configure quits if it can't build something we requested, rather than silently dropping it, so printing these directories has little use. --- I don't build gallium drivers often, so perhaps I'm not a good judge of whether this is useful. configure.ac | 78 1 file changed, 78 deletions(-) diff --git a/configure.ac b/configure.ac index 071b32c..60b2164 100644 --- a/configure.ac +++ b/configure.ac @@ -844,23 +844,14 @@ enable_shared_pipe_drivers=no dnl dnl Driver specific build directories dnl -GALLIUM_TARGET_DIRS= -GALLIUM_WINSYS_DIRS=sw -GALLIUM_DRIVERS_DIRS=galahad trace rbug noop identity -GALLIUM_STATE_TRACKERS_DIRS= case x$enable_glx$enable_xlib_glx in xyesyes) -GALLIUM_WINSYS_DIRS=$GALLIUM_WINSYS_DIRS sw/xlib -GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS libgl-xlib -GALLIUM_STATE_TRACKERS_DIRS=glx $GALLIUM_STATE_TRACKERS_DIRS NEED_WINSYS_XLIB=yes ;; esac if test x$enable_dri = xyes; then -GALLIUM_WINSYS_DIRS=$GALLIUM_WINSYS_DIRS sw/dri -GALLIUM_STATE_TRACKERS_DIRS=dri $GALLIUM_STATE_TRACKERS_DIRS enable_gallium_loader=$enable_shared_pipe_drivers fi @@ -871,8 +862,6 @@ if test x$enable_gallium_osmesa = xyes; then if test x$enable_osmesa = xyes; then AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations]) fi -GALLIUM_STATE_TRACKERS_DIRS=osmesa $GALLIUM_STATE_TRACKERS_DIRS -GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS osmesa fi AC_SUBST([MESA_LLVM]) @@ -1332,9 +1321,6 @@ if test x$enable_gallium_egl = xyes; then if test x$have_libdrm != xyes; then AC_MSG_ERROR([egl_gallium requires libdrm = $LIBDRM_REQUIRED]) fi - -GALLIUM_STATE_TRACKERS_DIRS=egl $GALLIUM_STATE_TRACKERS_DIRS -GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS egl-static # XXX: Uncomment once converted to use static/shared pipe-drivers #enable_gallium_loader=$enable_shared_pipe_drivers fi @@ -1363,8 +1349,6 @@ if test x$enable_gallium_gbm = xyes; then AC_MSG_ERROR([gbm_gallium is only used by egl_gallium]) fi -GALLIUM_STATE_TRACKERS_DIRS=gbm $GALLIUM_STATE_TRACKERS_DIRS -GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS gbm enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_GALLIUM_GBM, test x$enable_gallium_gbm = xyes) @@ -1381,7 +1365,6 @@ if test x$enable_xa = xyes; then enabling XA. Example: ./configure --enable-xa --with-gallium-drivers=svga...]) fi -GALLIUM_STATE_TRACKERS_DIRS=xa $GALLIUM_STATE_TRACKERS_DIRS enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_XA, test x$enable_xa = xyes) @@ -1404,7 +1387,6 @@ if test x$enable_openvg = xyes; then EGL_CLIENT_APIS=$EGL_CLIENT_APIS '$(VG_LIB)' VG_LIB_DEPS=$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS -GALLIUM_STATE_TRACKERS_DIRS=vega $GALLIUM_STATE_TRACKERS_DIRS VG_PC_LIB_PRIV=-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS AC_SUBST([VG_PC_LIB_PRIV]) fi @@ -1429,7 +1411,6 @@ fi if test x$enable_xvmc = xyes; then PKG_CHECK_MODULES([XVMC], [xvmc = $XVMC_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED]) -GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS xvmc enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_XVMC, test x$enable_xvmc = xyes) @@ -1437,14 +1418,12 @@ AM_CONDITIONAL(HAVE_ST_XVMC, test x$enable_xvmc = xyes) if test x$enable_vdpau = xyes; then PKG_CHECK_MODULES([VDPAU], [vdpau = $VDPAU_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED], [VDPAU_LIBS=`$PKG_CONFIG --libs x11-xcb xcb xcb-dri2`]) -GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS vdpau enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_VDPAU, test x$enable_vdpau = xyes) if test x$enable_omx = xyes; then PKG_CHECK_MODULES([OMX], [libomxil-bellagio = $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb xcb-dri2 = $XCBDRI2_REQUIRED]) -GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS omx enable_gallium_loader=$enable_shared_pipe_drivers fi AM_CONDITIONAL(HAVE_ST_OMX, test x$enable_omx = xyes) @@ -1495,8 +1474,6 @@ if test x$enable_opencl = xyes; then AC_SUBST([LIBCLC_LIBEXECDIR]) fi -GALLIUM_STATE_TRACKERS_DIRS=$GALLIUM_STATE_TRACKERS_DIRS clover -GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS opencl # XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers enable_gallium_loader=yes @@ -1559,7 +1536,6 @@ for plat in $egl_platforms; do case $plat in wayland) PKG_CHECK_MODULES([WAYLAND], [wayland-client = $WAYLAND_REQUIRED wayland-server = $WAYLAND_REQUIRED]) - GALLIUM_WINSYS_DIRS=$GALLIUM_WINSYS_DIRS sw/wayland WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
[Mesa-dev] [PATCH 10/12] configure.ac: Remove duplicate -DHAVE_PTHREAD.
It's also defined by the AX_PTHREAD macro. --- configure.ac | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index ebe329b..071b32c 100644 --- a/configure.ac +++ b/configure.ac @@ -169,13 +169,13 @@ DEFINES=-DUSE_EXTERNAL_DXTN_LIB=1 AC_SUBST([DEFINES]) case $host_os in linux*|*-gnu*|gnu*) -DEFINES=$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD +DEFINES=$DEFINES -D_GNU_SOURCE ;; solaris*) -DEFINES=$DEFINES -DHAVE_PTHREAD -DSVR4 +DEFINES=$DEFINES -DSVR4 ;; cygwin*) -DEFINES=$DEFINES -D_XOPEN_SOURCE=700 -DHAVE_PTHREAD +DEFINES=$DEFINES -D_XOPEN_SOURCE=700 ;; esac @@ -1045,7 +1045,7 @@ AC_ARG_ENABLE([glx-tls], AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) AS_IF([test x$GLX_USE_TLS = xyes -a x$ax_pthread_ok = xyes], - [DEFINES=${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD]) + [DEFINES=${DEFINES} -DGLX_USE_TLS]) dnl dnl More DRI setup @@ -1108,7 +1108,6 @@ if test x$enable_dri = xyes; then esac ;; *freebsd* | dragonfly* | *netbsd* | openbsd*) -DEFINES=$DEFINES -DHAVE_PTHREAD DEFINES=$DEFINES -DHAVE_ALIAS ;; gnu*) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: use ptrdiff_t cast to silence g++ sign warning
g++ 4.8.2 warns on this. -Brian On 09/22/2014 12:41 PM, Ian Romanick wrote: This seems fine. But I don't get a warning here, and that seems a little odd. I'm a pretty old GCC... 4.7.2. What are you on? Either way, this patch is Reviewed-by: Ian Romanick ian.d.roman...@intel.com On 09/22/2014 08:44 AM, Brian Paul wrote: --- src/glsl/link_uniforms.cpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 258d279..a6683a0 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -749,7 +749,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if (end == NULL) continue; - if (l != (end - begin)) + if ((ptrdiff_t) l != (end - begin)) continue; if (strncmp(var-name, begin, l) == 0) { ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC PATCH 2/4] mesa: Unifdef _WIN32_WCE.
I don't think we (at VMware) care for WinCE support anymore. Series looks good to me. Jose From: Matt Turner matts...@gmail.com Sent: 22 September 2014 19:22 To: mesa-dev@lists.freedesktop.org Cc: Jose Fonseca; Matt Turner Subject: [RFC PATCH 2/4] mesa: Unifdef _WIN32_WCE. --- José: if you guys don't care about WinCE anymore, this will let us drop two wrapper functions (bsearch, getenv). src/gallium/auxiliary/util/u_snprintf.c | 9 - src/gallium/state_trackers/egl/x11/glcore.h | 2 -- src/mapi/glapi/gen/gl_gentable.py | 2 +- src/mapi/glapi/glapi_nop.c | 4 +--- src/mesa/main/compiler.h| 2 -- src/mesa/main/errors.c | 2 +- src/mesa/main/imports.c | 21 - 7 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c index a24b6ff..7a2bf2a 100644 --- a/src/gallium/auxiliary/util/u_snprintf.c +++ b/src/gallium/auxiliary/util/u_snprintf.c @@ -334,15 +334,6 @@ static void *mymemcpy(void *, void *, size_t); #endif /* HAVE_UINTPTR_T || defined(uintptr_t) */ #endif /* !defined(UINTPTR_T) */ -/* WinCE5.0 does not have uintptr_t defined */ -#if (_WIN32_WCE 600) -#ifdef UINTPTR_T -#undef UINTPTR_T -#endif -#define UINTPTR_T unsigned long int -#endif - - /* Support for ptrdiff_t. */ #ifndef PTRDIFF_T #if HAVE_PTRDIFF_T || defined(ptrdiff_t) diff --git a/src/gallium/state_trackers/egl/x11/glcore.h b/src/gallium/state_trackers/egl/x11/glcore.h index 547b111..99de6c0 100644 --- a/src/gallium/state_trackers/egl/x11/glcore.h +++ b/src/gallium/state_trackers/egl/x11/glcore.h @@ -31,9 +31,7 @@ * Silicon Graphics, Inc. */ -#if !defined(_WIN32_WCE) #include sys/types.h -#endif #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index ce9af99..deffcee 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -42,7 +42,7 @@ header = /* GLXEXT is the define used in the xserver when the GLX extension i #endif #if (defined(GLXEXT) defined(HAVE_BACKTRACE)) \\ - || (!defined(GLXEXT) defined(DEBUG) !defined(_WIN32_WCE) !defined(__CYGWIN__) !defined(__MINGW32__) !defined(__OpenBSD__) !defined(__NetBSD__) !defined(__DragonFly__)) + || (!defined(GLXEXT) defined(DEBUG) !defined(__CYGWIN__) !defined(__MINGW32__) !defined(__OpenBSD__) !defined(__NetBSD__) !defined(__DragonFly__)) #define USE_BACKTRACE #endif diff --git a/src/mapi/glapi/glapi_nop.c b/src/mapi/glapi/glapi_nop.c index 2597c8c..628276e 100644 --- a/src/mapi/glapi/glapi_nop.c +++ b/src/mapi/glapi/glapi_nop.c @@ -63,7 +63,7 @@ _glapi_set_warning_func(_glapi_proc func) static int Warn(const char *func) { -#if defined(DEBUG) !defined(_WIN32_WCE) +#if defined(DEBUG) if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) { fprintf(stderr, GL User Error: gl%s called without a rendering context\n, func); @@ -103,11 +103,9 @@ NoOpUnused(void) static int NoOpGeneric(void) { -#if !defined(_WIN32_WCE) if (getenv(MESA_DEBUG) || getenv(LIBGL_DEBUG)) { fprintf(stderr, GL User Error: calling GL function without a rendering context\n); } -#endif return 0; } diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 813bf19..185c911 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -214,13 +214,11 @@ static inline GLuint CPU_TO_LE32(GLuint x) /** * ASSERT macro */ -#if !defined(_WIN32_WCE) #if defined(DEBUG) # define ASSERT(X) assert(X) #else # define ASSERT(X) #endif -#endif /* diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 9cde1e0..995fc82 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -1194,7 +1194,7 @@ output_if_debug(const char *prefixString, const char *outputString, fprintf(fout, \n); fflush(fout); -#if defined(_WIN32) !defined(_WIN32_WCE) +#if defined(_WIN32) /* stderr from windows applications without console is not usually * visible, so communicate with the debugger instead */ { diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b18603c..75db685 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -499,24 +499,7 @@ void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) ) { -#if defined(_WIN32_WCE) - void *mid; - int cmp; - while (nmemb) { - nmemb = 1; - mid = (char *)base + nmemb * size; - cmp = (*compar)(key, mid); - if (cmp == 0) -return mid; - if (cmp 0) { -base = (char *)mid + size; ---nmemb; - } - } - return NULL; -#else return bsearch(key, base, nmemb, size, compar); -#endif } /*@}*/ @@
[Mesa-dev] [Bug 59879] reducing symbol visibility of shared objects / static libstdc++
https://bugs.freedesktop.org/show_bug.cgi?id=59879 --- Comment #3 from Emil Velikov emil.l.veli...@gmail.com --- The issue here is that while -static-libstdc++ should work for both executables and libraries and gcc is smart enough to understand it, libtool is not :\ The latter essentially ignores the switch and always explicitly appends -lstdc++. Thus even adding -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic to our linker flags (inside the makefiles) will not work, as those come prior to -lstdc++. I fear that someone familiar with libtool will need to fix it... that or we can nuke the c++ code from mesa xD Either way, at least the symbol visibility is resolved has been fixed with recent mesa :) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC PATCH 2/4] mesa: Unifdef _WIN32_WCE.
On Mon, Sep 22, 2014 at 11:56 AM, Jose Fonseca jfons...@vmware.com wrote: I don't think we (at VMware) care for WinCE support anymore. Series looks good to me. Thanks! ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 62027] [build error] ln: accessing `.libs/libdricore9.0.3.so.1.0.0': No such file or directory
https://bugs.freedesktop.org/show_bug.cgi?id=62027 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #2 from Emil Velikov emil.l.veli...@gmail.com --- The libdricore is gone in recent mesa. Good bye and good riddance :P -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 65420] Remove gallium draw_arrays() and draw_arrays_instanced() functions
https://bugs.freedesktop.org/show_bug.cgi?id=65420 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Emil Velikov emil.l.veli...@gmail.com --- commit 3069357ef0cfa112c3c77a25c010df7f9af4467d Author: Arnas Milasevicius giant...@gmail.com Date: Fri Jun 7 01:21:19 2013 +0300 gallium: Remove draw_arrays() and draw_arrays_instanced() functions Moved draw_arrays() to st_draw_feedback.c and removed draw_arrays_instanced(). draw_arrays() was used by nobody else. Now there's just one draw entrypoint into the draw module. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 04/12] ralloc: Mark ralloc functions with gcc's malloc attribute.
Should we also add __attribute__(alloc_size(2)) to these functions? On 09/22/2014 11:51 AM, Matt Turner wrote: Cuts a few hundred bytes from the DRI drivers, so it must give gcc some extra information. --- configure.ac | 1 + src/util/macros.h | 6 ++ src/util/ralloc.h | 16 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 0aec6eb..024050e 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,7 @@ AX_GCC_BUILTIN([__builtin_unreachable]) AX_GCC_FUNC_ATTRIBUTE([flatten]) AX_GCC_FUNC_ATTRIBUTE([format]) +AX_GCC_FUNC_ATTRIBUTE([malloc]) AX_GCC_FUNC_ATTRIBUTE([packed]) AM_CONDITIONAL([GEN_ASM_OFFSETS], test x$GEN_ASM_OFFSETS = xyes) diff --git a/src/util/macros.h b/src/util/macros.h index a9867b4..40ebf02 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -87,6 +87,12 @@ do {\ #define PRINTFLIKE(f, a) #endif +#ifdef HAVE_FUNC_ATTRIBUTE_MALLOC +#define MALLOCLIKE __attribute__((__malloc__)) +#else +#define MALLOCLIKE +#endif + /* Used to optionally mark structures with misaligned elements or size as * packed, to trade off performance for space. */ diff --git a/src/util/ralloc.h b/src/util/ralloc.h index 4b88f32..f088a36 100644 --- a/src/util/ralloc.h +++ b/src/util/ralloc.h @@ -98,14 +98,14 @@ void *ralloc_context(const void *ctx); * simply allocates storage for \p size bytes and returns the pointer, * similar to \c malloc. */ -void *ralloc_size(const void *ctx, size_t size); +void *ralloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Allocate zero-initialized memory chained off of the given context. * * This is similar to \c calloc with a size of 1. */ -void *rzalloc_size(const void *ctx, size_t size); +void *rzalloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Resize a piece of ralloc-managed memory, preserving data. @@ -185,7 +185,7 @@ void *reralloc_size(const void *ctx, void *ptr, size_t size); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *ralloc_array_size(const void *ctx, size_t size, unsigned count); +void *ralloc_array_size(const void *ctx, size_t size, unsigned count) MALLOCLIKE; /** * Allocate a zero-initialized array chained off the given context. @@ -195,7 +195,7 @@ void *ralloc_array_size(const void *ctx, size_t size, unsigned count); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *rzalloc_array_size(const void *ctx, size_t size, unsigned count); +void *rzalloc_array_size(const void *ctx, size_t size, unsigned count) MALLOCLIKE; /** * Resize a ralloc-managed array, preserving data. @@ -257,7 +257,7 @@ void ralloc_set_destructor(const void *ptr, void(*destructor)(void *)); /** * Duplicate a string, allocating the memory from the given context. */ -char *ralloc_strdup(const void *ctx, const char *str); +char *ralloc_strdup(const void *ctx, const char *str) MALLOCLIKE; /** * Duplicate a string, allocating the memory from the given context. @@ -265,7 +265,7 @@ char *ralloc_strdup(const void *ctx, const char *str); * Like \c strndup, at most \p n characters are copied. If \p str is longer * than \p n characters, \p n are copied, and a termining \c '\0' byte is added. */ -char *ralloc_strndup(const void *ctx, const char *str, size_t n); +char *ralloc_strndup(const void *ctx, const char *str, size_t n) MALLOCLIKE; /** * Concatenate two strings, allocating the necessary space. @@ -302,7 +302,7 @@ bool ralloc_strncat(char **dest, const char *str, size_t n); * * \return The newly allocated string. */ -char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); +char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3) MALLOCLIKE; /** * Print to a string, given a va_list. @@ -312,7 +312,7 @@ char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); * * \return The newly allocated string. */ -char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args); +char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args) MALLOCLIKE; /** * Rewrite the tail of an existing string, starting at a given index. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/12] mesa: Consolidate likely/unlikely macros.
On Mon, Sep 22, 2014 at 11:51 AM, Matt Turner matts...@gmail.com wrote: --- src/gallium/include/pipe/p_compiler.h | 45 +-- src/mapi/u_compiler.h | 10 --- src/mesa/drivers/dri/i915/intel_context.h | 10 --- src/util/macros.h | 32 ++ 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 939fb06..4ed6a4b 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -30,6 +30,7 @@ #include c99_compat.h /* inline, __func__, etc. */ +#include ../../../util/macros.h Do we really need all those ..s? Seems to me like we should add something to Makefile.am instead. #include p_config.h @@ -204,50 +205,6 @@ void _ReadWriteBarrier(void); #endif - -/* You should use these macros to mark if blocks where the if condition - * is either likely to be true, or unlikely to be true. - * - * This will inform human readers of this fact, and will also inform - * the compiler, who will in turn inform the CPU. - * - * CPUs often start executing code inside the if or the else blocks - * without knowing whether the condition is true or not, and will have - * to throw the work away if they find out later they executed the - * wrong part of the if. - * - * If these macros are used, the CPU is more likely to correctly predict - * the right path, and will avoid speculatively executing the wrong branch, - * thus not throwing away work, resulting in better performance. - * - * In light of this, it is also a good idea to mark as likely a path - * which is not necessarily always more likely, but that will benefit much - * more from performance improvements since it is already much faster than - * the other path, or viceversa with unlikely. - * - * Example usage: - * if(unlikely(do_we_need_a_software_fallback())) - *do_software_fallback(); - * else - *render_with_gpu(); - * - * The macros follow the Linux kernel convention, and more examples can - * be found there. - * - * Note that profile guided optimization can offer better results, but - * needs an appropriate coverage suite and does not inform human readers. - */ -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - - /** * Static (compile-time) assertion. * Basically, use COND to dimension an array. If COND is false/zero the diff --git a/src/mapi/u_compiler.h b/src/mapi/u_compiler.h index b305beb..3364ecd 100644 --- a/src/mapi/u_compiler.h +++ b/src/mapi/u_compiler.h @@ -9,14 +9,4 @@ # define INLINE inline #endif -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - #endif /* _U_COMPILER_H_ */ diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index fccf821..0f315da 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -95,16 +95,6 @@ extern void intelFallback(struct intel_context *intel, GLbitfield bit, #define INTEL_WRITE_FULL 0x2 #define INTEL_READ0x4 -#ifndef likely -#ifdef __GNUC__ -#define likely(expr) (__builtin_expect(expr, 1)) -#define unlikely(expr) (__builtin_expect(expr, 0)) -#else -#define likely(expr) (expr) -#define unlikely(expr) (expr) -#endif -#endif - struct intel_sync_object { struct gl_sync_object Base; diff --git a/src/util/macros.h b/src/util/macros.h index c65ce8a..db5b31a 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -37,6 +37,38 @@ # define __builtin_expect(x, y) (x) #endif +/* You should use these macros to mark if blocks where the if condition + * is either likely to be true, or unlikely to be true. + * + * This will inform human readers of this fact, and will also inform + * the compiler, who will in turn inform the CPU. + * + * CPUs often start executing code inside the if or the else blocks + * without knowing whether the condition is true or not, and will have + * to throw the work away if they find out later they executed the + * wrong part of the if. + * + * If these macros are used, the CPU is more likely to correctly predict + * the right path, and will avoid speculatively executing the wrong branch, + * thus not throwing away work, resulting in better performance. + * + * In light of this, it is also a good idea to mark as likely a path + * which is not necessarily always more likely, but that will benefit much + * more from performance improvements since it is already much
Re: [Mesa-dev] [PATCH 2/3] gallium: replace pipe_type enum with tgsi_type enum
The only real purpose to this patch series was to clean up some type cross-contamination I found between TGSI and p_formats.h (actually, I found and patched this a few months ago but only rediscovered it this weekend). I think the purpose of the return type is to know if the sampler returns float vs. int without knowing anything about the texture. But I don't understand unorm/snorm there either. If it's really not used, maybe we can yank it down the road. I like the tgsi_return_type suggestion. I'll do that. -Brian On 09/22/2014 11:48 AM, Roland Scheidegger wrote: The series looks good to me, though could rename the (quite underused) pipe_type enum to tgsi_return_type instead and leave tgsi_type alone? Or for further clarity, rename both (to tgsi_opcode_type and tgsi_ret_type or something). Either way though looks ok to me. (That said, I don't understand what the tgsi return type is really good for. This is a d3d10-ism obviously, but even there I don't get it. What the hell does it do? The return type from sampling can't be something like unorm anyway, and I can't see why it makes sense to have to describe the pre-sampling channel type here, as that's going to be determined by the actual format anyway, so if this really would describe the pre-sampling channel type, it would mean you'd have to redeclare the shader if you want to sample float vs. unorm texture etc. which doesn't make much sense to me, is this really the case?. llvmpipe/gallivm certainly don't care about that channel type one bit.) Roland Am 22.09.2014 17:44, schrieb Brian Paul: The only place the enum pipe_type was used is for the TGSI sampler view return type. So make it a TGSI type. --- src/gallium/auxiliary/tgsi/tgsi_build.c|8 src/gallium/auxiliary/tgsi/tgsi_strings.c |3 ++- src/gallium/auxiliary/tgsi/tgsi_strings.h |2 +- src/gallium/auxiliary/tgsi/tgsi_text.c |4 ++-- src/gallium/include/pipe/p_format.h|9 - src/gallium/include/pipe/p_shader_tokens.h | 17 + 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index bef5c75..ffc4c61 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -297,10 +297,10 @@ tgsi_default_declaration_sampler_view(void) struct tgsi_declaration_sampler_view dsv; dsv.Resource = TGSI_TEXTURE_BUFFER; - dsv.ReturnTypeX = PIPE_TYPE_UNORM; - dsv.ReturnTypeY = PIPE_TYPE_UNORM; - dsv.ReturnTypeZ = PIPE_TYPE_UNORM; - dsv.ReturnTypeW = PIPE_TYPE_UNORM; + dsv.ReturnTypeX = TGSI_TYPE_UNORM; + dsv.ReturnTypeY = TGSI_TYPE_UNORM; + dsv.ReturnTypeZ = TGSI_TYPE_UNORM; + dsv.ReturnTypeW = TGSI_TYPE_UNORM; return dsv; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c index 3c108a8..fb19893 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.c +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c @@ -125,7 +125,7 @@ const char *tgsi_property_names[TGSI_PROPERTY_COUNT] = VS_POSITION_WINDOW_SPACE }; -const char *tgsi_type_names[5] = +const char *tgsi_type_names[TGSI_TYPE_COUNT] = { UNORM, SNORM, @@ -195,6 +195,7 @@ tgsi_strings_check(void) STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT); STATIC_ASSERT(Elements(tgsi_primitive_names) == PIPE_PRIM_MAX); STATIC_ASSERT(Elements(tgsi_interpolate_names) == TGSI_INTERPOLATE_COUNT); + STATIC_ASSERT(Elements(tgsi_type_names) == TGSI_TYPE_COUNT); (void) tgsi_processor_type_names; (void) tgsi_type_names; (void) tgsi_immediate_type_names; diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.h b/src/gallium/auxiliary/tgsi/tgsi_strings.h index 1c37c29..1e96883 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_strings.h +++ b/src/gallium/auxiliary/tgsi/tgsi_strings.h @@ -46,7 +46,7 @@ extern const char *tgsi_texture_names[TGSI_TEXTURE_COUNT]; extern const char *tgsi_property_names[TGSI_PROPERTY_COUNT]; -extern const char *tgsi_type_names[5]; +extern const char *tgsi_type_names[TGSI_TYPE_COUNT]; extern const char *tgsi_interpolate_names[TGSI_INTERPOLATE_COUNT]; diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 7291145..296af2a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1258,7 +1258,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) ++cur; eat_opt_white( cur ); for (j = 0; j 4; ++j) { -for (i = 0; i PIPE_TYPE_COUNT; ++i) { +for (i = 0; i TGSI_TYPE_COUNT; ++i) { if (str_match_nocase_whole(cur, tgsi_type_names[i])) { switch (j) { case 0: @@ -1279,7 +1279,7 @@ static boolean parse_declaration( struct translate_ctx *ctx ) break;
Re: [Mesa-dev] [PATCH 01/12] mesa: Use realloc() instead of _mesa_realloc() and remove the latter.
Patches 1 through 8 and 10 are Reviewed-by: Ian Romanick ian.d.roman...@intel.com I don't grok the others well enough to say anything about them. On 09/22/2014 11:50 AM, Matt Turner wrote: --- src/gallium/state_trackers/glx/xlib/glx_api.c | 3 +-- src/mesa/drivers/x11/fakeglx.c| 3 +-- src/mesa/main/imports.c | 14 -- src/mesa/main/imports.h | 3 --- src/mesa/main/shaderapi.c | 5 ++--- src/mesa/program/prog_instruction.c | 5 ++--- src/mesa/program/prog_parameter.c | 5 ++--- 7 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index d97cbd7..84b605a 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -248,8 +248,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis-vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) realloc( VisualTable, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index eba13ac..a47ad74 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -326,8 +326,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis-vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) realloc( VisualTable, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4afe156..c5a7d63 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -209,20 +209,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, #endif } - - -/** Reallocate memory */ -void * -_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) -{ - const size_t copySize = (oldSize newSize) ? oldSize : newSize; - void *newBuffer = malloc(newSize); - if (newBuffer oldBuffer copySize 0) - memcpy(newBuffer, oldBuffer, copySize); - free(oldBuffer); - return newBuffer; -} - /*@}*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 59fd19c..8dbcf83 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -473,9 +473,6 @@ _mesa_exec_malloc( GLuint size ); extern void _mesa_exec_free( void *addr ); -extern void * -_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); - #ifndef FFS_DEFINED #define FFS_DEFINED 1 diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 620cab3..dc8b255 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -272,9 +272,8 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader) /* grow list */ shProg-Shaders = (struct gl_shader **) - _mesa_realloc(shProg-Shaders, -n * sizeof(struct gl_shader *), -(n + 1) * sizeof(struct gl_shader *)); + realloc(shProg-Shaders, + (n + 1) * sizeof(struct gl_shader *)); if (!shProg-Shaders) { _mesa_error(ctx, GL_OUT_OF_MEMORY, glAttachShader); return; diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c index dc0a510..e2eadc3 100644 --- a/src/mesa/program/prog_instruction.c +++ b/src/mesa/program/prog_instruction.c @@ -90,9 +90,8 @@ _mesa_realloc_instructions(struct prog_instruction *oldInst, struct prog_instruction *newInst; newInst = (struct prog_instruction *) - _mesa_realloc(oldInst, -numOldInst * sizeof(struct prog_instruction), -numNewInst * sizeof(struct prog_instruction)); + realloc(oldInst, + numNewInst * sizeof(struct prog_instruction)); return newInst; } diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index f43deba..896c605 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -121,9 +121,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, /* realloc arrays */ paramList-Parameters = (struct gl_program_parameter *) - _mesa_realloc(paramList-Parameters, -oldNum * sizeof(struct
[Mesa-dev] [Bug 70766] Run-time link error in swrast_dri.so
https://bugs.freedesktop.org/show_bug.cgi?id=70766 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #6 from Emil Velikov emil.l.veli...@gmail.com --- Marking this as a duplicate of 81785 which has a lot more information + including a link to the actual llvm/cmake fix. Now all we need is to convince the llvm people to actually push it (or equivalent fix of course) :P *** This bug has been marked as a duplicate of bug 81785 *** -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 81785] MESA checks on configure for llvm 3.4.2 and fails to build with 3.4.2 being installed
https://bugs.freedesktop.org/show_bug.cgi?id=81785 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added CC||ahartm...@gmail.com --- Comment #11 from Emil Velikov emil.l.veli...@gmail.com --- *** Bug 70766 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 73934] Function roundf undeclared in textparam.c when building with MSVC11
https://bugs.freedesktop.org/show_bug.cgi?id=73934 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Emil Velikov emil.l.veli...@gmail.com --- AFAICS the fix is part of the latest two branches (10.2 and 10.3) + master. commit bba8f10598866776ae198b363b3752c2e3bbb126 Author: José Fonseca jfons...@vmware.com Date: Thu Nov 21 13:56:00 2013 + mesa: Use IROUND instead of roundf. roundf is not available on MSVC. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/12] mesa: Consolidate likely/unlikely macros.
I won't claim to have reviewed the automake bits and I haven't built it. However, the C bits in 2, 3, 5, and 6 are Reviewed-by: Jason Ekstrand jason.ekstr...@intel.com On Mon, Sep 22, 2014 at 12:13 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Sep 22, 2014 at 11:51 AM, Matt Turner matts...@gmail.com wrote: --- src/gallium/include/pipe/p_compiler.h | 45 +-- src/mapi/u_compiler.h | 10 --- src/mesa/drivers/dri/i915/intel_context.h | 10 --- src/util/macros.h | 32 ++ 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 939fb06..4ed6a4b 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -30,6 +30,7 @@ #include c99_compat.h /* inline, __func__, etc. */ +#include ../../../util/macros.h Do we really need all those ..s? Seems to me like we should add something to Makefile.am instead. #include p_config.h @@ -204,50 +205,6 @@ void _ReadWriteBarrier(void); #endif - -/* You should use these macros to mark if blocks where the if condition - * is either likely to be true, or unlikely to be true. - * - * This will inform human readers of this fact, and will also inform - * the compiler, who will in turn inform the CPU. - * - * CPUs often start executing code inside the if or the else blocks - * without knowing whether the condition is true or not, and will have - * to throw the work away if they find out later they executed the - * wrong part of the if. - * - * If these macros are used, the CPU is more likely to correctly predict - * the right path, and will avoid speculatively executing the wrong branch, - * thus not throwing away work, resulting in better performance. - * - * In light of this, it is also a good idea to mark as likely a path - * which is not necessarily always more likely, but that will benefit much - * more from performance improvements since it is already much faster than - * the other path, or viceversa with unlikely. - * - * Example usage: - * if(unlikely(do_we_need_a_software_fallback())) - *do_software_fallback(); - * else - *render_with_gpu(); - * - * The macros follow the Linux kernel convention, and more examples can - * be found there. - * - * Note that profile guided optimization can offer better results, but - * needs an appropriate coverage suite and does not inform human readers. - */ -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - - /** * Static (compile-time) assertion. * Basically, use COND to dimension an array. If COND is false/zero the diff --git a/src/mapi/u_compiler.h b/src/mapi/u_compiler.h index b305beb..3364ecd 100644 --- a/src/mapi/u_compiler.h +++ b/src/mapi/u_compiler.h @@ -9,14 +9,4 @@ # define INLINE inline #endif -#ifndef likely -# if defined(__GNUC__) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -# else -#define likely(x) (x) -#define unlikely(x) (x) -# endif -#endif - #endif /* _U_COMPILER_H_ */ diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index fccf821..0f315da 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -95,16 +95,6 @@ extern void intelFallback(struct intel_context *intel, GLbitfield bit, #define INTEL_WRITE_FULL 0x2 #define INTEL_READ0x4 -#ifndef likely -#ifdef __GNUC__ -#define likely(expr) (__builtin_expect(expr, 1)) -#define unlikely(expr) (__builtin_expect(expr, 0)) -#else -#define likely(expr) (expr) -#define unlikely(expr) (expr) -#endif -#endif - struct intel_sync_object { struct gl_sync_object Base; diff --git a/src/util/macros.h b/src/util/macros.h index c65ce8a..db5b31a 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -37,6 +37,38 @@ # define __builtin_expect(x, y) (x) #endif +/* You should use these macros to mark if blocks where the if condition + * is either likely to be true, or unlikely to be true. + * + * This will inform human readers of this fact, and will also inform + * the compiler, who will in turn inform the CPU. + * + * CPUs often start executing code inside the if or the else blocks + * without knowing whether the condition is true or not, and will have + * to throw the work away if they find out later they executed the + * wrong part of the if. + * + * If these macros are used, the CPU is more likely to correctly predict + * the right path, and will avoid speculatively executing the wrong branch, + * thus not throwing away
[Mesa-dev] [PATCH 4/4] configure: use explicit enabled/disabled in config switch description
Rather than having double negatives - disable-opencl, default=no simply use enabled/disabled. It makes things a bit easier for the reader and consistent throughout the file. Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- configure.ac | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index e8db8be..c2ccdfc 100644 --- a/configure.ac +++ b/configure.ac @@ -576,22 +576,22 @@ AC_SUBST([SELINUX_LIBS]) dnl Options for APIs AC_ARG_ENABLE([opengl], [AS_HELP_STRING([--disable-opengl], -[disable support for standard OpenGL API @:@default=no@:@])], +[disable support for standard OpenGL API @:@default=enabled@:@])], [enable_opengl=$enableval], [enable_opengl=yes]) AC_ARG_ENABLE([gles1], [AS_HELP_STRING([--enable-gles1], -[enable support for OpenGL ES 1.x API @:@default=no@:@])], +[enable support for OpenGL ES 1.x API @:@default=disabled@:@])], [enable_gles1=$enableval], [enable_gles1=no]) AC_ARG_ENABLE([gles2], [AS_HELP_STRING([--enable-gles2], -[enable support for OpenGL ES 2.x API @:@default=no@:@])], +[enable support for OpenGL ES 2.x API @:@default=disabled@:@])], [enable_gles2=$enableval], [enable_gles2=no]) AC_ARG_ENABLE([openvg], [AS_HELP_STRING([--enable-openvg], -[enable support for OpenVG API @:@default=no@:@])], +[enable support for OpenVG API @:@default=disabled@:@])], [enable_openvg=$enableval], [enable_openvg=no]) @@ -637,7 +637,7 @@ AC_ARG_ENABLE([egl], AC_ARG_ENABLE([xa], [AS_HELP_STRING([--enable-xa], -[enable build of the XA X Acceleration API @:@default=no@:@])], +[enable build of the XA X Acceleration API @:@default=disabled@:@])], [enable_xa=$enableval], [enable_xa=no]) AC_ARG_ENABLE([gbm], @@ -658,18 +658,18 @@ AC_ARG_ENABLE([vdpau], [enable_vdpau=auto]) AC_ARG_ENABLE([omx], [AS_HELP_STRING([--enable-omx], - [enable OpenMAX library @:@default=no@:@])], + [enable OpenMAX library @:@default=disabled@:@])], [enable_omx=$enableval], [enable_omx=no]) AC_ARG_ENABLE([opencl], [AS_HELP_STRING([--enable-opencl], - [enable OpenCL library @:@default=no@:@])], + [enable OpenCL library @:@default=disabled@:@])], [enable_opencl=$enableval], [enable_opencl=no]) AC_ARG_ENABLE([opencl_icd], [AS_HELP_STRING([--enable-opencl-icd], [Build an OpenCL ICD library to be loaded by an ICD implementation - @:@default=no@:@])], + @:@default=disabled@:@])], [enable_opencl_icd=$enableval], [enable_opencl_icd=no]) AC_ARG_ENABLE([xlib-glx], @@ -681,7 +681,7 @@ AC_ARG_ENABLE([gallium-egl], [AS_HELP_STRING([--enable-gallium-egl], [enable optional EGL state tracker (not required for EGL support in Gallium with OpenGL and OpenGL ES) - @:@default=disable@:@])], + @:@default=disabled@:@])], [enable_gallium_egl=$enableval], [enable_gallium_egl=no]) AC_ARG_ENABLE([gallium-gbm], @@ -694,13 +694,13 @@ AC_ARG_ENABLE([gallium-gbm], AC_ARG_ENABLE([r600-llvm-compiler], [AS_HELP_STRING([--enable-r600-llvm-compiler], -[Enable experimental LLVM backend for graphics shaders @:@default=disable@:@])], +[Enable experimental LLVM backend for graphics shaders @:@default=disabled@:@])], [enable_r600_llvm=$enableval], [enable_r600_llvm=no]) AC_ARG_ENABLE([gallium-tests], [AS_HELP_STRING([--enable-gallium-tests], -[Enable optional Gallium tests) @:@default=disable@:@])], +[Enable optional Gallium tests) @:@default=disabled@:@])], [enable_gallium_tests=$enableval], [enable_gallium_tests=no]) @@ -802,7 +802,7 @@ AM_CONDITIONAL(HAVE_APPLEDRI, test x$enable_dri = xyes test x$dri_platform AC_ARG_ENABLE([shared-glapi], [AS_HELP_STRING([--enable-shared-glapi], -[Enable shared glapi for OpenGL @:@default=yes@:@])], +[Enable shared glapi for OpenGL @:@default=enabled@:@])], [enable_shared_glapi=$enableval], [enable_shared_glapi=yes]) -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/4] configure: drop --with-egl-driver-dir switch
The location of the egl driver(s) is matter that we should have never exposed to the user. Currently the dri2 driver is built into the libEGL loader, with the gallium based one soon to follow. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- configure.ac | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 12dc955..b111732 100644 --- a/configure.ac +++ b/configure.ac @@ -1615,11 +1615,7 @@ if ! echo $egl_platforms | grep -q 'x11'; then GL_PC_CFLAGS=$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS fi -AC_ARG_WITH([egl-driver-dir], -[AS_HELP_STRING([--with-egl-driver-dir=DIR], -[directory for EGL drivers @:@default=${libdir}/egl@:@])], -[EGL_DRIVER_INSTALL_DIR=$withval], -[EGL_DRIVER_INSTALL_DIR='${libdir}/egl']) +EGL_DRIVER_INSTALL_DIR='${libdir}/egl' AC_SUBST([EGL_DRIVER_INSTALL_DIR]) AC_ARG_WITH([max-width], -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/4] configure: ask vdpau.pc for the default location of the vdpau drivers
Rather than using hardcoded values honor the value set at libvdpau build time - i.e. the moduledir variable from vdpau.pc Update the omx description to match reality while we're here. Cc: Christian König deathsim...@vodafone.de Cc: Alexandre Demers alexandre.f.dem...@gmail.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- configure.ac | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index b111732..e8db8be 100644 --- a/configure.ac +++ b/configure.ac @@ -1797,12 +1797,17 @@ if test x$enable_gallium_loader = xyes; then GALLIUM_TARGET_DIRS=$GALLIUM_TARGET_DIRS pipe-loader fi +VDPAU_LIB_INSTALL_DIR_DEFAULT='' +if test x$enable_vdpau = xyes; then +VDPAU_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=moduledir vdpau` +fi + dnl Directory for VDPAU libs AC_ARG_WITH([vdpau-libdir], [AS_HELP_STRING([--with-vdpau-libdir=DIR], -[directory for the VDPAU libraries @:@default=${libdir}/vdpau@:@])], +[directory for the VDPAU libraries @:@default=`pkg-config --variable=moduledir vdpau`@:@])], [VDPAU_LIB_INSTALL_DIR=$withval], -[VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau']) +[VDPAU_LIB_INSTALL_DIR=$VDPAU_LIB_INSTALL_DIR_DEFAULT]) AC_SUBST([VDPAU_LIB_INSTALL_DIR]) OMX_LIB_INSTALL_DIR_DEFAULT='' @@ -1812,7 +1817,7 @@ fi AC_ARG_WITH([omx-libdir], [AS_HELP_STRING([--with-omx-libdir=DIR], -[directory for the OMX libraries])], +[directory for the OMX libraries @:@default=`pkg-config --variable=pluginsdir libomxil-bellagio`@:@])], [OMX_LIB_INSTALL_DIR=$withval], [OMX_LIB_INSTALL_DIR=$OMX_LIB_INSTALL_DIR_DEFAULT]) AC_SUBST([OMX_LIB_INSTALL_DIR]) -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 77240] khrplatform.h not installed if EGL is disabled
https://bugs.freedesktop.org/show_bug.cgi?id=77240 --- Comment #2 from Ian Romanick i...@freedesktop.org --- GLX_EXT_create_context_es2_profile :) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/4] configure: remove non-functional --with-opencl-libdir
The parameter used to control where the gallium pipe-drivers were installed, but was broken since commit 45270fb0fd1abd7619933c2845f9dc74cdfbe6fd Author: Matt Turner matts...@gmail.com Date: Thu Sep 13 10:45:01 2012 -0700 targets/pipe-loader: Convert to automake Considering that nowadays the pipe-drivers can be used by more than just the opencl target, even fixing this up will not be the best idea. Cc: Matt Turner matts...@gmail.com Cc: Francisco Jerez curroje...@riseup.net Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61415 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- configure.ac | 8 1 file changed, 8 deletions(-) diff --git a/configure.ac b/configure.ac index 760a374..12dc955 100644 --- a/configure.ac +++ b/configure.ac @@ -1821,14 +1821,6 @@ AC_ARG_WITH([omx-libdir], [OMX_LIB_INSTALL_DIR=$OMX_LIB_INSTALL_DIR_DEFAULT]) AC_SUBST([OMX_LIB_INSTALL_DIR]) -dnl Directory for OpenCL libs -AC_ARG_WITH([opencl-libdir], -[AS_HELP_STRING([--with-opencl-libdir=DIR], -[directory for auxiliary libraries used by the OpenCL implementation @:@default=${libdir}/opencl@:@])], -[OPENCL_LIB_INSTALL_DIR=$withval], -[OPENCL_LIB_INSTALL_DIR='${libdir}/opencl']) -AC_SUBST([OPENCL_LIB_INSTALL_DIR]) - dnl dnl Gallium helper functions dnl -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/12] mesa: Consolidate likely/unlikely macros.
On Mon, Sep 22, 2014 at 12:13 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Sep 22, 2014 at 11:51 AM, Matt Turner matts...@gmail.com wrote: --- src/gallium/include/pipe/p_compiler.h | 45 +-- src/mapi/u_compiler.h | 10 --- src/mesa/drivers/dri/i915/intel_context.h | 10 --- src/util/macros.h | 32 ++ 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 939fb06..4ed6a4b 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -30,6 +30,7 @@ #include c99_compat.h /* inline, __func__, etc. */ +#include ../../../util/macros.h Do we really need all those ..s? Seems to me like we should add something to Makefile.am instead. Unclear, since there's already a util/ directory in the include path. Probably leave these ../ like they are until we can combine the util directories? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 80615] Files in bellagio directory [omx tracker] don't respect installation folder
https://bugs.freedesktop.org/show_bug.cgi?id=80615 --- Comment #8 from Emil Velikov emil.l.veli...@gmail.com --- Just sent out a few patches which should address all the points raised. Feel free to give them a try :) http://patchwork.freedesktop.org/patch/33915/ http://patchwork.freedesktop.org/patch/33916/ http://patchwork.freedesktop.org/patch/33917/ -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/9] tgsi: fix tgsi transform's epilog callback
Good point, but as it is this follows the convention that's been working all along so far. I can add a comment about looking for the final RET in the future. -Brian On 09/22/2014 11:50 AM, Roland Scheidegger wrote: Do you want to call it at (outermost) RET opcode (if any) instead? tgsi is kinda undecided if there should be a ret opcode in main but sometimes there is... Roland Am 22.09.2014 17:44, schrieb Brian Paul: We want to call the caller's epilog callback when we find the TGSI END instruction, not after it. --- src/gallium/auxiliary/tgsi/tgsi_transform.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c index 93e5b98..5a5f56c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.c +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c @@ -171,10 +171,19 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, ctx-prolog(ctx); } -if (ctx-transform_instruction) - ctx-transform_instruction(ctx, fullinst); -else +if (fullinst-Instruction.Opcode == TGSI_OPCODE_END + ctx-epilog) { + /* Emit caller's epilog */ + ctx-epilog(ctx); + /* Emit END */ ctx-emit_instruction(ctx, fullinst); +} +else { + if (ctx-transform_instruction) + ctx-transform_instruction(ctx, fullinst); + else + ctx-emit_instruction(ctx, fullinst); +} first_instruction = FALSE; } @@ -220,10 +229,6 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, } } - if (ctx-epilog) { - ctx-epilog(ctx); - } - tgsi_parse_free (parse); return ctx-ti; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 76698] DRI loader prints misleading error message
https://bugs.freedesktop.org/show_bug.cgi?id=76698 Emil Velikov emil.l.veli...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Emil Velikov emil.l.veli...@gmail.com --- A partial patch been pushed to master. commit 0406f59eebb77e537b50f5cac3a20355686d2a4d Author: Courtney Goeltzenleuchter court...@lunarg.com Date: Wed Feb 26 14:27:08 2014 -0700 mesa: glx: Reduce error log level The code that parses LIBGL_DRIVERS_PATH was printing an error for every attempted dlopen. It's not an error to have to check multiple items in the path, only an error if no suitable library is found. Reduced the load error to a warning to match behavior of dynamic linker. Signed-off-by: Courtney Goeltzenleuchter court...@lunarg.com Reviewed-by: Kristian Høgsberg k...@bitplanet.net Imho with it enough to get things to a more comprehensive level, yet feel free to send a patch to the mailing list (mesa-dev@...) if you think the rest of the patch should be included :) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev