Compare commits
70 Commits
mesa-21.0.
...
mesa-10.5.
Author | SHA1 | Date | |
---|---|---|---|
|
97357d475f | ||
|
c899144da6 | ||
|
b973acc093 | ||
|
90411b56f6 | ||
|
19422e433c | ||
|
1b00847bb2 | ||
|
a0264d4076 | ||
|
c7d4987897 | ||
|
c32d835281 | ||
|
54cc3cdff4 | ||
|
c0f425bb81 | ||
|
7c448551eb | ||
|
3e54be2e8a | ||
|
6f52686d77 | ||
|
1527f569e5 | ||
|
dfbaa8a843 | ||
|
9e8446beb1 | ||
|
9e5af14163 | ||
|
ed7272ade9 | ||
|
3592cbb21f | ||
|
5e026a2f63 | ||
|
04dc301669 | ||
|
4952a37697 | ||
|
aac12f4542 | ||
|
760407ff9e | ||
|
3cb2120088 | ||
|
b97e7ad355 | ||
|
bf563d59b2 | ||
|
7f7c35e854 | ||
|
b554a10e82 | ||
|
11cab7b36a | ||
|
80ec8ee3a1 | ||
|
d7fe0d9ce7 | ||
|
afe00ddc20 | ||
|
b9b8c10273 | ||
|
7f72b69c62 | ||
|
9bd832c24c | ||
|
ae275a653a | ||
|
86aaa10ce7 | ||
|
3e513ea65c | ||
|
2f8e96f71d | ||
|
c65ca6c815 | ||
|
4fa129cd9b | ||
|
4c2e35e0aa | ||
|
474f33e690 | ||
|
20471e9423 | ||
|
f0a736160b | ||
|
3a2043fddd | ||
|
39d823fa58 | ||
|
7bcdde5174 | ||
|
f2e513b2c0 | ||
|
c6b0a1638c | ||
|
694d656551 | ||
|
c38068f5c1 | ||
|
88d47387b8 | ||
|
c08e9605c2 | ||
|
fe98850c5f | ||
|
6f14955b71 | ||
|
8ab5a28bd6 | ||
|
4d6bc2c0ff | ||
|
631e76500d | ||
|
28650815ac | ||
|
b9518a41d4 | ||
|
550d7c26e7 | ||
|
716886c338 | ||
|
8898b68a3f | ||
|
93675c7aac | ||
|
6555c00b19 | ||
|
d03de1dd7d | ||
|
b1b7b5b068 |
@@ -21,7 +21,7 @@
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = \
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--enable-dri3 \
|
||||
--enable-gallium-tests \
|
||||
--enable-gbm \
|
||||
|
12
bin/.cherry-ignore
Normal file
12
bin/.cherry-ignore
Normal file
@@ -0,0 +1,12 @@
|
||||
# Cherry-picked without -x
|
||||
# nir: resolve nir.h dependency list (fix make distcheck)
|
||||
556fc4b84df99a1cd4b18c11fb16f7854a948b2a
|
||||
|
||||
# nir: add missing header to the sources list
|
||||
72e602905dd9d86450a936d5a22bf21758844b38
|
||||
|
||||
# configure: rework wayland_scanner handling(fix make distcheck)
|
||||
153539bd9d4445b504110958306f00632222f840
|
||||
|
||||
# auxiliary/vl: bring back the VL code for the dri targets
|
||||
c39dbfdd0f764b1aaa7319b4694e7335692993dd
|
28
configure.ac
28
configure.ac
@@ -1572,14 +1572,23 @@ if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_dri" = xyes -o \
|
||||
"x$enable_xvmc" = xyes -o \
|
||||
"x$enable_vdpau" = xyes -o \
|
||||
"x$enable_omx" = xyes -o \
|
||||
"x$enable_va" = xyes; then
|
||||
need_gallium_vl=yes
|
||||
fi
|
||||
AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
|
||||
|
||||
if test "x$enable_xvmc" = xyes -o \
|
||||
"x$enable_vdpau" = xyes -o \
|
||||
"x$enable_omx" = xyes -o \
|
||||
"x$enable_va" = xyes; then
|
||||
PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
|
||||
need_gallium_vl=yes
|
||||
need_gallium_vl_winsys=yes
|
||||
fi
|
||||
AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
|
||||
AM_CONDITIONAL(NEED_GALLIUM_VL_WINSYS, test "x$need_gallium_vl_winsys" = xyes)
|
||||
|
||||
if test "x$enable_xvmc" = xyes; then
|
||||
PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED])
|
||||
@@ -1730,6 +1739,13 @@ if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
|
||||
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland_scanner],
|
||||
WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland_scanner`,
|
||||
WAYLAND_SCANNER='')
|
||||
if test "x$WAYLAND_SCANNER" = x; then
|
||||
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
|
||||
fi
|
||||
|
||||
# Do per-EGL platform setups and checks
|
||||
egl_platforms=`IFS=', '; echo $with_egl_platforms`
|
||||
for plat in $egl_platforms; do
|
||||
@@ -1737,9 +1753,9 @@ for plat in $egl_platforms; do
|
||||
wayland)
|
||||
PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
|
||||
|
||||
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
|
||||
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
|
||||
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
|
||||
if test "x$WAYLAND_SCANNER" = x; then
|
||||
AC_MSG_ERROR([wayland-scanner is needed to compile the wayland egl platform])
|
||||
fi
|
||||
;;
|
||||
|
||||
x11)
|
||||
@@ -1770,7 +1786,7 @@ done
|
||||
# libEGL wants to default to the first platform specified in
|
||||
# ./configure. parse that here.
|
||||
if test "x$egl_platforms" != "x"; then
|
||||
FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
|
||||
FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr '[[a-z]]' '[[A-Z]]'`
|
||||
EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
|
||||
else
|
||||
EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.5.0 Release Notes / TBD</h1>
|
||||
<h1>Mesa 10.5.0 Release Notes / March 06, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.0 is a new development release.
|
||||
@@ -55,7 +55,150 @@ Note: some of the new features are only available with certain drivers.
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
TBD.
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=10370">Bug 10370</a> - Incorrect pixels read back if draw bitmap texture through Display list</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45348">Bug 45348</a> - [swrast] piglit fbo-drawbuffers-arbfp regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60879">Bug 60879</a> - [radeonsi] X11 can't start with acceleration enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67672">Bug 67672</a> - [llvmpipe] lp_test_arit fails on old CPUs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77544">Bug 77544</a> - i965: Try to use LINE instructions to perform MAD with immediate arguments</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78770">Bug 78770</a> - [SNB bisected]Webglc conformance/textures/texture-size-limit.html fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80568">Bug 80568</a> - [gen4] GPU Crash During Google Chrome Operation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82477">Bug 82477</a> - [softpipe] piglit fp-long-alu regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82585">Bug 82585</a> - geometry shader with optional out variable segfaults</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82991">Bug 82991</a> - Inverted bumpmap in webgl applications</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83463">Bug 83463</a> - [swrast] piglit glsl-vs-clamp-1 regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83500">Bug 83500</a> - si_dma_copy_tile causes GPU hangs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83510">Bug 83510</a> - Graphical glitches in Unreal Engine 4</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83908">Bug 83908</a> - [i965] Incorrect icon colors in Steam Big Picture</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84212">Bug 84212</a> - [BSW]ES3-CTS.shaders.loops.do_while_dynamic_iterations.vector_counter_vertex fails and causes GPU hang</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84651">Bug 84651</a> - Distorted graphics or black window when running Battle.net app on Intel hardware via wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84777">Bug 84777</a> - [BSW]Piglit spec_glsl-1.50_execution_geometry-basic fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85367">Bug 85367</a> - [gen4] GPU hang in glmark-es2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85467">Bug 85467</a> - [llvmpipe] piglit gl-1.0-dlist-beginend failure with llvm-3.6.0svn</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85529">Bug 85529</a> - Surfaces not drawn in Unvanquished</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85647">Bug 85647</a> - Random radeonsi crashes with mesa 10.3.x</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85696">Bug 85696</a> - r600g+nine: Bioshock shader failure after 7b1c0cbc90d456384b0950ad21faa3c61a6b43ff</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86089">Bug 86089</a> - [r600g][mesa 10.4.0-dev] shader failure - r600_sb::bc_finalizer::cf_peephole() when starting Second Life</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86618">Bug 86618</a> - [NV96] neg modifiers not working in MIN and MAX operations</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86760">Bug 86760</a> - mesa doesn't build: recipe for target 'r600_llvm.lo' failed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86764">Bug 86764</a> - [SNB+ Bisected]Piglit glean/pointSprite fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86788">Bug 86788</a> - (bisected) 32bit UrbanTerror 4.1 timedemo sse4.1 segfault...</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86811">Bug 86811</a> - [BDW/BSW Bisected]Piglit spec_arb_shading_language_packing_execution_built-in-functions_vs-unpackSnorm4x8 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86837">Bug 86837</a> - kodi segfault since auxiliary/vl: rework the build of the VL code</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86939">Bug 86939</a> - test_vf_float_conversions.cpp:63:12: error: expected primary-expression before ‘union’</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86944">Bug 86944</a> - glsl_parser_extras.cpp", line 1455: Error: Badly formed expression. (Oracle Studio)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86958">Bug 86958</a> - lp_bld_misc.cpp:503:40: error: no matching function for call to ‘llvm::EngineBuilder::setMCJITMemoryManager(ShaderMemoryManager*&)’</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86969">Bug 86969</a> - _drm_intel_gem_bo_references() function takes half the CPU with Witcher2 game</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87076">Bug 87076</a> - Dead Island needs allow_glsl_extension_directive_midshader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87516">Bug 87516</a> - glProgramBinary violates spec</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87619">Bug 87619</a> - Changes to state such as render targets change fragment shader without marking it dirty.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87658">Bug 87658</a> - [llvmpipe] SEGV in sse2_has_daz on ancient Pentium4-M</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87694">Bug 87694</a> - [SNB] Crash in brw_begin_transform_feedback</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87886">Bug 87886</a> - constant fps drops with Intel and Radeon</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87887">Bug 87887</a> - [i965 Bisected]ES2-CTS.gtf.GL.cos.cos_float_vert_xvary fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87913">Bug 87913</a> - CPU cacheline size of 0 can be returned by CPUID leaf 0x80000006 in some virtual machines</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88079">Bug 88079</a> - dEQP-GLES3.functional.fbo.completeness.renderable.renderbuffer.color0 tests fail due to enabling of GL_RGB and GL_RGBA</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88170">Bug 88170</a> - 32 bits opengl apps crash with latest llvm 3.6 git / mesa git / radeonsi</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88219">Bug 88219</a> - include/c11/threads_posix.h:197: undefined reference to `pthread_mutex_lock'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88227">Bug 88227</a> - Radeonsi: High GTT usage in Prison Architect large map</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88248">Bug 88248</a> - Calling glClear while there is an occlusion query in progress messes up the results</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88335">Bug 88335</a> - format_pack.c:9567:22: error: expected ')'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88385">Bug 88385</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels core dumped</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88467">Bug 88467</a> - nir.c:140: error: ‘nir_src’ has no member named ‘ssa’</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88478">Bug 88478</a> - #error "<malloc.h> has been replaced by <stdlib.h>"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88519">Bug 88519</a> - sha1.c:210:22: error: 'grcy_md_hd_t' undeclared (first use in this function)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88523">Bug 88523</a> - sha1.c:37: error: 'SHA1_CTX' undeclared (first use in this function)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88561">Bug 88561</a> - [radeonsi][regression,bisected] Depth test/buffer issues in Portal</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88658">Bug 88658</a> - (bisected) Slow video playback on Kabini</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88662">Bug 88662</a> - unaligned access to gl_dlist_node</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88783">Bug 88783</a> - FTBFS: Clover: src/gallium/state_trackers/clover/llvm/invocation.cpp:335:49: error: no matching function for call to 'llvm::TargetLibraryInfo::TargetLibraryInfo(llvm::Triple)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88792">Bug 88792</a> - [BDW/BSW Bisected]Piglit spec_ARB_pixel_buffer_object_pbo-read-argb8888 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88806">Bug 88806</a> - nir/nir_constant_expressions.c:2754:15: error: controlling expression type 'unsigned int' not compatible with any generic association type</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88841">Bug 88841</a> - [SNB/IVB/HSW/BDW Bisected]Piglit spec_EGL_NOK_texture_from_pixmap_basic fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88852">Bug 88852</a> - macros.h(181) : error C2143: syntax error : missing '{' before 'enum [tag]'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88905">Bug 88905</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88930">Bug 88930</a> - [osmesa] osbuffer->textures should be indexed by attachment type</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88962">Bug 88962</a> - [osmesa] Crash on postprocessing if z buffer is NULL</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89032">Bug 89032</a> - [BDW/BSW/SKL Bisected]Piglit spec_OpenGL_1.1_infinite-spot-light fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89037">Bug 89037</a> - [SKL]Piglit spec_EXT_texture_array_copyteximage_1D_ARRAY_samples=2 sporadically causes GPU hang</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89068">Bug 89068</a> - glTexImage2D regression by texstore_rgba switch to _mesa_format_convert</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89069">Bug 89069</a> - Lack of grass in The Talos Principle on radeonsi (native\wine\nine)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89180">Bug 89180</a> - [IVB regression] Rendering issues in Mass Effect through VMware Workstation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86330">Bug 86330</a> - lp_bld_debug.cpp:112: multiple definition of `raw_debug_ostream::write_impl(char const*, unsigned long)'</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
|
@@ -3,9 +3,9 @@
|
||||
|
||||
if BUILD_SHARED
|
||||
if HAVE_COMPAT_SYMLINKS
|
||||
all-local : .libs/install-mesa-links
|
||||
all-local : .install-mesa-links
|
||||
|
||||
.libs/install-mesa-links : $(lib_LTLIBRARIES)
|
||||
.install-mesa-links : $(lib_LTLIBRARIES)
|
||||
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
|
||||
for f in $(join $(addsuffix .libs/,$(dir $(lib_LTLIBRARIES))),$(notdir $(lib_LTLIBRARIES:%.la=%.$(LIB_EXT)*))); do \
|
||||
if test -h .libs/$$f; then \
|
||||
@@ -19,6 +19,7 @@ clean-local:
|
||||
for f in $(notdir $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)); do \
|
||||
$(RM) $(top_builddir)/$(LIB_DIR)/$$f; \
|
||||
done;
|
||||
$(RM) .install-mesa-links
|
||||
|
||||
endif
|
||||
endif
|
||||
|
@@ -534,7 +534,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
|
||||
}
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (dri2_dpy->image->base.version >= 8 &&
|
||||
dri2_dpy->image->createImageFromDmaBufs) {
|
||||
disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
|
||||
@@ -1335,7 +1335,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
return dri2_create_image_from_dri(disp, dri_image);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
static _EGLImage *
|
||||
dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
@@ -1571,7 +1571,7 @@ dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, dpy, img);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
static EGLBoolean
|
||||
dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
|
||||
{
|
||||
@@ -1821,7 +1821,7 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
return dri2_create_image_khr_texture(disp, ctx, target, buffer, attr_list);
|
||||
case EGL_GL_RENDERBUFFER_KHR:
|
||||
return dri2_create_image_khr_renderbuffer(disp, ctx, buffer, attr_list);
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
case EGL_DRM_BUFFER_MESA:
|
||||
return dri2_create_image_mesa_drm_buffer(disp, ctx, buffer, attr_list);
|
||||
#endif
|
||||
@@ -1829,7 +1829,7 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
case EGL_WAYLAND_BUFFER_WL:
|
||||
return dri2_create_image_wayland_wl_buffer(disp, ctx, buffer, attr_list);
|
||||
#endif
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
case EGL_LINUX_DMA_BUF_EXT:
|
||||
return dri2_create_image_dma_buf(disp, ctx, buffer, attr_list);
|
||||
#endif
|
||||
@@ -1853,7 +1853,7 @@ dri2_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image)
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
static _EGLImage *
|
||||
dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
const EGLint *attr_list)
|
||||
@@ -2215,7 +2215,7 @@ _eglBuiltInDriverDRI2(const char *args)
|
||||
dri2_drv->base.API.CreateImageKHR = dri2_create_image;
|
||||
dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
|
||||
dri2_drv->base.API.CreateWaylandBufferFromImageWL = dri2_create_wayland_buffer_from_image;
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#ifdef HAVE_LIBDRM
|
||||
dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
|
||||
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
|
||||
#endif
|
||||
|
@@ -292,6 +292,26 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
int i;
|
||||
unsigned int dri_image_format;
|
||||
|
||||
/* currently supports three WL DRM formats,
|
||||
* WL_DRM_FORMAT_ARGB8888, WL_DRM_FORMAT_XRGB8888,
|
||||
* and WL_DRM_FORMAT_RGB565
|
||||
*/
|
||||
switch (dri2_surf->format) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
dri_image_format = __DRI_IMAGE_FORMAT_ARGB8888;
|
||||
break;
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
dri_image_format = __DRI_IMAGE_FORMAT_XRGB8888;
|
||||
break;
|
||||
case WL_DRM_FORMAT_RGB565:
|
||||
dri_image_format = __DRI_IMAGE_FORMAT_RGB565;
|
||||
break;
|
||||
default:
|
||||
/* format is not supported */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* We always want to throttle to some event (either a frame callback or
|
||||
* a sync request) after the commit so that we can be sure the
|
||||
@@ -322,7 +342,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
|
||||
dri2_dpy->image->createImage(dri2_dpy->dri_screen,
|
||||
dri2_surf->base.Width,
|
||||
dri2_surf->base.Height,
|
||||
__DRI_IMAGE_FORMAT_ARGB8888,
|
||||
dri_image_format,
|
||||
__DRI_IMAGE_USE_SHARE,
|
||||
NULL);
|
||||
dri2_surf->back->age = 0;
|
||||
@@ -462,11 +482,26 @@ dri2_wl_get_buffers(__DRIdrawable * driDrawable,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||
unsigned int *attachments_with_format;
|
||||
__DRIbuffer *buffer;
|
||||
const unsigned int format = 32;
|
||||
unsigned int bpp;
|
||||
|
||||
int i;
|
||||
|
||||
switch (dri2_surf->format) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
bpp = 32;
|
||||
break;
|
||||
case WL_DRM_FORMAT_RGB565:
|
||||
bpp = 16;
|
||||
break;
|
||||
default:
|
||||
/* format is not supported */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
attachments_with_format = calloc(count, 2 * sizeof(unsigned int));
|
||||
if (!attachments_with_format) {
|
||||
*out_count = 0;
|
||||
@@ -475,7 +510,7 @@ dri2_wl_get_buffers(__DRIdrawable * driDrawable,
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
attachments_with_format[2*i] = attachments[i];
|
||||
attachments_with_format[2*i + 1] = format;
|
||||
attachments_with_format[2*i + 1] = bpp;
|
||||
}
|
||||
|
||||
buffer =
|
||||
|
@@ -53,24 +53,40 @@ libgalliumvl_stub_la_SOURCES = \
|
||||
|
||||
if NEED_GALLIUM_VL
|
||||
|
||||
noinst_LTLIBRARIES += libgalliumvl.la
|
||||
|
||||
libgalliumvl_la_CFLAGS = \
|
||||
COMMON_VL_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
$(VL_CFLAGS) \
|
||||
$(DRI2PROTO_CFLAGS) \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
$(GALLIUM_PIPE_LOADER_DEFINES) \
|
||||
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
|
||||
|
||||
if HAVE_GALLIUM_STATIC_TARGETS
|
||||
libgalliumvl_la_CFLAGS += \
|
||||
COMMON_VL_CFLAGS += \
|
||||
-DGALLIUM_STATIC_TARGETS=1
|
||||
|
||||
endif # HAVE_GALLIUM_STATIC_TARGETS
|
||||
|
||||
noinst_LTLIBRARIES += libgalliumvl.la
|
||||
|
||||
libgalliumvl_la_CFLAGS = \
|
||||
$(COMMON_VL_CFLAGS)
|
||||
|
||||
libgalliumvl_la_SOURCES = \
|
||||
$(VL_SOURCES)
|
||||
|
||||
if NEED_GALLIUM_VL_WINSYS
|
||||
|
||||
noinst_LTLIBRARIES += libgalliumvlwinsys.la
|
||||
|
||||
libgalliumvlwinsys_la_CFLAGS = \
|
||||
$(COMMON_VL_CFLAGS)
|
||||
|
||||
libgalliumvlwinsys_la_SOURCES = \
|
||||
$(VL_WINSYS_SOURCES)
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
|
@@ -334,10 +334,13 @@ VL_SOURCES := \
|
||||
vl/vl_video_buffer.h \
|
||||
vl/vl_vlc.h \
|
||||
vl/vl_winsys.h \
|
||||
vl/vl_winsys_dri.c \
|
||||
vl/vl_zscan.c \
|
||||
vl/vl_zscan.h
|
||||
|
||||
# XXX: Nuke this as our dri targets no longer depend on VL.
|
||||
VL_WINSYS_SOURCES := \
|
||||
vl/vl_winsys_dri.c
|
||||
|
||||
VL_STUB_SOURCES := \
|
||||
vl/vl_stubs.c
|
||||
|
||||
|
@@ -118,7 +118,7 @@ os_get_total_physical_memory(uint64_t *size)
|
||||
*size = phys_pages * page_size;
|
||||
return (phys_pages > 0 && page_size > 0);
|
||||
#elif defined(PIPE_OS_APPLE) || defined(PIPE_OS_BSD)
|
||||
size_t len = sizeof(size);
|
||||
size_t len = sizeof(*size);
|
||||
int mib[2];
|
||||
|
||||
mib[0] = CTL_HW;
|
||||
@@ -134,7 +134,7 @@ os_get_total_physical_memory(uint64_t *size)
|
||||
#error Unsupported *BSD
|
||||
#endif
|
||||
|
||||
return (sysctl(mib, 2, &size, &len, NULL, 0) == 0);
|
||||
return (sysctl(mib, 2, size, &len, NULL, 0) == 0);
|
||||
#elif defined(PIPE_OS_HAIKU)
|
||||
system_info info;
|
||||
status_t ret;
|
||||
|
@@ -252,7 +252,12 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
|
||||
|
||||
for (b = 0; b < nvc0->num_tfbbufs; ++b) {
|
||||
struct nvc0_so_target *targ = nvc0_so_target(nvc0->tfbbuf[b]);
|
||||
struct nv04_resource *buf = nv04_resource(targ->pipe.buffer);
|
||||
struct nv04_resource *buf;
|
||||
|
||||
if (!targ) {
|
||||
IMMED_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tfb)
|
||||
targ->stride = tfb->stride[b];
|
||||
@@ -260,6 +265,8 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
|
||||
if (!(nvc0->tfbbuf_dirty & (1 << b)))
|
||||
continue;
|
||||
|
||||
buf = nv04_resource(targ->pipe.buffer);
|
||||
|
||||
if (!targ->clean)
|
||||
nvc0_query_fifo_wait(push, targ->pq);
|
||||
BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
|
||||
|
@@ -1089,9 +1089,11 @@ nvc0_set_transform_feedback_targets(struct pipe_context *pipe,
|
||||
pipe_so_target_reference(&nvc0->tfbbuf[i], targets[i]);
|
||||
}
|
||||
for (; i < nvc0->num_tfbbufs; ++i) {
|
||||
nvc0->tfbbuf_dirty |= 1 << i;
|
||||
nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
|
||||
pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
|
||||
if (nvc0->tfbbuf[i]) {
|
||||
nvc0->tfbbuf_dirty |= 1 << i;
|
||||
nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
|
||||
pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
|
||||
}
|
||||
}
|
||||
nvc0->num_tfbbufs = num_targets;
|
||||
|
||||
|
@@ -1401,11 +1401,14 @@ nvc0_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
|
||||
} else
|
||||
if (!nv50_2d_src_format_faithful(info->src.format)) {
|
||||
if (!util_format_is_luminance(info->src.format)) {
|
||||
if (!nv50_2d_dst_format_ops_supported(info->dst.format))
|
||||
eng3d = TRUE;
|
||||
else
|
||||
if (util_format_is_intensity(info->src.format))
|
||||
eng3d = info->src.format != PIPE_FORMAT_I8_UNORM;
|
||||
else
|
||||
if (!nv50_2d_dst_format_ops_supported(info->dst.format))
|
||||
eng3d = TRUE;
|
||||
if (util_format_is_alpha(info->src.format))
|
||||
eng3d = info->src.format != PIPE_FORMAT_A8_UNORM;
|
||||
else
|
||||
eng3d = !nv50_2d_format_supported(info->src.format);
|
||||
}
|
||||
|
@@ -266,7 +266,7 @@ bool rp_gpr_tracker::try_reserve(alu_node* n) {
|
||||
|
||||
for (i = 0; i < nsrc; ++i) {
|
||||
value *v = n->src[i];
|
||||
if (v->is_readonly()) {
|
||||
if (v->is_readonly() || v->is_undef()) {
|
||||
const_count++;
|
||||
if (trans && const_count == 3)
|
||||
break;
|
||||
@@ -295,7 +295,7 @@ bool rp_gpr_tracker::try_reserve(alu_node* n) {
|
||||
if (need_unreserve && i--) {
|
||||
do {
|
||||
value *v = n->src[i];
|
||||
if (!v->is_readonly()) {
|
||||
if (!v->is_readonly() && !v->is_undef()) {
|
||||
if (i == 1 && opt)
|
||||
continue;
|
||||
unreserve(bs_cycle(trans, bs, i), n->bc.src[i].sel,
|
||||
|
@@ -80,10 +80,6 @@ void radeon_llvm_shader_type(LLVMValueRef F, unsigned type)
|
||||
sprintf(Str, "%1d", llvm_type);
|
||||
|
||||
LLVMAddTargetDependentFunctionAttr(F, "ShaderType", Str);
|
||||
|
||||
if (type != TGSI_PROCESSOR_COMPUTE) {
|
||||
LLVMAddTargetDependentFunctionAttr(F, "unsafe-fp-math", "true");
|
||||
}
|
||||
}
|
||||
|
||||
static void init_r600_target()
|
||||
|
@@ -735,12 +735,16 @@ static void si_delete_rs_state(struct pipe_context *ctx, void *state)
|
||||
*/
|
||||
static void si_update_dsa_stencil_ref(struct si_context *sctx)
|
||||
{
|
||||
struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
|
||||
struct si_pm4_state *pm4;
|
||||
struct pipe_stencil_ref *ref = &sctx->stencil_ref;
|
||||
struct si_state_dsa *dsa = sctx->queued.named.dsa;
|
||||
struct si_state_dsa *dsa = sctx->queued.named.dsa;
|
||||
|
||||
if (pm4 == NULL)
|
||||
return;
|
||||
if (!dsa)
|
||||
return;
|
||||
|
||||
pm4 = CALLOC_STRUCT(si_pm4_state);
|
||||
if (pm4 == NULL)
|
||||
return;
|
||||
|
||||
si_pm4_set_reg(pm4, R_028430_DB_STENCILREFMASK,
|
||||
S_028430_STENCILTESTVAL(ref->ref_value[0]) |
|
||||
|
@@ -367,24 +367,21 @@ void si_emit_cache_flush(struct r600_common_context *sctx, struct r600_atom *ato
|
||||
{
|
||||
struct radeon_winsys_cs *cs = sctx->rings.gfx.cs;
|
||||
uint32_t cp_coher_cntl = 0;
|
||||
uint32_t sqc_caches = 0;
|
||||
uint32_t compute =
|
||||
PKT3_SHADER_TYPE_S(!!(sctx->flags & SI_CONTEXT_FLAG_COMPUTE));
|
||||
|
||||
/* SI has a bug that it always flushes ICACHE and KCACHE if either
|
||||
* bit is set. An alternative way is to write SQC_CACHES. */
|
||||
if (sctx->chip_class == SI &&
|
||||
sctx->flags & BOTH_ICACHE_KCACHE &&
|
||||
(sctx->flags & BOTH_ICACHE_KCACHE) != BOTH_ICACHE_KCACHE) {
|
||||
sqc_caches =
|
||||
S_008C08_INST_INVALIDATE(!!(sctx->flags & SI_CONTEXT_INV_ICACHE)) |
|
||||
S_008C08_DATA_INVALIDATE(!!(sctx->flags & SI_CONTEXT_INV_KCACHE));
|
||||
} else {
|
||||
if (sctx->flags & SI_CONTEXT_INV_ICACHE)
|
||||
cp_coher_cntl |= S_0085F0_SH_ICACHE_ACTION_ENA(1);
|
||||
if (sctx->flags & SI_CONTEXT_INV_KCACHE)
|
||||
cp_coher_cntl |= S_0085F0_SH_KCACHE_ACTION_ENA(1);
|
||||
}
|
||||
* bit is set. An alternative way is to write SQC_CACHES, but that
|
||||
* doesn't seem to work reliably. Since the bug doesn't affect
|
||||
* correctness (it only does more work than necessary) and
|
||||
* the performance impact is likely negligible, there is no plan
|
||||
* to fix it.
|
||||
*/
|
||||
|
||||
if (sctx->flags & SI_CONTEXT_INV_ICACHE)
|
||||
cp_coher_cntl |= S_0085F0_SH_ICACHE_ACTION_ENA(1);
|
||||
if (sctx->flags & SI_CONTEXT_INV_KCACHE)
|
||||
cp_coher_cntl |= S_0085F0_SH_KCACHE_ACTION_ENA(1);
|
||||
|
||||
if (sctx->flags & SI_CONTEXT_INV_TC_L1)
|
||||
cp_coher_cntl |= S_0085F0_TCL1_ACTION_ENA(1);
|
||||
@@ -451,10 +448,6 @@ void si_emit_cache_flush(struct r600_common_context *sctx, struct r600_atom *ato
|
||||
* It looks like SURFACE_SYNC flushes caches immediately and doesn't
|
||||
* wait for any engines. This should be last.
|
||||
*/
|
||||
if (sqc_caches) {
|
||||
r600_write_config_reg(cs, R_008C08_SQC_CACHES, sqc_caches);
|
||||
cs->buf[cs->cdw-3] |= compute; /* set the compute bit in the header */
|
||||
}
|
||||
if (cp_coher_cntl) {
|
||||
if (sctx->chip_class >= CIK) {
|
||||
radeon_emit(cs, PKT3(PKT3_ACQUIRE_MEM, 5, 0) | compute);
|
||||
|
@@ -661,9 +661,11 @@ bcolor:
|
||||
}
|
||||
}
|
||||
|
||||
if (j == vsinfo->num_outputs) {
|
||||
/* No corresponding output found, load defaults into input */
|
||||
tmp |= S_028644_OFFSET(0x20);
|
||||
if (j == vsinfo->num_outputs && !G_028644_PT_SPRITE_TEX(tmp)) {
|
||||
/* No corresponding output found, load defaults into input.
|
||||
* Don't set any other bits.
|
||||
* (FLAT_SHADE=1 completely changes behavior) */
|
||||
tmp = S_028644_OFFSET(0x20);
|
||||
}
|
||||
|
||||
si_pm4_set_reg(pm4,
|
||||
|
@@ -706,6 +706,11 @@ static void slice_header(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp,
|
||||
if (pic_order_cnt_lsb != priv->codec_data.h264.pic_order_cnt_lsb)
|
||||
vid_dec_h264_EndFrame(priv);
|
||||
|
||||
if (IdrPicFlag) {
|
||||
priv->codec_data.h264.pic_order_cnt_msb = 0;
|
||||
priv->codec_data.h264.pic_order_cnt_lsb = 0;
|
||||
}
|
||||
|
||||
if ((pic_order_cnt_lsb < priv->codec_data.h264.pic_order_cnt_lsb) &&
|
||||
(priv->codec_data.h264.pic_order_cnt_lsb - pic_order_cnt_lsb) >= (max_pic_order_cnt_lsb / 2))
|
||||
pic_order_cnt_msb = priv->codec_data.h264.pic_order_cnt_msb + max_pic_order_cnt_lsb;
|
||||
|
@@ -44,7 +44,7 @@ gallium_dri_la_LIBADD = \
|
||||
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
|
||||
$(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
|
||||
$(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
|
||||
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
|
||||
|
@@ -24,6 +24,7 @@ endif # HAVE_LD_VERSION_SCRIPT
|
||||
|
||||
libomx_mesa_la_LIBADD = \
|
||||
$(top_builddir)/src/gallium/state_trackers/omx/libomxtracker.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
|
@@ -46,6 +46,11 @@ PIPE_LIBS += \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl_stub.la
|
||||
endif
|
||||
|
||||
if NEED_GALLIUM_VL_WINSYS
|
||||
PIPE_LIBS+= \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la
|
||||
endif
|
||||
|
||||
PIPE_LIBS += \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
|
@@ -25,6 +25,7 @@ endif # HAVE_LD_VERSION_SCRIPT
|
||||
# NOTE: gallium_drv_video does not use(link against) libva
|
||||
gallium_drv_video_la_LIBADD = \
|
||||
$(top_builddir)/src/gallium/state_trackers/va/libvatracker.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
|
@@ -30,6 +30,7 @@ endif # HAVE_LD_DYNAMIC_LIST
|
||||
# NOTE: libvdpau_gallium does not use(link against) libvdpau
|
||||
libvdpau_gallium_la_LIBADD = \
|
||||
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
|
@@ -24,6 +24,7 @@ endif # HAVE_LD_VERSION_SCRIPT
|
||||
|
||||
libXvMCgallium_la_LIBADD = \
|
||||
$(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
|
@@ -240,7 +240,7 @@ nir/nir_opcodes.h: nir/nir_opcodes.py nir/nir_opcodes_h.py
|
||||
$(MKDIR_P) nir; \
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/nir/nir_opcodes_h.py > $@
|
||||
|
||||
nir/nir.h: $(top_builddir)/src/glsl/nir/nir_opcodes.h
|
||||
nir/nir.h: nir/nir_opcodes.h
|
||||
|
||||
nir/nir_opcodes.c: nir/nir_opcodes.py nir/nir_opcodes_c.py
|
||||
$(MKDIR_P) nir; \
|
||||
|
@@ -21,6 +21,7 @@ NIR_FILES = \
|
||||
nir/glsl_to_nir.h \
|
||||
nir/nir.c \
|
||||
nir/nir.h \
|
||||
nir/nir_constant_expressions.h \
|
||||
nir/nir_dominance.c \
|
||||
nir/nir_from_ssa.c \
|
||||
nir/nir_intrinsics.c \
|
||||
|
@@ -110,39 +110,39 @@ DECL_TYPE(sampler2DRectShadow, GL_SAMPLER_2D_RECT_SHADOW, GLSL_TYPE_SA
|
||||
|
||||
DECL_TYPE(samplerExternalOES, GL_SAMPLER_EXTERNAL_OES, GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_EXTERNAL, 0, 0, GLSL_TYPE_FLOAT)
|
||||
|
||||
DECL_TYPE(image1D, GL_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image2D, GL_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image3D, GL_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image2DRect, GL_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(imageCube, GL_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(imageBuffer, GL_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image1DArray, GL_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image2DArray, GL_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(imageCubeArray, GL_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image2DMS, GL_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(image2DMSArray, GL_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_FLOAT);
|
||||
DECL_TYPE(iimage1D, GL_INT_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage2D, GL_INT_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage3D, GL_INT_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage2DRect, GL_INT_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimageCube, GL_INT_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimageBuffer, GL_INT_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage1DArray, GL_INT_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage2DArray, GL_INT_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimageCubeArray, GL_INT_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage2DMS, GL_INT_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_INT);
|
||||
DECL_TYPE(iimage2DMSArray, GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_INT);
|
||||
DECL_TYPE(uimage1D, GL_UNSIGNED_INT_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage2D, GL_UNSIGNED_INT_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage3D, GL_UNSIGNED_INT_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage2DRect, GL_UNSIGNED_INT_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimageCube, GL_UNSIGNED_INT_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimageBuffer, GL_UNSIGNED_INT_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage1DArray, GL_UNSIGNED_INT_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage2DArray, GL_UNSIGNED_INT_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimageCubeArray, GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage2DMS, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(uimage2DMSArray, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_UINT);
|
||||
DECL_TYPE(image1D, GL_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image2D, GL_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image3D, GL_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image2DRect, GL_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(imageCube, GL_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(imageBuffer, GL_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image1DArray, GL_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image2DArray, GL_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(imageCubeArray, GL_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image2DMS, GL_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(image2DMSArray, GL_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_FLOAT)
|
||||
DECL_TYPE(iimage1D, GL_INT_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage2D, GL_INT_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage3D, GL_INT_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage2DRect, GL_INT_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimageCube, GL_INT_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimageBuffer, GL_INT_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage1DArray, GL_INT_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage2DArray, GL_INT_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimageCubeArray, GL_INT_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage2DMS, GL_INT_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_INT)
|
||||
DECL_TYPE(iimage2DMSArray, GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_INT)
|
||||
DECL_TYPE(uimage1D, GL_UNSIGNED_INT_IMAGE_1D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage2D, GL_UNSIGNED_INT_IMAGE_2D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage3D, GL_UNSIGNED_INT_IMAGE_3D, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage2DRect, GL_UNSIGNED_INT_IMAGE_2D_RECT, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimageCube, GL_UNSIGNED_INT_IMAGE_CUBE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimageBuffer, GL_UNSIGNED_INT_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage1DArray, GL_UNSIGNED_INT_IMAGE_1D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage2DArray, GL_UNSIGNED_INT_IMAGE_2D_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimageCubeArray, GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage2DMS, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_UINT)
|
||||
DECL_TYPE(uimage2DMSArray, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_UINT)
|
||||
|
||||
DECL_TYPE(atomic_uint, GL_UNSIGNED_INT_ATOMIC_COUNTER, GLSL_TYPE_ATOMIC_UINT, 1, 1)
|
||||
|
||||
|
@@ -44,7 +44,7 @@ static int isnormal(double x)
|
||||
{
|
||||
return _fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN;
|
||||
}
|
||||
#elif defined(__SUNPRO_CC)
|
||||
#elif defined(__SUNPRO_CC) && !defined(isnormal)
|
||||
#include <ieeefp.h>
|
||||
static int isnormal(double x)
|
||||
{
|
||||
|
@@ -696,48 +696,65 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
||||
* a saturate operation
|
||||
*/
|
||||
for (int op = 0; op < 2; op++) {
|
||||
ir_expression *minmax = op_expr[op];
|
||||
ir_expression *inner_expr = op_expr[op];
|
||||
ir_constant *outer_const = op_const[1 - op];
|
||||
ir_expression_operation op_cond = (ir->operation == ir_binop_max) ?
|
||||
ir_binop_min : ir_binop_max;
|
||||
|
||||
if (!minmax || !outer_const || (minmax->operation != op_cond))
|
||||
if (!inner_expr || !outer_const || (inner_expr->operation != op_cond))
|
||||
continue;
|
||||
|
||||
/* One of these has to be a constant */
|
||||
if (!inner_expr->operands[0]->as_constant() &&
|
||||
!inner_expr->operands[1]->as_constant())
|
||||
break;
|
||||
|
||||
/* Found a min(max) combination. Now try to see if its operands
|
||||
* meet our conditions that we can do just a single saturate operation
|
||||
*/
|
||||
for (int minmax_op = 0; minmax_op < 2; minmax_op++) {
|
||||
ir_rvalue *inner_val_a = minmax->operands[minmax_op];
|
||||
ir_rvalue *inner_val_b = minmax->operands[1 - minmax_op];
|
||||
ir_rvalue *x = inner_expr->operands[minmax_op];
|
||||
ir_rvalue *y = inner_expr->operands[1 - minmax_op];
|
||||
|
||||
if (!inner_val_a || !inner_val_b)
|
||||
ir_constant *inner_const = y->as_constant();
|
||||
if (!inner_const)
|
||||
continue;
|
||||
|
||||
/* Found a {min|max} ({max|min} (x, 0.0), 1.0) operation and its variations */
|
||||
if ((outer_const->is_one() && inner_val_a->is_zero()) ||
|
||||
(inner_val_a->is_one() && outer_const->is_zero()))
|
||||
return saturate(inner_val_b);
|
||||
/* min(max(x, 0.0), 1.0) is sat(x) */
|
||||
if (ir->operation == ir_binop_min &&
|
||||
inner_const->is_zero() &&
|
||||
outer_const->is_one())
|
||||
return saturate(x);
|
||||
|
||||
/* Found a {min|max} ({max|min} (x, 0.0), b) where b < 1.0
|
||||
* and its variations
|
||||
*/
|
||||
if (is_less_than_one(outer_const) && inner_val_b->is_zero())
|
||||
return expr(ir_binop_min, saturate(inner_val_a), outer_const);
|
||||
/* max(min(x, 1.0), 0.0) is sat(x) */
|
||||
if (ir->operation == ir_binop_max &&
|
||||
inner_const->is_one() &&
|
||||
outer_const->is_zero())
|
||||
return saturate(x);
|
||||
|
||||
if (!inner_val_b->as_constant())
|
||||
continue;
|
||||
/* min(max(x, 0.0), b) where b < 1.0 is sat(min(x, b)) */
|
||||
if (ir->operation == ir_binop_min &&
|
||||
inner_const->is_zero() &&
|
||||
is_less_than_one(outer_const))
|
||||
return saturate(expr(ir_binop_min, x, outer_const));
|
||||
|
||||
if (is_less_than_one(inner_val_b->as_constant()) && outer_const->is_zero())
|
||||
return expr(ir_binop_min, saturate(inner_val_a), inner_val_b);
|
||||
/* max(min(x, b), 0.0) where b < 1.0 is sat(min(x, b)) */
|
||||
if (ir->operation == ir_binop_max &&
|
||||
is_less_than_one(inner_const) &&
|
||||
outer_const->is_zero())
|
||||
return saturate(expr(ir_binop_min, x, inner_const));
|
||||
|
||||
/* Found a {min|max} ({max|min} (x, b), 1.0), where b > 0.0
|
||||
* and its variations
|
||||
*/
|
||||
if (outer_const->is_one() && is_greater_than_zero(inner_val_b->as_constant()))
|
||||
return expr(ir_binop_max, saturate(inner_val_a), inner_val_b);
|
||||
if (inner_val_b->as_constant()->is_one() && is_greater_than_zero(outer_const))
|
||||
return expr(ir_binop_max, saturate(inner_val_a), outer_const);
|
||||
/* max(min(x, 1.0), b) where b > 0.0 is sat(max(x, b)) */
|
||||
if (ir->operation == ir_binop_max &&
|
||||
inner_const->is_one() &&
|
||||
is_greater_than_zero(outer_const))
|
||||
return saturate(expr(ir_binop_max, x, outer_const));
|
||||
|
||||
/* min(max(x, b), 1.0) where b > 0.0 is sat(max(x, b)) */
|
||||
if (ir->operation == ir_binop_min &&
|
||||
is_greater_than_zero(inner_const) &&
|
||||
outer_const->is_one())
|
||||
return saturate(expr(ir_binop_max, x, inner_const));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -128,6 +128,9 @@ ir_copy_propagation_visitor::visit_enter(ir_function_signature *ir)
|
||||
|
||||
visit_list_elements(this, &ir->body);
|
||||
|
||||
ralloc_free(this->acp);
|
||||
ralloc_free(this->kills);
|
||||
|
||||
this->kills = orig_kills;
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = orig_killed_all;
|
||||
@@ -215,7 +218,7 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
|
||||
|
||||
/* Populate the initial acp with a copy of the original */
|
||||
foreach_in_list(acp_entry, a, orig_acp) {
|
||||
this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs));
|
||||
this->acp->push_tail(new(this->acp) acp_entry(a->lhs, a->rhs));
|
||||
}
|
||||
|
||||
visit_list_elements(this, instructions);
|
||||
@@ -226,12 +229,15 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
|
||||
|
||||
exec_list *new_kills = this->kills;
|
||||
this->kills = orig_kills;
|
||||
ralloc_free(this->acp);
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = this->killed_all || orig_killed_all;
|
||||
|
||||
foreach_in_list(kill_entry, k, new_kills) {
|
||||
kill(k->var);
|
||||
}
|
||||
|
||||
ralloc_free(new_kills);
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
@@ -269,6 +275,7 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir)
|
||||
|
||||
exec_list *new_kills = this->kills;
|
||||
this->kills = orig_kills;
|
||||
ralloc_free(this->acp);
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = this->killed_all || orig_killed_all;
|
||||
|
||||
@@ -276,6 +283,8 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir)
|
||||
kill(k->var);
|
||||
}
|
||||
|
||||
ralloc_free(new_kills);
|
||||
|
||||
/* already descended into the children. */
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
@@ -294,7 +303,7 @@ ir_copy_propagation_visitor::kill(ir_variable *var)
|
||||
|
||||
/* Add the LHS variable to the list of killed variables in this block.
|
||||
*/
|
||||
this->kills->push_tail(new(this->mem_ctx) kill_entry(var));
|
||||
this->kills->push_tail(new(this->kills) kill_entry(var));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +331,7 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir)
|
||||
ir->condition = new(ralloc_parent(ir)) ir_constant(false);
|
||||
this->progress = true;
|
||||
} else {
|
||||
entry = new(this->mem_ctx) acp_entry(lhs_var, rhs_var);
|
||||
entry = new(this->acp) acp_entry(lhs_var, rhs_var);
|
||||
this->acp->push_tail(entry);
|
||||
}
|
||||
}
|
||||
|
@@ -156,6 +156,9 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_function_signature *ir)
|
||||
|
||||
visit_list_elements(this, &ir->body);
|
||||
|
||||
ralloc_free(this->acp);
|
||||
ralloc_free(this->kills);
|
||||
|
||||
this->kills = orig_kills;
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = orig_killed_all;
|
||||
@@ -173,9 +176,9 @@ ir_copy_propagation_elements_visitor::visit_leave(ir_assignment *ir)
|
||||
kill_entry *k;
|
||||
|
||||
if (lhs)
|
||||
k = new(mem_ctx) kill_entry(var, ir->write_mask);
|
||||
k = new(this->kills) kill_entry(var, ir->write_mask);
|
||||
else
|
||||
k = new(mem_ctx) kill_entry(var, ~0);
|
||||
k = new(this->kills) kill_entry(var, ~0);
|
||||
|
||||
kill(k);
|
||||
}
|
||||
@@ -334,7 +337,7 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
|
||||
|
||||
/* Populate the initial acp with a copy of the original */
|
||||
foreach_in_list(acp_entry, a, orig_acp) {
|
||||
this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
|
||||
this->acp->push_tail(new(this->acp) acp_entry(a));
|
||||
}
|
||||
|
||||
visit_list_elements(this, instructions);
|
||||
@@ -345,6 +348,7 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
|
||||
|
||||
exec_list *new_kills = this->kills;
|
||||
this->kills = orig_kills;
|
||||
ralloc_free(this->acp);
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = this->killed_all || orig_killed_all;
|
||||
|
||||
@@ -354,6 +358,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
|
||||
foreach_in_list_safe(kill_entry, k, new_kills) {
|
||||
kill(k);
|
||||
}
|
||||
|
||||
ralloc_free(new_kills);
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
@@ -391,6 +397,7 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
|
||||
|
||||
exec_list *new_kills = this->kills;
|
||||
this->kills = orig_kills;
|
||||
ralloc_free(this->acp);
|
||||
this->acp = orig_acp;
|
||||
this->killed_all = this->killed_all || orig_killed_all;
|
||||
|
||||
@@ -398,6 +405,8 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
|
||||
kill(k);
|
||||
}
|
||||
|
||||
ralloc_free(new_kills);
|
||||
|
||||
/* already descended into the children. */
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
@@ -423,6 +432,7 @@ ir_copy_propagation_elements_visitor::kill(kill_entry *k)
|
||||
if (k->next)
|
||||
k->remove();
|
||||
|
||||
ralloc_steal(this->kills, k);
|
||||
this->kills->push_tail(k);
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ EXTRA_DIST = RELEASE_NOTES
|
||||
noinst_LTLIBRARIES = libappleglx.la
|
||||
|
||||
AM_CFLAGS = \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/glx \
|
||||
-I$(top_srcdir)/src/mesa \
|
||||
|
@@ -65,10 +65,23 @@ dri2_convert_glx_query_renderer_attribs(int attribute)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Convert internal dri context profile bits into GLX context profile bits */
|
||||
static inline void
|
||||
dri_convert_context_profile_bits(int attribute, unsigned int *value)
|
||||
{
|
||||
if (attribute == GLX_RENDERER_PREFERRED_PROFILE_MESA) {
|
||||
if (value[0] == (1U << __DRI_API_OPENGL_CORE))
|
||||
value[0] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
else if (value[0] == (1U << __DRI_API_OPENGL))
|
||||
value[0] = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
|
||||
}
|
||||
}
|
||||
|
||||
_X_HIDDEN int
|
||||
dri2_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
unsigned int *value)
|
||||
{
|
||||
int ret;
|
||||
struct dri2_screen *const psc = (struct dri2_screen *) base;
|
||||
|
||||
/* Even though there are invalid values (and
|
||||
@@ -81,8 +94,11 @@ dri2_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
if (psc->rendererQuery == NULL)
|
||||
return -1;
|
||||
|
||||
return psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
ret = psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
dri_convert_context_profile_bits(attribute, value);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
_X_HIDDEN int
|
||||
@@ -108,6 +124,7 @@ _X_HIDDEN int
|
||||
dri3_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
unsigned int *value)
|
||||
{
|
||||
int ret;
|
||||
struct dri3_screen *const psc = (struct dri3_screen *) base;
|
||||
|
||||
/* Even though there are invalid values (and
|
||||
@@ -120,8 +137,11 @@ dri3_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
if (psc->rendererQuery == NULL)
|
||||
return -1;
|
||||
|
||||
return psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
ret = psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
dri_convert_context_profile_bits(attribute, value);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
_X_HIDDEN int
|
||||
@@ -147,6 +167,7 @@ _X_HIDDEN int
|
||||
drisw_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
unsigned int *value)
|
||||
{
|
||||
int ret;
|
||||
struct drisw_screen *const psc = (struct drisw_screen *) base;
|
||||
|
||||
/* Even though there are invalid values (and
|
||||
@@ -159,8 +180,11 @@ drisw_query_renderer_integer(struct glx_screen *base, int attribute,
|
||||
if (psc->rendererQuery == NULL)
|
||||
return -1;
|
||||
|
||||
return psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
ret = psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
|
||||
value);
|
||||
dri_convert_context_profile_bits(attribute, value);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
_X_HIDDEN int
|
||||
|
@@ -221,7 +221,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
|
||||
XGCValues values;
|
||||
unsigned long valuemask;
|
||||
XFontStruct *fs;
|
||||
|
||||
#if !defined(GLX_USE_APPLEGL)
|
||||
__GLXDRIdrawable *glxdraw;
|
||||
#endif
|
||||
|
||||
GLint swapbytes, lsbfirst, rowlength;
|
||||
GLint skiprows, skippixels, alignment;
|
||||
@@ -234,9 +237,11 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
|
||||
dpy = CC->currentDpy;
|
||||
win = CC->currentDrawable;
|
||||
|
||||
#if !defined(GLX_USE_APPLEGL)
|
||||
glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable);
|
||||
if (glxdraw)
|
||||
win = glxdraw->xDrawable;
|
||||
#endif
|
||||
|
||||
fs = XQueryFont(dpy, font);
|
||||
if (!fs) {
|
||||
|
@@ -66,7 +66,7 @@ if HAVE_SHARED_GLAPI
|
||||
BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h
|
||||
|
||||
lib_LTLIBRARIES += shared-glapi/libglapi.la
|
||||
shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
|
||||
shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES) shared-glapi/glapi_mapi_tmp.h
|
||||
shared_glapi_libglapi_la_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-DMAPI_MODE_GLAPI \
|
||||
|
@@ -122,5 +122,5 @@ format_info_deps := \
|
||||
$(LOCAL_PATH)/main/format_parser.py \
|
||||
$(FORMAT_INFO)
|
||||
|
||||
$(intermediates)/main/format_info.c: $(format_info_deps)
|
||||
$(intermediates)/main/format_info.h: $(format_info_deps)
|
||||
@$(MESA_PYTHON2) $(FORMAT_INFO) $< > $@
|
||||
|
@@ -80,7 +80,7 @@ EXTRA_DIST = \
|
||||
|
||||
BUILT_SOURCES = \
|
||||
main/get_hash.h \
|
||||
main/format_info.c \
|
||||
main/format_info.h \
|
||||
main/git_sha1.h \
|
||||
main/format_pack.c \
|
||||
main/format_unpack.c \
|
||||
@@ -94,13 +94,13 @@ CLEANFILES = \
|
||||
GET_HASH_GEN = main/get_hash_generator.py
|
||||
|
||||
main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
|
||||
$(GET_HASH_GEN) Makefile
|
||||
$(GET_HASH_GEN)
|
||||
$(AM_V_GEN)set -e; \
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
|
||||
-f $< > $@.tmp; \
|
||||
mv $@.tmp $@;
|
||||
|
||||
main/format_info.c: main/formats.csv \
|
||||
main/format_info.h: main/formats.csv \
|
||||
main/format_parser.py main/format_info.py
|
||||
$(AM_V_GEN)set -e; \
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
|
||||
@@ -123,7 +123,7 @@ main/format_unpack.c: main/format_unpack.py main/formats.csv \
|
||||
$(srcdir)/main/formats.csv \
|
||||
| $(INDENT) $(INDENT_FLAGS) > $@;
|
||||
|
||||
main/formats.c: main/format_info.c
|
||||
main/formats.c: main/format_info.h
|
||||
|
||||
noinst_LTLIBRARIES = $(ARCH_LIBS)
|
||||
if NEED_LIBMESA
|
||||
|
@@ -87,6 +87,7 @@ MAIN_FILES = \
|
||||
main/ffvertex_prog.h \
|
||||
main/fog.c \
|
||||
main/fog.h \
|
||||
main/format_info.h \
|
||||
main/format_pack.h \
|
||||
main/format_pack.c \
|
||||
main/format_unpack.h \
|
||||
@@ -101,6 +102,7 @@ MAIN_FILES = \
|
||||
main/framebuffer.h \
|
||||
main/get.c \
|
||||
main/get.h \
|
||||
main/get_hash.h \
|
||||
main/genmipmap.c \
|
||||
main/genmipmap.h \
|
||||
main/getstring.c \
|
||||
|
@@ -60,7 +60,7 @@ get_hash_header = env.CodeGenerate(
|
||||
)
|
||||
|
||||
format_info = env.CodeGenerate(
|
||||
target = 'main/format_info.c',
|
||||
target = 'main/format_info.h',
|
||||
script = 'main/format_info.py',
|
||||
source = 'main/formats.csv',
|
||||
command = python_cmd + ' $SCRIPT ' + ' $SOURCE > $TARGET'
|
||||
|
@@ -827,15 +827,18 @@ _mesa_meta_end(struct gl_context *ctx)
|
||||
const GLbitfield state = save->SavedState;
|
||||
int i;
|
||||
|
||||
/* After starting a new occlusion query, initialize the results to the
|
||||
* values saved previously. The driver will then continue to increment
|
||||
* these values.
|
||||
*/
|
||||
/* Grab the result of the old occlusion query before starting it again. The
|
||||
* old result is added to the result of the new query so the driver will
|
||||
* continue adding where it left off. */
|
||||
if (state & MESA_META_OCCLUSION_QUERY) {
|
||||
if (save->CurrentOcclusionObject) {
|
||||
_mesa_BeginQuery(save->CurrentOcclusionObject->Target,
|
||||
save->CurrentOcclusionObject->Id);
|
||||
ctx->Query.CurrentOcclusionObject->Result = save->CurrentOcclusionObject->Result;
|
||||
struct gl_query_object *q = save->CurrentOcclusionObject;
|
||||
GLuint64EXT result;
|
||||
if (!q->Ready)
|
||||
ctx->Driver.WaitQuery(ctx, q);
|
||||
result = q->Result;
|
||||
_mesa_BeginQuery(q->Target, q->Id);
|
||||
ctx->Query.CurrentOcclusionObject->Result += result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
|
||||
static struct gl_texture_image *
|
||||
create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,
|
||||
GLenum pbo_target, int width, int height, int depth,
|
||||
GLenum pbo_target, int width, int height,
|
||||
GLenum format, GLenum type, const void *pixels,
|
||||
const struct gl_pixelstore_attrib *packing,
|
||||
GLuint *tmp_pbo, GLuint *tmp_tex)
|
||||
@@ -57,8 +57,7 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,
|
||||
struct gl_texture_image *tex_image;
|
||||
bool read_only;
|
||||
|
||||
if ((packing->ImageHeight != 0 && packing->ImageHeight != height) ||
|
||||
packing->SwapBytes ||
|
||||
if (packing->SwapBytes ||
|
||||
packing->LsbFirst ||
|
||||
packing->Invert)
|
||||
return NULL;
|
||||
@@ -99,14 +98,16 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,
|
||||
|
||||
_mesa_GenTextures(1, tmp_tex);
|
||||
tex_obj = _mesa_lookup_texture(ctx, *tmp_tex);
|
||||
tex_obj->Target = depth > 1 ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D;
|
||||
tex_obj->Immutable = GL_TRUE;
|
||||
_mesa_initialize_texture_object(ctx, tex_obj, *tmp_tex, GL_TEXTURE_2D);
|
||||
/* This must be set after _mesa_initialize_texture_object, not before. */
|
||||
tex_obj->Immutable = GL_TRUE;
|
||||
/* This is required for interactions with ARB_texture_view. */
|
||||
tex_obj->NumLayers = 1;
|
||||
|
||||
internal_format = _mesa_get_format_base_format(pbo_format);
|
||||
|
||||
tex_image = _mesa_get_tex_image(ctx, tex_obj, tex_obj->Target, 0);
|
||||
_mesa_init_teximage_fields(ctx, tex_image, width, height, depth,
|
||||
_mesa_init_teximage_fields(ctx, tex_image, width, height, 1,
|
||||
0, internal_format, pbo_format);
|
||||
|
||||
read_only = pbo_target == GL_PIXEL_UNPACK_BUFFER;
|
||||
@@ -136,7 +137,7 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
struct gl_texture_image *pbo_tex_image;
|
||||
GLenum status;
|
||||
bool success = false;
|
||||
int z;
|
||||
int z, iters;
|
||||
|
||||
/* XXX: This should probably be passed in from somewhere */
|
||||
const char *where = "_mesa_meta_pbo_TexSubImage";
|
||||
@@ -166,9 +167,14 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only accept tightly packed pixels from the user. */
|
||||
if (packing->ImageHeight != 0 && packing->ImageHeight != height)
|
||||
return false;
|
||||
|
||||
/* For arrays, use a tall (height * depth) 2D texture. */
|
||||
pbo_tex_image = create_texture_for_pbo(ctx, create_pbo,
|
||||
GL_PIXEL_UNPACK_BUFFER,
|
||||
width, height, depth,
|
||||
width, height * depth,
|
||||
format, type, pixels, packing,
|
||||
&pbo, &pbo_tex);
|
||||
if (!pbo_tex_image)
|
||||
@@ -184,12 +190,6 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
_mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]);
|
||||
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[1]);
|
||||
|
||||
if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
|
||||
assert(depth == 1);
|
||||
depth = height;
|
||||
height = 1;
|
||||
}
|
||||
|
||||
_mesa_meta_bind_fbo_image(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
pbo_tex_image, 0);
|
||||
/* If this passes on the first layer it should pass on the others */
|
||||
@@ -213,7 +213,10 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST))
|
||||
goto fail;
|
||||
|
||||
for (z = 1; z < depth; z++) {
|
||||
iters = tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY ?
|
||||
height : depth;
|
||||
|
||||
for (z = 1; z < iters; z++) {
|
||||
_mesa_meta_bind_fbo_image(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
pbo_tex_image, z);
|
||||
_mesa_meta_bind_fbo_image(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
@@ -221,11 +224,18 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
0, 0, width, height,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY)
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
0, z, width, z + 1,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + 1,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
else
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
0, z * height, width, (z + 1) * height,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
|
||||
success = true;
|
||||
@@ -252,7 +262,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
struct gl_texture_image *pbo_tex_image;
|
||||
GLenum status;
|
||||
bool success = false;
|
||||
int z;
|
||||
int z, iters;
|
||||
|
||||
/* XXX: This should probably be passed in from somewhere */
|
||||
const char *where = "_mesa_meta_pbo_GetTexSubImage";
|
||||
@@ -282,8 +292,13 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only accept tightly packed pixels from the user. */
|
||||
if (packing->ImageHeight != 0 && packing->ImageHeight != height)
|
||||
return false;
|
||||
|
||||
/* For arrays, use a tall (height * depth) 2D texture. */
|
||||
pbo_tex_image = create_texture_for_pbo(ctx, false, GL_PIXEL_PACK_BUFFER,
|
||||
width, height, depth,
|
||||
width, height * depth,
|
||||
format, type, pixels, packing,
|
||||
&pbo, &pbo_tex);
|
||||
if (!pbo_tex_image)
|
||||
@@ -294,12 +309,6 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
|
||||
_mesa_GenFramebuffers(2, fbos);
|
||||
|
||||
if (tex_image && tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
|
||||
assert(depth == 1);
|
||||
depth = height;
|
||||
height = 1;
|
||||
}
|
||||
|
||||
/* If we were given a texture, bind it to the read framebuffer. If not,
|
||||
* we're doing a ReadPixels and we should just use whatever framebuffer
|
||||
* the client has bound.
|
||||
@@ -333,7 +342,12 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST))
|
||||
goto fail;
|
||||
|
||||
for (z = 1; z < depth; z++) {
|
||||
if (tex_image && tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY)
|
||||
iters = height;
|
||||
else
|
||||
iters = depth;
|
||||
|
||||
for (z = 1; z < iters; z++) {
|
||||
_mesa_meta_bind_fbo_image(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
tex_image, zoffset + z);
|
||||
_mesa_meta_bind_fbo_image(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
@@ -341,11 +355,18 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + height,
|
||||
0, 0, width, height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY)
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + 1,
|
||||
0, z, width, z + 1,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
else
|
||||
_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
|
||||
xoffset, yoffset,
|
||||
xoffset + width, yoffset + height,
|
||||
0, z * height, width, (z + 1) * height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
|
||||
success = true;
|
||||
|
@@ -52,7 +52,7 @@ POT=xmlpool.pot
|
||||
|
||||
.PHONY: all clean pot po mo
|
||||
|
||||
EXTRA_DIST = gen_xmlpool.py t_options.h $(POS) SConscript
|
||||
EXTRA_DIST = gen_xmlpool.py options.h t_options.h $(POS) SConscript
|
||||
BUILT_SOURCES = options.h
|
||||
CLEANFILES = $(MOS) options.h
|
||||
|
||||
|
@@ -54,6 +54,7 @@ TEST_LIBS = \
|
||||
|
||||
TESTS = \
|
||||
test_fs_cmod_propagation \
|
||||
test_fs_saturate_propagation \
|
||||
test_eu_compact \
|
||||
test_vf_float_conversions \
|
||||
test_vec4_copy_propagation \
|
||||
@@ -64,26 +65,32 @@ check_PROGRAMS = $(TESTS)
|
||||
test_fs_cmod_propagation_SOURCES = \
|
||||
test_fs_cmod_propagation.cpp
|
||||
test_fs_cmod_propagation_LDADD = \
|
||||
$(TEST_LIBS) \
|
||||
$(top_builddir)/src/gtest/libgtest.la
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(TEST_LIBS)
|
||||
|
||||
test_fs_saturate_propagation_SOURCES = \
|
||||
test_fs_saturate_propagation.cpp
|
||||
test_fs_saturate_propagation_LDADD = \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(TEST_LIBS)
|
||||
|
||||
test_vf_float_conversions_SOURCES = \
|
||||
test_vf_float_conversions.cpp
|
||||
test_vf_float_conversions_LDADD = \
|
||||
$(TEST_LIBS) \
|
||||
$(top_builddir)/src/gtest/libgtest.la
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(TEST_LIBS)
|
||||
|
||||
test_vec4_register_coalesce_SOURCES = \
|
||||
test_vec4_register_coalesce.cpp
|
||||
test_vec4_register_coalesce_LDADD = \
|
||||
$(TEST_LIBS) \
|
||||
$(top_builddir)/src/gtest/libgtest.la
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(TEST_LIBS)
|
||||
|
||||
test_vec4_copy_propagation_SOURCES = \
|
||||
test_vec4_copy_propagation.cpp
|
||||
test_vec4_copy_propagation_LDADD = \
|
||||
$(TEST_LIBS) \
|
||||
$(top_builddir)/src/gtest/libgtest.la
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
$(TEST_LIBS)
|
||||
|
||||
test_eu_compact_SOURCES = \
|
||||
test_eu_compact.c
|
||||
|
@@ -551,6 +551,7 @@
|
||||
#define BRW_SURFACE_PITCH_MASK INTEL_MASK(19, 3)
|
||||
#define BRW_SURFACE_TILED (1 << 1)
|
||||
#define BRW_SURFACE_TILED_Y (1 << 0)
|
||||
#define HSW_SURFACE_IS_INTEGER_FORMAT (1 << 18)
|
||||
|
||||
/* Surface state DW4 */
|
||||
#define BRW_SURFACE_MIN_LOD_SHIFT 28
|
||||
@@ -910,6 +911,7 @@ enum opcode {
|
||||
|
||||
SHADER_OPCODE_URB_WRITE_SIMD8,
|
||||
|
||||
VEC4_OPCODE_MOV_BYTES,
|
||||
VEC4_OPCODE_PACK_BYTES,
|
||||
VEC4_OPCODE_UNPACK_UNIFORM,
|
||||
|
||||
|
@@ -64,10 +64,10 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
|
||||
|
||||
bool interfered = false;
|
||||
foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst, block) {
|
||||
if (scan_inst->dst.file == GRF &&
|
||||
scan_inst->dst.reg == inst->src[0].reg &&
|
||||
scan_inst->dst.reg_offset == inst->src[0].reg_offset &&
|
||||
!scan_inst->is_partial_write()) {
|
||||
if (scan_inst->overwrites_reg(inst->src[0])) {
|
||||
if (scan_inst->is_partial_write())
|
||||
break;
|
||||
|
||||
if (scan_inst->saturate) {
|
||||
inst->saturate = false;
|
||||
progress = true;
|
||||
@@ -81,12 +81,16 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < scan_inst->sources; i++) {
|
||||
if ((scan_inst->opcode != BRW_OPCODE_MOV || !scan_inst->saturate) &&
|
||||
scan_inst->src[i].file == GRF &&
|
||||
if (scan_inst->src[i].file == GRF &&
|
||||
scan_inst->src[i].reg == inst->src[0].reg &&
|
||||
scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
|
||||
interfered = true;
|
||||
break;
|
||||
if (scan_inst->opcode != BRW_OPCODE_MOV ||
|
||||
!scan_inst->saturate ||
|
||||
scan_inst->src[0].abs ||
|
||||
scan_inst->src[0].negate) {
|
||||
interfered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -208,7 +208,7 @@ upload_default_color(struct brw_context *brw,
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||
struct gl_texture_object *texObj = texUnit->_Current;
|
||||
struct gl_texture_image *firstImage = texObj->Image[0][texObj->BaseLevel];
|
||||
float color[4];
|
||||
union gl_color_union color;
|
||||
|
||||
switch (firstImage->_BaseFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
@@ -216,40 +216,40 @@ upload_default_color(struct brw_context *brw,
|
||||
* R channel, while the hardware uses A. Spam R into all the
|
||||
* channels for safety.
|
||||
*/
|
||||
color[0] = sampler->BorderColor.f[0];
|
||||
color[1] = sampler->BorderColor.f[0];
|
||||
color[2] = sampler->BorderColor.f[0];
|
||||
color[3] = sampler->BorderColor.f[0];
|
||||
color.ui[0] = sampler->BorderColor.ui[0];
|
||||
color.ui[1] = sampler->BorderColor.ui[0];
|
||||
color.ui[2] = sampler->BorderColor.ui[0];
|
||||
color.ui[3] = sampler->BorderColor.ui[0];
|
||||
break;
|
||||
case GL_ALPHA:
|
||||
color[0] = 0.0;
|
||||
color[1] = 0.0;
|
||||
color[2] = 0.0;
|
||||
color[3] = sampler->BorderColor.f[3];
|
||||
color.ui[0] = 0u;
|
||||
color.ui[1] = 0u;
|
||||
color.ui[2] = 0u;
|
||||
color.ui[3] = sampler->BorderColor.ui[3];
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
color[0] = sampler->BorderColor.f[0];
|
||||
color[1] = sampler->BorderColor.f[0];
|
||||
color[2] = sampler->BorderColor.f[0];
|
||||
color[3] = sampler->BorderColor.f[0];
|
||||
color.ui[0] = sampler->BorderColor.ui[0];
|
||||
color.ui[1] = sampler->BorderColor.ui[0];
|
||||
color.ui[2] = sampler->BorderColor.ui[0];
|
||||
color.ui[3] = sampler->BorderColor.ui[0];
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
color[0] = sampler->BorderColor.f[0];
|
||||
color[1] = sampler->BorderColor.f[0];
|
||||
color[2] = sampler->BorderColor.f[0];
|
||||
color[3] = 1.0;
|
||||
color.ui[0] = sampler->BorderColor.ui[0];
|
||||
color.ui[1] = sampler->BorderColor.ui[0];
|
||||
color.ui[2] = sampler->BorderColor.ui[0];
|
||||
color.ui[3] = float_as_int(1.0);
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
color[0] = sampler->BorderColor.f[0];
|
||||
color[1] = sampler->BorderColor.f[0];
|
||||
color[2] = sampler->BorderColor.f[0];
|
||||
color[3] = sampler->BorderColor.f[3];
|
||||
color.ui[0] = sampler->BorderColor.ui[0];
|
||||
color.ui[1] = sampler->BorderColor.ui[0];
|
||||
color.ui[2] = sampler->BorderColor.ui[0];
|
||||
color.ui[3] = sampler->BorderColor.ui[3];
|
||||
break;
|
||||
default:
|
||||
color[0] = sampler->BorderColor.f[0];
|
||||
color[1] = sampler->BorderColor.f[1];
|
||||
color[2] = sampler->BorderColor.f[2];
|
||||
color[3] = sampler->BorderColor.f[3];
|
||||
color.ui[0] = sampler->BorderColor.ui[0];
|
||||
color.ui[1] = sampler->BorderColor.ui[1];
|
||||
color.ui[2] = sampler->BorderColor.ui[2];
|
||||
color.ui[3] = sampler->BorderColor.ui[3];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -258,18 +258,79 @@ upload_default_color(struct brw_context *brw,
|
||||
* the border color alpha to 1.0 in that case.
|
||||
*/
|
||||
if (firstImage->_BaseFormat == GL_RGB)
|
||||
color[3] = 1.0;
|
||||
color.ui[3] = float_as_int(1.0);
|
||||
|
||||
if (brw->gen >= 8) {
|
||||
/* On Broadwell, the border color is represented as four 32-bit floats,
|
||||
* integers, or unsigned values, interpreted according to the surface
|
||||
* format. This matches the sampler->BorderColor union exactly. Since
|
||||
* we use floats both here and in the above reswizzling code, we preserve
|
||||
* the original bit pattern. So we actually handle all three formats.
|
||||
* format. This matches the sampler->BorderColor union exactly; just
|
||||
* memcpy the values.
|
||||
*/
|
||||
float *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
|
||||
4 * 4, 64, sdc_offset);
|
||||
COPY_4FV(sdc, color);
|
||||
uint32_t *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
|
||||
4 * 4, 64, sdc_offset);
|
||||
memcpy(sdc, color.ui, 4 * 4);
|
||||
} else if (brw->is_haswell && texObj->_IsIntegerFormat) {
|
||||
/* Haswell's integer border color support is completely insane:
|
||||
* SAMPLER_BORDER_COLOR_STATE is 20 DWords. The first four are
|
||||
* for float colors. The next 12 DWords are MBZ and only exist to
|
||||
* pad it out to a 64 byte cacheline boundary. DWords 16-19 then
|
||||
* contain integer colors; these are only used if SURFACE_STATE
|
||||
* has the "Integer Surface Format" bit set. Even then, the
|
||||
* arrangement of the RGBA data devolves into madness.
|
||||
*/
|
||||
uint32_t *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
|
||||
20 * 4, 512, sdc_offset);
|
||||
memset(sdc, 0, 20 * 4);
|
||||
sdc = &sdc[16];
|
||||
|
||||
mesa_format format = firstImage->TexFormat;
|
||||
int bits_per_channel = _mesa_get_format_bits(format, GL_RED_BITS);
|
||||
|
||||
/* From the Haswell PRM, "Command Reference: Structures", Page 36:
|
||||
* "If any color channel is missing from the surface format,
|
||||
* corresponding border color should be programmed as zero and if
|
||||
* alpha channel is missing, corresponding Alpha border color should
|
||||
* be programmed as 1."
|
||||
*/
|
||||
unsigned c[4] = { 0, 0, 0, 1 };
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (_mesa_format_has_color_component(format, i))
|
||||
c[i] = color.ui[i];
|
||||
}
|
||||
|
||||
switch (bits_per_channel) {
|
||||
case 8:
|
||||
/* Copy RGBA in order. */
|
||||
for (int i = 0; i < 4; i++)
|
||||
((uint8_t *) sdc)[i] = c[i];
|
||||
break;
|
||||
case 10:
|
||||
/* R10G10B10A2_UINT is treated like a 16-bit format. */
|
||||
case 16:
|
||||
((uint16_t *) sdc)[0] = c[0]; /* R -> DWord 0, bits 15:0 */
|
||||
((uint16_t *) sdc)[1] = c[1]; /* G -> DWord 0, bits 31:16 */
|
||||
/* DWord 1 is Reserved/MBZ! */
|
||||
((uint16_t *) sdc)[4] = c[2]; /* B -> DWord 2, bits 15:0 */
|
||||
((uint16_t *) sdc)[5] = c[3]; /* A -> DWord 3, bits 31:16 */
|
||||
break;
|
||||
case 32:
|
||||
if (firstImage->_BaseFormat == GL_RG) {
|
||||
/* Careful inspection of the tables reveals that for RG32 formats,
|
||||
* the green channel needs to go where blue normally belongs.
|
||||
*/
|
||||
sdc[0] = c[0];
|
||||
sdc[2] = c[1];
|
||||
sdc[3] = 1;
|
||||
} else {
|
||||
/* Copy RGBA in order. */
|
||||
for (int i = 0; i < 4; i++)
|
||||
sdc[i] = c[i];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(!"Invalid number of bits per channel in integer format.");
|
||||
break;
|
||||
}
|
||||
} else if (brw->gen == 5 || brw->gen == 6) {
|
||||
struct gen5_sampler_default_color *sdc;
|
||||
|
||||
@@ -278,39 +339,39 @@ upload_default_color(struct brw_context *brw,
|
||||
|
||||
memset(sdc, 0, sizeof(*sdc));
|
||||
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[0], color[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[1], color[1]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[2], color[2]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[3], color[3]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[0], color.f[0]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[1], color.f[1]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[2], color.f[2]);
|
||||
UNCLAMPED_FLOAT_TO_UBYTE(sdc->ub[3], color.f[3]);
|
||||
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[0], color[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[1], color[1]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[2], color[2]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[3], color[3]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[0], color.f[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[1], color.f[1]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[2], color.f[2]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(sdc->us[3], color.f[3]);
|
||||
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[0], color[0]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[1], color[1]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[2], color[2]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[3], color[3]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[0], color.f[0]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[1], color.f[1]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[2], color.f[2]);
|
||||
UNCLAMPED_FLOAT_TO_SHORT(sdc->s[3], color.f[3]);
|
||||
|
||||
sdc->hf[0] = _mesa_float_to_half(color[0]);
|
||||
sdc->hf[1] = _mesa_float_to_half(color[1]);
|
||||
sdc->hf[2] = _mesa_float_to_half(color[2]);
|
||||
sdc->hf[3] = _mesa_float_to_half(color[3]);
|
||||
sdc->hf[0] = _mesa_float_to_half(color.f[0]);
|
||||
sdc->hf[1] = _mesa_float_to_half(color.f[1]);
|
||||
sdc->hf[2] = _mesa_float_to_half(color.f[2]);
|
||||
sdc->hf[3] = _mesa_float_to_half(color.f[3]);
|
||||
|
||||
sdc->b[0] = sdc->s[0] >> 8;
|
||||
sdc->b[1] = sdc->s[1] >> 8;
|
||||
sdc->b[2] = sdc->s[2] >> 8;
|
||||
sdc->b[3] = sdc->s[3] >> 8;
|
||||
|
||||
sdc->f[0] = color[0];
|
||||
sdc->f[1] = color[1];
|
||||
sdc->f[2] = color[2];
|
||||
sdc->f[3] = color[3];
|
||||
sdc->f[0] = color.f[0];
|
||||
sdc->f[1] = color.f[1];
|
||||
sdc->f[2] = color.f[2];
|
||||
sdc->f[3] = color.f[3];
|
||||
} else {
|
||||
float *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR,
|
||||
4 * 4, 32, sdc_offset);
|
||||
memcpy(sdc, color, 4 * 4);
|
||||
memcpy(sdc, color.f, 4 * 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -470,6 +470,8 @@ brw_instruction_name(enum opcode op)
|
||||
case SHADER_OPCODE_URB_WRITE_SIMD8:
|
||||
return "gen8_urb_write_simd8";
|
||||
|
||||
case VEC4_OPCODE_MOV_BYTES:
|
||||
return "mov_bytes";
|
||||
case VEC4_OPCODE_PACK_BYTES:
|
||||
return "pack_bytes";
|
||||
case VEC4_OPCODE_UNPACK_UNIFORM:
|
||||
|
@@ -1512,6 +1512,22 @@ vec4_generator::generate_code(const cfg_t *cfg)
|
||||
generate_unpack_flags(inst, dst);
|
||||
break;
|
||||
|
||||
case VEC4_OPCODE_MOV_BYTES: {
|
||||
/* Moves the low byte from each channel, using an Align1 access mode
|
||||
* and a <4,1,0> source region.
|
||||
*/
|
||||
assert(src[0].type == BRW_REGISTER_TYPE_UB ||
|
||||
src[0].type == BRW_REGISTER_TYPE_B);
|
||||
|
||||
brw_set_default_access_mode(p, BRW_ALIGN_1);
|
||||
src[0].vstride = BRW_VERTICAL_STRIDE_4;
|
||||
src[0].width = BRW_WIDTH_1;
|
||||
src[0].hstride = BRW_HORIZONTAL_STRIDE_0;
|
||||
brw_MOV(p, dst, src[0]);
|
||||
brw_set_default_access_mode(p, BRW_ALIGN_16);
|
||||
break;
|
||||
}
|
||||
|
||||
case VEC4_OPCODE_PACK_BYTES: {
|
||||
/* Is effectively:
|
||||
*
|
||||
|
@@ -485,7 +485,7 @@ vec4_visitor::emit_unpack_unorm_4x8(const dst_reg &dst, src_reg src0)
|
||||
|
||||
shifted.type = BRW_REGISTER_TYPE_UB;
|
||||
dst_reg f(this, glsl_type::vec4_type);
|
||||
emit(MOV(f, src_reg(shifted)));
|
||||
emit(VEC4_OPCODE_MOV_BYTES, f, src_reg(shifted));
|
||||
|
||||
emit(MUL(dst, src_reg(f), src_reg(1.0f / 255.0f)));
|
||||
}
|
||||
@@ -507,7 +507,7 @@ vec4_visitor::emit_unpack_snorm_4x8(const dst_reg &dst, src_reg src0)
|
||||
|
||||
shifted.type = BRW_REGISTER_TYPE_B;
|
||||
dst_reg f(this, glsl_type::vec4_type);
|
||||
emit(MOV(f, src_reg(shifted)));
|
||||
emit(VEC4_OPCODE_MOV_BYTES, f, src_reg(shifted));
|
||||
|
||||
dst_reg scaled(this, glsl_type::vec4_type);
|
||||
emit(MUL(scaled, src_reg(f), src_reg(1.0f / 127.0f)));
|
||||
|
@@ -43,8 +43,7 @@ vec4_visitor::emit_vp_sop(enum brw_conditional_mod conditional_mod,
|
||||
{
|
||||
vec4_instruction *inst;
|
||||
|
||||
inst = emit(BRW_OPCODE_CMP, dst_null_d(), src0, src1);
|
||||
inst->conditional_mod = conditional_mod;
|
||||
inst = emit(CMP(dst_null_f(), src0, src1, conditional_mod));
|
||||
|
||||
inst = emit(BRW_OPCODE_SEL, dst, one, src_reg(0.0f));
|
||||
inst->predicate = BRW_PREDICATE_NORMAL;
|
||||
|
@@ -199,6 +199,14 @@ brw_get_texture_swizzle(const struct gl_context *ctx,
|
||||
swizzles[1] = SWIZZLE_ZERO;
|
||||
swizzles[2] = SWIZZLE_ZERO;
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
if (t->_IsIntegerFormat) {
|
||||
swizzles[0] = SWIZZLE_X;
|
||||
swizzles[1] = SWIZZLE_X;
|
||||
swizzles[2] = SWIZZLE_X;
|
||||
swizzles[3] = SWIZZLE_ONE;
|
||||
}
|
||||
break;
|
||||
case GL_RED:
|
||||
case GL_RG:
|
||||
case GL_RGB:
|
||||
|
@@ -321,6 +321,9 @@ gen7_update_texture_surface(struct gl_context *ctx,
|
||||
surf[3] = SET_FIELD(effective_depth - 1, BRW_SURFACE_DEPTH) |
|
||||
(mt->pitch - 1);
|
||||
|
||||
if (brw->is_haswell && tObj->_IsIntegerFormat)
|
||||
surf[3] |= HSW_SURFACE_IS_INTEGER_FORMAT;
|
||||
|
||||
surf[4] = gen7_surface_msaa_bits(mt->num_samples, mt->msaa_layout) |
|
||||
SET_FIELD(tObj->MinLayer, GEN7_SURFACE_MIN_ARRAY_ELEMENT) |
|
||||
SET_FIELD((effective_depth - 1),
|
||||
|
@@ -190,6 +190,18 @@ gen8_emit_depth_stencil_hiz(struct brw_context *brw,
|
||||
case GL_TEXTURE_3D:
|
||||
assert(mt);
|
||||
depth = MAX2(mt->logical_depth0, 1);
|
||||
surftype = translate_tex_target(gl_target);
|
||||
break;
|
||||
case GL_TEXTURE_1D_ARRAY:
|
||||
case GL_TEXTURE_1D:
|
||||
if (brw->gen >= 9) {
|
||||
/* WaDisable1DDepthStencil. Skylake+ doesn't support 1D depth
|
||||
* textures but it does allow pretending it's a 2D texture
|
||||
* instead.
|
||||
*/
|
||||
surftype = BRW_SURFACE_2D;
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
default:
|
||||
surftype = translate_tex_target(gl_target);
|
||||
|
@@ -885,6 +885,13 @@ intel_blit_framebuffer(struct gl_context *ctx,
|
||||
if (mask == 0x0)
|
||||
return;
|
||||
|
||||
mask = _mesa_meta_BlitFramebuffer(ctx, readFb, drawFb,
|
||||
srcX0, srcY0, srcX1, srcY1,
|
||||
dstX0, dstY0, dstX1, dstY1,
|
||||
mask, filter);
|
||||
if (mask == 0x0)
|
||||
return;
|
||||
|
||||
if (brw->gen >= 8 && (mask & GL_STENCIL_BUFFER_BIT)) {
|
||||
brw_meta_fbo_stencil_blit(brw_context(ctx), readFb, drawFb,
|
||||
srcX0, srcY0, srcX1, srcY1,
|
||||
@@ -902,13 +909,6 @@ intel_blit_framebuffer(struct gl_context *ctx,
|
||||
if (mask == 0x0)
|
||||
return;
|
||||
|
||||
mask = _mesa_meta_BlitFramebuffer(ctx, readFb, drawFb,
|
||||
srcX0, srcY0, srcX1, srcY1,
|
||||
dstX0, dstY0, dstX1, dstY1,
|
||||
mask, filter);
|
||||
if (mask == 0x0)
|
||||
return;
|
||||
|
||||
_swrast_BlitFramebuffer(ctx, readFb, drawFb,
|
||||
srcX0, srcY0, srcX1, srcY1,
|
||||
dstX0, dstY0, dstX1, dstY1,
|
||||
|
439
src/mesa/drivers/dri/i965/test_fs_saturate_propagation.cpp
Normal file
439
src/mesa/drivers/dri/i965/test_fs_saturate_propagation.cpp
Normal file
@@ -0,0 +1,439 @@
|
||||
/*
|
||||
* Copyright © 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "brw_fs.h"
|
||||
#include "brw_cfg.h"
|
||||
#include "program/program.h"
|
||||
|
||||
class saturate_propagation_test : public ::testing::Test {
|
||||
virtual void SetUp();
|
||||
|
||||
public:
|
||||
struct brw_context *brw;
|
||||
struct gl_context *ctx;
|
||||
struct brw_wm_prog_data *prog_data;
|
||||
struct gl_shader_program *shader_prog;
|
||||
struct brw_fragment_program *fp;
|
||||
fs_visitor *v;
|
||||
};
|
||||
|
||||
class saturate_propagation_fs_visitor : public fs_visitor
|
||||
{
|
||||
public:
|
||||
saturate_propagation_fs_visitor(struct brw_context *brw,
|
||||
struct brw_wm_prog_data *prog_data,
|
||||
struct gl_shader_program *shader_prog)
|
||||
: fs_visitor(brw, NULL, NULL, prog_data, shader_prog, NULL, 8) {}
|
||||
};
|
||||
|
||||
|
||||
void saturate_propagation_test::SetUp()
|
||||
{
|
||||
brw = (struct brw_context *)calloc(1, sizeof(*brw));
|
||||
ctx = &brw->ctx;
|
||||
|
||||
fp = ralloc(NULL, struct brw_fragment_program);
|
||||
prog_data = ralloc(NULL, struct brw_wm_prog_data);
|
||||
shader_prog = ralloc(NULL, struct gl_shader_program);
|
||||
|
||||
v = new saturate_propagation_fs_visitor(brw, prog_data, shader_prog);
|
||||
|
||||
_mesa_init_fragment_program(ctx, &fp->program, GL_FRAGMENT_SHADER, 0);
|
||||
|
||||
brw->gen = 4;
|
||||
}
|
||||
|
||||
static fs_inst *
|
||||
instruction(bblock_t *block, int num)
|
||||
{
|
||||
fs_inst *inst = (fs_inst *)block->start();
|
||||
for (int i = 0; i < num; i++) {
|
||||
inst = (fs_inst *)inst->next;
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
static bool
|
||||
saturate_propagation(fs_visitor *v)
|
||||
{
|
||||
const bool print = false;
|
||||
|
||||
if (print) {
|
||||
fprintf(stderr, "= Before =\n");
|
||||
v->cfg->dump(v);
|
||||
}
|
||||
|
||||
bool ret = v->opt_saturate_propagation();
|
||||
|
||||
if (print) {
|
||||
fprintf(stderr, "\n= After =\n");
|
||||
v->cfg->dump(v);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, basic)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1);
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 dst0
|
||||
*
|
||||
* = After =
|
||||
* 0: add.sat(8) dst0 src0 src1
|
||||
* 1: mov(8) dst1 dst0
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
|
||||
EXPECT_TRUE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 1)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, other_non_saturated_use)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst2 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1);
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
v->emit(BRW_OPCODE_ADD, dst2, dst0, src0);
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 dst0
|
||||
* 2: add(8) dst2 dst0 src0
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 1)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 2)->opcode);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, predicated_instruction)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1)
|
||||
->predicate = BRW_PREDICATE_NORMAL;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: (+f0) add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 dst0
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 1)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, neg_mov_sat)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1);
|
||||
dst0.negate = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 -dst0
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 1)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, abs_mov_sat)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1);
|
||||
dst0.abs = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 (abs)dst0
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(1, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 1)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, producer_saturates)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst2 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1)
|
||||
->saturate = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst2, dst0);
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add.sat(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 dst0
|
||||
* 2: mov(8) dst2 dst0
|
||||
*
|
||||
* = After =
|
||||
* 0: add.sat(8) dst0 src0 src1
|
||||
* 1: mov(8) dst1 dst0
|
||||
* 2: mov(8) dst2 dst0
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
|
||||
EXPECT_TRUE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 1)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, intervening_saturating_copy)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst2 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_ADD, dst0, src0, src1);
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst2, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 dst0
|
||||
* 2: mov.sat(8) dst2 dst0
|
||||
*
|
||||
* = After =
|
||||
* 0: add.sat(8) dst0 src0 src1
|
||||
* 1: mov(8) dst1 dst0
|
||||
* 2: mov(8) dst2 dst0
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
|
||||
EXPECT_TRUE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 1)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 2)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 2)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, intervening_dest_write)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::vec4_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src2 = v->vgrf(glsl_type::vec2_type);
|
||||
v->emit(BRW_OPCODE_ADD, offset(dst0, 2), src0, src1);
|
||||
v->emit(SHADER_OPCODE_TEX, dst0, src2)
|
||||
->regs_written = 4;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, offset(dst0, 2))
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: add(8) dst0+2 src0 src1
|
||||
* 1: tex(8) rlen 4 dst0+0 src2
|
||||
* 2: mov.sat(8) dst1 dst0+2
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_ADD, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(SHADER_OPCODE_TEX, instruction(block0, 1)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 2)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 2)->saturate);
|
||||
}
|
||||
|
||||
TEST_F(saturate_propagation_test, mul_neg_mov_sat_mov_sat)
|
||||
{
|
||||
fs_reg dst0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst1 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg dst2 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src0 = v->vgrf(glsl_type::float_type);
|
||||
fs_reg src1 = v->vgrf(glsl_type::float_type);
|
||||
v->emit(BRW_OPCODE_MUL, dst0, src0, src1);
|
||||
dst0.negate = true;
|
||||
v->emit(BRW_OPCODE_MOV, dst1, dst0)
|
||||
->saturate = true;
|
||||
dst0.negate = false;
|
||||
v->emit(BRW_OPCODE_MOV, dst2, dst0)
|
||||
->saturate = true;
|
||||
|
||||
/* = Before =
|
||||
*
|
||||
* 0: mul(8) dst0 src0 src1
|
||||
* 1: mov.sat(8) dst1 -dst0
|
||||
* 2: mov.sat(8) dst2 dst0
|
||||
*
|
||||
* = After =
|
||||
* (no changes)
|
||||
*/
|
||||
|
||||
v->calculate_cfg();
|
||||
bblock_t *block0 = v->cfg->blocks[0];
|
||||
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
|
||||
EXPECT_FALSE(saturate_propagation(v));
|
||||
EXPECT_EQ(0, block0->start_ip);
|
||||
EXPECT_EQ(2, block0->end_ip);
|
||||
EXPECT_EQ(BRW_OPCODE_MUL, instruction(block0, 0)->opcode);
|
||||
EXPECT_FALSE(instruction(block0, 0)->saturate);
|
||||
EXPECT_FALSE(instruction(block0, 0)->src[1].negate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 1)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 1)->saturate);
|
||||
EXPECT_TRUE(instruction(block0, 1)->src[0].negate);
|
||||
EXPECT_EQ(BRW_OPCODE_MOV, instruction(block0, 2)->opcode);
|
||||
EXPECT_TRUE(instruction(block0, 2)->saturate);
|
||||
}
|
4
src/mesa/main/.gitignore
vendored
4
src/mesa/main/.gitignore
vendored
@@ -1,13 +1,11 @@
|
||||
api_exec.c
|
||||
dispatch.h
|
||||
enums.c
|
||||
get_es1.c
|
||||
get_es2.c
|
||||
git_sha1.h
|
||||
git_sha1.h.tmp
|
||||
remap_helper.h
|
||||
get_hash.h
|
||||
get_hash.h.tmp
|
||||
format_info.c
|
||||
format_info.h
|
||||
format_pack.c
|
||||
format_unpack.c
|
||||
|
@@ -1226,7 +1226,7 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->UniformBuffer == bufObj) {
|
||||
if (ctx->AtomicBuffer == bufObj) {
|
||||
_mesa_BindBuffer( GL_ATOMIC_COUNTER_BUFFER, 0 );
|
||||
}
|
||||
|
||||
|
@@ -780,6 +780,18 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format,
|
||||
att->Complete = GL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
/* OES_texture_float allows creation and use of floating point
|
||||
* textures with GL_FLOAT, GL_HALF_FLOAT but it does not allow
|
||||
* these textures to be used as a render target, this is done via
|
||||
* GL_EXT_color_buffer(_half)_float with set of new sized types.
|
||||
*/
|
||||
if (_mesa_is_gles(ctx) && (texImage->TexObject->_IsFloat ||
|
||||
texImage->TexObject->_IsHalfFloat)) {
|
||||
att_incomplete("bad internal format");
|
||||
att->Complete = GL_FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (format == GL_DEPTH) {
|
||||
if (baseFormat == GL_DEPTH_COMPONENT) {
|
||||
|
@@ -1423,8 +1423,8 @@ convert_int(void *void_dst, int num_dst_channels,
|
||||
* \param[in] count the number of pixels to convert
|
||||
*/
|
||||
void
|
||||
_mesa_swizzle_and_convert(void *void_dst, GLenum dst_type, int num_dst_channels,
|
||||
const void *void_src, GLenum src_type, int num_src_channels,
|
||||
_mesa_swizzle_and_convert(void *void_dst, enum mesa_array_format_datatype dst_type, int num_dst_channels,
|
||||
const void *void_src, enum mesa_array_format_datatype src_type, int num_src_channels,
|
||||
const uint8_t swizzle[4], bool normalized, int count)
|
||||
{
|
||||
if (swizzle_convert_try_memcpy(void_dst, dst_type, num_dst_channels,
|
||||
|
@@ -75,7 +75,7 @@ struct gl_format_info
|
||||
mesa_array_format ArrayFormat;
|
||||
};
|
||||
|
||||
#include "format_info.c"
|
||||
#include "format_info.h"
|
||||
|
||||
static const struct gl_format_info *
|
||||
_mesa_get_format_info(mesa_format format)
|
||||
|
@@ -605,12 +605,15 @@ read_rgba_pixels( struct gl_context *ctx,
|
||||
done_swap:
|
||||
/* Handle byte swapping if required */
|
||||
if (packing->SwapBytes) {
|
||||
int components = _mesa_components_in_format(format);
|
||||
GLint swapSize = _mesa_sizeof_packed_type(type);
|
||||
if (swapSize == 2)
|
||||
_mesa_swap2((GLushort *) dst, width * height * components);
|
||||
else if (swapSize == 4)
|
||||
_mesa_swap4((GLuint *) dst, width * height * components);
|
||||
if (swapSize == 2 || swapSize == 4) {
|
||||
int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
|
||||
assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
|
||||
if (swapSize == 2)
|
||||
_mesa_swap2((GLushort *) dst, width * height * swapsPerPixel);
|
||||
else if (swapSize == 4)
|
||||
_mesa_swap4((GLuint *) dst, width * height * swapsPerPixel);
|
||||
}
|
||||
}
|
||||
|
||||
done_unmap:
|
||||
|
@@ -511,12 +511,15 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, GLuint dimensions,
|
||||
do_swap:
|
||||
/* Handle byte swapping if required */
|
||||
if (ctx->Pack.SwapBytes) {
|
||||
int components = _mesa_components_in_format(format);
|
||||
GLint swapSize = _mesa_sizeof_packed_type(type);
|
||||
if (swapSize == 2)
|
||||
_mesa_swap2((GLushort *) dest, width * height * components);
|
||||
else if (swapSize == 4)
|
||||
_mesa_swap4((GLuint *) dest, width * height * components);
|
||||
if (swapSize == 2 || swapSize == 4) {
|
||||
int swapsPerPixel = _mesa_bytes_per_pixel(format, type) / swapSize;
|
||||
assert(_mesa_bytes_per_pixel(format, type) % swapSize == 0);
|
||||
if (swapSize == 2)
|
||||
_mesa_swap2((GLushort *) dest, width * height * swapsPerPixel);
|
||||
else if (swapSize == 4)
|
||||
_mesa_swap4((GLuint *) dest, width * height * swapsPerPixel);
|
||||
}
|
||||
}
|
||||
|
||||
/* Unmap the src texture buffer */
|
||||
@@ -740,7 +743,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
|
||||
GLubyte *src;
|
||||
|
||||
/* map src texture buffer */
|
||||
ctx->Driver.MapTextureImage(ctx, texImage, 0,
|
||||
ctx->Driver.MapTextureImage(ctx, texImage, slice,
|
||||
0, 0, texImage->Width, texImage->Height,
|
||||
GL_MAP_READ_BIT, &src, &srcRowStride);
|
||||
|
||||
@@ -752,7 +755,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
|
||||
src += srcRowStride;
|
||||
}
|
||||
|
||||
ctx->Driver.UnmapTextureImage(ctx, texImage, 0);
|
||||
ctx->Driver.UnmapTextureImage(ctx, texImage, slice);
|
||||
|
||||
/* Advance to next slice */
|
||||
dest += store.TotalBytesPerRow * (store.TotalRowsPerSlice - store.CopyRowsPerSlice);
|
||||
|
@@ -2491,8 +2491,8 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
|
||||
}
|
||||
|
||||
if (error_check_subtexture_dimensions(ctx, dimensions,
|
||||
texImage, xoffset, yoffset, 0,
|
||||
width, height, 1,
|
||||
texImage, xoffset, yoffset, zoffset,
|
||||
width, height, depth,
|
||||
dsa ? "glTextureSubImage" :
|
||||
"glTexSubImage")) {
|
||||
return GL_TRUE;
|
||||
|
@@ -73,6 +73,7 @@
|
||||
#include "texstore.h"
|
||||
#include "enums.h"
|
||||
#include "glformats.h"
|
||||
#include "pixeltransfer.h"
|
||||
#include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
|
||||
#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
|
||||
|
||||
@@ -675,12 +676,13 @@ texstore_compressed(TEXSTORE_PARAMS)
|
||||
static GLboolean
|
||||
texstore_rgba(TEXSTORE_PARAMS)
|
||||
{
|
||||
void *tempImage = NULL;
|
||||
void *tempImage = NULL, *tempRGBA = NULL;
|
||||
int srcRowStride, img;
|
||||
GLubyte *src;
|
||||
GLubyte *src, *dst;
|
||||
uint32_t srcMesaFormat;
|
||||
uint8_t rebaseSwizzle[4];
|
||||
bool needRebase;
|
||||
bool transferOpsDone = false;
|
||||
|
||||
/* We have to handle MESA_FORMAT_YCBCR manually because it is a special case
|
||||
* and _mesa_format_convert does not support it. In this case the we only
|
||||
@@ -709,6 +711,11 @@ texstore_rgba(TEXSTORE_PARAMS)
|
||||
if (!tempImage)
|
||||
return GL_FALSE;
|
||||
|
||||
/* _mesa_unpack_color_index_to_rgba_ubyte has handled transferops
|
||||
* if needed.
|
||||
*/
|
||||
transferOpsDone = true;
|
||||
|
||||
/* Now we only have to adjust our src info for a conversion from
|
||||
* the RGBA ubyte and then we continue as usual.
|
||||
*/
|
||||
@@ -721,15 +728,19 @@ texstore_rgba(TEXSTORE_PARAMS)
|
||||
*/
|
||||
GLint swapSize = _mesa_sizeof_packed_type(srcType);
|
||||
if (swapSize == 2 || swapSize == 4) {
|
||||
int components = _mesa_components_in_format(srcFormat);
|
||||
int elementCount = srcWidth * srcHeight * components;
|
||||
tempImage = malloc(elementCount * swapSize);
|
||||
int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
|
||||
assert(bytesPerPixel % swapSize == 0);
|
||||
int swapsPerPixel = bytesPerPixel / swapSize;
|
||||
int elementCount = srcWidth * srcHeight * srcDepth;
|
||||
tempImage = malloc(elementCount * bytesPerPixel);
|
||||
if (!tempImage)
|
||||
return GL_FALSE;
|
||||
if (swapSize == 2)
|
||||
_mesa_swap2_copy(tempImage, (GLushort *) srcAddr, elementCount);
|
||||
_mesa_swap2_copy(tempImage, (GLushort *) srcAddr,
|
||||
elementCount * swapsPerPixel);
|
||||
else
|
||||
_mesa_swap4_copy(tempImage, (GLuint *) srcAddr, elementCount);
|
||||
_mesa_swap4_copy(tempImage, (GLuint *) srcAddr,
|
||||
elementCount * swapsPerPixel);
|
||||
srcAddr = tempImage;
|
||||
}
|
||||
}
|
||||
@@ -737,13 +748,52 @@ texstore_rgba(TEXSTORE_PARAMS)
|
||||
srcRowStride =
|
||||
_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
|
||||
|
||||
srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
|
||||
dstFormat = _mesa_get_srgb_format_linear(dstFormat);
|
||||
|
||||
/* If we have transferOps then we need to convert to RGBA float first,
|
||||
then apply transferOps, then do the conversion to dst
|
||||
*/
|
||||
if (!transferOpsDone &&
|
||||
_mesa_texstore_needs_transfer_ops(ctx, baseInternalFormat, dstFormat)) {
|
||||
/* Allocate RGBA float image */
|
||||
int elementCount = srcWidth * srcHeight * srcDepth;
|
||||
tempRGBA = malloc(4 * elementCount * sizeof(float));
|
||||
if (!tempRGBA) {
|
||||
free(tempImage);
|
||||
free(tempRGBA);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* Convert from src to RGBA float */
|
||||
src = (GLubyte *) srcAddr;
|
||||
dst = (GLubyte *) tempRGBA;
|
||||
for (img = 0; img < srcDepth; img++) {
|
||||
_mesa_format_convert(dst, RGBA32_FLOAT, 4 * srcWidth * sizeof(float),
|
||||
src, srcMesaFormat, srcRowStride,
|
||||
srcWidth, srcHeight, NULL);
|
||||
src += srcHeight * srcRowStride;
|
||||
dst += srcHeight * 4 * srcWidth * sizeof(float);
|
||||
}
|
||||
|
||||
/* Apply transferOps */
|
||||
_mesa_apply_rgba_transfer_ops(ctx, ctx->_ImageTransferState, elementCount,
|
||||
(float(*)[4]) tempRGBA);
|
||||
|
||||
/* Now we have to adjust our src info for a conversion from
|
||||
* the RGBA float image and then we continue as usual.
|
||||
*/
|
||||
srcAddr = tempRGBA;
|
||||
srcFormat = GL_RGBA;
|
||||
srcType = GL_FLOAT;
|
||||
srcRowStride = srcWidth * 4 * sizeof(float);
|
||||
srcMesaFormat = RGBA32_FLOAT;
|
||||
}
|
||||
|
||||
src = (GLubyte *)
|
||||
_mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
|
||||
srcFormat, srcType, 0, 0, 0);
|
||||
|
||||
srcMesaFormat = _mesa_format_from_format_and_type(srcFormat, srcType);
|
||||
dstFormat = _mesa_get_srgb_format_linear(dstFormat);
|
||||
|
||||
if (_mesa_get_format_base_format(dstFormat) != baseInternalFormat) {
|
||||
needRebase =
|
||||
_mesa_compute_rgba2base2rgba_component_mapping(baseInternalFormat,
|
||||
@@ -761,6 +811,7 @@ texstore_rgba(TEXSTORE_PARAMS)
|
||||
}
|
||||
|
||||
free(tempImage);
|
||||
free(tempRGBA);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@@ -85,9 +85,6 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0)
|
||||
_mesa_optimize_program(ctx, &prog);
|
||||
|
||||
free(program->Base.String);
|
||||
|
||||
/* Copy the relevant contents of the arb_program struct into the
|
||||
|
@@ -1100,7 +1100,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
|
||||
const GLfloat *color;
|
||||
struct pipe_context *pipe = st->pipe;
|
||||
GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE;
|
||||
struct pipe_sampler_view *sv[2];
|
||||
struct pipe_sampler_view *sv[2] = { NULL };
|
||||
int num_sampler_view = 1;
|
||||
struct st_fp_variant *fpv;
|
||||
struct gl_pixelstore_attrib clippedUnpack;
|
||||
@@ -1154,8 +1154,9 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
|
||||
|
||||
color = NULL;
|
||||
if (st->pixel_xfer.pixelmap_enabled) {
|
||||
sv[1] = st->pixel_xfer.pixelmap_sampler_view;
|
||||
num_sampler_view++;
|
||||
pipe_sampler_view_reference(&sv[1],
|
||||
st->pixel_xfer.pixelmap_sampler_view);
|
||||
num_sampler_view++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1176,7 +1177,8 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
|
||||
if (write_stencil) {
|
||||
enum pipe_format stencil_format =
|
||||
util_format_stencil_only(pt->format);
|
||||
|
||||
/* we should not be doing pixel map/transfer (see above) */
|
||||
assert(num_sampler_view == 1);
|
||||
sv[1] = st_create_texture_sampler_view_format(st->pipe, pt,
|
||||
stencil_format);
|
||||
num_sampler_view++;
|
||||
@@ -1467,7 +1469,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
|
||||
struct st_renderbuffer *rbRead;
|
||||
void *driver_vp, *driver_fp;
|
||||
struct pipe_resource *pt;
|
||||
struct pipe_sampler_view *sv[2];
|
||||
struct pipe_sampler_view *sv[2] = { NULL };
|
||||
int num_sampler_view = 1;
|
||||
GLfloat *color;
|
||||
enum pipe_format srcFormat;
|
||||
@@ -1516,7 +1518,8 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
|
||||
driver_vp = make_passthrough_vertex_shader(st, GL_FALSE);
|
||||
|
||||
if (st->pixel_xfer.pixelmap_enabled) {
|
||||
sv[1] = st->pixel_xfer.pixelmap_sampler_view;
|
||||
pipe_sampler_view_reference(&sv[1],
|
||||
st->pixel_xfer.pixelmap_sampler_view);
|
||||
num_sampler_view++;
|
||||
}
|
||||
}
|
||||
|
@@ -122,7 +122,7 @@ st_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
|
||||
for (i = 0; i < max_num_targets; i++) {
|
||||
struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]);
|
||||
|
||||
if (bo) {
|
||||
if (bo && bo->buffer) {
|
||||
/* Check whether we need to recreate the target. */
|
||||
if (!sobj->targets[i] ||
|
||||
sobj->targets[i] == sobj->draw_count ||
|
||||
|
@@ -933,19 +933,19 @@ clamp_colors(SWspan *span)
|
||||
* \param output which fragment program color output is being processed
|
||||
*/
|
||||
static inline void
|
||||
convert_color_type(SWspan *span, GLenum newType, GLuint output)
|
||||
convert_color_type(SWspan *span, GLenum srcType, GLenum newType, GLuint output)
|
||||
{
|
||||
GLvoid *src, *dst;
|
||||
|
||||
if (output > 0 || span->array->ChanType == GL_FLOAT) {
|
||||
if (output > 0 || srcType == GL_FLOAT) {
|
||||
src = span->array->attribs[VARYING_SLOT_COL0 + output];
|
||||
span->array->ChanType = GL_FLOAT;
|
||||
}
|
||||
else if (span->array->ChanType == GL_UNSIGNED_BYTE) {
|
||||
else if (srcType == GL_UNSIGNED_BYTE) {
|
||||
src = span->array->rgba8;
|
||||
}
|
||||
else {
|
||||
ASSERT(span->array->ChanType == GL_UNSIGNED_SHORT);
|
||||
ASSERT(srcType == GL_UNSIGNED_SHORT);
|
||||
src = span->array->rgba16;
|
||||
}
|
||||
|
||||
@@ -979,7 +979,7 @@ shade_texture_span(struct gl_context *ctx, SWspan *span)
|
||||
ctx->ATIFragmentShader._Enabled) {
|
||||
/* programmable shading */
|
||||
if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) {
|
||||
convert_color_type(span, GL_FLOAT, 0);
|
||||
convert_color_type(span, span->array->ChanType, GL_FLOAT, 0);
|
||||
}
|
||||
else {
|
||||
span->array->rgba = (void *) span->array->attribs[VARYING_SLOT_COL0];
|
||||
@@ -1314,6 +1314,8 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
|
||||
const GLboolean multiFragOutputs =
|
||||
_swrast_use_fragment_program(ctx)
|
||||
&& fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0);
|
||||
/* Save srcColorType because convert_color_type() can change it */
|
||||
const GLenum srcColorType = span->array->ChanType;
|
||||
GLuint buf;
|
||||
|
||||
for (buf = 0; buf < numBuffers; buf++) {
|
||||
@@ -1325,17 +1327,18 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
|
||||
/* re-use one of the attribute array buffers for rgbaSave */
|
||||
GLchan (*rgbaSave)[4] = (GLchan (*)[4]) span->array->attribs[0];
|
||||
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
|
||||
GLenum colorType = srb->ColorType;
|
||||
const GLenum dstColorType = srb->ColorType;
|
||||
|
||||
assert(colorType == GL_UNSIGNED_BYTE ||
|
||||
colorType == GL_FLOAT);
|
||||
assert(dstColorType == GL_UNSIGNED_BYTE ||
|
||||
dstColorType == GL_FLOAT);
|
||||
|
||||
/* set span->array->rgba to colors for renderbuffer's datatype */
|
||||
if (span->array->ChanType != colorType) {
|
||||
convert_color_type(span, colorType, 0);
|
||||
if (srcColorType != dstColorType) {
|
||||
convert_color_type(span, srcColorType, dstColorType,
|
||||
multiFragOutputs ? buf : 0);
|
||||
}
|
||||
else {
|
||||
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
|
||||
if (srcColorType == GL_UNSIGNED_BYTE) {
|
||||
span->array->rgba = span->array->rgba8;
|
||||
}
|
||||
else {
|
||||
|
@@ -210,6 +210,7 @@ static inline float conv_i2_to_norm_float(const struct gl_context *ctx, int i2)
|
||||
} \
|
||||
} else if ((type) == GL_UNSIGNED_INT_10F_11F_11F_REV) { \
|
||||
float res[4]; \
|
||||
res[3] = 1; \
|
||||
r11g11b10f_to_float3((arg), res); \
|
||||
ATTR##val##FV((attr), res); \
|
||||
} else \
|
||||
|
@@ -177,7 +177,7 @@ char _InterlockedCompareExchange8(char volatile *Destination8, char Exchange8, c
|
||||
sizeof(*v) == sizeof(uint64_t) ? atomic_inc_64((uint64_t *)(v)) : \
|
||||
(assert(!"should not get here"), 0))
|
||||
|
||||
#define p_atomic_inc_return(v) ((typeof(*v)) \
|
||||
#define p_atomic_inc_return(v) ((__typeof(*v)) \
|
||||
sizeof(*v) == sizeof(uint8_t) ? atomic_inc_8_nv ((uint8_t *)(v)) : \
|
||||
sizeof(*v) == sizeof(uint16_t) ? atomic_inc_16_nv((uint16_t *)(v)) : \
|
||||
sizeof(*v) == sizeof(uint32_t) ? atomic_inc_32_nv((uint32_t *)(v)) : \
|
||||
@@ -191,14 +191,14 @@ char _InterlockedCompareExchange8(char volatile *Destination8, char Exchange8, c
|
||||
sizeof(*v) == sizeof(uint64_t) ? atomic_dec_64((uint64_t *)(v)) : \
|
||||
(assert(!"should not get here"), 0))
|
||||
|
||||
#define p_atomic_dec_return(v) ((typeof(*v)) \
|
||||
#define p_atomic_dec_return(v) ((__typeof(*v)) \
|
||||
sizeof(*v) == sizeof(uint8_t) ? atomic_dec_8_nv ((uint8_t *)(v)) : \
|
||||
sizeof(*v) == sizeof(uint16_t) ? atomic_dec_16_nv((uint16_t *)(v)) : \
|
||||
sizeof(*v) == sizeof(uint32_t) ? atomic_dec_32_nv((uint32_t *)(v)) : \
|
||||
sizeof(*v) == sizeof(uint64_t) ? atomic_dec_64_nv((uint64_t *)(v)) : \
|
||||
(assert(!"should not get here"), 0))
|
||||
|
||||
#define p_atomic_cmpxchg(v, old, _new) ((typeof(*v)) \
|
||||
#define p_atomic_cmpxchg(v, old, _new) ((__typeof(*v)) \
|
||||
sizeof(*v) == sizeof(uint8_t) ? atomic_cas_8 ((uint8_t *)(v), (uint8_t )(old), (uint8_t )(_new)) : \
|
||||
sizeof(*v) == sizeof(uint16_t) ? atomic_cas_16((uint16_t *)(v), (uint16_t)(old), (uint16_t)(_new)) : \
|
||||
sizeof(*v) == sizeof(uint32_t) ? atomic_cas_32((uint32_t *)(v), (uint32_t)(old), (uint32_t)(_new)) : \
|
||||
|
Reference in New Issue
Block a user