Mesa (master): i965/blorp: Implement destination clipping and scissoring
Module: Mesa Branch: master Commit: 47b64c9290d54f78e5a20e378593977cd47e285f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=47b64c9290d54f78e5a20e378593977cd47e285f Author: Paul Berry Date: Mon May 14 10:19:08 2012 -0700 i965/blorp: Implement destination clipping and scissoring This patch implements clipping and scissoring of the destination rect for blits that use the blorp engine (e.g. MSAA blits). --- src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 72 -- 1 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 977490d..93c3f73 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -50,6 +50,63 @@ fixup_mirroring(bool &mirror, GLint &coord0, GLint &coord1) } +/** + * Adjust {src,dst}_x{0,1} to account for clipping and scissoring of + * destination coordinates. + * + * Return true if there is still blitting to do, false if all pixels got + * rejected by the clip and/or scissor. + * + * For clarity, the nomenclature of this function assumes we are clipping and + * scissoring the X coordinate; the exact same logic applies for Y + * coordinates. + */ +static inline bool +clip_or_scissor(bool mirror, GLint &src_x0, GLint &src_x1, GLint &dst_x0, +GLint &dst_x1, GLint fb_xmin, GLint fb_xmax) +{ + /* If we are going to scissor everything away, stop. */ + if (!(fb_xmin < fb_xmax && + dst_x0 < fb_xmax && + fb_xmin < dst_x1 && + dst_x0 < dst_x1)) { + return false; + } + + /* Clip the destination rectangle, and keep track of how many pixels we +* clipped off of the left and right sides of it. +*/ + GLint pixels_clipped_left = 0; + GLint pixels_clipped_right = 0; + if (dst_x0 < fb_xmin) { + pixels_clipped_left = fb_xmin - dst_x0; + dst_x0 = fb_xmin; + } + if (fb_xmax < dst_x1) { + pixels_clipped_right = dst_x1 - fb_xmax; + dst_x1 = fb_xmax; + } + + /* If we are mirrored, then before applying pixels_clipped_{left,right} to +* the source coordinates, we need to flip them to account for the +* mirroring. +*/ + if (mirror) { + GLint tmp = pixels_clipped_left; + pixels_clipped_left = pixels_clipped_right; + pixels_clipped_right = tmp; + } + + /* Adjust the source rectangle to remove the pixels corresponding to those +* that were clipped/scissored out of the destination rectangle. +*/ + src_x0 += pixels_clipped_left; + src_x1 -= pixels_clipped_right; + + return true; +} + + static bool try_blorp_blit(struct intel_context *intel, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, @@ -154,14 +211,19 @@ try_blorp_blit(struct intel_context *intel, if (width != dstX1 - dstX0) return false; if (height != dstY1 - dstY0) return false; - /* Make sure width and height don't need to be clipped or scissored. -* TODO: support clipping and scissoring. + /* If the destination rectangle needs to be clipped or scissored, do so. */ + if (!(clip_or_scissor(mirror_x, srcX0, srcX1, dstX0, dstX1, + draw_fb->_Xmin, draw_fb->_Xmax) && + clip_or_scissor(mirror_y, srcY0, srcY1, dstY0, dstY1, + draw_fb->_Ymin, draw_fb->_Ymax))) { + /* Everything got clipped/scissored away, so the blit was successful. */ + return true; + } + + /* TODO: Clipping the source rectangle is not yet implemented. */ if (srcX0 < 0 || (GLuint) srcX1 > read_fb->Width) return false; if (srcY0 < 0 || (GLuint) srcY1 > read_fb->Height) return false; - if (dstX0 < 0 || (GLuint) dstX1 > draw_fb->Width) return false; - if (dstY0 < 0 || (GLuint) dstY1 > draw_fb->Height) return false; - if (ctx->Scissor.Enabled) return false; /* Get ready to blit. This includes depth resolving the src and dst * buffers if necessary. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Clean up some dricore-related detritus in the old Makefile.
Module: Mesa Branch: master Commit: 6a15790632ed65fcaa79e0d03555983330197692 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a15790632ed65fcaa79e0d03555983330197692 Author: Eric Anholt Date: Thu May 24 15:53:09 2012 -0700 mesa: Clean up some dricore-related detritus in the old Makefile. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mesa/Makefile | 30 +++--- 1 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index dab1c37..069527e 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -6,15 +6,9 @@ include $(TOP)/configs/current MESA_LIBS := libmesa.a libmesagallium.a DEPENDS := depend -MESA_OBJ_DIR := . - SRCDIR = . include sources.mak -# adjust object dirs -MESA_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_OBJECTS)) -MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS)) - # define preprocessor flags MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES) @@ -29,24 +23,14 @@ CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS)) MESA_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS) MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS) -define mesa-cc-c - @mkdir -p $(dir $@) - $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS) -endef - -define mesa-cxx-c - @mkdir -p $(dir $@) - $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CXXFLAGS) -endef - -$(MESA_OBJ_DIR)/%.o: %.c - $(call mesa-cc-c,MESA) +%.o: %.c + $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) -$(MESA_OBJ_DIR)/%.o: %.cpp - $(call mesa-cxx-c,MESA) +%.o: %.cpp + $(CXX) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CXXFLAGS) -$(MESA_OBJ_DIR)/%.o: %.S - $(call mesa-cc-c,MESA) +%.o: %.S + $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) # Default: build dependencies, then asm_subdirs, GLSL built-in lib, # then convenience libs (.a) and finally the device drivers: @@ -137,7 +121,7 @@ asm_subdirs: depend: $(ALL_FILES) @ echo "running $(MKDEP)" @ touch depend - @$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(MESA_CPPFLAGS) \ + @$(MKDEP) $(MKDEP_OPTIONS) $(MESA_CPPFLAGS) \ $(ALL_FILES) > /dev/null 2>/dev/null ## ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): automake: Convert dricore building to automake.
Module: Mesa Branch: master Commit: f9d1562f356a66b70f13324e3360d63e8602a35f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9d1562f356a66b70f13324e3360d63e8602a35f Author: Eric Anholt Date: Thu May 24 13:59:21 2012 -0700 automake: Convert dricore building to automake. This is performed in a subdirectory to avoid needing to convert all of src/mesa/Makefile in one go. I can now cherry-pick a commit containing glapi XML changes, do "(cd src/mapi/glapi/gen && make) && make", and get a working driver. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- configure.ac| 12 ++ src/mesa/Makefile | 54 ++ src/mesa/libdricore/.gitignore |2 + src/mesa/libdricore/Makefile.am | 79 +++ 4 files changed, 105 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 6830bde..20bd00b 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ AC_PROG_CPP AC_PROG_CC AC_PROG_CXX AM_PROG_CC_C_O +AM_PROG_AS AC_CHECK_PROGS([MAKE], [gmake make]) AC_CHECK_PROGS([PYTHON2], [python2 python]) AC_PROG_SED @@ -1087,7 +1088,9 @@ if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE' DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE' MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)' +HAVE_DRICORE=yes fi +AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes) AC_SUBST([DRICORE_LIBS]) AC_SUBST([DRICORE_GLSL_LIBS]) AC_SUBST([DRICORE_LIB_DEPS]) @@ -2074,6 +2077,14 @@ AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes) AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes) AC_SUBST([GALLIUM_MAKE_DIRS]) +AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_DRI_DRIVER, echo "$DRIVER_DIRS" | grep 'dri' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_OSMESA_DRIVER, echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1) + +AM_CONDITIONAL(HAVE_X86_ASM, echo "$ASM_FLAGS" | grep 'X86_ASM' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$ASM_FLAGS" | grep 'X86_64_ASM' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$ASM_FLAGS" | grep 'SPARC_ASM' >/dev/null 2>&1) + dnl prepend CORE_DIRS to SRC_DIRS SRC_DIRS="$CORE_DIRS $SRC_DIRS" @@ -2108,6 +2119,7 @@ AC_CONFIG_FILES([configs/autoconf src/glx/Makefile src/mapi/shared-glapi/Makefile src/gtest/Makefile + src/mesa/libdricore/Makefile src/mesa/drivers/dri/dri.pc src/mesa/drivers/dri/Makefile src/mesa/drivers/dri/common/Makefile diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 2d5b727..dab1c37 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -7,13 +7,11 @@ MESA_LIBS := libmesa.a libmesagallium.a DEPENDS := depend MESA_OBJ_DIR := . -DRICORE_OBJ_DIR := objs-dricore SRCDIR = . include sources.mak # adjust object dirs -DRICORE_OBJECTS := $(addprefix $(DRICORE_OBJ_DIR)/, $(MESA_OBJECTS)) MESA_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_OBJECTS)) MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS)) @@ -23,18 +21,13 @@ MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES) # append include dirs MESA_CPPFLAGS += $(INCLUDE_DIRS) -DRICORE_CPPFLAGS = $(MESA_CPPFLAGS) - # tidy compiler flags CFLAGS := $(filter-out $(DEFINES), $(CFLAGS)) CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS)) # LLVM is needed for the state tracker MESA_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS) -DRICORE_CFLAGS := $(LLVM_CFLAGS) $(DRI_CFLAGS) - MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS) -DRICORE_CXXFLAGS := $(LLVM_CFLAGS) $(DRI_CXXFLAGS) define mesa-cc-c @mkdir -p $(dir $@) @@ -55,18 +48,9 @@ $(MESA_OBJ_DIR)/%.o: %.cpp $(MESA_OBJ_DIR)/%.o: %.S $(call mesa-cc-c,MESA) -$(DRICORE_OBJ_DIR)/%.o: %.c - $(call mesa-cc-c,DRICORE) - -$(DRICORE_OBJ_DIR)/%.o: %.cpp - $(call mesa-cxx-c,DRICORE) - -$(DRICORE_OBJ_DIR)/%.o: %.S - $(call mesa-cc-c,DRICORE) - # Default: build dependencies, then asm_subdirs, GLSL built-in lib, # then convenience libs (.a) and finally the device drivers: -default: $(DEPENDS) asm_subdirs $(MESA_LIBS) $(DRICORE_LIBS) driver_subdirs +default: $(DEPENDS) asm_subdirs $(MESA_LIBS) driver_subdirs # include glapi_gen.mk for generating glapi headers for GLES GLAPI := $(TOP)/src/mapi/glapi/gen @@ -111,6 +95,11 @@ program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y program/lex.yy.c: program/program_lexer.l $(FLEX) --never-interactive --outfile=$@ $< +ifneq (,$(DRICORE_LIBS)) +DRICORE_TARGET = dricore +DRICORE_INSTALL_TARGET = install-dricore +endif + ## # Helper libraries used by many drivers: @@ -118,20 +107,16 @@ program/lex.yy.c: program/progra
Mesa (master): automake: Add a prefix variable to the common sources lists.
Module: Mesa Branch: master Commit: e86c40a84d241b954594f5ae7df9b9c3fc797a4e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e86c40a84d241b954594f5ae7df9b9c3fc797a4e Author: Eric Anholt Date: Thu May 24 15:25:09 2012 -0700 automake: Add a prefix variable to the common sources lists. In order to do the minimal change for libdricore conversion to automake, I need to put its Makefile.am in a subdirectory. Automake gets whiny/broken if you use GNU make features like "addprefix" or "$(FILES:%=../%)" to munge your *_SOURCES. So, use a plain old variable to be able to substitute in that "../" Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mesa/Android.mk |1 + src/mesa/Makefile|1 + src/mesa/sources.mak | 554 +- 3 files changed, 279 insertions(+), 277 deletions(-) diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk index 4b62b81..115db47 100644 --- a/src/mesa/Android.mk +++ b/src/mesa/Android.mk @@ -31,6 +31,7 @@ LOCAL_PATH := $(call my-dir) # MESA_GALLIUM_FILES # MESA_FILES # X86_FILES +SRCDIR = . include $(LOCAL_PATH)/sources.mak common_CFLAGS := \ diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 3906053..2d5b727 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -9,6 +9,7 @@ DEPENDS := depend MESA_OBJ_DIR := . DRICORE_OBJ_DIR := objs-dricore +SRCDIR = . include sources.mak # adjust object dirs diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 7b19bbc..63fbf58 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -2,315 +2,315 @@ # this is part of MAIN_FILES MAIN_ES_FILES = \ - main/api_exec_es1.c \ - main/api_exec_es2.c + $(SRCDIR)/main/api_exec_es1.c \ + $(SRCDIR)/main/api_exec_es2.c MAIN_FILES = \ - main/api_arrayelt.c \ - main/api_exec.c \ - main/api_loopback.c \ - main/api_validate.c \ - main/accum.c \ - main/arbprogram.c \ - main/atifragshader.c \ - main/attrib.c \ - main/arrayobj.c \ - main/blend.c \ - main/bufferobj.c \ - main/buffers.c \ - main/clear.c \ - main/clip.c \ - main/colortab.c \ - main/condrender.c \ - main/context.c \ - main/convolve.c \ - main/cpuinfo.c \ - main/debug.c \ - main/depth.c \ - main/dlist.c \ - main/dlopen.c \ - main/drawpix.c \ - main/drawtex.c \ - main/enable.c \ - main/enums.c \ - main/errors.c \ - main/eval.c \ - main/execmem.c \ - main/extensions.c \ - main/fbobject.c \ - main/feedback.c \ - main/ffvertex_prog.c \ - main/fog.c \ - main/formats.c \ - main/format_pack.c \ - main/format_unpack.c \ - main/framebuffer.c \ - main/get.c \ - main/getstring.c \ - main/hash.c \ - main/hint.c \ - main/histogram.c \ - main/image.c \ - main/imports.c \ - main/light.c \ - main/lines.c \ - main/matrix.c \ - main/mipmap.c \ - main/mm.c \ - main/multisample.c \ - main/nvprogram.c \ - main/pack.c \ - main/pbo.c \ - main/pixel.c \ - main/pixelstore.c \ - main/pixeltransfer.c \ - main/points.c \ - main/polygon.c \ - main/queryobj.c \ - main/querymatrix.c \ - main/rastpos.c \ - main/readpix.c \ - main/remap.c \ - main/renderbuffer.c \ - main/samplerobj.c \ - main/scissor.c \ - main/shaderapi.c \ - main/shaderobj.c \ - main/shared.c \ - main/state.c \ - main/stencil.c \ - main/syncobj.c \ - main/texcompress.c \ - main/texcompress_rgtc.c \ - main/texcompress_s3tc.c \ - main/texcompress_fxt1.c \ - main/texcompress_etc.c \ - main/texenv.c \ - main/texformat.c \ - main/texgen.c \ - main/texgetimage.c \ - main/teximage.c \ - main/texobj.c \ - main/texpal.c \ - main/texparam.c \ - main/texstate.c \ - main/texstorage.c \ - main/texstore.c \ - main/texturebarrier.c \ - main/transformfeedback.c \ - main/uniforms.c \ - main/varray.c \ - main/version.c \ - main/viewport.c \ - main/vtxfmt.c \ + $(SRCDIR)/main/api_arrayelt.c \ + $(SRCDIR)/main/api_exec.c \ + $(SRCDIR)/main/api_loopback.c \ + $(SRCDIR)/main/api_validate.c \ + $(SRCDIR)/main/accum.c \ + $(SRCDIR)/main/arbprogram.c \ + $(SRCDIR)/main/atifragshader.c \ + $(SRCDIR)/main/attrib.c \ + $(SRCDIR)/main/arrayobj.c \ + $(SRCDIR)/main/blend.c \ + $(SRCDIR)/main/bufferobj.c \ + $(SRCDIR)/main/buffers.c \ + $(SRCDIR)/main/clear.c \ + $(SRCDIR)/main/clip.c \ + $(SRCDIR)/main/colortab.c \ + $(SRCDIR)/main/condrender.c \ + $(SRCDIR)/main/context.c \ + $(SRCDIR)/main/convolve.c \ +
Mesa (master): automake: Rename variables in sources. mak to be automake compatible.
Module: Mesa Branch: master Commit: 7d7fe1b0376d5017c21351c0df8168b733801570 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d7fe1b0376d5017c21351c0df8168b733801570 Author: Eric Anholt Date: Wed May 16 09:09:18 2012 -0700 automake: Rename variables in sources.mak to be automake compatible. *_SOURCES is reserved for files lists for particular automake targets. Also, "-" in the variable names is not allowed. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- configs/autoconf.in |2 +- configs/default |2 +- configure.ac | 10 ++-- src/mesa/Android.mk | 20 +- src/mesa/Makefile|6 +- src/mesa/sources.mak | 108 +- 6 files changed, 74 insertions(+), 74 deletions(-) diff --git a/configs/autoconf.in b/configs/autoconf.in index 3c8f4c1..38f49a2 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -47,7 +47,7 @@ DRI_CXXFLAGS = @DRI_CXXFLAGS@ DLOPEN_LIBS = @DLOPEN_LIBS@ # Source selection -MESA_ASM_SOURCES = @MESA_ASM_SOURCES@ +MESA_ASM_FILES = @MESA_ASM_FILES@ GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@ # Misc tools and flags diff --git a/configs/default b/configs/default index 40fa5e3..0f8b09f 100644 --- a/configs/default +++ b/configs/default @@ -89,7 +89,7 @@ DRI_CFLAGS = $(CFLAGS) DRI_CXXFLAGS = $(CXXFLAGS) # Optional assembly language optimization files for libGL -MESA_ASM_SOURCES = +MESA_ASM_FILES = # GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in # order to build the Motif widget too) diff --git a/configure.ac b/configure.ac index ca2220f..6830bde 100644 --- a/configure.ac +++ b/configure.ac @@ -436,7 +436,7 @@ AC_ARG_ENABLE([asm], ) asm_arch="" ASM_FLAGS="" -MESA_ASM_SOURCES="" +MESA_ASM_FILES="" GLAPI_ASM_SOURCES="" AC_MSG_CHECKING([whether to enable assembly]) test "x$enable_asm" = xno && AC_MSG_RESULT([no]) @@ -485,19 +485,19 @@ if test "x$enable_asm" = xyes; then case "$asm_arch" in x86) ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" -MESA_ASM_SOURCES='$(X86_SOURCES)' +MESA_ASM_FILES='$(X86_FILES)' GLAPI_ASM_SOURCES='$(X86_API)' AC_MSG_RESULT([yes, x86]) ;; x86_64) ASM_FLAGS="-DUSE_X86_64_ASM" -MESA_ASM_SOURCES='$(X86-64_SOURCES)' +MESA_ASM_FILES='$(X86_64_FILES)' GLAPI_ASM_SOURCES='$(X86-64_API)' AC_MSG_RESULT([yes, x86_64]) ;; sparc) ASM_FLAGS="-DUSE_SPARC_ASM" -MESA_ASM_SOURCES='$(SPARC_SOURCES)' +MESA_ASM_FILES='$(SPARC_FILES)' GLAPI_ASM_SOURCES='$(SPARC_API)' AC_MSG_RESULT([yes, sparc]) ;; @@ -507,7 +507,7 @@ if test "x$enable_asm" = xyes; then esac fi AC_SUBST([ASM_FLAGS]) -AC_SUBST([MESA_ASM_SOURCES]) +AC_SUBST([MESA_ASM_FILES]) AC_SUBST([GLAPI_ASM_SOURCES]) dnl PIC code macro diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk index f6c0f4e..4b62b81 100644 --- a/src/mesa/Android.mk +++ b/src/mesa/Android.mk @@ -26,11 +26,11 @@ LOCAL_PATH := $(call my-dir) # Import the following variables: -# MESA_CXX_SOURCES -# MESA_GALLIUM_CXX_SOURCES -# MESA_GALLIUM_SOURCES -# MESA_SOURCES -# X86_SOURCES +# MESA_CXX_FILES +# MESA_GALLIUM_CXX_FILES +# MESA_GALLIUM_FILES +# MESA_FILES +# X86_FILES include $(LOCAL_PATH)/sources.mak common_CFLAGS := \ @@ -49,7 +49,7 @@ common_ASM := ifeq ($(strip $(MESA_ENABLE_ASM)),true) ifeq ($(TARGET_ARCH),x86) -common_ASM += $(X86_SOURCES) +common_ASM += $(X86_FILES) include $(CLEAR_VARS) LOCAL_SRC_FILES := x86/gen_matypes.c @@ -71,8 +71,8 @@ ifeq ($(strip $(MESA_BUILD_GALLIUM)),true) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ - $(MESA_GALLIUM_SOURCES) \ - $(MESA_GALLIUM_CXX_SOURCES) \ + $(MESA_GALLIUM_FILES) \ + $(MESA_GALLIUM_CXX_FILES) \ $(common_ASM) LOCAL_CFLAGS := $(common_CFLAGS) @@ -108,8 +108,8 @@ LOCAL_C_INCLUDES := \ $(common_C_INCLUDES) LOCAL_SRC_FILES := \ -$(MESA_SOURCES) \ -$(MESA_CXX_SOURCES) \ +$(MESA_FILES) \ +$(MESA_CXX_FILES) \ $(common_ASM) include $(LOCAL_PATH)/Android.gen.mk diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 4783f32..3906053 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -149,13 +149,13 @@ asm_subdirs: ## # Dependency generation -depend: $(ALL_SOURCES) +depend: $(ALL_FILES) @ echo "running $(MKDEP)" @ touch depend @$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(MESA_CPPFLAGS) \ - $(ALL_SOURCES) > /dev/null 2>/dev/null + $(ALL_FILES) > /dev/null 2>/dev/null @$(MKDEP) $(MKDEP_OPTIONS) -a -p$(DRICORE_OBJ_DIR)/ $(MESA_CPPFLAGS) \ - $(ALL_SOURCES) > /dev/null 2>/dev/null + $(ALL_FILES) > /dev/null 2>/dev/null
Mesa (master): mesa: Remove generated source files during make clean.
Module: Mesa Branch: master Commit: b284d4773b889d042a4ea086a28a7ea18de98f28 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b284d4773b889d042a4ea086a28a7ea18de98f28 Author: Eric Anholt Date: Thu May 24 10:55:08 2012 -0700 mesa: Remove generated source files during make clean. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mesa/Makefile | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index bb7b13a..4783f32 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -71,6 +71,17 @@ default: $(DEPENDS) asm_subdirs $(MESA_LIBS) $(DRICORE_LIBS) driver_subdirs GLAPI := $(TOP)/src/mapi/glapi/gen include $(GLAPI)/glapi_gen.mk +BUILT_SOURCES = \ + main/api_exec_es1_dispatch.h \ + main/api_exec_es1_remap_helper.h \ + main/api_exec_es2_dispatch.h \ + main/api_exec_es2_remap_helper.h \ + main/api_exec_es1.c \ + main/api_exec_es2.c \ + program/program_parse.tab.c \ + program/program_parse.tab.h \ + program/lex.yy.c + main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps) $(call glapi_gen_dispatch,$<,es1) @@ -243,6 +254,7 @@ clean: clean-dricore -rm -f depend depend.bak libmesa.a libmesagallium.a -rm -f drivers/*/*.o -rm -f *.pc + -rm -f $(BUILT_SOURCES) -@cd drivers/dri && $(MAKE) clean -@cd drivers/x11 && $(MAKE) clean -@cd drivers/osmesa && $(MAKE) clean ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: Enable silent rules for generation when used from automake.
Module: Mesa Branch: master Commit: 79273b1a7a14f1302c8962acbf323075d7b7a829 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=79273b1a7a14f1302c8962acbf323075d7b7a829 Author: Eric Anholt Date: Thu May 24 15:56:27 2012 -0700 glapi: Enable silent rules for generation when used from automake. This variable won't be set when called from non-automake makefiles, but it cleans up shared-glapi's output. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mapi/glapi/gen/glapi_gen.mk |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mapi/glapi/gen/glapi_gen.mk b/src/mapi/glapi/gen/glapi_gen.mk index c7fa7c0..1b05a40 100644 --- a/src/mapi/glapi/gen/glapi_gen.mk +++ b/src/mapi/glapi/gen/glapi_gen.mk @@ -17,7 +17,7 @@ glapi_gen_mapi_deps := \ # $(2): name of the printer define glapi_gen_mapi @mkdir -p $(dir $@) -$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_mapi_script) \ +$(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_mapi_script) \ --mode lib --printer $(2) $(1) > $@ endef @@ -28,7 +28,7 @@ glapi_gen_dispatch_deps := $(glapi_gen_common_deps) # $(2): empty, es1, or es2 for entry point filtering define glapi_gen_dispatch @mkdir -p $(dir $@) -$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_dispatch_script) \ +$(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_dispatch_script) \ -f $(1) -m remap_table $(if $(2),-c $(2),) > $@ endef @@ -39,6 +39,6 @@ glapi_gen_remap_deps := $(glapi_gen_common_deps) # $(2): empty, es1, or es2 for entry point filtering define glapi_gen_remap @mkdir -p $(dir $@) -$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_remap_script) \ +$(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_remap_script) \ -f $(1) $(if $(2),-c $(2),) > $@ endef ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): shared-glapi: Don't forget to clean our built file.
Module: Mesa Branch: master Commit: 559d5924483b8872cdd7c8123666d1762662c6c7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=559d5924483b8872cdd7c8123666d1762662c6c7 Author: Eric Anholt Date: Thu May 24 15:54:40 2012 -0700 shared-glapi: Don't forget to clean our built file. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mapi/shared-glapi/Makefile.am |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am index a80ba1f..9485683 100644 --- a/src/mapi/shared-glapi/Makefile.am +++ b/src/mapi/shared-glapi/Makefile.am @@ -13,6 +13,7 @@ glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) $(call glapi_gen_mapi,$<,shared-glapi) BUILT_SOURCES = glapi_mapi_tmp.h +CLEANFILES = $(BUILT_SOURCES) AM_CPPFLAGS = \ $(DEFINES) \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Restore installing of libGL for non-dri builds.
Module: Mesa Branch: master Commit: 26eaee32455355c5376796140e0e3eb49e1c5865 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=26eaee32455355c5376796140e0e3eb49e1c5865 Author: Eric Anholt Date: Thu May 24 16:16:28 2012 -0700 mesa: Restore installing of libGL for non-dri builds. Reported-by: Sven Joachim Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- src/mesa/Makefile | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 71e22b9..bb7b13a 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -166,8 +166,8 @@ install: default $(DRICORE_INSTALL_TARGET) else \ $(MAKE) install-osmesa || exit 1 ; \ fi ;; \ - dri)$(MAKE) install-libgl install-dri || exit 1 ;; \ - *) $(MAKE) install-libgl || exit 1 ;; \ + dri)$(MAKE) install-libgl-pc install-dri || exit 1 ;; \ + *) $(MAKE) install-libgl-pc install-libgl || exit 1 ;; \ esac ; \ done @@ -203,7 +203,11 @@ install-headers: $(INSTALL) -m 644 $(TOP)/include/GL/*.h \ $(DESTDIR)$(INSTALL_INC_DIR)/GL -install-libgl: default gl.pc install-headers +install-libgl: default + $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \ + $(DESTDIR)$(INSTALL_LIB_DIR) + +install-libgl-pc: gl.pc install-headers $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Remove the generated glapi from source control, and just build it.
Module: Mesa Branch: master Commit: 0ce0f7c0c8fa9902678af7f3ecad2541be5808d2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ce0f7c0c8fa9902678af7f3ecad2541be5808d2 Author: Eric Anholt Date: Tue May 15 13:06:22 2012 -0700 mesa: Remove the generated glapi from source control, and just build it. Mesa already always depends on python to build. The checked in changes are not reviewed (because any trivial change rewrites the world). We also have been pushing commits between xml change and regen where at-build-time xml-generated code disagrees with committed xml-generated code. And worst of all, sometimes we ("I") check in *stale* xml-generated code. Acked-by: Ian Romanick --- configure.ac|2 +- src/glx/.gitignore |6 + src/glx/indirect.c |10736 --- src/glx/indirect.h | 722 - src/glx/indirect_init.c | 789 - src/glx/indirect_size.c | 382 - src/glx/indirect_size.h | 85 - src/mapi/glapi/.gitignore |9 + src/mapi/glapi/gen/Makefile |3 +- src/mapi/glapi/glapi_gentable.c | 9530 -- src/mapi/glapi/glapi_mapi_tmp.h |14139 --- src/mapi/glapi/glapi_sparc.S| 1613 -- src/mapi/glapi/glapi_x86-64.S |37708 --- src/mapi/glapi/glapi_x86.S | 1528 -- src/mapi/glapi/glapitable.h | 1023 -- src/mapi/glapi/glapitemp.h | 9742 -- src/mapi/glapi/glprocs.h| 2853 --- src/mesa/main/.gitignore|3 + src/mesa/main/dispatch.h|12958 -- src/mesa/main/enums.c | 6638 --- src/mesa/main/remap_helper.h| 5818 -- 21 files changed, 21 insertions(+), 116266 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=0ce0f7c0c8fa9902678af7f3ecad2541be5808d2 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i830: Fix crash for GL_STENCIL_TEST in i830Enable()
Module: Mesa Branch: master Commit: f92b2e5e90f456491fc15b3b9612381a83726606 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f92b2e5e90f456491fc15b3b9612381a83726606 Author: Kurt Roeckx Date: Fri May 11 00:19:42 2012 +0200 i830: Fix crash for GL_STENCIL_TEST in i830Enable() commit 87f12bb2d95236c7b025d1a8be56b5ab1683d702 tried to fix rb->mt being NULL, but change this case wrong. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Kurt Roeckx Reviewed-by: Eric Anholt Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i915/i830_state.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 6f8bd69..647ba62 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -862,7 +862,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state) if (ctx->DrawBuffer) { struct intel_renderbuffer *irbStencil = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); -hw_stencil = (irbStencil && irbStencil->mt->region); +hw_stencil = (irbStencil && irbStencil->mt); } if (hw_stencil) { I830_STATECHANGE(i830, I830_UPLOAD_CTX); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nv50: hook up forgotten short constant buffer upload method
Module: Mesa Branch: master Commit: 89241336276deeef525b35bf5dc7db345a18a3e1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=89241336276deeef525b35bf5dc7db345a18a3e1 Author: Marcin Slusarz Date: Tue May 29 20:13:55 2012 +0200 nv50: hook up forgotten short constant buffer upload method Fixes crash in xorg st. --- src/gallium/drivers/nv50/nv50_context.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 1e6bbaf..952dc03 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -140,6 +140,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv) nv50->base.screen= &screen->base; nv50->base.copy_data = nv50_m2mf_copy_linear; nv50->base.push_data = nv50_sifc_linear_u8; + nv50->base.push_cb = nv50_cb_push; nv50->screen = screen; pipe->screen = pscreen; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radeon/llvm: Update and fix some comments
Module: Mesa Branch: master Commit: 83169900fb96f1a51d8292e66c203c64a82e204d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=83169900fb96f1a51d8292e66c203c64a82e204d Author: Tom Stellard Date: Tue May 29 11:59:01 2012 -0400 radeon/llvm: Update and fix some comments --- src/gallium/drivers/radeon/R600ISelLowering.cpp |8 +--- src/gallium/drivers/radeon/SIISelLowering.cpp | 10 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 5926a08..2347ac7 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -7,7 +7,7 @@ // //===--===// // -// Most of the DAG lowering is handled in AMDILISelLowering.cpp. This file +// Most of the DAG lowering is handled in AMDGPUISelLowering.cpp. This file // is mostly EmitInstrWithCustomInserter(). // //===--===// @@ -39,12 +39,6 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) : setOperationAction(ISD::FSUB, MVT::f32, Expand); -#if 0 - - setTargetDAGCombine(ISD::Constant); - setTargetDAGCombine(ISD::ConstantFP); - -#endif } MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( diff --git a/src/gallium/drivers/radeon/SIISelLowering.cpp b/src/gallium/drivers/radeon/SIISelLowering.cpp index 1cdcd36..c8a0e0b 100644 --- a/src/gallium/drivers/radeon/SIISelLowering.cpp +++ b/src/gallium/drivers/radeon/SIISelLowering.cpp @@ -7,7 +7,7 @@ // //===--===// // -// Most of the DAG lowering is handled in AMDILISelLowering.cpp. This file is +// Most of the DAG lowering is handled in AMDGPUISelLowering.cpp. This file is // mostly EmitInstrWithCustomInserter(). // //===--===// @@ -61,8 +61,8 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter( BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDIL::V_MOV_B32_e64)) .addOperand(MI->getOperand(0)) .addOperand(MI->getOperand(1)) - /* VSRC1-2 are unused, but we still need to fill all the - * operand slots, so we just reuse the VSRC0 operand */ + // VSRC1-2 are unused, but we still need to fill all the + // operand slots, so we just reuse the VSRC0 operand .addOperand(MI->getOperand(1)) .addOperand(MI->getOperand(1)) .addImm(0) // ABS @@ -76,8 +76,8 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter( BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDIL::V_MOV_B32_e64)) .addOperand(MI->getOperand(0)) .addOperand(MI->getOperand(1)) -/* VSRC1-2 are unused, but we still need to fill all the - * operand slots, so we just reuse the VSRC0 operand */ + // VSRC1-2 are unused, but we still need to fill all the + // operand slots, so we just reuse the VSRC0 operand .addOperand(MI->getOperand(1)) .addOperand(MI->getOperand(1)) .addImm(1) // ABS ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radeonsi: Remove use.sgpr* intrinsics, use load instructions instead
Module: Mesa Branch: master Commit: 89ece086bcd2186ab53cb6a69d53005893cab0ea URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=89ece086bcd2186ab53cb6a69d53005893cab0ea Author: Tom Stellard Date: Tue May 29 11:36:29 2012 -0400 radeonsi: Remove use.sgpr* intrinsics, use load instructions instead We now model loading uses sgpr values with LLVM IR load instructions that use the USER_SGPR address space. The definition of the sgpr parameter to the use_sgpr() helper function in radeonsi_shader.c has changed so that you can pass raw sgpr values rather than having to divide the sgpr value you want to use by the dword width of the type you want to load. --- src/gallium/drivers/radeon/AMDIL.h |3 +- src/gallium/drivers/radeon/SIISelLowering.cpp |3 + src/gallium/drivers/radeon/SIInstructions.td | 40 +--- src/gallium/drivers/radeon/SIIntrinsics.td |5 -- src/gallium/drivers/radeonsi/radeonsi_shader.c | 80 +++- 5 files changed, 57 insertions(+), 74 deletions(-) diff --git a/src/gallium/drivers/radeon/AMDIL.h b/src/gallium/drivers/radeon/AMDIL.h index 45638f6..8bd024a 100644 --- a/src/gallium/drivers/radeon/AMDIL.h +++ b/src/gallium/drivers/radeon/AMDIL.h @@ -129,7 +129,8 @@ enum AddressSpaces { ADDRESS_NONE = 5, // Address space for unknown memory. PARAM_D_ADDRESS = 6, // Address space for direct addressible parameter memory (CONST0) PARAM_I_ADDRESS = 7, // Address space for indirect addressible parameter memory (VTX1) - LAST_ADDRESS = 8 + USER_SGPR_ADDRESS = 8, // Address space for USER_SGPRS on SI + LAST_ADDRESS = 9 }; // This union/struct combination is an easy way to read out the diff --git a/src/gallium/drivers/radeon/SIISelLowering.cpp b/src/gallium/drivers/radeon/SIISelLowering.cpp index a79aba9..1cdcd36 100644 --- a/src/gallium/drivers/radeon/SIISelLowering.cpp +++ b/src/gallium/drivers/radeon/SIISelLowering.cpp @@ -188,6 +188,9 @@ void SITargetLowering::lowerUSE_SGPR(MachineInstr *MI, unsigned dstReg = MI->getOperand(0).getReg(); int64_t newIndex = MI->getOperand(1).getImm(); const TargetRegisterClass * dstClass = MRI.getRegClass(dstReg); + unsigned DwordWidth = dstClass->getSize() / 4; + assert(newIndex % DwordWidth == 0 && "USER_SGPR not properly aligned"); + newIndex = newIndex / DwordWidth; unsigned newReg = dstClass->getRegister(newIndex); addLiveIn(MI, MF, MRI, TII, newReg); diff --git a/src/gallium/drivers/radeon/SIInstructions.td b/src/gallium/drivers/radeon/SIInstructions.td index a77b8bd..fc8ec4a 100644 --- a/src/gallium/drivers/radeon/SIInstructions.td +++ b/src/gallium/drivers/radeon/SIInstructions.td @@ -7,6 +7,18 @@ // //===--===// +def load_user_sgpr : PatFrag<(ops node:$ptr), + (load node:$ptr), + [{ +const Value *Src = cast(N)->getSrcValue(); +if (Src) { + PointerType * PT = dyn_cast(Src->getType()); + return PT && PT->getAddressSpace() == AMDILAS::USER_SGPR_ADDRESS; +} +return false; + }] +>; + def isSI : Predicate<"Subtarget.device()" "->getGeneration() == AMDILDeviceInfo::HD7XXX">; @@ -826,26 +838,19 @@ def SI_INTERP_CONST : InstSI < imm:$attr, SReg_32:$params))] >; - def USE_SGPR_32 : InstSI < (outs SReg_32:$dst), (ins i32imm:$src0), "USE_SGPR_32", - [(set SReg_32:$dst, (int_SI_use_sgpr imm:$src0))] - -> { - field bits<32> Inst = 0; -} + [(set (i32 SReg_32:$dst), (load_user_sgpr imm:$src0))] +>; def USE_SGPR_64 : InstSI < (outs SReg_64:$dst), (ins i32imm:$src0), "USE_SGPR_64", - [(set SReg_64:$dst, (int_SI_use_sgpr imm:$src0))] - -> { - field bits<32> Inst = 0; -} + [(set (i64 SReg_64:$dst), (load_user_sgpr imm:$src0))] +>; def VS_LOAD_BUFFER_INDEX : InstSI < (outs VReg_32:$dst), @@ -869,19 +874,6 @@ def : Pat< 0, 0, (i32 SREG_LIT_0)) >; -def : Pat< - (int_SI_use_sgprptrcf32 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; -def : Pat< - (int_SI_use_sgprptrci128 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; -def : Pat< - (int_SI_use_sgprptrci256 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; - /* int_SI_export */ def : Pat < (int_SI_export imm:$en, imm:$vm, imm:$done, imm:$tgt, imm:$compr, diff --git a/src/gallium/drivers/radeon/SIIntrinsics.td b/src/gallium/drivers/radeon/SIIntrinsics.td index d8bf4fa..95273a2 100644 --- a/src/gallium/drivers/radeon/SIIntrinsics.td +++ b/src/gallium/drivers/radeon/SIIntrinsics.td @@ -21,11 +21,6 @@ let TargetPrefix = "SI", isTarget = 1 in { def int_SI_vs_load_input : Intrinsic <[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i16_ty, llvm_i32_ty], []> ; def int_SI_sample : Intrinsic <[llvm_v4f32_ty], [llvm_i32_ty, llvm_v4f32_ty, llvm_v8i32_ty, llvm_v4i32_ty]>; - def int_SI_use_sgpr : Intrinsic <[llvm_anyint_ty], [llvm_i32_ty], [IntrNoMem]>; - class int_SI_use_sgprptr : Intr
Mesa (master): radeonsi: Handle TGSI CONST registers
Module: Mesa Branch: master Commit: 467f51613eb1f2cdaa86243d5fae2abca4f2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=467f51613eb1f2cdaa86243d5fae2abca4f2 Author: Tom Stellard Date: Wed May 16 15:15:35 2012 -0400 radeonsi: Handle TGSI CONST registers We now emit LLVM load instructions for TGSI CONST register reads, which are lowered in the backend to S_LOAD_DWORD* instructions. --- src/gallium/drivers/radeon/AMDILCodeEmitter.h |4 + src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp | 56 + src/gallium/drivers/radeon/AMDILISelLowering.cpp |1 - src/gallium/drivers/radeon/R600ISelLowering.cpp|1 + src/gallium/drivers/radeon/SICodeEmitter.cpp | 34 ++ src/gallium/drivers/radeon/SIGenRegisterInfo.pl|4 +- src/gallium/drivers/radeon/SIISelLowering.cpp | 11 ++ src/gallium/drivers/radeon/SIInstrInfo.td | 62 ++ src/gallium/drivers/radeon/SIInstructions.td | 46 +++- src/gallium/drivers/radeon/SIIntrinsics.td |9 +- src/gallium/drivers/radeon/SIPropagateImmReads.cpp |1 + src/gallium/drivers/radeonsi/radeonsi_shader.c | 125 +--- 12 files changed, 254 insertions(+), 100 deletions(-) diff --git a/src/gallium/drivers/radeon/AMDILCodeEmitter.h b/src/gallium/drivers/radeon/AMDILCodeEmitter.h index fa46cbd..0c7ae59 100644 --- a/src/gallium/drivers/radeon/AMDILCodeEmitter.h +++ b/src/gallium/drivers/radeon/AMDILCodeEmitter.h @@ -37,6 +37,10 @@ namespace llvm { unsigned OpNo) const { return 0; } +virtual uint32_t SMRDmemriEncode(const MachineInstr &MI, unsigned OpNo) + const { + return 0; +} }; } // End namespace llvm diff --git a/src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp b/src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp index b08e97b..40b35fd 100644 --- a/src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp +++ b/src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp @@ -67,6 +67,9 @@ private: SDNode *xformAtomicInst(SDNode *N); + bool SelectADDR8BitOffset(SDValue Addr, SDValue& Base, SDValue& Offset); + bool SelectADDRReg(SDValue Addr, SDValue& Base, SDValue& Offset); + // Include the pieces autogenerated from the target description. #include "AMDILGenDAGISel.inc" }; @@ -513,3 +516,56 @@ AMDILDAGToDAGISel::xformAtomicInst(SDNode *N) #undef INT64_C #endif #undef DEBUGTMP + +/// AMDGPU Functions /// + +bool AMDILDAGToDAGISel::SelectADDR8BitOffset(SDValue Addr, SDValue& Base, + SDValue& Offset) { + if (Addr.getOpcode() == ISD::TargetExternalSymbol || + Addr.getOpcode() == ISD::TargetGlobalAddress) { +return false; + } + + + if (Addr.getOpcode() == ISD::ADD) { +bool Match = false; + +// Find the base ptr and the offset +for (unsigned i = 0; i < Addr.getNumOperands(); i++) { + SDValue Arg = Addr.getOperand(i); + ConstantSDNode * OffsetNode = dyn_cast(Arg); + // This arg isn't a constant so it must be the base PTR. + if (!OffsetNode) { +Base = Addr.getOperand(i); +continue; + } + // Check if the constant argument fits in 8-bits. The offset is in bytes + // so we need to convert it to dwords. + if (isInt<8>(OffsetNode->getZExtValue() >> 2)) { +Match = true; +Offset = CurDAG->getTargetConstant(OffsetNode->getZExtValue() >> 2, + MVT::i32); + } +} +return Match; + } + + // Default case, no offset + Base = Addr; + Offset = CurDAG->getTargetConstant(0, MVT::i32); + return true; +} + +bool AMDILDAGToDAGISel::SelectADDRReg(SDValue Addr, SDValue& Base, + SDValue& Offset) { + if (Addr.getOpcode() == ISD::TargetExternalSymbol || + Addr.getOpcode() == ISD::TargetGlobalAddress || + Addr.getOpcode() != ISD::ADD) { +return false; + } + + Base = Addr.getOperand(0); + Offset = Addr.getOperand(1); + + return false; +} diff --git a/src/gallium/drivers/radeon/AMDILISelLowering.cpp b/src/gallium/drivers/radeon/AMDILISelLowering.cpp index 27cf9b1..a52c83e 100644 --- a/src/gallium/drivers/radeon/AMDILISelLowering.cpp +++ b/src/gallium/drivers/radeon/AMDILISelLowering.cpp @@ -796,7 +796,6 @@ AMDILTargetLowering::convertToReg(MachineOperand op) const setPrefLoopAlignment(16); setSelectIsExpensive(true); setJumpIsExpensive(true); - computeRegisterProperties(); maxStoresPerMemcpy = 4096; maxStoresPerMemmove = 4096; diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 77d90e2..5926a08 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -30,6 +30,7 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) : addRegisterClass(MVT:
Mesa (master): radeon/llvm: Remove AMDILIntrinsicInfo:: GetDeclaration fuction body
Module: Mesa Branch: master Commit: 32b83e0366560a77798545880f980adc04b4361f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=32b83e0366560a77798545880f980adc04b4361f Author: Tom Stellard Date: Mon May 28 12:07:41 2012 -0400 radeon/llvm: Remove AMDILIntrinsicInfo::GetDeclaration fuction body This function was causing compile errors in the tablegen'd code for some intrinsic definitions. I don't think we really need this function, so I'm removing the function body just as a temporary solution. I'll look into removing the entire AMDILIntrinsicInfo class later. --- src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp | 21 + 1 files changed, 1 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp b/src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp index 566a91e..651c054 100644 --- a/src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp +++ b/src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp @@ -146,26 +146,7 @@ AMDILIntrinsicInfo::getDeclaration(Module *M, unsigned IntrID, Type **Tys, unsigned numTys) const { - assert(!isOverloaded(IntrID) && "AMDIL intrinsics are not overloaded"); - AttrListPtr AList = getAttributes((AMDGPUIntrinsic::ID) IntrID); - LLVMContext& Context = M->getContext(); - unsigned int id = IntrID; - Type *ResultTy = NULL; - std::vector ArgTys; - bool IsVarArg = false; - -#define GET_INTRINSIC_GENERATOR -#include "AMDILGenIntrinsics.inc" -#undef GET_INTRINSIC_GENERATOR - // We need to add the resource ID argument for atomics. - if (id >= AMDGPUIntrinsic::AMDIL_atomic_add_gi32 -&& id <= AMDGPUIntrinsic::AMDIL_atomic_xor_ru32_noret) { -ArgTys.push_back(IntegerType::get(Context, 32)); - } - - return cast(M->getOrInsertFunction(getName(IntrID), -FunctionType::get(ResultTy, ArgTys, IsVarArg), -AList)); + assert(!"Not implemented"); } /// Because the code generator has to support different SC versions, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radeon/llvm: Remove AMDILTargetMachine
Module: Mesa Branch: master Commit: 49fb99bd131a4ed89e6f55cf360f67618acafec4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=49fb99bd131a4ed89e6f55cf360f67618acafec4 Author: Tom Stellard Date: Sun May 27 22:11:53 2012 -0400 radeon/llvm: Remove AMDILTargetMachine --- src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp | 12 +- src/gallium/drivers/radeon/AMDGPUTargetMachine.h | 25 ++- src/gallium/drivers/radeon/AMDIL.h |3 +- .../drivers/radeon/AMDILCFGStructurizer.cpp|5 +- src/gallium/drivers/radeon/AMDILISelDAGToDAG.cpp |7 +- src/gallium/drivers/radeon/AMDILISelLowering.cpp | 92 --- src/gallium/drivers/radeon/AMDILInstrInfo.cpp |2 +- src/gallium/drivers/radeon/AMDILInstrInfo.h|4 +- src/gallium/drivers/radeon/AMDILIntrinsicInfo.cpp |8 +- src/gallium/drivers/radeon/AMDILIntrinsicInfo.h|6 +- src/gallium/drivers/radeon/AMDILRegisterInfo.cpp |3 +- src/gallium/drivers/radeon/AMDILRegisterInfo.h |5 +- src/gallium/drivers/radeon/AMDILTargetMachine.cpp | 180 src/gallium/drivers/radeon/AMDILTargetMachine.h| 72 .../radeon/MCTargetDesc/AMDILMCTargetDesc.cpp |7 +- .../radeon/MCTargetDesc/AMDILMCTargetDesc.h|1 - src/gallium/drivers/radeon/Makefile.sources|1 - .../drivers/radeon/TargetInfo/AMDILTargetInfo.cpp |8 +- src/gallium/drivers/radeon/radeon_llvm_emit.cpp| 12 +- 19 files changed, 90 insertions(+), 363 deletions(-) diff --git a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp index 5c4d82b..0601fbc 100644 --- a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp +++ b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp @@ -14,7 +14,6 @@ #include "AMDGPUTargetMachine.h" #include "AMDGPU.h" -#include "AMDILTargetMachine.h" #include "R600ISelLowering.h" #include "R600InstrInfo.h" #include "SIISelLowering.h" @@ -33,6 +32,11 @@ using namespace llvm; +extern "C" void LLVMInitializeAMDGPUTarget() { + // Register the target + RegisterTargetMachine X(TheAMDGPUTarget); +} + AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, TargetOptions Options, @@ -40,8 +44,12 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, StringRef TT, CodeGenOpt::Level OptLevel ) : - AMDILTargetMachine(T, TT, CPU, FS, Options, RM, CM, OptLevel), + LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OptLevel), Subtarget(TT, CPU, FS), + DataLayout(Subtarget.getDataLayout()), + FrameLowering(TargetFrameLowering::StackGrowsUp, + Subtarget.device()->getStackAlignment(), 0), + IntrinsicInfo(this), mDump(false) { diff --git a/src/gallium/drivers/radeon/AMDGPUTargetMachine.h b/src/gallium/drivers/radeon/AMDGPUTargetMachine.h index 2f60e76..84a1ea3 100644 --- a/src/gallium/drivers/radeon/AMDGPUTargetMachine.h +++ b/src/gallium/drivers/radeon/AMDGPUTargetMachine.h @@ -15,7 +15,9 @@ #define AMDGPU_TARGET_MACHINE_H #include "AMDGPUInstrInfo.h" -#include "AMDILTargetMachine.h" +#include "AMDILFrameLowering.h" +#include "AMDILIntrinsicInfo.h" +#include "AMDILSubtarget.h" #include "R600ISelLowering.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Target/TargetData.h" @@ -24,13 +26,15 @@ namespace llvm { MCAsmInfo* createMCAsmInfo(const Target &T, StringRef TT); -class AMDGPUTargetMachine : public AMDILTargetMachine { +class AMDGPUTargetMachine : public LLVMTargetMachine { + AMDILSubtarget Subtarget; - const AMDGPUInstrInfo * InstrInfo; - AMDGPUTargetLowering * TLInfo; - AMDILGlobalManager *mGM; - AMDILKernelManager *mKM; - bool mDump; + const TargetData DataLayout; + AMDILFrameLowering FrameLowering; + AMDILIntrinsicInfo IntrinsicInfo; + const AMDGPUInstrInfo * InstrInfo; + AMDGPUTargetLowering * TLInfo; + bool mDump; public: AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef FS, @@ -39,6 +43,12 @@ public: Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL); ~AMDGPUTargetMachine(); + virtual const AMDILFrameLowering* getFrameLowering() const { + return &FrameLowering; + } + virtual const AMDILIntrinsicInfo* getIntrinsicInfo() const { + return &IntrinsicInfo; + } virtual const AMDGPUInstrInfo *getInstrInfo() const {return InstrInfo;} virtual const AMDILSubtarget *getSubtargetImpl() const {return &Subtarget; } virtual const AMDGPURegisterInfo *getRegisterInfo() const { @@ -47,6 +57,7 @@ public: virtual AMDGPUTargetLowering * getTargetLowering() const { return TLInfo; } + virtual const TargetData* getTargetData() const { return &DataLayout; } virtual TargetPassConfig *createPassConfig(PassManagerBase &PM); virtual bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostr
Mesa (master): nouveau: unreference fences on resource destruction
Module: Mesa Branch: master Commit: 94a25b216bb7bf1f55e657d93d84f6de3f5e7ed4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=94a25b216bb7bf1f55e657d93d84f6de3f5e7ed4 Author: Christoph Bumiller Date: Mon May 28 18:01:15 2012 +0200 nouveau: unreference fences on resource destruction --- src/gallium/drivers/nouveau/nouveau_buffer.c |3 +++ src/gallium/drivers/nv50/nv50_miptree.c |3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index d04ac2f..e83aae0 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -94,6 +94,9 @@ nouveau_buffer_destroy(struct pipe_screen *pscreen, if (res->data && !(res->status & NOUVEAU_BUFFER_STATUS_USER_MEMORY)) FREE(res->data); + nouveau_fence_ref(NULL, &res->fence); + nouveau_fence_ref(NULL, &res->fence_wr); + FREE(res); } diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index bfadbc5..5ba8cf8 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -116,6 +116,9 @@ nv50_miptree_destroy(struct pipe_screen *pscreen, struct pipe_resource *pt) nouveau_bo_ref(NULL, &mt->base.bo); + nouveau_fence_ref(NULL, &mt->base.fence); + nouveau_fence_ref(NULL, &mt->base.fence_wr); + FREE(mt); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0: optimize blend cso by checking which by-RT data actually differs
Module: Mesa Branch: master Commit: 1a21e36b6818991ced32d0e3d1acc1fea0d936ce URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a21e36b6818991ced32d0e3d1acc1fea0d936ce Author: Christoph Bumiller Date: Thu May 24 21:18:22 2012 +0200 nvc0: optimize blend cso by checking which by-RT data actually differs Can save about 200 bytes of command buffer space. --- src/gallium/drivers/nvc0/nvc0_state.c | 163 +++-- 1 files changed, 96 insertions(+), 67 deletions(-) diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c index 01bd5ce..cce2a48 100644 --- a/src/gallium/drivers/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nvc0/nvc0_state.c @@ -86,77 +86,106 @@ static void * nvc0_blend_state_create(struct pipe_context *pipe, const struct pipe_blend_state *cso) { -struct nvc0_blend_stateobj *so = CALLOC_STRUCT(nvc0_blend_stateobj); -int i; -uint32_t ms; + struct nvc0_blend_stateobj *so = CALLOC_STRUCT(nvc0_blend_stateobj); + int i; + int r; /* reference */ + uint32_t ms; + uint8_t blend_en = 0; + boolean indep_masks = FALSE; + boolean indep_funcs = FALSE; -so->pipe = *cso; + so->pipe = *cso; -SB_IMMED_3D(so, BLEND_INDEPENDENT, cso->independent_blend_enable); - -if (!cso->logicop_enable) - SB_IMMED_3D(so, LOGIC_OP_ENABLE, 0); - -if (cso->logicop_enable) { - SB_BEGIN_3D(so, LOGIC_OP_ENABLE, 2); - SB_DATA(so, 1); - SB_DATA(so, nvgl_logicop_func(cso->logicop_func)); - - SB_IMMED_3D(so, MACRO_BLEND_ENABLES, 0); -} else -if (!cso->independent_blend_enable) { -SB_IMMED_3D(so, -MACRO_BLEND_ENABLES, cso->rt[0].blend_enable ? 0xff : 0); - -if (cso->rt[0].blend_enable) { -SB_BEGIN_3D(so, BLEND_EQUATION_RGB, 5); -SB_DATA(so, nvgl_blend_eqn(cso->rt[0].rgb_func)); -SB_DATA(so, nvc0_blend_fac(cso->rt[0].rgb_src_factor)); -SB_DATA(so, nvc0_blend_fac(cso->rt[0].rgb_dst_factor)); -SB_DATA(so, nvgl_blend_eqn(cso->rt[0].alpha_func)); -SB_DATA(so, nvc0_blend_fac(cso->rt[0].alpha_src_factor)); -SB_BEGIN_3D(so, BLEND_FUNC_DST_ALPHA, 1); -SB_DATA(so, nvc0_blend_fac(cso->rt[0].alpha_dst_factor)); -} - -SB_IMMED_3D(so, COLOR_MASK_COMMON, 1); -SB_BEGIN_3D(so, COLOR_MASK(0), 1); -SB_DATA(so, nvc0_colormask(cso->rt[0].colormask)); -} else { -uint8_t en = 0; - -for (i = 0; i < 8; ++i) { -if (!cso->rt[i].blend_enable) -continue; -en |= 1 << i; - -SB_BEGIN_3D(so, IBLEND_EQUATION_RGB(i), 6); -SB_DATA(so, nvgl_blend_eqn(cso->rt[i].rgb_func)); -SB_DATA(so, nvc0_blend_fac(cso->rt[i].rgb_src_factor)); -SB_DATA(so, nvc0_blend_fac(cso->rt[i].rgb_dst_factor)); -SB_DATA(so, nvgl_blend_eqn(cso->rt[i].alpha_func)); -SB_DATA(so, nvc0_blend_fac(cso->rt[i].alpha_src_factor)); -SB_DATA(so, nvc0_blend_fac(cso->rt[i].alpha_dst_factor)); -} -SB_IMMED_3D(so, MACRO_BLEND_ENABLES, en); - -SB_IMMED_3D(so, COLOR_MASK_COMMON, 0); -SB_BEGIN_3D(so, COLOR_MASK(0), 8); -for (i = 0; i < 8; ++i) + /* check which states actually have differing values */ + if (cso->independent_blend_enable) { + for (r = 0; r < 8 && !cso->rt[r].blend_enable; ++r); + blend_en |= 1 << r; + for (i = r + 1; i < 8; ++i) { + if (!cso->rt[i].blend_enable) +continue; + blend_en |= 1 << i; + if (cso->rt[i].rgb_func != cso->rt[r].rgb_func || + cso->rt[i].rgb_src_factor != cso->rt[r].rgb_src_factor || + cso->rt[i].rgb_dst_factor != cso->rt[r].rgb_dst_factor || + cso->rt[i].alpha_func != cso->rt[r].alpha_func || + cso->rt[i].alpha_src_factor != cso->rt[r].alpha_src_factor || + cso->rt[i].alpha_dst_factor != cso->rt[r].alpha_dst_factor) { +indep_funcs = TRUE; +break; + } + } + for (; i < 8; ++i) + blend_en |= (cso->rt[i].blend_enable ? 1 : 0) << i; + + for (i = 1; i < 8; ++i) { + if (cso->rt[i].colormask != cso->rt[0].colormask) { +indep_masks = TRUE; +break; + } + } + } else { + r = 0; + if (cso->rt[0].blend_enable) + blend_en = 0xff; + } + + if (cso->logicop_enable) { + SB_BEGIN_3D(so, LOGIC_OP_ENABLE, 2); + SB_DATA(so, 1); + SB_DATA(so, nvgl_logicop_func(cso->logicop_func)); + + SB_IMMED_3D(so, MACRO_BLEND_ENABLES, 0); + } else { + SB_IMMED_3D(so, LOGIC_OP_ENABLE, 0); + + SB_IMMED_3D(so, BLEND_INDEPENDENT, indep_funcs); + SB_IMMED_3D(so, MACRO_BLEND_ENABLES, blend_en); + if (indep_funcs) { + for (i = 0; i < 8; ++i) { +
Mesa (master): nvc0: don't upload UCPs if the shader doesn't use them
Module: Mesa Branch: master Commit: f09ee76c9892dc9ddbd4f74c485c4be8b55033a7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f09ee76c9892dc9ddbd4f74c485c4be8b55033a7 Author: Christoph Bumiller Date: Sat May 26 13:54:55 2012 +0200 nvc0: don't upload UCPs if the shader doesn't use them --- src/gallium/drivers/nvc0/nvc0_state_validate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c index e35aae5..0f92614 100644 --- a/src/gallium/drivers/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c @@ -308,7 +308,7 @@ nvc0_validate_clip(struct nvc0_context *nvc0) nvc0_check_program_ucps(nvc0, vp, clip_enable); if (nvc0->dirty & (NVC0_NEW_CLIP | (NVC0_NEW_VERTPROG << stage))) - if (vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES) + if (vp->vp.num_ucps > 0 && vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES) nvc0_upload_uclip_planes(nvc0, stage); clip_enable &= vp->vp.clip_enable; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0/ir: fix texture barrier insertion to prevent WAW hazards
Module: Mesa Branch: master Commit: 40c224a573f2b763046001e622aafca90f68c693 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=40c224a573f2b763046001e622aafca90f68c693 Author: Christoph Bumiller Date: Fri May 25 17:27:03 2012 +0200 nvc0/ir: fix texture barrier insertion to prevent WAW hazards Fixes, for instance, object highlighting in Diablo 3 (wine). --- src/gallium/drivers/nv50/codegen/nv50_ir.h |2 +- src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp | 12 ++- src/gallium/drivers/nv50/codegen/nv50_ir_graph.h |2 +- src/gallium/drivers/nv50/codegen/nv50_ir_inlines.h |2 +- .../drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp |2 +- .../drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 97 6 files changed, 88 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir.h b/src/gallium/drivers/nv50/codegen/nv50_ir.h index 9b47e3e..0b47c32 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir.h @@ -864,7 +864,7 @@ public: inline bool isTerminated() const { return exit && exit->terminator; } bool dominatedBy(BasicBlock *bb); - inline bool reachableBy(BasicBlock *by, BasicBlock *term); + inline bool reachableBy(const BasicBlock *by, const BasicBlock *term); // returns mask of conditional out blocks // e.g. 3 for IF { .. } ELSE { .. } ENDIF, 1 for IF { .. } ENDIF diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp index f1bff97..33e35ee 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp @@ -23,6 +23,7 @@ #include "nv50_ir_graph.h" #include #include +#include #include "nv50_ir.h" namespace nv50_ir { @@ -165,16 +166,17 @@ Graph::Edge::Edge(Node *org, Node *tgt, Type kind) } bool -Graph::Node::reachableBy(Node *node, Node *term) +Graph::Node::reachableBy(const Node *node, const Node *term) const { - Stack stack; - Node *pos; + std::stack stack; + const Node *pos = NULL; const int seq = graph->nextSequence(); stack.push(node); - while (stack.getSize()) { - pos = reinterpret_cast(stack.pop().u.p); + while (!stack.empty()) { + pos = stack.top(); + stack.pop(); if (pos == this) return true; diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.h b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.h index 9ef317f..3bf84ba 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.h @@ -117,7 +117,7 @@ public: inline Node *parent() const; // returns NULL if count(incident edges) != 1 - bool reachableBy(Node *node, Node *term); + bool reachableBy(const Node *node, const Node *term) const; inline bool visit(int); inline int getSequence() const; diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_inlines.h b/src/gallium/drivers/nv50/codegen/nv50_ir_inlines.h index b62431f..ab4c98f 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_inlines.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_inlines.h @@ -359,7 +359,7 @@ Value *Value::get(Iterator &it) return reinterpret_cast(it.get()); } -bool BasicBlock::reachableBy(BasicBlock *by, BasicBlock *term) +bool BasicBlock::reachableBy(const BasicBlock *by, const BasicBlock *term) { return cfg.reachableBy(&by->cfg, &term->cfg); } diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp index fbd1aa5..57d5d72 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp @@ -960,7 +960,7 @@ void CodeEmitterNVC0::emitTEXBAR(const Instruction *i) code[0] = 0x0006 | (i->subOp << 26); code[1] = 0xf000; emitPredicate(i); - emitCondCode(i->predSrc >= 0 ? i->cc : CC_ALWAYS, 5); + emitCondCode(i->flagsSrc >= 0 ? i->cc : CC_ALWAYS, 5); } void CodeEmitterNVC0::emitTEXCSAA(const TexInstruction *i) diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp index 8fd4541..efb5124 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp @@ -148,7 +148,13 @@ private: }; bool insertTextureBarriers(Function *); inline bool insnDominatedBy(const Instruction *, const Instruction *) const; - void findFirstUses(const Instruction *, std::list&); + void findFirstUses(const Instruction *tex, const Instruction *def, + std::list&); + void findOverwritingDefs(const Instruction *tex, Instruction *insn, +const BasicBlock *term, +std::list&); + void addTexUse(std::list&, Instruction *, const Instruction *); + const Inst
Mesa (master): nvc0/ir: allow 64-bit constant loads on nve4
Module: Mesa Branch: master Commit: 79eed0d2246e8e7be505784af0078507c712a02c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=79eed0d2246e8e7be505784af0078507c712a02c Author: Christoph Bumiller Date: Tue May 29 17:00:10 2012 +0200 nvc0/ir: allow 64-bit constant loads on nve4 Looks like only 128-bit access doesn't work. --- .../drivers/nv50/codegen/nv50_ir_peephole.cpp |2 ++ .../drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp |2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp index cfbe3ec..6f34b1a 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp @@ -1939,6 +1939,8 @@ FlatteningPass::visit(BasicBlock *bb) !isTextureOp(insn->op) && // probably just nve4 insn->op != OP_LINTERP && // probably just nve4 insn->op != OP_PINTERP && // probably just nve4 + ((insn->op != OP_LOAD && insn->op != OP_STORE) || + typeSizeof(insn->dType) <= 4) && !insn->isNop()) { insn->join = 1; bb->remove(bb->getExit()); diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp index e4b9dc1..0674f12 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp @@ -448,7 +448,7 @@ TargetNVC0::isAccessSupported(DataFile file, DataType ty) const if (ty == TYPE_NONE) return false; if (file == FILE_MEMORY_CONST && getChipset() >= 0xe0) // wrong encoding ? - return typeSizeof(ty) <= 4; + return typeSizeof(ty) <= 8; if (ty == TYPE_B96) return (file == FILE_SHADER_INPUT) || (file == FILE_SHADER_OUTPUT); return true; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0/ir: TEX doesn't support JOIN modifier either
Module: Mesa Branch: master Commit: 0d818cdacce0299fabe4ac2aa735247c651fdcfa URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d818cdacce0299fabe4ac2aa735247c651fdcfa Author: Christoph Bumiller Date: Mon May 28 22:38:10 2012 +0200 nvc0/ir: TEX doesn't support JOIN modifier either --- .../drivers/nv50/codegen/nv50_ir_peephole.cpp |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp index 10382d9..cfbe3ec 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp @@ -1936,6 +1936,7 @@ FlatteningPass::visit(BasicBlock *bb) if (insn && !insn->getPredicate() && !insn->asFlow() && insn->op != OP_TEXBAR && + !isTextureOp(insn->op) && // probably just nve4 insn->op != OP_LINTERP && // probably just nve4 insn->op != OP_PINTERP && // probably just nve4 !insn->isNop()) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gallium: add st_api feature mask to prevent advertising MS visuals
Module: Mesa Branch: master Commit: f80c2874eca86a12517fbe2f4c15287edfb4dc89 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f80c2874eca86a12517fbe2f4c15287edfb4dc89 Author: Christoph Bumiller Date: Mon May 21 23:46:11 2012 +0200 gallium: add st_api feature mask to prevent advertising MS visuals v2: use a define for the maximum sample count v3: also test odd sample counts (r300 supports MS3) While multisample renderbuffers are supported by mesa, MS visuals are not, so we need a way to tell dri/st not to advertise them even if the gallium driver does support multisampled surfaces. Otherwise applications selecting these non-functional visuals would run into trouble ... Reviewed-by: Brian Paul --- src/gallium/include/state_tracker/st_api.h | 16 ++ src/gallium/state_trackers/dri/common/dri_screen.c | 31 --- src/gallium/state_trackers/vega/vg_manager.c |1 + src/mesa/state_tracker/st_manager.c|1 + 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 3af1dfc..86ab02d 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -70,6 +70,17 @@ enum st_profile_type #define ST_PROFILE_OPENGL_ES2_MASK (1 << ST_PROFILE_OPENGL_ES2) /** + * Optional API/state tracker features. + */ +enum st_api_feature +{ + ST_API_FEATURE_MS_VISUALS /**< support for multisample visuals */ +}; + +/* for feature_mask in st_api */ +#define ST_API_FEATURE_MS_VISUALS_MASK (1 << ST_API_FEATURE_MS_VISUALS) + +/** * New context flags for GL 3.0 and beyond. * * Profile information (core vs. compatibilty for OpenGL 3.2+) is communicated @@ -430,6 +441,11 @@ struct st_api unsigned profile_mask; /** +* The supported optional features. Tested with ST_FEATURE_*_MASK. +*/ + unsigned feature_mask; + + /** * Destroy the API. */ void (*destroy)(struct st_api *stapi); diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c index 24efbde..406e550 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.c +++ b/src/gallium/state_trackers/dri/common/dri_screen.c @@ -41,6 +41,8 @@ #include "util/u_debug.h" +#define MSAA_VISUAL_MAX_SAMPLES 8 + PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE @@ -72,10 +74,10 @@ dri_fill_in_modes(struct dri_screen *screen, __DRIconfig **configs_x8r8g8b8 = NULL; uint8_t depth_bits_array[5]; uint8_t stencil_bits_array[5]; - uint8_t msaa_samples_array[5]; + uint8_t msaa_samples_array[MSAA_VISUAL_MAX_SAMPLES]; unsigned depth_buffer_factor; unsigned back_buffer_factor; - unsigned msaa_samples_factor; + unsigned msaa_samples_factor, msaa_samples_max; unsigned i; struct pipe_screen *p_screen = screen->base.screen; boolean pf_r5g6b5, pf_a8r8g8b8, pf_x8r8g8b8; @@ -89,6 +91,9 @@ dri_fill_in_modes(struct dri_screen *screen, stencil_bits_array[0] = 0; depth_buffer_factor = 1; + msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS) + ? MSAA_VISUAL_MAX_SAMPLES : 1; + pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM, PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL); @@ -146,14 +151,16 @@ dri_fill_in_modes(struct dri_screen *screen, msaa_samples_array[0] = 0; back_buffer_factor = 3; - /* also test color for msaa 2/4/6/8 - just assume it'll work for all depth buffers */ + /* Also test for color multisample support - just assume it'll work +* for all depth buffers. +*/ if (pf_r5g6b5) { msaa_samples_factor = 1; - for (i = 1; i < 5; i++) { + for (i = 2; i <= msaa_samples_max; i++) { if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM, - PIPE_TEXTURE_2D, i*2, + PIPE_TEXTURE_2D, i, PIPE_BIND_RENDER_TARGET)) { -msaa_samples_array[msaa_samples_factor] = i * 2; +msaa_samples_array[msaa_samples_factor] = i; msaa_samples_factor++; } } @@ -168,11 +175,11 @@ dri_fill_in_modes(struct dri_screen *screen, if (pf_a8r8g8b8) { msaa_samples_factor = 1; - for (i = 1; i < 5; i++) { + for (i = 2; i <= msaa_samples_max; i++) { if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_TEXTURE_2D, i*2, + PIPE_TEXTURE_2D, i, PIPE_BIND_RENDER_TARGET)) { -msaa_samples_array[msaa_sample