Compare commits
293 Commits
android-x8
...
useful
Author | SHA1 | Date | |
---|---|---|---|
|
d6db9143b6 | ||
|
9c0b233c44 | ||
|
364aa72824 | ||
|
d290ec228b | ||
|
c0906e06ee | ||
|
b6c49104ce | ||
|
6a35cbb656 | ||
|
909bd476ca | ||
|
487debfda5 | ||
|
b9c8b2a1f1 | ||
|
32aab51df5 | ||
|
4cbb261eba | ||
|
032a7ef0a1 | ||
|
75d585e544 | ||
|
d3cc3901ab | ||
|
4d7c187167 | ||
|
05173c61c7 | ||
|
9949d2a251 | ||
|
3f7318c1b8 | ||
|
35b3f597bd | ||
|
f703ba8c42 | ||
|
f05751aa2a | ||
|
b27f206b0c | ||
|
16d42af618 | ||
|
b5829c0d64 | ||
|
6b95cfb0de | ||
|
e338a1b0ce | ||
|
847f991a87 | ||
|
482a64dcf1 | ||
|
155a9670e6 | ||
|
1ca5585459 | ||
|
2432ca1c2e | ||
|
a7fa203f0d | ||
|
7e809f0b8d | ||
|
03eade164d | ||
|
f2bda1b566 | ||
|
65b024d63a | ||
|
88022278f7 | ||
|
b1be5bd205 | ||
|
aaf188e3bb | ||
|
45920d2ecb | ||
|
5c477ab2de | ||
|
da8d0c965c | ||
|
34a5d3b9f4 | ||
|
f22d49de0f | ||
|
6bb4d807f7 | ||
|
0308beebc2 | ||
|
aebe16da53 | ||
|
ecfaab88b2 | ||
|
1cbd3a1cc7 | ||
|
d40ec9a884 | ||
|
a26121f375 | ||
|
a75de67c51 | ||
|
158d42c8b0 | ||
|
82cb6e6519 | ||
|
ae5776c41f | ||
|
74559abbef | ||
|
003224bd97 | ||
|
7b4e478496 | ||
|
d9ef976967 | ||
|
843d5391c3 | ||
|
d546df4d9c | ||
|
ee2a8ea7d9 | ||
|
d27ff8c5cd | ||
|
64ce3933f5 | ||
|
ee678895e9 | ||
|
69c71396c6 | ||
|
c6e33ca285 | ||
|
e7d18ed1ef | ||
|
758561786c | ||
|
aac4bae986 | ||
|
ff3d7ce201 | ||
|
9634318290 | ||
|
a0d154dc13 | ||
|
1329d94334 | ||
|
1bcdc1e319 | ||
|
08070cead0 | ||
|
9acdd7739b | ||
|
79db70bd8a | ||
|
2ecb73379e | ||
|
7984c2d42d | ||
|
10ea8567f4 | ||
|
9d5de0fcb6 | ||
|
6eff8479af | ||
|
55a629cee5 | ||
|
09eff39a58 | ||
|
3e15fa86d7 | ||
|
0da2a22ba6 | ||
|
06613b7b3a | ||
|
ef2c80f506 | ||
|
1e105741f1 | ||
|
6638b4a590 | ||
|
584d1e2309 | ||
|
0c501bacef | ||
|
204991bf5d | ||
|
23d75936a7 | ||
|
aa61b15351 | ||
|
66b66295d0 | ||
|
8800a798d1 | ||
|
95368f25c1 | ||
|
7b8830d81d | ||
|
de4cb19a1c | ||
|
130872a2a6 | ||
|
2c8ba760fa | ||
|
3f8455d07b | ||
|
122275760d | ||
|
53245fffc0 | ||
|
c1f4b2364f | ||
|
cd2857fae1 | ||
|
740282b417 | ||
|
dcbc9be38e | ||
|
c0f6bfd489 | ||
|
391f7147e7 | ||
|
afeaf1771d | ||
|
14b574433c | ||
|
874a2c0b7d | ||
|
9a77e285e8 | ||
|
13ba6b7369 | ||
|
622ee08e51 | ||
|
b4dfb7473e | ||
|
ce5d969adf | ||
|
5d9718f0db | ||
|
01e19fcf1f | ||
|
cb21fa91b8 | ||
|
fc6b4332c3 | ||
|
461273e910 | ||
|
0c2455031d | ||
|
de579a1629 | ||
|
0fe34b7bbc | ||
|
9996a86085 | ||
|
4af3fe857d | ||
|
d8361400b7 | ||
|
5d5db24a26 | ||
|
d863bd7d7b | ||
|
8778bf221e | ||
|
c7339d42c6 | ||
|
db0f9e701d | ||
|
e9375cd0e8 | ||
|
9ac64f7301 | ||
|
b3011ea60c | ||
|
20141d9efd | ||
|
c97234507a | ||
|
5d92596c56 | ||
|
ed9396782e | ||
|
6cab07685f | ||
|
e397b3a7c0 | ||
|
ad3fbac00b | ||
|
19d06b5c05 | ||
|
fdb04c0384 | ||
|
32a11e5324 | ||
|
48f696c793 | ||
|
0d96ae8fc7 | ||
|
2679760834 | ||
|
a0fc40f0d5 | ||
|
b0da65bd0e | ||
|
6caac3ecb8 | ||
|
9d881cbd5a | ||
|
f814dd7a81 | ||
|
652bf121f2 | ||
|
437c748bf5 | ||
|
c35572352e | ||
|
381d32af74 | ||
|
5d7fefb9af | ||
|
a019dd0d6e | ||
|
904b8ba1bb | ||
|
6586a3b287 | ||
|
3f68d4b058 | ||
|
17bbc1f042 | ||
|
3733da31e8 | ||
|
4a7f013f9d | ||
|
25f2699767 | ||
|
9f013a8233 | ||
|
18dcbd358f | ||
|
c3526585b7 | ||
|
3f625689ac | ||
|
3dedd39cdd | ||
|
c40b7910ee | ||
|
5f996e2b1d | ||
|
ebe304fa54 | ||
|
dcad6fb670 | ||
|
713230ff39 | ||
|
6584d0cd4f | ||
|
58f95f9d01 | ||
|
5eb9f68708 | ||
|
f5a9a0bc22 | ||
|
167d35c303 | ||
|
72e82418ef | ||
|
b082e04619 | ||
|
ee8d182426 | ||
|
8f060df60d | ||
|
d04ab396a5 | ||
|
948e1eb8e9 | ||
|
a99e80d795 | ||
|
89d81ab16c | ||
|
92e412e788 | ||
|
0420ae3d90 | ||
|
7d41857566 | ||
|
7bae1c3d85 | ||
|
252eaa765e | ||
|
b094dff50a | ||
|
8cbdfe1de4 | ||
|
2e6a69939c | ||
|
f037914670 | ||
|
8d4ec87d7f | ||
|
e28fe8fe5d | ||
|
b518f4d0ea | ||
|
2af1da1546 | ||
|
daa5242f9e | ||
|
0be369975f | ||
|
47e3896dfd | ||
|
e5c6a92a12 | ||
|
3bdd12ecb5 | ||
|
9d60a7ce08 | ||
|
9a21bc6401 | ||
|
4f94e0b76a | ||
|
e21beaeb10 | ||
|
92e29dc5b0 | ||
|
2737350157 | ||
|
0fbb64a529 | ||
|
40ae214067 | ||
|
5d7c27f5ec | ||
|
244a3bbf14 | ||
|
da5b4764b2 | ||
|
78037d95da | ||
|
8752824f27 | ||
|
0c8beb0ab5 | ||
|
62d5f7a04a | ||
|
a1bd012473 | ||
|
981e338611 | ||
|
56ef62d988 | ||
|
eb0dd37094 | ||
|
dfdff940b6 | ||
|
4e994e150f | ||
|
0d9d036004 | ||
|
bc83f6bd58 | ||
|
cf290344cc | ||
|
28f1d6ab49 | ||
|
a81828cb96 | ||
|
7fbe020bbc | ||
|
5858abec6e | ||
|
acd7ce57f7 | ||
|
226ae9d6c8 | ||
|
e1a9ef2304 | ||
|
e4852ae4d2 | ||
|
2911fa0cca | ||
|
4a101f9577 | ||
|
53d78be3bd | ||
|
82dd62fb22 | ||
|
4c75d5ae63 | ||
|
c22a7f9045 | ||
|
ff2950dd69 | ||
|
b5745429d7 | ||
|
7d40bf2566 | ||
|
f4e392bf8d | ||
|
81992010b5 | ||
|
12b9e07966 | ||
|
7ecb61c30c | ||
|
f6970872c0 | ||
|
8d7c12de1e | ||
|
e4b040c2b9 | ||
|
b881ea87f1 | ||
|
29288249e3 | ||
|
9b13c988ac | ||
|
cfc7ded3ff | ||
|
d0d767ad4c | ||
|
912c4ec6df | ||
|
933b99f113 | ||
|
ec4a21b0e2 | ||
|
957552fce0 | ||
|
aafcbd2cf7 | ||
|
9459cc593c | ||
|
630d925666 | ||
|
79f4281a52 | ||
|
83ff3809f1 | ||
|
9d2ef284bb | ||
|
8042d751de | ||
|
5b902a08c1 | ||
|
582570a04c | ||
|
147148fd50 | ||
|
5e9aa9926b | ||
|
cbadedb511 | ||
|
552f54bf04 | ||
|
dfda559b98 | ||
|
2279156fe7 | ||
|
f3a828c21f | ||
|
2baac48f39 | ||
|
cc48d663f7 | ||
|
b47d508412 | ||
|
74651f5738 | ||
|
8767fe2437 | ||
|
e08a3d674a | ||
|
6b3713f8b8 | ||
|
5fc5820cbc |
4
Makefile
4
Makefile
@@ -5,7 +5,10 @@ TOP = .
|
||||
SUBDIRS = src
|
||||
|
||||
|
||||
# The git command below generates an empty string when we're not
|
||||
# building in a GIT tree (i.e., building from a release tarball).
|
||||
default: $(TOP)/configs/current
|
||||
@$(TOP)/bin/extract_git_sha1
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE)) || exit 1 ; \
|
||||
@@ -199,6 +202,7 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/aclocal.m4 \
|
||||
$(DIRECTORY)/bin/config.guess \
|
||||
$(DIRECTORY)/bin/config.sub \
|
||||
$(DIRECTORY)/bin/extract_git_sha1 \
|
||||
$(DIRECTORY)/bin/install-sh \
|
||||
$(DIRECTORY)/bin/mklib \
|
||||
$(DIRECTORY)/bin/minstall \
|
||||
|
10
bin/extract_git_sha1
Executable file
10
bin/extract_git_sha1
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
touch src/mesa/main/git_sha1.h
|
||||
if which git > /dev/null; then
|
||||
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
|
||||
# it to a string, and wrap it in a #define. This is used in
|
||||
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
|
||||
git log -n 1 --oneline |\
|
||||
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
|
||||
> src/mesa/main/git_sha1.h
|
||||
fi
|
@@ -63,7 +63,7 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
|
||||
GALLIUM_TARGET_DIRS =
|
||||
GALLIUM_STATE_TRACKERS_DIRS = egl
|
||||
|
||||
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
|
||||
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
|
||||
savage sis tdfx unichrome swrast
|
||||
|
||||
INTEL_LIBS = `pkg-config --libs libdrm_intel`
|
||||
|
52
configure.ac
52
configure.ac
@@ -729,6 +729,27 @@ else
|
||||
enable_xcb=no
|
||||
fi
|
||||
|
||||
dnl Direct rendering or just indirect rendering
|
||||
case "$host_os" in
|
||||
gnu*)
|
||||
dnl Disable by default on GNU/Hurd
|
||||
driglx_direct_default="no"
|
||||
;;
|
||||
cygwin*)
|
||||
dnl Disable by default on cygwin
|
||||
driglx_direct_default="no"
|
||||
;;
|
||||
*)
|
||||
driglx_direct_default="yes"
|
||||
;;
|
||||
esac
|
||||
AC_ARG_ENABLE([driglx-direct],
|
||||
[AS_HELP_STRING([--disable-driglx-direct],
|
||||
[enable direct rendering in GLX and EGL for DRI \
|
||||
@<:@default=auto@:>@])],
|
||||
[driglx_direct="$enableval"],
|
||||
[driglx_direct="$driglx_direct_default"])
|
||||
|
||||
dnl
|
||||
dnl libGL configuration per driver
|
||||
dnl
|
||||
@@ -762,12 +783,17 @@ dri|no) # these checks are still desired when there is no mesa_driver
|
||||
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
|
||||
fi
|
||||
|
||||
# Check for libdrm
|
||||
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
|
||||
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
|
||||
PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
|
||||
GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
|
||||
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
|
||||
GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
|
||||
DRI_PC_REQ_PRIV=""
|
||||
|
||||
if test x"$driglx_direct" = xyes; then
|
||||
# Check for libdrm
|
||||
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
|
||||
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
|
||||
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
|
||||
fi
|
||||
|
||||
# find the DRI deps for libGL
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
@@ -910,12 +936,6 @@ AC_ARG_WITH([dri-searchpath],
|
||||
[DRI_DRIVER_SEARCH_DIR="$withval"],
|
||||
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
|
||||
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
|
||||
dnl Direct rendering or just indirect rendering
|
||||
AC_ARG_ENABLE([driglx-direct],
|
||||
[AS_HELP_STRING([--disable-driglx-direct],
|
||||
[enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])],
|
||||
[driglx_direct="$enableval"],
|
||||
[driglx_direct="yes"])
|
||||
dnl Which drivers to build - default is chosen by platform
|
||||
AC_ARG_WITH([dri-drivers],
|
||||
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
|
||||
@@ -1006,6 +1026,16 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
|
||||
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
|
||||
fi
|
||||
;;
|
||||
cygwin*)
|
||||
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
|
||||
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
|
||||
if test "x$driglx_direct" = xyes; then
|
||||
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
|
||||
fi
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
DRI_DIRS="swrast"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# default drivers
|
||||
|
4
docs/ARB_color_buffer_float.txt
Normal file
4
docs/ARB_color_buffer_float.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Known issues in the ARB_color_buffer_float implementation:
|
||||
- Rendering to multiple render targets, some fixed-point, some floating-point, with FIXED_ONLY fragment clamping and polygon smooth enabled may write incorrect values to the fixed point buffers (depends on spec interpretation)
|
||||
- For fragment programs with ARB_fog_* options, colors are clamped before fog application regardless of the fragment clamping setting (this depends on spec interpretation)
|
||||
|
@@ -15,7 +15,7 @@ GL 3.0:
|
||||
GLSL changes (GL_EXT_gpu_shader4, etc) not started
|
||||
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
|
||||
Map buffer subranges (GL_ARB_map_buffer_range) DONE
|
||||
Clamping controls (GL_ARB_color_buffer_float) BRANCH ~mareko/mesa floating2
|
||||
Clamping controls (GL_ARB_color_buffer_float) DONE
|
||||
Float textures, renderbuffers (GL_ARB_texture_float) BRANCH ~mareko/mesa floating2
|
||||
GL_EXT_packed_float not started
|
||||
GL_EXT_texture_shared_exponent not started
|
||||
@@ -53,7 +53,7 @@ Primitive restart (GL_NV_primitive_restart) DONE (gallium)
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) not started
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
|
||||
Signed normalized textures (GL_EXT_texture_snorm) ~50% done
|
||||
Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
|
||||
|
||||
|
||||
GL 3.2:
|
||||
@@ -77,7 +77,7 @@ GLSL 3.30 not started
|
||||
GL_ARB_blend_func_extended not started
|
||||
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
|
||||
GL_ARB_occlusion_query2 DONE (swrast, gallium)
|
||||
GL_ARB_sampler_objects not started
|
||||
GL_ARB_sampler_objects DONE (gallium)
|
||||
GL_ARB_texture_rgb10_a2ui not started
|
||||
GL_ARB_texture_swizzle DONE (same as EXT version)
|
||||
GL_ARB_timer_query DONE (only Xlib sw driver)
|
||||
|
@@ -67,7 +67,7 @@ Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors)
|
||||
On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV
|
||||
and freed with glXFreeMemoryNV. Sometimes it's useful to know where a
|
||||
block of AGP memory is located with respect to the start of the AGP
|
||||
aperature. The function
|
||||
aperture. The function
|
||||
|
||||
GLuint glXGetAGPOffsetMESA( const GLvoid *pointer )
|
||||
|
||||
|
@@ -24,7 +24,7 @@ Number
|
||||
|
||||
Dependencies
|
||||
|
||||
Reguires EGL 1.4 or later. This extension is written against the
|
||||
Requires EGL 1.4 or later. This extension is written against the
|
||||
wording of the EGL 1.4 specification.
|
||||
|
||||
EGL_KHR_base_image is required.
|
||||
@@ -134,7 +134,7 @@ Issues
|
||||
RESOLVED: The eglQueryImage function has been proposed often,
|
||||
but it goes against the EGLImage design. EGLImages are opaque
|
||||
handles to a 2D array of pixels, which can be passed between
|
||||
client APIs. By referenceing an EGLImage in a client API, the
|
||||
client APIs. By referencing an EGLImage in a client API, the
|
||||
EGLImage target (a texture, a renderbuffer or such) can be
|
||||
used to query the attributes of the EGLImage. We don't have a
|
||||
full client API for creating and querying DRM buffers, though,
|
||||
|
@@ -48,7 +48,7 @@ IP Status
|
||||
|
||||
Issues
|
||||
|
||||
1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
|
||||
1. Should we also define UNPACK_INVERT_MESA for glDrawPixels, etc?
|
||||
|
||||
Resolved: No, we're only concerned with pixel packing. There are other
|
||||
solutions for inverting images when using glDrawPixels (negative Y pixel
|
||||
|
@@ -31,12 +31,12 @@ Overview
|
||||
|
||||
Mesa's implementation of GLX is entirely implemented on the client side.
|
||||
Therefore, Mesa cannot immediately detect when an X window or pixmap is
|
||||
destroyed in order to free any ancilliary data associated with the window
|
||||
destroyed in order to free any ancillary data associated with the window
|
||||
or pixmap.
|
||||
|
||||
The glxMesaReleaseBuffers() function can be used to explicitly indicate
|
||||
when the back color buffer, depth buffer, stencil buffer, and/or accum-
|
||||
ulation buffer associated with a drawable can be freed.
|
||||
when the back color buffer, depth buffer, stencil buffer, and/or accumu-
|
||||
lation buffer associated with a drawable can be freed.
|
||||
|
||||
IP Status
|
||||
|
||||
@@ -60,7 +60,7 @@ Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
|
||||
|
||||
Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
|
||||
|
||||
causes all software ancilliary buffers (back buffer, depth, stencil,
|
||||
causes all software ancillary buffers (back buffer, depth, stencil,
|
||||
accum, etc) associated with the named drawable to be immediately
|
||||
deallocated. True is returned if <d> is a valid Mesa GLX drawable,
|
||||
else False is returned. After calling glXReleaseBuffersMESA, the
|
||||
|
@@ -35,7 +35,7 @@ Overview
|
||||
|
||||
Mesa's glViewport command queries the current window size and updates
|
||||
its internal data structors accordingly. This normally works fine
|
||||
since most applications call glViewport in responce to window size
|
||||
since most applications call glViewport in response to window size
|
||||
changes.
|
||||
|
||||
In some situations, however, the application may not call glViewport
|
||||
@@ -65,7 +65,7 @@ Additions to the AGL/GLX/WGL Specifications
|
||||
|
||||
Errors
|
||||
|
||||
INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen
|
||||
INVALID_OPERATION is generated if glResizeBuffersMESA is called between
|
||||
Begin and End.
|
||||
|
||||
New State
|
||||
|
@@ -88,8 +88,8 @@ Additions to the GLX 1.3 Specification
|
||||
this is typically the time required to display both the even and odd
|
||||
fields of a frame of video data.
|
||||
|
||||
If <interval> is set to a value of 0, buffer swaps are not synchron-
|
||||
ized to a video frame. The <interval> value is silently clamped to
|
||||
If <interval> is set to a value of 0, buffer swaps are not synchro-
|
||||
nized to a video frame. The <interval> value is silently clamped to
|
||||
the maximum implementation-dependent value supported before being
|
||||
stored.
|
||||
|
||||
|
@@ -328,7 +328,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
|
||||
|
||||
-- Section 3.8.10 "Texture Completeness"
|
||||
|
||||
Change the second paragaph (page 177) to say (spec changes identical
|
||||
Change the second paragraph (page 177) to say (spec changes identical
|
||||
to EXT_texture_array):
|
||||
|
||||
"For one-, two-, or three-dimensional textures and one- or
|
||||
@@ -443,10 +443,10 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
|
||||
Change second through fourth paragraphs (page 188) to say:
|
||||
|
||||
"Let D_t be the depth texture value, in the range [0, 1]. For
|
||||
texture lookups from one- and two-dimesional, rectangle, and
|
||||
texture lookups from one- and two-dimensional, rectangle, and
|
||||
one-dimensional array targets, let R be the interpolated <r>
|
||||
texture coordinate, clamped to the range [0, 1]. For texture lookups
|
||||
from two-dimesional array texture targets, let R be the interpolated
|
||||
from two-dimensional array texture targets, let R be the interpolated
|
||||
<q> texture coordinate, clamped to the range [0, 1]. Then the
|
||||
effective texture value L_t, I_t, or A_t is computed as follows:
|
||||
|
||||
@@ -604,7 +604,7 @@ Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
|
||||
|
||||
-- Section 5.4 "Display Lists"
|
||||
|
||||
Change the first paragraphi on page 242 to say (spec changes
|
||||
Change the first paragraph on page 242 to say (spec changes
|
||||
identical to EXT_texture_array):
|
||||
|
||||
"TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are
|
||||
|
@@ -44,7 +44,7 @@ Overview
|
||||
ARB_texture_compression_rgtc introduces some compressed red and
|
||||
red_green signed formats but no uncompressed ones, which might
|
||||
still be useful. NV_texture_shader adds signed texture formats,
|
||||
but also a lot of functionality which has been superceded by fragment
|
||||
but also a lot of functionality which has been superseded by fragment
|
||||
shaders.
|
||||
It is usually possible to get the same functionality
|
||||
using a unsigned format by doing scale and bias in a shader, but this
|
||||
@@ -105,7 +105,7 @@ Issues
|
||||
This is also different to what NV_texture_shader used.
|
||||
The above mapping should be considered the reference, but there
|
||||
is some leeway so other mappings are allowed for implementations which
|
||||
cannot do this. Particulary the mapping given in NV_texture_shader or
|
||||
cannot do this. Particularly the mapping given in NV_texture_shader or
|
||||
the standard OpenGL byte/float mapping is considered acceptable too, as
|
||||
might be a mapping which represents -1.0 by -128, 0.0 by 0 and 1.0 by
|
||||
127 (that is, uses different scale factors for negative and positive
|
||||
|
@@ -88,7 +88,7 @@ Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
|
||||
WindosPos4MESA takes four values indicating x, y, z, and w.
|
||||
WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only
|
||||
x, y, and z with w implicitly set to 1 (or only x and y with z
|
||||
implicititly set to 0 and w implicitly set to 1).
|
||||
implicitly set to 0 and w implicitly set to 1).
|
||||
|
||||
WindowPosMESA operates like RasterPos except that the current modelview
|
||||
matrix, projection matrix and viewport parameters are ignored and the
|
||||
@@ -108,7 +108,7 @@ GLX Protocol
|
||||
|
||||
Errors
|
||||
|
||||
INVALID_OPERATION is generated if WindowPosMESA is called betweeen
|
||||
INVALID_OPERATION is generated if WindowPosMESA is called between
|
||||
Begin and End.
|
||||
|
||||
New State
|
||||
|
@@ -26,7 +26,7 @@ Number
|
||||
Dependencies
|
||||
|
||||
OpenGL 1.0 or later is required
|
||||
This extensions is written against the OpenGL 1.4 Specification.
|
||||
This extension is written against the OpenGL 1.4 Specification.
|
||||
NV_texture_rectangle effects the definition of this extension.
|
||||
|
||||
Overview
|
||||
@@ -104,7 +104,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
|
||||
|
||||
|
||||
In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
|
||||
add the following to Table 3.12 (Packed pixel fiedl assignments):
|
||||
add the following to Table 3.12 (Packed pixel field assignments):
|
||||
|
||||
First Second Third Fourth
|
||||
Format Element Element Element Element
|
||||
|
@@ -25,7 +25,7 @@ Number
|
||||
|
||||
Dependencies
|
||||
|
||||
Reguires EGL 1.4 or later. This extension is written against the
|
||||
Requires EGL 1.4 or later. This extension is written against the
|
||||
wording of the EGL 1.4 specification.
|
||||
|
||||
EGL_KHR_base_image is required.
|
||||
@@ -40,9 +40,9 @@ Overview
|
||||
provides a new target for eglCreateImageKHR, to create an EGLImage
|
||||
from a wl_buffer
|
||||
|
||||
Adding a implementation specific wayland interface, allows the
|
||||
Adding an implementation specific wayland interface, allows the
|
||||
EGL implementation to define specific wayland requests and events,
|
||||
needed for buffer sharing in a EGL wayland platform.
|
||||
needed for buffer sharing in an EGL wayland platform.
|
||||
|
||||
IP Status
|
||||
|
||||
|
@@ -62,6 +62,7 @@ a:visited {
|
||||
<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
|
||||
<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
|
||||
<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
|
||||
<LI><A href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</A>
|
||||
</ul>
|
||||
|
||||
<b>Developer Topics</b>
|
||||
|
@@ -21,76 +21,52 @@ When a new release is coming, release candidates (betas) may be found
|
||||
|
||||
|
||||
<p>
|
||||
Mesa is distributed in several parts:
|
||||
The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
|
||||
is the version. There are three types of compressed archives.
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers
|
||||
and documentation.
|
||||
</li>
|
||||
<li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs.
|
||||
Most of the programs require GLUT (either the
|
||||
<a href="http://www.opengl.org/resources/libraries/glut"
|
||||
target="_parent">original GLUT by Mark Kilgard</a> or
|
||||
<a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or
|
||||
<a href="http://openglut.sourceforge.net" target="_parent">OpenGLUT</a>).
|
||||
</li>
|
||||
<li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used
|
||||
with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you're not interested in running the demos, you'll only need the first
|
||||
package.
|
||||
There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
|
||||
contain Mark Kilgard's GLUT library.
|
||||
This is optional.
|
||||
Most Linux distributions include an implementation of GLUT (such as freeglut).
|
||||
</p>
|
||||
<p>
|
||||
In the past, the Mesa demos collection was distributed as
|
||||
MesaDemos-x.y.z.{tar.bz2, tar.gz, zip}.
|
||||
Now, the
|
||||
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">
|
||||
Mesa demos</a> are distributed separately.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you're new to this and not sure what you're doing, grab all three packages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The packages are available in .tar.gz, .tar.bz2 and .zip formats.
|
||||
Other sites might offer additional package formats.
|
||||
</p>
|
||||
|
||||
<H1>Unpacking</H1>
|
||||
|
||||
<p>
|
||||
All the packages should be in the same directory prior to unpacking.
|
||||
To unpack .tar.gz files:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>To unpack .tar.gz files:
|
||||
<pre>
|
||||
tar zxf MesaLib-X.Y.tar.gz
|
||||
tar zxf MesaDemos-X.Y.tar.gz
|
||||
tar zxf MesaGLUT-X.Y.tar.gz
|
||||
tar zxf MesaLib-x.y.z.tar.gz
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
gzcat MesaLib-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaDemos-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaGLUT-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaLib-x.y.z.tar.gz | tar xf -
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
|
||||
gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
|
||||
gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
|
||||
gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
|
||||
</pre>
|
||||
<li>To unpack .tar.bz2 files:
|
||||
<p>
|
||||
To unpack .tar.bz2 files:
|
||||
</p>
|
||||
<pre>
|
||||
bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
|
||||
bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
|
||||
bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
|
||||
bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
|
||||
</pre>
|
||||
<li>To unpack .zip files:
|
||||
<p>
|
||||
To unpack .zip files:
|
||||
</p>
|
||||
<pre>
|
||||
unzip MesaLib-X.Y.zip
|
||||
unzip MesaDemos-X.Y.zip
|
||||
unzip MesaGLUT-X.Y.zip
|
||||
unzip MesaLib-x.y.z.zip
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>Contents</h1>
|
||||
@@ -106,22 +82,13 @@ bin/ - shell scripts for making shared libraries, etc
|
||||
docs/ - documentation
|
||||
src/ - source code for libraries
|
||||
src/mesa - sources for the main Mesa library and device drivers
|
||||
src/gallium - sources for Gallium and Gallium drivers
|
||||
src/glu - libGLU source code
|
||||
src/glx - sources for building libGL with full GLX and DRI support
|
||||
src/glw - Xt/Motif/OpenGL widget code
|
||||
</pre>
|
||||
|
||||
If you downloaded and unpacked the MesaDemos.X.Y package:
|
||||
|
||||
<pre>
|
||||
progs/demos - original Mesa demos
|
||||
progs/xdemos - GLX OpenGL/Mesa demos
|
||||
progs/redbook - examples from the OpenGL Programming Guide
|
||||
progs/samples - examples from SGI
|
||||
progs/images/ - image files
|
||||
</pre>
|
||||
|
||||
If you downloaded and unpacked the MesaGLUT.X.Y package:
|
||||
If you downloaded and unpacked the MesaGLUT.x.y.z package:
|
||||
<pre>
|
||||
src/glut - GLUT library source code
|
||||
</pre>
|
||||
|
@@ -49,6 +49,15 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
|
||||
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
|
||||
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
|
||||
and disable the GL_EXT_bar extension.
|
||||
<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
|
||||
by extension year.
|
||||
If this variable is set to year X, only extensions defined on or before year
|
||||
X will be reported.
|
||||
This is to work-around a bug in some games where the extension string is
|
||||
copied into a fixed-size buffer without truncating.
|
||||
If the extension string is too long, the buffer overrun can cause the game
|
||||
to crash.
|
||||
This is a work-around for that.
|
||||
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
|
||||
</ul>
|
||||
|
||||
|
@@ -12,16 +12,16 @@
|
||||
<ol>
|
||||
<li><a href="#unix-x11">Unix / X11</a>
|
||||
<ul>
|
||||
<li><a href="#prereq">Prerequisites for DRI and hardware acceleration</a>
|
||||
<li><a href="#prereq-general">General prerequisites for building</a>
|
||||
<li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
|
||||
<li><a href="#autoconf">Building with autoconf</a>
|
||||
<li><a href="#traditional">Building with traditional Makefiles</a>
|
||||
<li><a href="#libs">The Libraries</a>
|
||||
<li><a href="#demos">Running the demos
|
||||
<li><a href="#install">Installing the header and library files
|
||||
<li><a href="#pkg-config">Building OpenGL programs with pkg-config
|
||||
</ul>
|
||||
<li><a href="#windows">Windows</a>
|
||||
<li><a href="#scons">SCons</a>
|
||||
<li><a href="#scons">Building with SCons</a>
|
||||
<li><a href="#other">Other</a>
|
||||
</ol>
|
||||
<br>
|
||||
@@ -31,8 +31,22 @@
|
||||
<H2>1. Unix/X11 Compilation and Installation</H1>
|
||||
|
||||
|
||||
<a name="prereq">
|
||||
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
|
||||
<a name="prereq-general">
|
||||
<h3>1.1 General prerequisites for building</h3>
|
||||
|
||||
<ul>
|
||||
<li>lex / yacc - for building the GLSL compiler.
|
||||
On Linux systems, flex and bison are used.
|
||||
Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
|
||||
</li>
|
||||
<li>python - Python is needed for building the Gallium components.
|
||||
Version 2.6.4 or later should work.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="prereq-dri">
|
||||
<h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
|
||||
|
||||
<p>
|
||||
The following are required for DRI-based hardware acceleration with Mesa:
|
||||
@@ -49,7 +63,7 @@ version 2.4.15 or later
|
||||
|
||||
|
||||
<a name="autoconf">
|
||||
<h3>1.2 Building with Autoconf</h3>
|
||||
<h3>1.3 Building with Autoconf</h3>
|
||||
|
||||
<p>
|
||||
Mesa may be <a href="autoconf.html">built using autoconf</a>.
|
||||
@@ -59,7 +73,7 @@ If that fails the traditional Mesa build system is available.
|
||||
|
||||
|
||||
<a name="traditional">
|
||||
<h3>1.3 Building with traditional Makefiles</h3>
|
||||
<h3>1.4 Building with traditional Makefiles</h3>
|
||||
|
||||
<p>
|
||||
The traditional Mesa build system is based on a collection of pre-defined
|
||||
@@ -126,7 +140,7 @@ Later, if you want to rebuild for a different configuration run
|
||||
|
||||
|
||||
<a name="libs">
|
||||
<h3>1.4 The libraries</h3>
|
||||
<h3>1.5 The libraries</h3>
|
||||
|
||||
<p>
|
||||
When compilation has finished, look in the top-level <code>lib/</code>
|
||||
@@ -185,81 +199,11 @@ If you built the DRI hardware drivers, you'll also see the DRI drivers:
|
||||
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
|
||||
</pre>
|
||||
|
||||
|
||||
<a name="demos">
|
||||
<h3>1.5 Running the demos</h3>
|
||||
|
||||
<p>
|
||||
If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or
|
||||
obtained Mesa from CVS, the <b>progs/</b> directory will contain a
|
||||
bunch of demonstration programs.
|
||||
If you built with Gallium support, look in lib/gallium/ for Gallium-based
|
||||
versions of libGL and device drivers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Before running a demo, you'll probably have to set two environment variables
|
||||
to indicate where the libraries are located. For example:
|
||||
<p>
|
||||
<blockquote>
|
||||
<b>cd lib/</b>
|
||||
<br>
|
||||
<b>export LD_LIBRARY_PATH=${PWD}</b>
|
||||
<br>
|
||||
<b>export LIBGL_DRIVERS_PATH=${PWD}</b> (if using DRI drivers)
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
Next, change to the Mesa/demos/ directory:
|
||||
</p>
|
||||
<blockquote>
|
||||
<b>cd ../progs/demos</b>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
Run a demo such as gears:
|
||||
</p>
|
||||
<blockquote>
|
||||
<b>./gears</b>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
If this doesn't work, try the <b>Mesa/progs/xdemos/glxinfo</b> program
|
||||
and see that it prints the expected Mesa version number.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you're using Linux or a similar OS, verify that the demo program is
|
||||
being linked with the proper library files:
|
||||
</p>
|
||||
<blockquote>
|
||||
<b>ldd gears</b>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
You should see something like this:
|
||||
</p>
|
||||
<pre>
|
||||
libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
|
||||
libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
|
||||
libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
|
||||
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
|
||||
libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
|
||||
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
|
||||
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
|
||||
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
|
||||
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
|
||||
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
|
||||
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
|
||||
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
|
||||
libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
|
||||
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
|
||||
libdl.so.2 => /lib/libdl.so.2 (0x40644000)
|
||||
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
|
||||
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Retrace your steps if this doesn't look right.
|
||||
</p>
|
||||
|
||||
|
||||
<a name="install">
|
||||
|
@@ -1,61 +1,116 @@
|
||||
LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
|
||||
<HTML>
|
||||
|
||||
<TITLE>llvmpipe</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Introduction</H1>
|
||||
|
||||
<p>
|
||||
The Gallium llvmpipe driver is a software rasterizer that uses LLVM to
|
||||
do runtime code generation.
|
||||
Shaders, point/line/triangle rasterization and vertex processing are
|
||||
implemented with LLVM IR which is translated to x86 or x86-64 machine
|
||||
code.
|
||||
Also, the driver is multithreaded to take advantage of multiple CPU cores
|
||||
(up to 8 at this time).
|
||||
It's the fastest software rasterizer for Mesa.
|
||||
</p>
|
||||
|
||||
|
||||
Requirements
|
||||
============
|
||||
<h1>Requirements</h1>
|
||||
|
||||
- A x86 or amd64 processor. 64bit mode is preferred.
|
||||
|
||||
<dl>
|
||||
<dt>An x86 or amd64 processor. 64-bit mode is preferred.</dt>
|
||||
<dd>
|
||||
<p>
|
||||
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
|
||||
yield the most efficient code. The less features the CPU has the more
|
||||
likely is that you ran into underperforming, buggy, or incomplete code.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
See /proc/cpuinfo to know what your CPU supports.
|
||||
|
||||
- LLVM. Version 2.8 recommended. 2.6 or later required.
|
||||
|
||||
</p>
|
||||
</dd>
|
||||
<dt>LLVM. Version 2.8 recommended. 2.6 or later required.</dt>
|
||||
<dd>
|
||||
<p>
|
||||
<b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
|
||||
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
|
||||
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
|
||||
</p>
|
||||
<p>
|
||||
For Linux, on a recent Debian based distribution do:
|
||||
|
||||
</p>
|
||||
<pre>
|
||||
aptitude install llvm-dev
|
||||
</pre>
|
||||
For a RPM-based distribution do:
|
||||
</p>
|
||||
<pre>
|
||||
yum install llvm-devel
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
For Windows download pre-built MSVC 9.0 or MinGW binaries from
|
||||
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment
|
||||
variable to the extracted path.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and
|
||||
llvm-x.x-msvc32mtd.7z .
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing
|
||||
debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with
|
||||
debug=no. This is necessary as LLVM builds as static library so the chosen
|
||||
MS CRT must match.
|
||||
</p>
|
||||
</dd>
|
||||
|
||||
- scons (optional)
|
||||
<dt>scons (optional)</dt>
|
||||
</dl>
|
||||
|
||||
|
||||
Building
|
||||
========
|
||||
|
||||
<h1>Building</h1>
|
||||
|
||||
To build everything on Linux invoke scons as:
|
||||
|
||||
<pre>
|
||||
scons build=debug libgl-xlib
|
||||
</pre>
|
||||
|
||||
Alternatively, you can build it with GNU make, if you prefer, by invoking it as
|
||||
|
||||
<pre>
|
||||
make linux-llvm
|
||||
</pre>
|
||||
|
||||
but the rest of these instructions assume that scons is used.
|
||||
|
||||
For windows is everything the except except the winsys:
|
||||
|
||||
<pre>
|
||||
scons build=debug libgl-gdi
|
||||
</pre>
|
||||
|
||||
Using
|
||||
=====
|
||||
|
||||
<h1>Using</h1>
|
||||
|
||||
On Linux, building will create a drop-in alternative for libGL.so into
|
||||
|
||||
<pre>
|
||||
build/foo/gallium/targets/libgl-xlib/libGL.so
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
lib/gallium/libGL.so
|
||||
</pre>
|
||||
|
||||
To use it set the LD_LIBRARY_PATH environment variable accordingly.
|
||||
|
||||
@@ -68,19 +123,20 @@ replacing the native ICD driver, but it's quite an advanced usage, so if you
|
||||
need to ask, don't even try it.
|
||||
|
||||
|
||||
Profiling
|
||||
=========
|
||||
<h1>Profiling</h1>
|
||||
|
||||
To profile llvmpipe you should pass the options
|
||||
|
||||
<pre>
|
||||
scons build=profile <same-as-before>
|
||||
</pre>
|
||||
|
||||
This will ensure that frame pointers are used both in C and JIT functions, and
|
||||
that no tail call optimizations are done by gcc.
|
||||
|
||||
|
||||
To better profile JIT code you'll need to build LLVM with oprofile integration.
|
||||
|
||||
<pre>
|
||||
./configure \
|
||||
--prefix=$install_dir \
|
||||
--enable-optimized \
|
||||
@@ -92,43 +148,57 @@ To better profile JIT code you'll need to build LLVM with oprofile integration.
|
||||
make -C "$build_dir" install
|
||||
|
||||
find "$install_dir/lib" -iname '*.a' -print0 | xargs -0 strip --strip-debug
|
||||
</pre>
|
||||
|
||||
The you should define
|
||||
|
||||
<pre>
|
||||
export LLVM=/path/to/llvm-2.6-profile
|
||||
</pre>
|
||||
|
||||
and rebuild.
|
||||
|
||||
|
||||
Unit testing
|
||||
============
|
||||
<h1>Unit testing</h1>
|
||||
|
||||
<p>
|
||||
Building will also create several unit tests in
|
||||
build/linux-???-debug/gallium/drivers/llvmpipe:
|
||||
</p>
|
||||
|
||||
- lp_test_blend: blending
|
||||
- lp_test_conv: SIMD vector conversion
|
||||
- lp_test_format: pixel unpacking/packing
|
||||
</ul>
|
||||
<li> lp_test_blend: blending
|
||||
<li> lp_test_conv: SIMD vector conversion
|
||||
<li> lp_test_format: pixel unpacking/packing
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Some of this tests can output results and benchmarks to a tab-separated-file
|
||||
for posterior analysis, e.g.:
|
||||
|
||||
</p>
|
||||
<pre>
|
||||
build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
|
||||
</pre>
|
||||
|
||||
|
||||
Development Notes
|
||||
=================
|
||||
<h1>Development Notes</h1>
|
||||
|
||||
- When looking to this code by the first time start in lp_state_fs.c, and
|
||||
<ul>
|
||||
<li>
|
||||
When looking to this code by the first time start in lp_state_fs.c, and
|
||||
then skim through the lp_bld_* functions called in there, and the comments
|
||||
at the top of the lp_bld_*.c functions.
|
||||
|
||||
- The driver-independent parts of the LLVM / Gallium code are found in
|
||||
</li>
|
||||
<li>
|
||||
The driver-independent parts of the LLVM / Gallium code are found in
|
||||
src/gallium/auxiliary/gallivm/. The filenames and function prefixes
|
||||
need to be renamed from "lp_bld_" to something else though.
|
||||
|
||||
- We use LLVM-C bindings for now. They are not documented, but follow the C++
|
||||
</li>
|
||||
<li>
|
||||
We use LLVM-C bindings for now. They are not documented, but follow the C++
|
||||
interfaces very closely, and appear to be complete enough for code
|
||||
generation. See
|
||||
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
|
||||
for a stand-alone example. See the llvm-c/Core.h file for reference.
|
||||
</li>
|
||||
</ul>
|
@@ -11,6 +11,13 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>April 6, 2011</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
|
||||
fix release release.
|
||||
</p>
|
||||
|
||||
<h2>March 2, 2011</h2>
|
||||
|
||||
<p>
|
||||
|
206
docs/relnotes-7.10.2.html
Normal file
206
docs/relnotes-7.10.2.html
Normal file
@@ -0,0 +1,206 @@
|
||||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.10.2 Release Notes / April 6, 2011</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.10.2 is a bug fix release which fixes bugs found since the 7.10 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.10.2 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
2f9f444265534a2cfd9a99d1a8291089 MesaLib-7.10.2.tar.gz
|
||||
f5de82852f1243f42cc004039e10b771 MesaLib-7.10.2.tar.bz2
|
||||
47836e37bab6fcafe3ac90c9544ba0e9 MesaLib-7.10.2.zip
|
||||
175120325828f313621cc5bc6c504803 MesaGLUT-7.10.2.tar.gz
|
||||
8c71d273f5f8d6c5eda4ffc39e0fe03e MesaGLUT-7.10.2.tar.bz2
|
||||
03036c8efe7b791a90fa0f2c41b43f43 MesaGLUT-7.10.2.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<p>This list is likely incomplete.</p>
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29172">Bug 29172</a> - Arrandale - Pill Popper Pops Pills</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31159">Bug 31159</a> - shadow problem in 0ad game</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32688">Bug 32688</a> - [RADEON:KMS:R300G] some games have a wireframe or outline visible</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32949">Bug 32949</a> - [glsl wine] Need for Speed renders incorrectly with GLSL enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34203">Bug 34203</a> - [GLSL] fail to call long chains across shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34376">Bug 34376</a> - [GLSL] allowing assignment to unsized array
|
||||
<ul>
|
||||
<li>The commit message incorrectly
|
||||
lists <a href="https://bugs.freedesktop.org/show_bug.cgi?id=34367">bug
|
||||
34367</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34370">Bug 34370</a> - [GLSL] "i<5 && i<4" in for loop fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34374">Bug 34374</a> - [GLSL] fail to redeclare an array using initializer</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35073">Bug 35073</a> - [GM45] Alpha test is broken when rendering to FBO with no color attachment</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35483">Bug 35483</a> - util_blit_pixels_writemask: crash in line 322 of src/gallium/auxiliary/util/u_blit.c</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-7.10.1..mesa-7.10.2
|
||||
</pre>
|
||||
|
||||
<p><em>Note:</em> Reverted commits and the reverts are not included in this list.</p>
|
||||
|
||||
<p>Alex Deucher (2):
|
||||
<ul>
|
||||
<li>r600c: add new ontario pci ids</li>
|
||||
<li>r600g: add some additional ontario pci ids</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Benjamin Franzke (1):
|
||||
<ul>
|
||||
<li>st/dri: Fix surfaceless gl using contexts with previous bound surfaces</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (9):
|
||||
<ul>
|
||||
<li>docs: pull 7.9.2 release notes into 7.10 branch</li>
|
||||
<li>docs: update news.html with 7.10.1 and 7.9.2 releases</li>
|
||||
<li>docs: fill in 7.10.1 release data</li>
|
||||
<li>docs: add, fix release notes links</li>
|
||||
<li>docs: update info about Mesa packaging/contents</li>
|
||||
<li>docs: update prerequisites, remove old demo info</li>
|
||||
<li>mesa: Guard against null pointer deref in fbo validation</li>
|
||||
<li>st/mesa: Apply LOD bias from correct texture unit</li>
|
||||
<li>glsl: silence warning in printf() with a cast</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Chad Versace (1):
|
||||
<ul>
|
||||
<li>i965: Fix tex_swizzle when depth mode is GL_RED</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dave Airlie (1):
|
||||
<ul>
|
||||
<li>r600: don't close fd on failed load</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (2):
|
||||
<ul>
|
||||
<li>i965: Apply a workaround for the Ironlake "vertex flashing".</li>
|
||||
<li>i965: Fix alpha testing when there is no color buffer in the FBO.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Fabian Bieler (1):
|
||||
<ul>
|
||||
<li>st/mesa: Apply LOD from texture object</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Henri Verbeet (1):
|
||||
<ul>
|
||||
<li>st/mesa: Validate state before doing blits.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (13):
|
||||
<ul>
|
||||
<li>docs: Add 7.10.1 md5sums</li>
|
||||
<li>glsl: Refactor AST-to-HIR code handling variable initializers</li>
|
||||
<li>glsl: Refactor AST-to-HIR code handling variable redeclarations</li>
|
||||
<li>glsl: Process redeclarations before initializers</li>
|
||||
<li>glsl: Function signatures cannot have NULL return type</li>
|
||||
<li>glsl: Add several function / call related validations</li>
|
||||
<li>linker: Add imported functions to the linked IR</li>
|
||||
<li>glsl: Use insert_before for lists instead of open coding it</li>
|
||||
<li>glsl: Only allow unsized array assignment in an initializer</li>
|
||||
<li>glcpp: Refresh autogenerated lexer files</li>
|
||||
<li>docs: Initial bits of 7.10.2 release notes</li>
|
||||
<li>mesa: set version string to 7.10.2</li>
|
||||
<li>mesa: Remove nonexistant files from _FILES lists</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jerome Glisse (1):
|
||||
<ul>
|
||||
<li>r600g: move user fence into base radeon structure</li>
|
||||
</ul></p>
|
||||
|
||||
<p>José Fonseca (2):
|
||||
<ul>
|
||||
<li>mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*).</li>
|
||||
<li>mesa: More glGet* fixes.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (4):
|
||||
<ul>
|
||||
<li>glcpp: Rework lexer to use a SKIP state rather than REJECT.</li>
|
||||
<li>glcpp: Remove trailing contexts from #if rules.</li>
|
||||
<li>i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.</li>
|
||||
<li>glsl: Accept precision qualifiers on sampler types, but only in ES.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (15):
|
||||
<ul>
|
||||
<li>st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL</li>
|
||||
<li>st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails</li>
|
||||
<li>r300/compiler: fix the saturate modifier when applied to TEX instructions</li>
|
||||
<li>r300/compiler: fix translating the src negate bits in pair_translate</li>
|
||||
<li>r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)</li>
|
||||
<li>r300/compiler: TEX instructions don't support negation on source arguments</li>
|
||||
<li>r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500</li>
|
||||
<li>r300/compiler: saturate Z before the shadow comparison</li>
|
||||
<li>r300/compiler: fix equal and notequal shadow compare functions</li>
|
||||
<li>r300/compiler: remove unused variables</li>
|
||||
<li>st/mesa: fix crash when using both user and vbo buffers with the same stride</li>
|
||||
<li>r300g: fix alpha-test with no colorbuffer</li>
|
||||
<li>r300g: tell the GLSL compiler to lower the continue opcode</li>
|
||||
<li>r300/compiler: propagate SaturateMode down to the result of shadow comparison</li>
|
||||
<li>r300/compiler: apply the texture swizzle to shadow pass and fail values too</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Michel Dänzer (1):
|
||||
<ul>
|
||||
<li>Use proper source row stride when getting depth/stencil texels.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Tom Stellard (4):
|
||||
<ul>
|
||||
<li>r300/compiler: Use a 4-bit writemask in pair instructions</li>
|
||||
<li>prog_optimize: Fix reallocating registers for shaders with loops</li>
|
||||
<li>r300/compiler: Fix vertex shader MAD instructions with constant swizzles</li>
|
||||
<li>r300/compiler: Don't try to convert RGB to Alpha in full instructions</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -41,6 +41,7 @@ tbd
|
||||
<li>GL_ARB_texture_compression_rgtc (gallium r600, swrast)
|
||||
<li>GL_ARB_draw_buffers_blend (gallium)
|
||||
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
|
||||
<li>GL_ARB_sampler_objects (gallium drivers)
|
||||
</ul>
|
||||
|
||||
|
||||
|
@@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
|
||||
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
|
||||
|
@@ -655,6 +655,8 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_TEXTURE_ENV_COLOR 0x2201
|
||||
#define GL_TEXTURE_GEN_S 0x0C60
|
||||
#define GL_TEXTURE_GEN_T 0x0C61
|
||||
#define GL_TEXTURE_GEN_R 0x0C62
|
||||
#define GL_TEXTURE_GEN_Q 0x0C63
|
||||
#define GL_TEXTURE_GEN_MODE 0x2500
|
||||
#define GL_TEXTURE_BORDER_COLOR 0x1004
|
||||
#define GL_TEXTURE_WIDTH 0x1000
|
||||
@@ -685,8 +687,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_T 0x2001
|
||||
#define GL_R 0x2002
|
||||
#define GL_Q 0x2003
|
||||
#define GL_TEXTURE_GEN_R 0x0C62
|
||||
#define GL_TEXTURE_GEN_Q 0x0C63
|
||||
|
||||
/* Utility */
|
||||
#define GL_VENDOR 0x1F00
|
||||
|
@@ -1,72 +0,0 @@
|
||||
"""gallium
|
||||
|
||||
Frontend-tool for Gallium3D architecture.
|
||||
|
||||
"""
|
||||
|
||||
#
|
||||
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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, sub license, 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 NON-INFRINGEMENT.
|
||||
# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
|
||||
#
|
||||
|
||||
|
||||
import sys
|
||||
import distutils.sysconfig
|
||||
import os.path
|
||||
|
||||
|
||||
def generate(env):
|
||||
# See http://www.scons.org/wiki/PythonExtensions
|
||||
|
||||
if sys.platform in ['win32']:
|
||||
python_root = sys.prefix
|
||||
python_version = '%u%u' % sys.version_info[:2]
|
||||
python_include = os.path.join(python_root, 'include')
|
||||
python_libs = os.path.join(python_root, 'libs')
|
||||
python_lib = os.path.join(python_libs, 'python' + python_version + '.lib')
|
||||
|
||||
env.Append(CPPPATH = [python_include])
|
||||
env.Append(LIBPATH = [python_libs])
|
||||
env.Append(LIBS = ['python' + python_version + '.lib'])
|
||||
env.Replace(SHLIBPREFIX = '')
|
||||
env.Replace(SHLIBSUFFIX = '.pyd')
|
||||
|
||||
# XXX; python25_d.lib is not included in Python for windows, and
|
||||
# we'll get missing symbols unless we undefine _DEBUG
|
||||
cppdefines = env['CPPDEFINES']
|
||||
cppdefines = [define for define in cppdefines if define != '_DEBUG']
|
||||
env.Replace(CPPDEFINES = cppdefines)
|
||||
env.AppendUnique(CPPFLAGS = ['/U_DEBUG'])
|
||||
env.AppendUnique(LINKFLAGS = ['/nodefaultlib:python25_d.lib'])
|
||||
else:
|
||||
#env.ParseConfig('python-config --cflags --ldflags --libs')
|
||||
env.AppendUnique(CPPPATH = [distutils.sysconfig.get_python_inc()])
|
||||
env.Replace(SHLIBPREFIX = '')
|
||||
env.Replace(SHLIBSUFFIX = distutils.sysconfig.get_config_vars()['SO'])
|
||||
|
||||
# for debugging
|
||||
#print env.Dump()
|
||||
|
||||
|
||||
def exists(env):
|
||||
return 1
|
@@ -462,6 +462,12 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
}
|
||||
}
|
||||
|
||||
if (dri2_dpy->image) {
|
||||
disp->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
cleanup_dri_screen:
|
||||
|
@@ -708,11 +708,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
for (i = 0; dri2_dpy->driver_configs[i]; i++)
|
||||
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
|
||||
|
||||
disp->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
#endif
|
||||
|
@@ -429,7 +429,7 @@ wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
||||
}
|
||||
|
||||
static void
|
||||
wayland_frame_callback(void *data, uint32_t time)
|
||||
wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = data;
|
||||
|
||||
@@ -459,7 +459,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
|
||||
dri2_surf->block_swap_buffers = EGL_TRUE;
|
||||
wl_display_frame_callback(dri2_dpy->wl_dpy->display,
|
||||
wayland_frame_callback, dri2_surf);
|
||||
dri2_surf->wl_win->surface,
|
||||
wayland_frame_callback, dri2_surf);
|
||||
|
||||
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
|
||||
pointer_swap(
|
||||
@@ -677,11 +678,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
|
||||
|
||||
|
||||
disp->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
|
||||
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
dri2_dpy->authenticate = dri2_wayland_authenticate;
|
||||
|
@@ -231,7 +231,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
if (dri2_dpy->dri2) {
|
||||
xcb_dri2_create_drawable (dri2_dpy->conn, dri2_surf->drawable);
|
||||
} else {
|
||||
swrastCreateDrawable(dri2_dpy, dri2_surf, _eglGetConfigKey(conf, EGL_DEPTH_SIZE));
|
||||
swrastCreateDrawable(dri2_dpy, dri2_surf, _eglGetConfigKey(conf, EGL_BUFFER_SIZE));
|
||||
}
|
||||
|
||||
if (type != EGL_PBUFFER_BIT) {
|
||||
@@ -990,7 +990,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
if (!dri2_load_driver(disp))
|
||||
goto cleanup_conn;
|
||||
|
||||
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
|
||||
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR | O_CLOEXEC);
|
||||
if (dri2_dpy->fd == -1) {
|
||||
_eglLog(_EGL_WARNING,
|
||||
"DRI2: could not open %s (%s)", dri2_dpy->device_name,
|
||||
@@ -1030,11 +1030,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
goto cleanup_configs;
|
||||
}
|
||||
|
||||
disp->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
|
||||
disp->Extensions.NOK_swap_region = EGL_TRUE;
|
||||
disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
|
||||
|
||||
|
@@ -12,7 +12,8 @@ wayland_drm_OBJECTS = $(wayland_drm_SOURCES:.c=.o)
|
||||
|
||||
wayland_drm_INCLUDES = \
|
||||
$(WAYLAND_CFLAGS) \
|
||||
-I$(TOP)/src/egl/main
|
||||
-I$(TOP)/src/egl/main \
|
||||
-I$(TOP)/include
|
||||
|
||||
# Generate protocol sources
|
||||
prefix=$(shell pkg-config --variable=prefix wayland-server)
|
||||
|
@@ -53,7 +53,6 @@ if env['drm']:
|
||||
# Needed by some state trackers
|
||||
SConscript('winsys/sw/null/SConscript')
|
||||
|
||||
SConscript('state_trackers/python/SConscript')
|
||||
if env['platform'] != 'embedded':
|
||||
SConscript('state_trackers/vega/SConscript')
|
||||
SConscript('state_trackers/egl/SConscript')
|
||||
|
@@ -107,6 +107,7 @@ C_SOURCES = \
|
||||
util/u_caps.c \
|
||||
util/u_cpu_detect.c \
|
||||
util/u_dl.c \
|
||||
util/u_draw.c \
|
||||
util/u_draw_quad.c \
|
||||
util/u_format.c \
|
||||
util/u_format_other.c \
|
||||
|
@@ -154,6 +154,7 @@ source = [
|
||||
'util/u_dump_defines.c',
|
||||
'util/u_dump_state.c',
|
||||
'util/u_dl.c',
|
||||
'util/u_draw.c',
|
||||
'util/u_draw_quad.c',
|
||||
'util/u_format.c',
|
||||
'util/u_format_other.c',
|
||||
|
@@ -751,7 +751,7 @@ void
|
||||
draw_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t last_level,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
const void *data[PIPE_MAX_TEXTURE_LEVELS])
|
||||
@@ -760,7 +760,7 @@ draw_set_mapped_texture(struct draw_context *draw,
|
||||
if(draw->llvm)
|
||||
draw_llvm_set_mapped_texture(draw,
|
||||
sampler_idx,
|
||||
width, height, depth, last_level,
|
||||
width, height, depth, first_level, last_level,
|
||||
row_stride, img_stride, data);
|
||||
#endif
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ void
|
||||
draw_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t last_level,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
const void *data[PIPE_MAX_TEXTURE_LEVELS]);
|
||||
|
@@ -106,6 +106,7 @@ create_jit_texture_type(struct gallivm_state *gallivm)
|
||||
elem_types[DRAW_JIT_TEXTURE_WIDTH] =
|
||||
elem_types[DRAW_JIT_TEXTURE_HEIGHT] =
|
||||
elem_types[DRAW_JIT_TEXTURE_DEPTH] =
|
||||
elem_types[DRAW_JIT_TEXTURE_FIRST_LEVEL] =
|
||||
elem_types[DRAW_JIT_TEXTURE_LAST_LEVEL] = int32_type;
|
||||
elem_types[DRAW_JIT_TEXTURE_ROW_STRIDE] =
|
||||
elem_types[DRAW_JIT_TEXTURE_IMG_STRIDE] =
|
||||
@@ -136,6 +137,9 @@ create_jit_texture_type(struct gallivm_state *gallivm)
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, depth,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_DEPTH);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, first_level,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_FIRST_LEVEL);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, last_level,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_LAST_LEVEL);
|
||||
@@ -438,7 +442,8 @@ generate_vs(struct draw_llvm *llvm,
|
||||
const LLVMValueRef (*inputs)[NUM_CHANNELS],
|
||||
LLVMValueRef system_values_array,
|
||||
LLVMValueRef context_ptr,
|
||||
struct lp_build_sampler_soa *draw_sampler)
|
||||
struct lp_build_sampler_soa *draw_sampler,
|
||||
boolean clamp_vertex_color)
|
||||
{
|
||||
const struct tgsi_token *tokens = llvm->draw->vs.vertex_shader->state.tokens;
|
||||
struct lp_type vs_type;
|
||||
@@ -474,6 +479,30 @@ generate_vs(struct draw_llvm *llvm,
|
||||
outputs,
|
||||
sampler,
|
||||
&llvm->draw->vs.vertex_shader->info);
|
||||
|
||||
if(clamp_vertex_color)
|
||||
{
|
||||
LLVMValueRef out;
|
||||
unsigned chan, attrib;
|
||||
struct lp_build_context bld;
|
||||
struct tgsi_shader_info* info = &llvm->draw->vs.vertex_shader->info;
|
||||
lp_build_context_init(&bld, llvm->gallivm, vs_type);
|
||||
|
||||
for (attrib = 0; attrib < info->num_outputs; ++attrib) {
|
||||
for(chan = 0; chan < NUM_CHANNELS; ++chan) {
|
||||
if(outputs[attrib][chan]) {
|
||||
switch (info->output_semantic_name[attrib]) {
|
||||
case TGSI_SEMANTIC_COLOR:
|
||||
case TGSI_SEMANTIC_BCOLOR:
|
||||
out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
|
||||
out = lp_build_clamp(&bld, out, bld.zero, bld.one);
|
||||
LLVMBuildStore(builder, out, outputs[attrib][chan]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG_STORE
|
||||
@@ -1235,7 +1264,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
|
||||
ptr_aos,
|
||||
system_values_array,
|
||||
context_ptr,
|
||||
sampler);
|
||||
sampler,
|
||||
variant->key.clamp_vertex_color);
|
||||
|
||||
/* store original positions in clip before further manipulation */
|
||||
store_clip(gallivm, io, outputs);
|
||||
@@ -1446,7 +1476,8 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
|
||||
ptr_aos,
|
||||
system_values_array,
|
||||
context_ptr,
|
||||
sampler);
|
||||
sampler,
|
||||
variant->key.clamp_vertex_color);
|
||||
|
||||
/* store original positions in clip before further manipulation */
|
||||
store_clip(gallivm, io, outputs);
|
||||
@@ -1524,6 +1555,8 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
|
||||
|
||||
key = (struct draw_llvm_variant_key *)store;
|
||||
|
||||
key->clamp_vertex_color = llvm->draw->rasterizer->clamp_vertex_color; /**/
|
||||
|
||||
/* Presumably all variants of the shader should have the same
|
||||
* number of vertex elements - ie the number of shader inputs.
|
||||
*/
|
||||
@@ -1566,7 +1599,7 @@ void
|
||||
draw_llvm_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t last_level,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
const void *data[PIPE_MAX_TEXTURE_LEVELS])
|
||||
@@ -1582,9 +1615,10 @@ draw_llvm_set_mapped_texture(struct draw_context *draw,
|
||||
jit_tex->width = width;
|
||||
jit_tex->height = height;
|
||||
jit_tex->depth = depth;
|
||||
jit_tex->first_level = first_level;
|
||||
jit_tex->last_level = last_level;
|
||||
|
||||
for (j = 0; j <= last_level; j++) {
|
||||
for (j = first_level; j <= last_level; j++) {
|
||||
jit_tex->data[j] = data[j];
|
||||
jit_tex->row_stride[j] = row_stride[j];
|
||||
jit_tex->img_stride[j] = img_stride[j];
|
||||
|
@@ -50,6 +50,7 @@ struct draw_jit_texture
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t depth;
|
||||
uint32_t first_level;
|
||||
uint32_t last_level;
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS];
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
|
||||
@@ -64,6 +65,7 @@ enum {
|
||||
DRAW_JIT_TEXTURE_WIDTH = 0,
|
||||
DRAW_JIT_TEXTURE_HEIGHT,
|
||||
DRAW_JIT_TEXTURE_DEPTH,
|
||||
DRAW_JIT_TEXTURE_FIRST_LEVEL,
|
||||
DRAW_JIT_TEXTURE_LAST_LEVEL,
|
||||
DRAW_JIT_TEXTURE_ROW_STRIDE,
|
||||
DRAW_JIT_TEXTURE_IMG_STRIDE,
|
||||
@@ -162,6 +164,7 @@ struct draw_llvm_variant_key
|
||||
{
|
||||
unsigned nr_vertex_elements:8;
|
||||
unsigned nr_samplers:8;
|
||||
unsigned clamp_vertex_color:1;
|
||||
unsigned clip_xy:1;
|
||||
unsigned clip_z:1;
|
||||
unsigned clip_user:1;
|
||||
@@ -169,7 +172,7 @@ struct draw_llvm_variant_key
|
||||
unsigned bypass_viewport:1;
|
||||
unsigned need_edgeflags:1;
|
||||
unsigned nr_planes:4;
|
||||
unsigned pad:6;
|
||||
unsigned pad:5;
|
||||
|
||||
/* Variable number of vertex elements:
|
||||
*/
|
||||
@@ -295,7 +298,7 @@ void
|
||||
draw_llvm_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t last_level,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
const void *data[PIPE_MAX_TEXTURE_LEVELS]);
|
||||
|
@@ -144,6 +144,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
DRAW_LLVM_TEXTURE_MEMBER(width, DRAW_JIT_TEXTURE_WIDTH, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(height, DRAW_JIT_TEXTURE_HEIGHT, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(depth, DRAW_JIT_TEXTURE_DEPTH, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(first_level,DRAW_JIT_TEXTURE_FIRST_LEVEL, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(last_level, DRAW_JIT_TEXTURE_LAST_LEVEL, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(row_stride, DRAW_JIT_TEXTURE_ROW_STRIDE, FALSE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(img_stride, DRAW_JIT_TEXTURE_IMG_STRIDE, FALSE)
|
||||
@@ -209,6 +210,7 @@ draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
|
||||
sampler->dynamic_state.base.width = draw_llvm_texture_width;
|
||||
sampler->dynamic_state.base.height = draw_llvm_texture_height;
|
||||
sampler->dynamic_state.base.depth = draw_llvm_texture_depth;
|
||||
sampler->dynamic_state.base.first_level = draw_llvm_texture_first_level;
|
||||
sampler->dynamic_state.base.last_level = draw_llvm_texture_last_level;
|
||||
sampler->dynamic_state.base.row_stride = draw_llvm_texture_row_stride;
|
||||
sampler->dynamic_state.base.img_stride = draw_llvm_texture_img_stride;
|
||||
|
@@ -146,6 +146,14 @@ struct draw_context
|
||||
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
|
||||
unsigned nr_vertex_buffers;
|
||||
|
||||
/*
|
||||
* This is the largest legal index value for the current set of
|
||||
* bound vertex buffers. Regardless of any other consideration,
|
||||
* all vertex lookups need to be clamped to 0..max_index to
|
||||
* prevent out-of-bound access.
|
||||
*/
|
||||
unsigned max_index;
|
||||
|
||||
struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
|
||||
unsigned nr_vertex_elements;
|
||||
|
||||
|
@@ -470,6 +470,17 @@ draw_vbo(struct draw_context *draw,
|
||||
if (0)
|
||||
draw_print_arrays(draw, info->mode, info->start, MIN2(info->count, 20));
|
||||
|
||||
draw->pt.max_index = util_draw_max_index(draw->pt.vertex_buffer,
|
||||
draw->pt.nr_vertex_buffers,
|
||||
draw->pt.vertex_element,
|
||||
draw->pt.nr_vertex_elements,
|
||||
info);
|
||||
|
||||
/*
|
||||
* TODO: We could use draw->pt.max_index to further narrow
|
||||
* the min_index/max_index hints given by the state tracker.
|
||||
*/
|
||||
|
||||
for (instance = 0; instance < info->instance_count; instance++) {
|
||||
draw->instance_id = instance + info->start_instance;
|
||||
|
||||
|
@@ -139,7 +139,7 @@ void draw_pt_fetch_run( struct pt_fetch *fetch,
|
||||
((char *)draw->pt.user.vbuffer[i] +
|
||||
draw->pt.vertex_buffer[i].buffer_offset),
|
||||
draw->pt.vertex_buffer[i].stride,
|
||||
draw->pt.user.max_index);
|
||||
draw->pt.max_index);
|
||||
}
|
||||
|
||||
translate->run_elts( translate,
|
||||
|
@@ -186,7 +186,7 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
|
||||
((char *)draw->pt.user.vbuffer[i] +
|
||||
draw->pt.vertex_buffer[i].buffer_offset),
|
||||
draw->pt.vertex_buffer[i].stride,
|
||||
draw->pt.user.max_index);
|
||||
draw->pt.max_index);
|
||||
}
|
||||
|
||||
*max_vertices = (draw->render->max_vertex_buffer_bytes /
|
||||
|
@@ -169,7 +169,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
|
||||
((const ubyte *) draw->pt.user.vbuffer[i] +
|
||||
draw->pt.vertex_buffer[i].buffer_offset),
|
||||
draw->pt.vertex_buffer[i].stride,
|
||||
draw->pt.user.max_index );
|
||||
draw->pt.max_index );
|
||||
}
|
||||
|
||||
*max_vertices = (draw->render->max_vertex_buffer_bytes /
|
||||
|
@@ -85,7 +85,12 @@ vsplit_flush_cache(struct vsplit_frontend *vsplit, unsigned flags)
|
||||
static INLINE void
|
||||
vsplit_add_cache(struct vsplit_frontend *vsplit, unsigned fetch)
|
||||
{
|
||||
unsigned hash = fetch % MAP_SIZE;
|
||||
struct draw_context *draw = vsplit->draw;
|
||||
unsigned hash;
|
||||
|
||||
fetch = MIN2(fetch, draw->pt.max_index);
|
||||
|
||||
hash = fetch % MAP_SIZE;
|
||||
|
||||
if (vsplit->cache.fetches[hash] != fetch) {
|
||||
/* update cache */
|
||||
|
@@ -47,14 +47,18 @@ CONCAT(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit,
|
||||
const ushort *draw_elts = NULL;
|
||||
unsigned i;
|
||||
|
||||
ib += istart;
|
||||
|
||||
/* use the ib directly */
|
||||
if (min_index == 0 && sizeof(ib[0]) == sizeof(draw_elts[0])) {
|
||||
if (icount > vsplit->max_vertices)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < icount; i++) {
|
||||
ELT_TYPE idx = ib[istart + i];
|
||||
assert(idx >= min_index && idx <= max_index);
|
||||
ELT_TYPE idx = ib[i];
|
||||
if (idx < min_index || idx > max_index) {
|
||||
debug_printf("warning: index out of range\n");
|
||||
}
|
||||
}
|
||||
draw_elts = (const ushort *) ib;
|
||||
}
|
||||
@@ -83,17 +87,21 @@ CONCAT(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit,
|
||||
if (!draw_elts) {
|
||||
if (min_index == 0) {
|
||||
for (i = 0; i < icount; i++) {
|
||||
ELT_TYPE idx = ib[istart + i];
|
||||
ELT_TYPE idx = ib[i];
|
||||
|
||||
assert(idx >= min_index && idx <= max_index);
|
||||
if (idx < min_index || idx > max_index) {
|
||||
debug_printf("warning: index out of range\n");
|
||||
}
|
||||
vsplit->draw_elts[i] = (ushort) idx;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < icount; i++) {
|
||||
ELT_TYPE idx = ib[istart + i];
|
||||
ELT_TYPE idx = ib[i];
|
||||
|
||||
assert(idx >= min_index && idx <= max_index);
|
||||
if (idx < min_index || idx > max_index) {
|
||||
debug_printf("warning: index out of range\n");
|
||||
}
|
||||
vsplit->draw_elts[i] = (ushort) (idx - min_index);
|
||||
}
|
||||
}
|
||||
|
@@ -104,10 +104,17 @@ draw_create_vertex_shader(struct draw_context *draw,
|
||||
}
|
||||
|
||||
if (!draw->pt.middle.llvm) {
|
||||
#if 0
|
||||
/* these paths don't support vertex clamping
|
||||
* TODO: either add it, or remove them completely
|
||||
* use LLVM instead if you want performance
|
||||
* use exec instead if you want debugging/more correctness
|
||||
*/
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
vs = draw_create_vs_sse( draw, shader );
|
||||
#elif defined(PIPE_ARCH_PPC)
|
||||
vs = draw_create_vs_ppc( draw, shader );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#if HAVE_LLVM
|
||||
|
@@ -95,6 +95,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
|
||||
struct tgsi_exec_machine *machine = evs->machine;
|
||||
unsigned int i, j;
|
||||
unsigned slot;
|
||||
boolean clamp_vertex_color = shader->draw->rasterizer->clamp_vertex_color;
|
||||
|
||||
tgsi_exec_set_constant_buffers(machine, PIPE_MAX_CONSTANT_BUFFERS,
|
||||
constants, const_size);
|
||||
@@ -151,11 +152,22 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
|
||||
*/
|
||||
for (j = 0; j < max_vertices; j++) {
|
||||
for (slot = 0; slot < shader->info.num_outputs; slot++) {
|
||||
output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
|
||||
output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];
|
||||
output[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
|
||||
output[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
|
||||
|
||||
unsigned name = shader->info.output_semantic_name[slot];
|
||||
if(clamp_vertex_color &&
|
||||
(name == TGSI_SEMANTIC_COLOR || name == TGSI_SEMANTIC_BCOLOR))
|
||||
{
|
||||
output[slot][0] = CLAMP(machine->Outputs[slot].xyzw[0].f[j], 0.0f, 1.0f);
|
||||
output[slot][1] = CLAMP(machine->Outputs[slot].xyzw[1].f[j], 0.0f, 1.0f);
|
||||
output[slot][2] = CLAMP(machine->Outputs[slot].xyzw[2].f[j], 0.0f, 1.0f);
|
||||
output[slot][3] = CLAMP(machine->Outputs[slot].xyzw[3].f[j], 0.0f, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
|
||||
output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];
|
||||
output[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
|
||||
output[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@@ -32,7 +32,12 @@
|
||||
#include <llvm/Target/TargetInstrInfo.h>
|
||||
#include <llvm/Support/raw_ostream.h>
|
||||
#include <llvm/Support/MemoryObject.h>
|
||||
|
||||
#if HAVE_LLVM >= 0x0209
|
||||
#include <llvm/Support/Host.h>
|
||||
#else
|
||||
#include <llvm/System/Host.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LLVM >= 0x0207
|
||||
#include <llvm/MC/MCDisassembler.h>
|
||||
@@ -202,9 +207,17 @@ lp_disassemble(const void* func)
|
||||
}
|
||||
|
||||
raw_debug_ostream Out;
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, "");
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
#else
|
||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
#if HAVE_LLVM >= 0x0208
|
||||
#endif
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(*TM, AsmPrinterVariant, *AsmInfo));
|
||||
#elif HAVE_LLVM >= 0x0208
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo));
|
||||
#else
|
||||
@@ -216,8 +229,6 @@ lp_disassemble(const void* func)
|
||||
return;
|
||||
}
|
||||
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, "");
|
||||
|
||||
const TargetInstrInfo *TII = TM->getInstrInfo();
|
||||
|
||||
/*
|
||||
|
@@ -51,6 +51,10 @@
|
||||
*/
|
||||
#define BRILINEAR_FACTOR 2
|
||||
|
||||
static LLVMValueRef
|
||||
lp_build_minify(struct lp_build_context *bld,
|
||||
LLVMValueRef base_size,
|
||||
LLVMValueRef level);
|
||||
|
||||
/**
|
||||
* Does the given texture wrap mode allow sampling the texture border color?
|
||||
@@ -184,9 +188,11 @@ lp_sampler_static_state(struct lp_sampler_static_state *state,
|
||||
*/
|
||||
static LLVMValueRef
|
||||
lp_build_rho(struct lp_build_sample_context *bld,
|
||||
unsigned unit,
|
||||
const LLVMValueRef ddx[4],
|
||||
const LLVMValueRef ddy[4])
|
||||
{
|
||||
struct lp_build_context *int_size_bld = &bld->int_size_bld;
|
||||
struct lp_build_context *float_size_bld = &bld->float_size_bld;
|
||||
struct lp_build_context *float_bld = &bld->float_bld;
|
||||
const unsigned dims = bld->dims;
|
||||
@@ -198,8 +204,9 @@ lp_build_rho(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef dsdx, dsdy, dtdx, dtdy, drdx, drdy;
|
||||
LLVMValueRef rho_x, rho_y;
|
||||
LLVMValueRef rho_vec;
|
||||
LLVMValueRef float_size;
|
||||
LLVMValueRef int_size, float_size;
|
||||
LLVMValueRef rho;
|
||||
LLVMValueRef first_level, first_level_vec;
|
||||
|
||||
dsdx = ddx[0];
|
||||
dsdy = ddy[0];
|
||||
@@ -235,7 +242,11 @@ lp_build_rho(struct lp_build_sample_context *bld,
|
||||
|
||||
rho_vec = lp_build_max(float_size_bld, rho_x, rho_y);
|
||||
|
||||
float_size = lp_build_int_to_float(float_size_bld, bld->int_size);
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
first_level_vec = lp_build_broadcast_scalar(&bld->int_size_bld, first_level);
|
||||
int_size = lp_build_minify(int_size_bld, bld->int_size, first_level_vec);
|
||||
float_size = lp_build_int_to_float(float_size_bld, int_size);
|
||||
|
||||
rho_vec = lp_build_mul(float_size_bld, rho_vec, float_size);
|
||||
|
||||
@@ -442,7 +453,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
else {
|
||||
LLVMValueRef rho;
|
||||
|
||||
rho = lp_build_rho(bld, ddx, ddy);
|
||||
rho = lp_build_rho(bld, unit, ddx, ddy);
|
||||
|
||||
/*
|
||||
* Compute lod = log2(rho)
|
||||
@@ -542,18 +553,18 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef *level_out)
|
||||
{
|
||||
struct lp_build_context *int_bld = &bld->int_bld;
|
||||
LLVMValueRef last_level, level;
|
||||
|
||||
LLVMValueRef zero = lp_build_const_int32(bld->gallivm, 0);
|
||||
LLVMValueRef first_level, last_level, level;
|
||||
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
|
||||
/* convert float lod to integer */
|
||||
level = lod_ipart;
|
||||
level = lp_build_add(int_bld, lod_ipart, first_level);
|
||||
|
||||
/* clamp level to legal range of levels */
|
||||
*level_out = lp_build_clamp(int_bld, level, zero, last_level);
|
||||
*level_out = lp_build_clamp(int_bld, level, first_level, last_level);
|
||||
}
|
||||
|
||||
|
||||
@@ -573,39 +584,42 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
struct lp_build_context *int_bld = &bld->int_bld;
|
||||
struct lp_build_context *float_bld = &bld->float_bld;
|
||||
LLVMValueRef last_level;
|
||||
LLVMValueRef first_level, last_level;
|
||||
LLVMValueRef clamp_min;
|
||||
LLVMValueRef clamp_max;
|
||||
|
||||
*level0_out = lod_ipart;
|
||||
*level1_out = lp_build_add(int_bld, lod_ipart, int_bld->one);
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
|
||||
*level0_out = lp_build_add(int_bld, lod_ipart, first_level);
|
||||
*level1_out = lp_build_add(int_bld, *level0_out, int_bld->one);
|
||||
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
|
||||
/*
|
||||
* Clamp both lod_ipart and lod_ipart + 1 to [0, last_level], with the
|
||||
* minimum number of comparisons, and zeroing lod_fpart in the extreme
|
||||
* Clamp both *level0_out and *level1_out to [first_level, last_level], with
|
||||
* the minimum number of comparisons, and zeroing lod_fpart in the extreme
|
||||
* ends in the process.
|
||||
*/
|
||||
|
||||
/* lod_ipart < 0 */
|
||||
/* *level0_out < first_level */
|
||||
clamp_min = LLVMBuildICmp(builder, LLVMIntSLT,
|
||||
lod_ipart, int_bld->zero,
|
||||
"clamp_lod_to_zero");
|
||||
*level0_out, first_level,
|
||||
"clamp_lod_to_first");
|
||||
|
||||
*level0_out = LLVMBuildSelect(builder, clamp_min,
|
||||
int_bld->zero, *level0_out, "");
|
||||
first_level, *level0_out, "");
|
||||
|
||||
*level1_out = LLVMBuildSelect(builder, clamp_min,
|
||||
int_bld->zero, *level1_out, "");
|
||||
first_level, *level1_out, "");
|
||||
|
||||
*lod_fpart_inout = LLVMBuildSelect(builder, clamp_min,
|
||||
float_bld->zero, *lod_fpart_inout, "");
|
||||
|
||||
/* lod_ipart >= last_level */
|
||||
/* *level0_out >= last_level */
|
||||
clamp_max = LLVMBuildICmp(builder, LLVMIntSGE,
|
||||
lod_ipart, last_level,
|
||||
*level0_out, last_level,
|
||||
"clamp_lod_to_last");
|
||||
|
||||
*level0_out = LLVMBuildSelect(builder, clamp_max,
|
||||
|
@@ -120,6 +120,12 @@ struct lp_sampler_dynamic_state
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the first mipmap level (base level) (returns int32) */
|
||||
LLVMValueRef
|
||||
(*first_level)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the number of mipmap levels minus one (returns int32) */
|
||||
LLVMValueRef
|
||||
(*last_level)( const struct lp_sampler_dynamic_state *state,
|
||||
|
@@ -939,6 +939,7 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef unswizzled[4];
|
||||
LLVMValueRef face_ddx[4], face_ddy[4];
|
||||
struct lp_build_context h16_bld;
|
||||
LLVMValueRef first_level;
|
||||
LLVMValueRef i32t_zero = lp_build_const_int32(bld->gallivm, 0);
|
||||
|
||||
/* we only support the common/simple wrap modes at this time */
|
||||
@@ -1008,7 +1009,9 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
lp_build_nearest_mip_level(bld, unit, lod_ipart, &ilevel0);
|
||||
}
|
||||
else {
|
||||
ilevel0 = i32t_zero;
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
ilevel0 = first_level;
|
||||
}
|
||||
break;
|
||||
case PIPE_TEX_MIPFILTER_NEAREST:
|
||||
@@ -1065,7 +1068,7 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
lp_build_sample_mipmap(bld,
|
||||
mag_filter, PIPE_TEX_MIPFILTER_NONE,
|
||||
s, t, r,
|
||||
i32t_zero, NULL, NULL,
|
||||
ilevel0, NULL, NULL,
|
||||
packed_lo, packed_hi);
|
||||
}
|
||||
lp_build_endif(&if_ctx);
|
||||
|
@@ -943,6 +943,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef ilevel0, ilevel1 = NULL;
|
||||
LLVMValueRef face_ddx[4], face_ddy[4];
|
||||
LLVMValueRef texels[4];
|
||||
LLVMValueRef first_level;
|
||||
LLVMValueRef i32t_zero = lp_build_const_int32(bld->gallivm, 0);
|
||||
unsigned chan;
|
||||
|
||||
@@ -1009,7 +1010,9 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
lp_build_nearest_mip_level(bld, unit, lod_ipart, &ilevel0);
|
||||
}
|
||||
else {
|
||||
ilevel0 = i32t_zero;
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, unit);
|
||||
ilevel0 = first_level;
|
||||
}
|
||||
break;
|
||||
case PIPE_TEX_MIPFILTER_NEAREST:
|
||||
@@ -1068,7 +1071,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
lp_build_sample_mipmap(bld, unit,
|
||||
mag_filter, PIPE_TEX_MIPFILTER_NONE,
|
||||
s, t, r,
|
||||
i32t_zero, NULL, NULL,
|
||||
ilevel0, NULL, NULL,
|
||||
texels);
|
||||
}
|
||||
lp_build_endif(&if_ctx);
|
||||
|
@@ -726,6 +726,16 @@ void x86_movzx16(struct x86_function *p, struct x86_reg dst, struct x86_reg src
|
||||
emit_modrm(p, dst, src);
|
||||
}
|
||||
|
||||
void x86_cmovcc( struct x86_function *p,
|
||||
struct x86_reg dst,
|
||||
struct x86_reg src,
|
||||
enum x86_cc cc)
|
||||
{
|
||||
DUMP_RRI( dst, src, cc );
|
||||
emit_2ub( p, 0x0f, 0x40 + cc );
|
||||
emit_modrm( p, dst, src );
|
||||
}
|
||||
|
||||
void x86_xor( struct x86_function *p,
|
||||
struct x86_reg dst,
|
||||
struct x86_reg src )
|
||||
|
@@ -309,6 +309,7 @@ void sse_movmskps( struct x86_function *p, struct x86_reg dst, struct x86_reg sr
|
||||
|
||||
void x86_add( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
|
||||
void x86_and( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
|
||||
void x86_cmovcc( struct x86_function *p, struct x86_reg dst, struct x86_reg src, enum x86_cc cc );
|
||||
void x86_cmp( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
|
||||
void x86_dec( struct x86_function *p, struct x86_reg reg );
|
||||
void x86_inc( struct x86_function *p, struct x86_reg reg );
|
||||
|
@@ -1067,6 +1067,8 @@ static boolean init_inputs( struct translate_sse *p,
|
||||
struct translate_buffer *buffer = &p->buffer[varient->buffer_index];
|
||||
|
||||
if (!index_size || varient->instance_divisor) {
|
||||
struct x86_reg buf_max_index = x86_make_disp(p->machine_EDI,
|
||||
get_offset(p, &buffer->max_index));
|
||||
struct x86_reg buf_stride = x86_make_disp(p->machine_EDI,
|
||||
get_offset(p, &buffer->stride));
|
||||
struct x86_reg buf_ptr = x86_make_disp(p->machine_EDI,
|
||||
@@ -1100,14 +1102,17 @@ static boolean init_inputs( struct translate_sse *p,
|
||||
x86_mov(p->func, tmp_EAX, elt);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Respect translate_buffer::max_index.
|
||||
/* Clamp to max_index
|
||||
*/
|
||||
x86_cmp(p->func, tmp_EAX, buf_max_index);
|
||||
x86_cmovcc(p->func, tmp_EAX, buf_max_index, cc_AE);
|
||||
|
||||
x86_imul(p->func, tmp_EAX, buf_stride);
|
||||
x64_rexw(p->func);
|
||||
x86_add(p->func, tmp_EAX, buf_base_ptr);
|
||||
|
||||
x86_cmp(p->func, p->count_EBP, p->tmp_EAX);
|
||||
|
||||
|
||||
/* In the linear case, keep the buffer pointer instead of the
|
||||
* index number.
|
||||
@@ -1163,6 +1168,10 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p,
|
||||
x86_make_disp(p->machine_EDI,
|
||||
get_offset(p, &p->buffer[varient->buffer_index].base_ptr));
|
||||
|
||||
struct x86_reg buf_max_index =
|
||||
x86_make_disp(p->machine_EDI,
|
||||
get_offset(p, &p->buffer[varient->buffer_index].max_index));
|
||||
|
||||
|
||||
|
||||
/* Calculate pointer to current attrib:
|
||||
@@ -1179,6 +1188,12 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p,
|
||||
x86_mov(p->func, ptr, elt);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Clamp to max_index
|
||||
*/
|
||||
x86_cmp(p->func, ptr, buf_max_index);
|
||||
x86_cmovcc(p->func, ptr, buf_max_index, cc_AE);
|
||||
|
||||
x86_imul(p->func, ptr, buf_stride);
|
||||
x64_rexw(p->func);
|
||||
x86_add(p->func, ptr, buf_base_ptr);
|
||||
|
@@ -270,13 +270,15 @@ util_cpu_detect(void)
|
||||
util_cpu_caps.x86_cpu_type = 8 + ((regs2[0] >> 20) & 255); /* use extended family (P4, IA64) */
|
||||
|
||||
/* general feature flags */
|
||||
util_cpu_caps.has_tsc = (regs2[3] & (1 << 8 )) >> 8; /* 0x0000010 */
|
||||
util_cpu_caps.has_mmx = (regs2[3] & (1 << 23 )) >> 23; /* 0x0800000 */
|
||||
util_cpu_caps.has_sse = (regs2[3] & (1 << 25 )) >> 25; /* 0x2000000 */
|
||||
util_cpu_caps.has_sse2 = (regs2[3] & (1 << 26 )) >> 26; /* 0x4000000 */
|
||||
util_cpu_caps.has_sse3 = (regs2[2] & (1)); /* 0x0000001 */
|
||||
util_cpu_caps.has_ssse3 = (regs2[2] & (1 << 9 )) >> 9; /* 0x0000020 */
|
||||
util_cpu_caps.has_sse4_1 = (regs2[2] & (1 << 19)) >> 19;
|
||||
util_cpu_caps.has_tsc = (regs2[3] >> 8) & 1; /* 0x0000010 */
|
||||
util_cpu_caps.has_mmx = (regs2[3] >> 23) & 1; /* 0x0800000 */
|
||||
util_cpu_caps.has_sse = (regs2[3] >> 25) & 1; /* 0x2000000 */
|
||||
util_cpu_caps.has_sse2 = (regs2[3] >> 26) & 1; /* 0x4000000 */
|
||||
util_cpu_caps.has_sse3 = (regs2[2] >> 0) & 1; /* 0x0000001 */
|
||||
util_cpu_caps.has_ssse3 = (regs2[2] >> 9) & 1; /* 0x0000020 */
|
||||
util_cpu_caps.has_sse4_1 = (regs2[2] >> 19) & 1;
|
||||
util_cpu_caps.has_sse4_2 = (regs2[2] >> 20) & 1;
|
||||
util_cpu_caps.has_avx = (regs2[2] >> 28) & 1;
|
||||
util_cpu_caps.has_mmx2 = util_cpu_caps.has_sse; /* SSE cpus supports mmxext too */
|
||||
|
||||
cacheline = ((regs2[1] >> 8) & 0xFF) * 8;
|
||||
@@ -290,10 +292,10 @@ util_cpu_detect(void)
|
||||
|
||||
cpuid(0x80000001, regs2);
|
||||
|
||||
util_cpu_caps.has_mmx |= (regs2[3] & (1 << 23 )) >> 23; /* 0x0800000 */
|
||||
util_cpu_caps.has_mmx2 |= (regs2[3] & (1 << 22 )) >> 22; /* 0x400000 */
|
||||
util_cpu_caps.has_3dnow = (regs2[3] & (1 << 31 )) >> 31; /* 0x80000000 */
|
||||
util_cpu_caps.has_3dnow_ext = (regs2[3] & (1 << 30 )) >> 30;
|
||||
util_cpu_caps.has_mmx |= (regs2[3] >> 23) & 1;
|
||||
util_cpu_caps.has_mmx2 |= (regs2[3] >> 22) & 1;
|
||||
util_cpu_caps.has_3dnow = (regs2[3] >> 31) & 1;
|
||||
util_cpu_caps.has_3dnow_ext = (regs2[3] >> 30) & 1;
|
||||
}
|
||||
|
||||
if (regs[0] >= 0x80000006) {
|
||||
@@ -329,6 +331,8 @@ util_cpu_detect(void)
|
||||
debug_printf("util_cpu_caps.has_sse3 = %u\n", util_cpu_caps.has_sse3);
|
||||
debug_printf("util_cpu_caps.has_ssse3 = %u\n", util_cpu_caps.has_ssse3);
|
||||
debug_printf("util_cpu_caps.has_sse4_1 = %u\n", util_cpu_caps.has_sse4_1);
|
||||
debug_printf("util_cpu_caps.has_sse4_2 = %u\n", util_cpu_caps.has_sse4_2);
|
||||
debug_printf("util_cpu_caps.has_avx = %u\n", util_cpu_caps.has_avx);
|
||||
debug_printf("util_cpu_caps.has_3dnow = %u\n", util_cpu_caps.has_3dnow);
|
||||
debug_printf("util_cpu_caps.has_3dnow_ext = %u\n", util_cpu_caps.has_3dnow_ext);
|
||||
debug_printf("util_cpu_caps.has_altivec = %u\n", util_cpu_caps.has_altivec);
|
||||
|
@@ -53,6 +53,8 @@ struct util_cpu_caps {
|
||||
unsigned has_sse3:1;
|
||||
unsigned has_ssse3:1;
|
||||
unsigned has_sse4_1:1;
|
||||
unsigned has_sse4_2:1;
|
||||
unsigned has_avx:1;
|
||||
unsigned has_3dnow:1;
|
||||
unsigned has_3dnow_ext:1;
|
||||
unsigned has_altivec:1;
|
||||
|
@@ -39,6 +39,7 @@
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
|
||||
struct list_head
|
||||
@@ -47,50 +48,56 @@ struct list_head
|
||||
struct list_head *next;
|
||||
};
|
||||
|
||||
static INLINE void list_inithead(struct list_head *item)
|
||||
{
|
||||
item->prev = item;
|
||||
item->next = item;
|
||||
}
|
||||
|
||||
#define LIST_INITHEAD(__item) \
|
||||
do { \
|
||||
(__item)->prev = (__item); \
|
||||
(__item)->next = (__item); \
|
||||
} while (0)
|
||||
static INLINE void list_add(struct list_head *item, struct list_head *list)
|
||||
{
|
||||
item->prev = list;
|
||||
item->next = list->next;
|
||||
list->next->prev = item;
|
||||
list->next = item;
|
||||
}
|
||||
|
||||
#define LIST_ADD(__item, __list) \
|
||||
do { \
|
||||
(__item)->prev = (__list); \
|
||||
(__item)->next = (__list)->next; \
|
||||
(__list)->next->prev = (__item); \
|
||||
(__list)->next = (__item); \
|
||||
} while (0)
|
||||
static INLINE void list_addtail(struct list_head *item, struct list_head *list)
|
||||
{
|
||||
item->next = list;
|
||||
item->prev = list->prev;
|
||||
list->prev->next = item;
|
||||
list->prev = item;
|
||||
}
|
||||
|
||||
#define LIST_ADDTAIL(__item, __list) \
|
||||
do { \
|
||||
(__item)->next = (__list); \
|
||||
(__item)->prev = (__list)->prev; \
|
||||
(__list)->prev->next = (__item); \
|
||||
(__list)->prev = (__item); \
|
||||
} while(0)
|
||||
static INLINE void list_replace(struct list_head *from, struct list_head *to)
|
||||
{
|
||||
to->prev = from->prev;
|
||||
to->next = from->next;
|
||||
from->next->prev = to;
|
||||
from->prev->next = to;
|
||||
}
|
||||
|
||||
#define LIST_REPLACE(__from, __to) \
|
||||
do { \
|
||||
(__to)->prev = (__from)->prev; \
|
||||
(__to)->next = (__from)->next; \
|
||||
(__from)->next->prev = (__to); \
|
||||
(__from)->prev->next = (__to); \
|
||||
} while (0)
|
||||
static INLINE void list_del(struct list_head *item)
|
||||
{
|
||||
item->prev->next = item->next;
|
||||
item->next->prev = item->prev;
|
||||
}
|
||||
|
||||
#define LIST_DEL(__item) \
|
||||
do { \
|
||||
(__item)->prev->next = (__item)->next; \
|
||||
(__item)->next->prev = (__item)->prev; \
|
||||
} while(0)
|
||||
static INLINE void list_delinit(struct list_head *item)
|
||||
{
|
||||
item->prev->next = item->next;
|
||||
item->next->prev = item->prev;
|
||||
item->next = item;
|
||||
item->prev = item;
|
||||
}
|
||||
|
||||
#define LIST_DELINIT(__item) \
|
||||
do { \
|
||||
(__item)->prev->next = (__item)->next; \
|
||||
(__item)->next->prev = (__item)->prev; \
|
||||
(__item)->next = (__item); \
|
||||
(__item)->prev = (__item); \
|
||||
} while(0)
|
||||
#define LIST_INITHEAD(__item) list_inithead(__item)
|
||||
#define LIST_ADD(__item, __list) list_add(__item, __list)
|
||||
#define LIST_ADDTAIL(__item, __list) list_addtail(__item, __list)
|
||||
#define LIST_REPLACE(__from, __to) list_replace(__from, __to)
|
||||
#define LIST_DEL(__item) list_del(__item)
|
||||
#define LIST_DELINIT(__item) list_delinit(__item)
|
||||
|
||||
#define LIST_ENTRY(__type, __item, __field) \
|
||||
((__type *)(((char *)(__item)) - offsetof(__type, __field)))
|
||||
@@ -114,4 +121,21 @@ struct list_head
|
||||
storage = container_of(pos->member.next, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = storage, storage = container_of(storage->member.next, storage, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \
|
||||
for (pos = container_of((head)->prev, pos, member), \
|
||||
storage = container_of(pos->member.prev, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = storage, storage = container_of(storage->member.prev, storage, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \
|
||||
for (pos = container_of((start), pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = container_of(pos->member.next, pos, member))
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \
|
||||
for (pos = container_of((start), pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = container_of(pos->member.prev, pos, member))
|
||||
|
||||
#endif /*_U_DOUBLE_LIST_H_*/
|
||||
|
99
src/gallium/auxiliary/util/u_draw.c
Normal file
99
src/gallium/auxiliary/util/u_draw.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2011 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* 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, sub license, 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 NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 "util/u_debug.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_format.h"
|
||||
#include "util/u_draw.h"
|
||||
|
||||
|
||||
/**
|
||||
* Returns the largest legal index value for the current set of bound vertex
|
||||
* buffers. Regardless of any other consideration, all vertex lookups need to
|
||||
* be clamped to 0..max_index to prevent an out-of-bound access.
|
||||
*/
|
||||
unsigned
|
||||
util_draw_max_index(
|
||||
const struct pipe_vertex_buffer *vertex_buffers,
|
||||
unsigned nr_vertex_buffers,
|
||||
const struct pipe_vertex_element *vertex_elements,
|
||||
unsigned nr_vertex_elements,
|
||||
const struct pipe_draw_info *info)
|
||||
{
|
||||
unsigned max_index;
|
||||
unsigned i;
|
||||
|
||||
max_index = ~0;
|
||||
for (i = 0; i < nr_vertex_elements; i++) {
|
||||
const struct pipe_vertex_element *element =
|
||||
&vertex_elements[i];
|
||||
const struct pipe_vertex_buffer *buffer =
|
||||
&vertex_buffers[element->vertex_buffer_index];
|
||||
unsigned buffer_size;
|
||||
const struct util_format_description *format_desc;
|
||||
unsigned format_size;
|
||||
|
||||
assert(buffer->buffer->height0 == 1);
|
||||
assert(buffer->buffer->depth0 == 1);
|
||||
buffer_size = buffer->buffer->width0;
|
||||
|
||||
format_desc = util_format_description(element->src_format);
|
||||
assert(format_desc->block.width == 1);
|
||||
assert(format_desc->block.height == 1);
|
||||
assert(format_desc->block.bits % 8 == 0);
|
||||
format_size = format_desc->block.bits/8;
|
||||
|
||||
assert(buffer_size - buffer->buffer_offset <= buffer_size);
|
||||
buffer_size -= buffer->buffer_offset;
|
||||
|
||||
assert(buffer_size - element->src_offset <= buffer_size);
|
||||
buffer_size -= element->src_offset;
|
||||
|
||||
assert(buffer_size - format_size <= buffer_size);
|
||||
buffer_size -= format_size;
|
||||
|
||||
if (buffer->stride != 0) {
|
||||
unsigned buffer_max_index;
|
||||
|
||||
buffer_max_index = buffer_size / buffer->stride;
|
||||
|
||||
if (element->instance_divisor == 0) {
|
||||
/* Per-vertex data */
|
||||
max_index = MIN2(max_index, buffer_max_index);
|
||||
}
|
||||
else {
|
||||
/* Per-instance data. Simply make sure the state tracker didn't
|
||||
* request more instances than those that fit in the buffer */
|
||||
assert((info->start_instance + info->instance_count)/element->instance_divisor
|
||||
<= (buffer_max_index + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return max_index;
|
||||
}
|
@@ -34,6 +34,11 @@
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
static INLINE void
|
||||
util_draw_init_info(struct pipe_draw_info *info)
|
||||
{
|
||||
@@ -136,4 +141,18 @@ util_draw_range_elements(struct pipe_context *pipe,
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
}
|
||||
|
||||
|
||||
unsigned
|
||||
util_draw_max_index(
|
||||
const struct pipe_vertex_buffer *vertex_buffers,
|
||||
unsigned nr_vertex_buffers,
|
||||
const struct pipe_vertex_element *vertex_elements,
|
||||
unsigned nr_vertex_elements,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !U_DRAW_H */
|
||||
|
@@ -88,6 +88,14 @@ PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, r
|
||||
PIPE_FORMAT_A16_UNORM , plain, 1, 1, un16, , , , 000x, rgb
|
||||
PIPE_FORMAT_I16_UNORM , plain, 1, 1, un16, , , , xxxx, rgb
|
||||
PIPE_FORMAT_L16A16_UNORM , plain, 1, 1, un16, un16, , , xxxy, rgb
|
||||
PIPE_FORMAT_A8_SNORM , plain, 1, 1, sn8 , , , , 000x, rgb
|
||||
PIPE_FORMAT_L8_SNORM , plain, 1, 1, sn8 , , , , xxx1, rgb
|
||||
PIPE_FORMAT_L8A8_SNORM , plain, 1, 1, sn8 , sn8 , , , xxxy, rgb
|
||||
PIPE_FORMAT_I8_SNORM , plain, 1, 1, sn8 , , , , xxxx, rgb
|
||||
PIPE_FORMAT_A16_SNORM , plain, 1, 1, sn16, , , , 000x, rgb
|
||||
PIPE_FORMAT_L16_SNORM , plain, 1, 1, sn16, , , , xxx1, rgb
|
||||
PIPE_FORMAT_L16A16_SNORM , plain, 1, 1, sn16, sn16, , , xxxy, rgb
|
||||
PIPE_FORMAT_I16_SNORM , plain, 1, 1, sn16, , , , xxxx, rgb
|
||||
|
||||
# SRGB formats
|
||||
PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 3.
|
@@ -499,7 +499,7 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
|
||||
/* Update the maximum index. */
|
||||
mgr->b.max_index =
|
||||
MIN2(mgr->b.max_index,
|
||||
(vb->buffer->width0 - vb->buffer_offset) / vb->stride);
|
||||
(vb->buffer->width0 - vb->buffer_offset) / vb->stride - 1);
|
||||
}
|
||||
|
||||
for (; i < mgr->b.nr_real_vertex_buffers; i++) {
|
||||
@@ -572,7 +572,11 @@ void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
|
||||
int min_index, max_index;
|
||||
|
||||
min_index = info->min_index - info->index_bias;
|
||||
max_index = info->max_index - info->index_bias;
|
||||
if (info->max_index == ~0) {
|
||||
max_index = mgr->b.max_index;
|
||||
} else {
|
||||
max_index = MIN2(info->max_index - info->index_bias, mgr->b.max_index);
|
||||
}
|
||||
|
||||
/* Translate vertices with non-native layouts or formats. */
|
||||
if (mgr->incompatible_vb_layout || mgr->ve->incompatible_layout) {
|
||||
|
@@ -53,7 +53,7 @@ struct u_vbuf_mgr {
|
||||
int nr_real_vertex_buffers;
|
||||
|
||||
/* Precomputed max_index for hardware vertex buffers. */
|
||||
int max_index;
|
||||
unsigned max_index;
|
||||
|
||||
/* This uploader can optionally be used by the driver.
|
||||
*
|
||||
|
@@ -7,6 +7,30 @@ The rasterizer state controls the rendering of points, lines and triangles.
|
||||
Attributes include polygon culling state, line width, line stipple,
|
||||
multisample state, scissoring and flat/smooth shading.
|
||||
|
||||
Linkage
|
||||
|
||||
clamp_vertex_color
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If set, TGSI_SEMANTIC_COLOR registers are clamped to the [0, 1] range after
|
||||
the execution of the vertex shader, before being passed to the geometry
|
||||
shader or fragment shader.
|
||||
|
||||
OpenGL: glClampColor(GL_CLAMP_VERTEX_COLOR) in GL 3.0 or GL_ARB_color_buffer_float
|
||||
|
||||
D3D11: seems always disabled
|
||||
|
||||
clamp_fragment_color
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Controls whether TGSI_SEMANTIC_COLOR outputs of the fragment shader
|
||||
are clamped to [0, 1].
|
||||
|
||||
OpenGL: glClampColor(GL_CLAMP_FRAGMENT_COLOR) in GL 3.0 or ARB_color_buffer_float
|
||||
|
||||
D3D11: seems always disabled
|
||||
|
||||
|
||||
Shading
|
||||
-------
|
||||
|
||||
|
@@ -54,6 +54,7 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
||||
elem_types[LP_JIT_TEXTURE_WIDTH] =
|
||||
elem_types[LP_JIT_TEXTURE_HEIGHT] =
|
||||
elem_types[LP_JIT_TEXTURE_DEPTH] =
|
||||
elem_types[LP_JIT_TEXTURE_FIRST_LEVEL] =
|
||||
elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32TypeInContext(lc);
|
||||
elem_types[LP_JIT_TEXTURE_ROW_STRIDE] =
|
||||
elem_types[LP_JIT_TEXTURE_IMG_STRIDE] =
|
||||
@@ -81,6 +82,9 @@ lp_jit_create_types(struct llvmpipe_context *lp)
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, depth,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_DEPTH);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, first_level,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_FIRST_LEVEL);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_LAST_LEVEL);
|
||||
|
@@ -50,6 +50,7 @@ struct lp_jit_texture
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t depth;
|
||||
uint32_t first_level;
|
||||
uint32_t last_level;
|
||||
uint32_t row_stride[LP_MAX_TEXTURE_LEVELS];
|
||||
uint32_t img_stride[LP_MAX_TEXTURE_LEVELS];
|
||||
@@ -66,6 +67,7 @@ enum {
|
||||
LP_JIT_TEXTURE_WIDTH = 0,
|
||||
LP_JIT_TEXTURE_HEIGHT,
|
||||
LP_JIT_TEXTURE_DEPTH,
|
||||
LP_JIT_TEXTURE_FIRST_LEVEL,
|
||||
LP_JIT_TEXTURE_LAST_LEVEL,
|
||||
LP_JIT_TEXTURE_ROW_STRIDE,
|
||||
LP_JIT_TEXTURE_IMG_STRIDE,
|
||||
|
@@ -166,6 +166,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_TGSI_INSTANCEID:
|
||||
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
|
||||
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
@@ -653,6 +653,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
|
||||
jit_tex->width = tex->width0;
|
||||
jit_tex->height = tex->height0;
|
||||
jit_tex->depth = tex->depth0;
|
||||
jit_tex->first_level = view->u.tex.first_level;
|
||||
jit_tex->last_level = tex->last_level;
|
||||
|
||||
/* We're referencing the texture's internal data, so save a
|
||||
@@ -663,7 +664,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
|
||||
if (!lp_tex->dt) {
|
||||
/* regular texture - setup array of mipmap level pointers */
|
||||
int j;
|
||||
for (j = 0; j <= tex->last_level; j++) {
|
||||
for (j = view->u.tex.first_level; j <= tex->last_level; j++) {
|
||||
jit_tex->data[j] =
|
||||
llvmpipe_get_texture_image_all(lp_tex, j, LP_TEX_USAGE_READ,
|
||||
LP_TEX_LAYOUT_LINEAR);
|
||||
@@ -677,6 +678,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
|
||||
jit_tex->width = TILE_SIZE/8;
|
||||
jit_tex->height = TILE_SIZE/8;
|
||||
jit_tex->depth = 1;
|
||||
jit_tex->first_level = 0;
|
||||
jit_tex->last_level = 0;
|
||||
jit_tex->row_stride[j] = 0;
|
||||
jit_tex->img_stride[j] = 0;
|
||||
|
@@ -269,7 +269,7 @@ llvmpipe_prepare_vertex_sampling(struct llvmpipe_context *lp,
|
||||
if (!lp_tex->dt) {
|
||||
/* regular texture - setup array of mipmap level pointers */
|
||||
int j;
|
||||
for (j = 0; j <= tex->last_level; j++) {
|
||||
for (j = view->u.tex.first_level; j <= tex->last_level; j++) {
|
||||
data[j] =
|
||||
llvmpipe_get_texture_image_all(lp_tex, j, LP_TEX_USAGE_READ,
|
||||
LP_TEX_LAYOUT_LINEAR);
|
||||
@@ -293,7 +293,7 @@ llvmpipe_prepare_vertex_sampling(struct llvmpipe_context *lp,
|
||||
draw_set_mapped_texture(lp->draw,
|
||||
i,
|
||||
tex->width0, tex->height0, tex->depth0,
|
||||
tex->last_level,
|
||||
view->u.tex.first_level, tex->last_level,
|
||||
row_stride, img_stride, data);
|
||||
}
|
||||
}
|
||||
|
@@ -149,6 +149,7 @@ lp_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
LP_LLVM_TEXTURE_MEMBER(width, LP_JIT_TEXTURE_WIDTH, TRUE)
|
||||
LP_LLVM_TEXTURE_MEMBER(height, LP_JIT_TEXTURE_HEIGHT, TRUE)
|
||||
LP_LLVM_TEXTURE_MEMBER(depth, LP_JIT_TEXTURE_DEPTH, TRUE)
|
||||
LP_LLVM_TEXTURE_MEMBER(first_level, LP_JIT_TEXTURE_FIRST_LEVEL, TRUE)
|
||||
LP_LLVM_TEXTURE_MEMBER(last_level, LP_JIT_TEXTURE_LAST_LEVEL, TRUE)
|
||||
LP_LLVM_TEXTURE_MEMBER(row_stride, LP_JIT_TEXTURE_ROW_STRIDE, FALSE)
|
||||
LP_LLVM_TEXTURE_MEMBER(img_stride, LP_JIT_TEXTURE_IMG_STRIDE, FALSE)
|
||||
@@ -219,6 +220,7 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
|
||||
sampler->dynamic_state.base.width = lp_llvm_texture_width;
|
||||
sampler->dynamic_state.base.height = lp_llvm_texture_height;
|
||||
sampler->dynamic_state.base.depth = lp_llvm_texture_depth;
|
||||
sampler->dynamic_state.base.first_level = lp_llvm_texture_first_level;
|
||||
sampler->dynamic_state.base.last_level = lp_llvm_texture_last_level;
|
||||
sampler->dynamic_state.base.row_stride = lp_llvm_texture_row_stride;
|
||||
sampler->dynamic_state.base.img_stride = lp_llvm_texture_img_stride;
|
||||
|
@@ -337,6 +337,7 @@ static int noop_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TEXTURE_SHADOW_MAP:
|
||||
case PIPE_CAP_TEXTURE_SWIZZLE:
|
||||
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
|
||||
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
|
||||
|
||||
return 1;
|
||||
case PIPE_CAP_DUAL_SOURCE_BLEND:
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "nouveau/nouveau_bo.h"
|
||||
#include "nouveau/nouveau_mm.h"
|
||||
#include "nouveau_winsys.h"
|
||||
#include "nouveau_screen.h"
|
||||
#include "nouveau_fence.h"
|
||||
|
@@ -558,7 +558,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#define NV50_3D_UNK0F8C 0x00000f8c
|
||||
|
||||
#define NV50_3D_UNK0F90 0x00000f90
|
||||
#define NV50_3D_COLOR_MASK_COMMON 0x00000f90
|
||||
|
||||
#define NV50_3D_UNK0F94 0x00000f94
|
||||
|
||||
@@ -1007,7 +1007,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NV50_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
|
||||
#define NV50_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
|
||||
|
||||
#define NV50_3D_UNK133C 0x0000133c
|
||||
#define NV50_3D_BLEND_SEPARATE_ALPHA 0x0000133c
|
||||
|
||||
#define NV50_3D_BLEND_EQUATION_RGB 0x00001340
|
||||
#define NV50_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
|
||||
@@ -1033,7 +1033,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#define NV50_3D_BLEND_FUNC_DST_ALPHA 0x00001358
|
||||
|
||||
#define NV50_3D_UNK135C 0x0000135c
|
||||
#define NV50_3D_BLEND_ENABLE_COMMON 0x0000135c
|
||||
|
||||
#define NV50_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
|
||||
#define NV50_3D_BLEND_ENABLE__ESIZE 0x00000004
|
||||
@@ -1673,7 +1673,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NV50_3D_MAP_SEMANTIC_0_BFC0_ID__SHIFT 8
|
||||
#define NV50_3D_MAP_SEMANTIC_0_COLR_NR__MASK 0x00ff0000
|
||||
#define NV50_3D_MAP_SEMANTIC_0_COLR_NR__SHIFT 16
|
||||
#define NV50_3D_MAP_SEMANTIC_0_CLMP_EN 0xff000000
|
||||
#define NV50_3D_MAP_SEMANTIC_0_CLMP_EN 0x01000000
|
||||
|
||||
#define NV50_3D_MAP_SEMANTIC_1 0x00001908
|
||||
#define NV50_3D_MAP_SEMANTIC_1_CLIP_START__MASK 0x000000ff
|
||||
@@ -1706,7 +1706,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NV50_3D_CULL_FACE_BACK 0x00000405
|
||||
#define NV50_3D_CULL_FACE_FRONT_AND_BACK 0x00000408
|
||||
|
||||
#define NV50_3D_UNK1924 0x00001924
|
||||
#define NV50_3D_LINE_LAST_PIXEL 0x00001924
|
||||
|
||||
#define NVA3_3D_FP_MULTISAMPLE 0x00001928
|
||||
#define NVA3_3D_FP_MULTISAMPLE_EXPORT_SAMPLE_MASK 0x00000001
|
||||
|
@@ -46,6 +46,17 @@ nv50_flush(struct pipe_context *pipe,
|
||||
FIRE_RING(screen->channel);
|
||||
}
|
||||
|
||||
static void
|
||||
nv50_texture_barrier(struct pipe_context *pipe)
|
||||
{
|
||||
struct nouveau_channel *chan = nv50_context(pipe)->screen->base.channel;
|
||||
|
||||
BEGIN_RING(chan, RING_3D(SERIALIZE), 1);
|
||||
OUT_RING (chan, 0);
|
||||
BEGIN_RING(chan, RING_3D(TEX_CACHE_CTL), 1);
|
||||
OUT_RING (chan, 0x20);
|
||||
}
|
||||
|
||||
void
|
||||
nv50_default_flush_notify(struct nouveau_channel *chan)
|
||||
{
|
||||
@@ -125,6 +136,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
|
||||
pipe->clear = nv50_clear;
|
||||
|
||||
pipe->flush = nv50_flush;
|
||||
pipe->texture_barrier = nv50_texture_barrier;
|
||||
|
||||
if (!screen->cur_ctx)
|
||||
screen->cur_ctx = nv50;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#ifndef __NV50_CONTEXT_H__
|
||||
#define __NV50_CONTEXT_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_state.h"
|
||||
@@ -13,6 +12,7 @@
|
||||
|
||||
#include "draw/draw_vertex.h"
|
||||
|
||||
#include "nv50_debug.h"
|
||||
#include "nv50_winsys.h"
|
||||
#include "nv50_stateobj.h"
|
||||
#include "nv50_screen.h"
|
||||
@@ -26,15 +26,6 @@
|
||||
#include "nv50_3d.xml.h"
|
||||
#include "nv50_2d.xml.h"
|
||||
|
||||
#define NOUVEAU_ERR(fmt, args...) \
|
||||
fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args);
|
||||
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
# define NOUVEAU_DBG(args...) printf(args);
|
||||
#else
|
||||
# define NOUVEAU_DBG(args...)
|
||||
#endif
|
||||
|
||||
#define NV50_NEW_BLEND (1 << 0)
|
||||
#define NV50_NEW_RASTERIZER (1 << 1)
|
||||
#define NV50_NEW_ZSA (1 << 2)
|
||||
@@ -80,6 +71,8 @@ struct nv50_context {
|
||||
uint32_t instance_elts; /* bitmask of per-instance elements */
|
||||
uint32_t instance_base;
|
||||
uint32_t interpolant_ctrl;
|
||||
uint32_t semantic_color;
|
||||
uint32_t semantic_psize;
|
||||
int32_t index_bias;
|
||||
boolean prim_restart;
|
||||
boolean point_sprite;
|
||||
@@ -183,7 +176,7 @@ void nv50_fragprog_validate(struct nv50_context *);
|
||||
void nv50_fp_linkage_validate(struct nv50_context *);
|
||||
void nv50_gp_linkage_validate(struct nv50_context *);
|
||||
void nv50_constbufs_validate(struct nv50_context *);
|
||||
void nv50_sprite_coords_validate(struct nv50_context *);
|
||||
void nv50_validate_derived_rs(struct nv50_context *);
|
||||
|
||||
/* nv50_state.c */
|
||||
extern void nv50_init_state_functions(struct nv50_context *);
|
||||
|
25
src/gallium/drivers/nv50/nv50_debug.h
Normal file
25
src/gallium/drivers/nv50/nv50_debug.h
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#ifndef __NV50_DEBUG_H__
|
||||
#define __NV50_DEBUG_H__
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "util/u_debug.h"
|
||||
|
||||
#define NV50_DEBUG_MISC 0x0001
|
||||
#define NV50_DEBUG_SHADER 0x0100
|
||||
#define NV50_DEBUG_PROG_IR 0x0200
|
||||
#define NV50_DEBUG_PROG_RA 0x0400
|
||||
#define NV50_DEBUG_PROG_CFLOW 0x0800
|
||||
#define NV50_DEBUG_PROG_ALL 0x1f00
|
||||
|
||||
#define NV50_DEBUG 0
|
||||
|
||||
#define NOUVEAU_ERR(fmt, args...) \
|
||||
fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args)
|
||||
|
||||
#define NV50_DBGMSG(ch, args...) \
|
||||
if ((NV50_DEBUG) & (NV50_DEBUG_##ch)) \
|
||||
debug_printf(args)
|
||||
|
||||
#endif /* __NV50_DEBUG_H__ */
|
@@ -20,8 +20,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* #define NV50PC_DEBUG */
|
||||
|
||||
#include "nv50_pc.h"
|
||||
#include "nv50_program.h"
|
||||
|
||||
@@ -180,6 +178,7 @@ nv50_op_can_write_flags(uint opcode)
|
||||
switch (opcode) { /* obvious ones like KIL, CALL, etc. not included */
|
||||
case NV_OP_PHI:
|
||||
case NV_OP_MOV:
|
||||
case NV_OP_SELECT:
|
||||
case NV_OP_LINTERP:
|
||||
case NV_OP_PINTERP:
|
||||
case NV_OP_LDA:
|
||||
@@ -367,7 +366,7 @@ nv_print_program(struct nv_pc *pc)
|
||||
nv_print_function(pc->root[i]);
|
||||
}
|
||||
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_CFLOW
|
||||
static void
|
||||
nv_do_print_cfgraph(struct nv_pc *pc, FILE *f, struct nv_basic_block *b)
|
||||
{
|
||||
@@ -425,7 +424,7 @@ nv_print_cfgraph(struct nv_pc *pc, const char *filepath, int subr)
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
#endif /* NV50_DEBUG_PROG_CFLOW */
|
||||
|
||||
static INLINE void
|
||||
nvcg_show_bincode(struct nv_pc *pc)
|
||||
@@ -446,7 +445,7 @@ nv50_emit_program(struct nv_pc *pc)
|
||||
uint32_t *code = pc->emit;
|
||||
int n;
|
||||
|
||||
NV50_DBGMSG("emitting program: size = %u\n", pc->bin_size);
|
||||
NV50_DBGMSG(SHADER, "emitting program: size = %u\n", pc->bin_size);
|
||||
|
||||
for (n = 0; n < pc->num_blocks; ++n) {
|
||||
struct nv_instruction *i;
|
||||
@@ -472,7 +471,7 @@ nv50_emit_program(struct nv_pc *pc)
|
||||
pc->emit = code;
|
||||
code[pc->bin_size / 4 - 1] |= 1;
|
||||
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
nvcg_show_bincode(pc);
|
||||
#endif
|
||||
|
||||
@@ -500,7 +499,7 @@ nv50_generate_code(struct nv50_translation_info *ti)
|
||||
ret = nv50_tgsi_to_nc(pc, ti);
|
||||
if (ret)
|
||||
goto out;
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
nv_print_program(pc);
|
||||
#endif
|
||||
|
||||
@@ -510,7 +509,7 @@ nv50_generate_code(struct nv50_translation_info *ti)
|
||||
ret = nv_pc_exec_pass0(pc);
|
||||
if (ret)
|
||||
goto out;
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
nv_print_program(pc);
|
||||
#endif
|
||||
|
||||
@@ -518,7 +517,7 @@ nv50_generate_code(struct nv50_translation_info *ti)
|
||||
ret = nv_pc_exec_pass1(pc);
|
||||
if (ret)
|
||||
goto out;
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_CFLOW
|
||||
nv_print_program(pc);
|
||||
nv_print_cfgraph(pc, "nv50_shader_cfgraph.dot", 0);
|
||||
#endif
|
||||
@@ -552,7 +551,7 @@ nv50_generate_code(struct nv50_translation_info *ti)
|
||||
|
||||
ti->p->uses_lmem = ti->store_to_memory;
|
||||
|
||||
NV50_DBGMSG("SHADER TRANSLATION - %s\n", ret ? "failure" : "success");
|
||||
NV50_DBGMSG(SHADER, "SHADER TRANSLATION - %s\n", ret ? "failed" : "success");
|
||||
|
||||
out:
|
||||
nv_pc_free_refs(pc);
|
||||
@@ -624,6 +623,9 @@ nvbb_insert_tail(struct nv_basic_block *b, struct nv_instruction *i)
|
||||
|
||||
i->bb = b;
|
||||
b->num_instructions++;
|
||||
|
||||
if (i->prev && i->prev->is_terminator)
|
||||
nv_nvi_permute(i->prev, i);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -669,7 +671,7 @@ nv_nvi_delete(struct nv_instruction *nvi)
|
||||
|
||||
if (nvi == b->phi) {
|
||||
if (nvi->opcode != NV_OP_PHI)
|
||||
NV50_DBGMSG("NOTE: b->phi points to non-PHI instruction\n");
|
||||
NV50_DBGMSG(PROG_IR, "NOTE: b->phi points to non-PHI instruction\n");
|
||||
|
||||
assert(!nvi->prev);
|
||||
if (!nvi->next || nvi->next->opcode != NV_OP_PHI)
|
||||
|
@@ -23,13 +23,7 @@
|
||||
#ifndef __NV50_COMPILER_H__
|
||||
#define __NV50_COMPILER_H__
|
||||
|
||||
#define NV50PC_DEBUG
|
||||
|
||||
#ifdef NV50PC_DEBUG
|
||||
# define NV50_DBGMSG(args...) debug_printf(args)
|
||||
#else
|
||||
# define NV50_DBGMSG(args...)
|
||||
#endif
|
||||
#include "nv50_debug.h"
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_inlines.h"
|
||||
@@ -228,6 +222,8 @@ struct nv_ref {
|
||||
ubyte flags; /* not used yet */
|
||||
};
|
||||
|
||||
#define NV_REF_FLAG_REGALLOC_PRIV (1 << 0)
|
||||
|
||||
struct nv_basic_block;
|
||||
|
||||
struct nv_instruction {
|
||||
@@ -263,6 +259,15 @@ struct nv_instruction {
|
||||
ubyte quadop;
|
||||
};
|
||||
|
||||
static INLINE int
|
||||
nvi_vector_size(struct nv_instruction *nvi)
|
||||
{
|
||||
int i;
|
||||
assert(nvi);
|
||||
for (i = 0; i < 4 && nvi->def[i]; ++i);
|
||||
return i;
|
||||
}
|
||||
|
||||
#define CFG_EDGE_FORWARD 0
|
||||
#define CFG_EDGE_BACK 1
|
||||
#define CFG_EDGE_LOOP_ENTER 2
|
||||
|
@@ -20,8 +20,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* #define NV50PC_DEBUG */
|
||||
|
||||
#include "nv50_pc.h"
|
||||
|
||||
#define DESCEND_ARBITRARY(j, f) \
|
||||
@@ -116,7 +114,7 @@ nvi_isnop(struct nv_instruction *nvi)
|
||||
return FALSE;
|
||||
|
||||
if (nvi->src[0]->value->join->reg.id < 0) {
|
||||
NV50_DBGMSG("nvi_isnop: orphaned value detected\n");
|
||||
NV50_DBGMSG(PROG_IR, "nvi_isnop: orphaned value detected\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -201,7 +199,7 @@ nv_pc_pass_pre_emission(void *priv, struct nv_basic_block *b)
|
||||
}
|
||||
|
||||
if (!b->entry) {
|
||||
NV50_DBGMSG("block %p is now empty\n", b);
|
||||
NV50_DBGMSG(PROG_IR, "block %p is now empty\n", b);
|
||||
} else
|
||||
if (!b->exit->is_long) {
|
||||
assert(n32);
|
||||
@@ -240,7 +238,7 @@ nv_pc_exec_pass2(struct nv_pc *pc)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
NV50_DBGMSG("preparing %u blocks for emission\n", pc->num_blocks);
|
||||
NV50_DBGMSG(PROG_IR, "preparing %u blocks for emission\n", pc->num_blocks);
|
||||
|
||||
pc->num_blocks = 0; /* will reorder bb_list */
|
||||
|
||||
@@ -966,7 +964,8 @@ nv_pass_flatten(struct nv_pass *ctx, struct nv_basic_block *b)
|
||||
|
||||
if (bb_is_if_else_endif(b)) {
|
||||
|
||||
NV50_DBGMSG("pass_flatten: IF/ELSE/ENDIF construct at BB:%i\n", b->id);
|
||||
NV50_DBGMSG(PROG_IR,
|
||||
"pass_flatten: IF/ELSE/ENDIF construct at BB:%i\n", b->id);
|
||||
|
||||
for (n0 = 0, nvi = b->out[0]->entry; nvi; nvi = nvi->next, ++n0)
|
||||
if (!nv50_nvi_can_predicate(nvi))
|
||||
@@ -975,7 +974,7 @@ nv_pass_flatten(struct nv_pass *ctx, struct nv_basic_block *b)
|
||||
for (n1 = 0, nvi = b->out[1]->entry; nvi; nvi = nvi->next, ++n1)
|
||||
if (!nv50_nvi_can_predicate(nvi))
|
||||
break;
|
||||
#ifdef NV50PC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
if (nvi) {
|
||||
debug_printf("cannot predicate: "); nv_print_instruction(nvi);
|
||||
}
|
||||
|
@@ -20,11 +20,11 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* #define NV50PC_DEBUG */
|
||||
|
||||
/* #define NV50_RA_DEBUG_LIVEI */
|
||||
/* #define NV50_RA_DEBUG_LIVE_SETS */
|
||||
/* #define NV50_RA_DEBUG_JOIN */
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_RA
|
||||
# define NV50_RA_DEBUG_LIVEI
|
||||
# define NV50_RA_DEBUG_LIVE_SETS
|
||||
# define NV50_RA_DEBUG_JOIN
|
||||
#endif
|
||||
|
||||
#include "nv50_context.h"
|
||||
#include "nv50_pc.h"
|
||||
@@ -32,14 +32,39 @@
|
||||
#include "util/u_simple_list.h"
|
||||
|
||||
#define NUM_REGISTER_FILES 4
|
||||
#define MAX_REGISTER_COUNT 256
|
||||
|
||||
struct register_set {
|
||||
struct nv_pc *pc;
|
||||
|
||||
uint32_t last[NUM_REGISTER_FILES];
|
||||
uint32_t bits[NUM_REGISTER_FILES][8];
|
||||
uint32_t bits[NUM_REGISTER_FILES][(MAX_REGISTER_COUNT + 31) / 32];
|
||||
};
|
||||
|
||||
/* using OR because a set bit means occupied/unavailable, aliasing is allowed */
|
||||
static void
|
||||
intersect_register_sets(struct register_set *dst,
|
||||
struct register_set *src1, struct register_set *src2)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < NUM_REGISTER_FILES; ++i) {
|
||||
for (j = 0; j < (MAX_REGISTER_COUNT + 31) / 32; ++j)
|
||||
dst->bits[i][j] = src1->bits[i][j] | src2->bits[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mask_register_set(struct register_set *set, uint32_t mask, uint32_t umask)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < NUM_REGISTER_FILES; ++i) {
|
||||
for (j = 0; j < (MAX_REGISTER_COUNT + 31) / 32; ++j)
|
||||
set->bits[i][j] = (set->bits[i][j] | mask) & umask;
|
||||
}
|
||||
}
|
||||
|
||||
struct nv_pc_pass {
|
||||
struct nv_pc *pc;
|
||||
|
||||
@@ -61,11 +86,15 @@ ranges_coalesce(struct nv_range *range)
|
||||
}
|
||||
}
|
||||
|
||||
/* @return: TRUE if @new_range can be freed (i.e. was not reused) */
|
||||
static boolean
|
||||
add_range_ex(struct nv_value *val, int bgn, int end, struct nv_range *new_range)
|
||||
{
|
||||
struct nv_range *range, **nextp = &val->livei;
|
||||
|
||||
if (bgn == end) /* [a, a) is invalid / empty */
|
||||
return TRUE;
|
||||
|
||||
for (range = val->livei; range; range = range->next) {
|
||||
if (end < range->bgn)
|
||||
break; /* insert before */
|
||||
@@ -251,6 +280,8 @@ reg_occupy(struct register_set *set, struct nv_value *val)
|
||||
id <<= s;
|
||||
m = (1 << (1 << s)) - 1;
|
||||
|
||||
assert(s >= 0); /* XXX: remove me */
|
||||
|
||||
set->bits[f][id / 32] |= m << (id % 32);
|
||||
|
||||
if (set->pc->max_reg[f] < id)
|
||||
@@ -286,15 +317,12 @@ join_allowed(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b)
|
||||
if (a->join->reg.id == b->join->reg.id)
|
||||
return TRUE;
|
||||
|
||||
#if 1
|
||||
/* either a or b or both have been assigned */
|
||||
|
||||
if (a->join->reg.id >= 0 && b->join->reg.id >= 0)
|
||||
return FALSE;
|
||||
else
|
||||
if (b->join->reg.id >= 0) {
|
||||
if (a->join->reg.id >= 0)
|
||||
return FALSE;
|
||||
val = a;
|
||||
a = b;
|
||||
b = val;
|
||||
@@ -309,8 +337,6 @@ join_allowed(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
@@ -336,14 +362,14 @@ do_join_values(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b)
|
||||
assert(b->join == a->join);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
static INLINE boolean
|
||||
try_join_values(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b)
|
||||
{
|
||||
if (!join_allowed(ctx, a, b)) {
|
||||
#ifdef NV50_RA_DEBUG_JOIN
|
||||
debug_printf("cannot join %i to %i: not allowed\n", b->n, a->n);
|
||||
#endif
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
if (livei_have_overlap(a->join, b->join)) {
|
||||
#ifdef NV50_RA_DEBUG_JOIN
|
||||
@@ -351,10 +377,27 @@ try_join_values(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b)
|
||||
livei_print(a);
|
||||
livei_print(b);
|
||||
#endif
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
do_join_values(ctx, a, b);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
join_values_nofail(struct nv_pc_pass *ctx,
|
||||
struct nv_value *a, struct nv_value *b, boolean type_only)
|
||||
{
|
||||
if (type_only) {
|
||||
assert(join_allowed(ctx, a, b));
|
||||
do_join_values(ctx, a, b);
|
||||
} else {
|
||||
boolean ok = try_join_values(ctx, a, b);
|
||||
if (!ok) {
|
||||
NOUVEAU_ERR("failed to coalesce values\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE boolean
|
||||
@@ -369,20 +412,32 @@ need_new_else_block(struct nv_basic_block *b, struct nv_basic_block *p)
|
||||
return (b->num_in > 1) && (n == 2);
|
||||
}
|
||||
|
||||
/* Look for the @phi's operand whose definition reaches @b. */
|
||||
static int
|
||||
phi_opnd_for_bb(struct nv_instruction *phi, struct nv_basic_block *b,
|
||||
struct nv_basic_block *tb)
|
||||
{
|
||||
struct nv_ref *srci, *srcj;
|
||||
int i, j;
|
||||
|
||||
for (j = -1, i = 0; i < 4 && phi->src[i]; ++i) {
|
||||
if (!nvbb_reachable_by(b, phi->src[i]->value->insn->bb, tb))
|
||||
for (j = -1, i = 0; i < 6 && phi->src[i]; ++i) {
|
||||
srci = phi->src[i];
|
||||
/* if already replaced, check with original source first */
|
||||
if (srci->flags & NV_REF_FLAG_REGALLOC_PRIV)
|
||||
srci = srci->value->insn->src[0];
|
||||
if (!nvbb_reachable_by(b, srci->value->insn->bb, NULL))
|
||||
continue;
|
||||
/* NOTE: back-edges are ignored by the reachable-by check */
|
||||
if (j < 0 || !nvbb_reachable_by(phi->src[j]->value->insn->bb,
|
||||
phi->src[i]->value->insn->bb, tb))
|
||||
if (j < 0 || !nvbb_reachable_by(srcj->value->insn->bb,
|
||||
srci->value->insn->bb, NULL)) {
|
||||
j = i;
|
||||
srcj = srci;
|
||||
}
|
||||
}
|
||||
if (j >= 0 && nvbb_reachable_by(b, phi->def[0]->insn->bb, NULL))
|
||||
if (!nvbb_reachable_by(srcj->value->insn->bb,
|
||||
phi->def[0]->insn->bb, NULL))
|
||||
j = -1;
|
||||
return j;
|
||||
}
|
||||
|
||||
@@ -429,16 +484,21 @@ pass_generate_phi_movs(struct nv_pc_pass *ctx, struct nv_basic_block *b)
|
||||
ctx->pc->current_block = pn;
|
||||
|
||||
for (i = b->phi; i && i->opcode == NV_OP_PHI; i = i->next) {
|
||||
if ((j = phi_opnd_for_bb(i, p, b)) < 0)
|
||||
continue;
|
||||
val = i->src[j]->value;
|
||||
j = phi_opnd_for_bb(i, p, b);
|
||||
|
||||
if (i->src[j]->flags) {
|
||||
val = val->insn->src[0]->value;
|
||||
while (j < 4 && i->src[j])
|
||||
++j;
|
||||
assert(j < 4);
|
||||
if (j < 0) {
|
||||
val = i->def[0];
|
||||
} else {
|
||||
val = i->src[j]->value;
|
||||
if (i->src[j]->flags & NV_REF_FLAG_REGALLOC_PRIV) {
|
||||
j = -1;
|
||||
/* use original value, we already encountered & replaced it */
|
||||
val = val->insn->src[0]->value;
|
||||
}
|
||||
}
|
||||
if (j < 0) /* need an additional source ? */
|
||||
for (j = 0; j < 5 && i->src[j] && i->src[j]->value != val; ++j);
|
||||
assert(j < 5);
|
||||
|
||||
ni = new_instruction(ctx->pc, NV_OP_MOV);
|
||||
|
||||
@@ -452,11 +512,13 @@ pass_generate_phi_movs(struct nv_pc_pass *ctx, struct nv_basic_block *b)
|
||||
|
||||
nv_reference(ctx->pc, &i->src[j], ni->def[0]);
|
||||
|
||||
i->src[j]->flags = 1;
|
||||
i->src[j]->flags |= NV_REF_FLAG_REGALLOC_PRIV;
|
||||
}
|
||||
|
||||
if (pn != p && pn->exit) {
|
||||
ctx->pc->current_block = b->in[n ? 0 : 1];
|
||||
assert(!b->in[!n]->exit || b->in[!n]->exit->is_terminator);
|
||||
/* insert terminator (branch to ENDIF) in new else block */
|
||||
ctx->pc->current_block = pn;
|
||||
ni = new_instruction(ctx->pc, NV_OP_BRA);
|
||||
ni->target = b;
|
||||
ni->is_terminator = 1;
|
||||
@@ -470,45 +532,50 @@ pass_generate_phi_movs(struct nv_pc_pass *ctx, struct nv_basic_block *b)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define JOIN_MASK_PHI (1 << 0)
|
||||
#define JOIN_MASK_SELECT (1 << 1)
|
||||
#define JOIN_MASK_MOV (1 << 2)
|
||||
#define JOIN_MASK_TEX (1 << 3)
|
||||
|
||||
static int
|
||||
pass_join_values(struct nv_pc_pass *ctx, int iter)
|
||||
pass_join_values(struct nv_pc_pass *ctx, unsigned mask)
|
||||
{
|
||||
int c, n;
|
||||
|
||||
for (n = 0; n < ctx->num_insns; ++n) {
|
||||
struct nv_instruction *i = ctx->insns[n];
|
||||
struct nv_instruction *nvi, *i = ctx->insns[n];
|
||||
|
||||
switch (i->opcode) {
|
||||
case NV_OP_PHI:
|
||||
if (iter != 2)
|
||||
if (!(mask & JOIN_MASK_PHI))
|
||||
break;
|
||||
for (c = 0; c < 4 && i->src[c]; ++c)
|
||||
try_join_values(ctx, i->def[0], i->src[c]->value);
|
||||
for (c = 0; c < 5 && i->src[c]; ++c)
|
||||
join_values_nofail(ctx, i->def[0], i->src[c]->value, FALSE);
|
||||
break;
|
||||
case NV_OP_MOV:
|
||||
if ((iter == 2) && i->src[0]->value->insn &&
|
||||
!nv_is_vector_op(i->src[0]->value->join->insn->opcode))
|
||||
if (!(mask & JOIN_MASK_MOV))
|
||||
break;
|
||||
nvi = i->src[0]->value->join->insn;
|
||||
if (nvi && !nv_is_vector_op(nvi->opcode))
|
||||
try_join_values(ctx, i->def[0], i->src[0]->value);
|
||||
break;
|
||||
case NV_OP_SELECT:
|
||||
if (iter != 1)
|
||||
if (!(mask & JOIN_MASK_SELECT))
|
||||
break;
|
||||
for (c = 0; c < 4 && i->src[c]; ++c) {
|
||||
assert(join_allowed(ctx, i->def[0], i->src[c]->value));
|
||||
do_join_values(ctx, i->def[0], i->src[c]->value);
|
||||
}
|
||||
for (c = 0; c < 5 && i->src[c]; ++c)
|
||||
join_values_nofail(ctx, i->def[0], i->src[c]->value, TRUE);
|
||||
break;
|
||||
case NV_OP_TEX:
|
||||
case NV_OP_TXB:
|
||||
case NV_OP_TXL:
|
||||
case NV_OP_TXQ:
|
||||
if (iter)
|
||||
if (!(mask & JOIN_MASK_TEX))
|
||||
break;
|
||||
for (c = 0; c < 4; ++c) {
|
||||
if (!i->src[c])
|
||||
break;
|
||||
do_join_values(ctx, i->def[c], i->src[c]->value);
|
||||
}
|
||||
/* This should work without conflicts because we always generate
|
||||
* extra MOVs for the sources of a TEX.
|
||||
*/
|
||||
for (c = 0; c < 4 && i->src[c]; ++c)
|
||||
join_values_nofail(ctx, i->def[c], i->src[c]->value, TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -643,15 +710,15 @@ static void collect_live_values(struct nv_basic_block *b, const int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (b->out[0]) {
|
||||
if (b->out[1]) { /* what to do about back-edges ? */
|
||||
if (b->out[0] && b->out_kind[0] != CFG_EDGE_FAKE) {
|
||||
if (b->out[1] && b->out_kind[1] != CFG_EDGE_FAKE) {
|
||||
for (i = 0; i < n; ++i)
|
||||
b->live_set[i] = b->out[0]->live_set[i] | b->out[1]->live_set[i];
|
||||
} else {
|
||||
memcpy(b->live_set, b->out[0]->live_set, n * sizeof(uint32_t));
|
||||
}
|
||||
} else
|
||||
if (b->out[1]) {
|
||||
if (b->out[1] && b->out_kind[1] != CFG_EDGE_FAKE) {
|
||||
memcpy(b->live_set, b->out[1]->live_set, n * sizeof(uint32_t));
|
||||
} else {
|
||||
memset(b->live_set, 0, n * sizeof(uint32_t));
|
||||
@@ -770,8 +837,8 @@ insert_ordered_tail(struct nv_value *list, struct nv_value *nval)
|
||||
struct nv_value *elem;
|
||||
|
||||
for (elem = list->prev;
|
||||
elem != list && elem->livei->bgn > nval->livei->bgn;
|
||||
elem = elem->prev);
|
||||
elem != list && elem->livei->bgn > nval->livei->bgn;
|
||||
elem = elem->prev);
|
||||
/* now elem begins before or at the same time as val */
|
||||
|
||||
nval->prev = elem;
|
||||
@@ -780,44 +847,49 @@ insert_ordered_tail(struct nv_value *list, struct nv_value *nval)
|
||||
elem->next = nval;
|
||||
}
|
||||
|
||||
static void
|
||||
collect_register_values(struct nv_pc_pass *ctx, struct nv_value *head,
|
||||
boolean assigned_only)
|
||||
{
|
||||
struct nv_value *val;
|
||||
int k, n;
|
||||
|
||||
make_empty_list(head);
|
||||
|
||||
for (n = 0; n < ctx->num_insns; ++n) {
|
||||
struct nv_instruction *i = ctx->insns[n];
|
||||
|
||||
/* for joined values, only the representative will have livei != NULL */
|
||||
for (k = 0; k < 4; ++k) {
|
||||
if (i->def[k] && i->def[k]->livei)
|
||||
if (!assigned_only || i->def[k]->reg.id >= 0)
|
||||
insert_ordered_tail(head, i->def[k]);
|
||||
}
|
||||
if (i->flags_def && i->flags_def->livei)
|
||||
if (!assigned_only || i->flags_def->reg.id >= 0)
|
||||
insert_ordered_tail(head, i->flags_def);
|
||||
}
|
||||
|
||||
for (val = head->next; val != head->prev; val = val->next) {
|
||||
assert(val->join == val);
|
||||
assert(val->livei->bgn <= val->next->livei->bgn);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
pass_linear_scan(struct nv_pc_pass *ctx, int iter)
|
||||
{
|
||||
struct nv_instruction *i;
|
||||
struct register_set f, free;
|
||||
int k, n;
|
||||
struct nv_value *cur, *val, *tmp[2];
|
||||
struct nv_value active, inactive, handled, unhandled;
|
||||
|
||||
make_empty_list(&active);
|
||||
make_empty_list(&inactive);
|
||||
make_empty_list(&handled);
|
||||
make_empty_list(&unhandled);
|
||||
|
||||
nv50_ctor_register_set(ctx->pc, &free);
|
||||
|
||||
/* joined values should have range = NULL and thus not be added;
|
||||
* also, fixed memory values won't be added because they're not
|
||||
* def'd, just used
|
||||
*/
|
||||
for (n = 0; n < ctx->num_insns; ++n) {
|
||||
i = ctx->insns[n];
|
||||
|
||||
for (k = 0; k < 4; ++k) {
|
||||
if (i->def[k] && i->def[k]->livei)
|
||||
insert_ordered_tail(&unhandled, i->def[k]);
|
||||
else
|
||||
if (0 && i->def[k])
|
||||
debug_printf("skipping def'd value %i: no livei\n", i->def[k]->n);
|
||||
}
|
||||
if (i->flags_def && i->flags_def->livei)
|
||||
insert_ordered_tail(&unhandled, i->flags_def);
|
||||
}
|
||||
|
||||
for (val = unhandled.next; val != unhandled.prev; val = val->next) {
|
||||
assert(val->join == val);
|
||||
assert(val->livei->bgn <= val->next->livei->bgn);
|
||||
}
|
||||
collect_register_values(ctx, &unhandled, FALSE);
|
||||
|
||||
foreach_s(cur, tmp[0], &unhandled) {
|
||||
remove_from_list(cur);
|
||||
@@ -854,13 +926,7 @@ pass_linear_scan(struct nv_pc_pass *ctx, int iter)
|
||||
reg_occupy(&f, val);
|
||||
|
||||
if (cur->reg.id < 0) {
|
||||
boolean mem = FALSE;
|
||||
|
||||
if (nv_is_vector_op(cur->insn->opcode))
|
||||
mem = !reg_assign(&f, &cur->insn->def[0], 4);
|
||||
else
|
||||
if (iter)
|
||||
mem = !reg_assign(&f, &cur, 1);
|
||||
boolean mem = !reg_assign(&f, &cur, 1);
|
||||
|
||||
if (mem) {
|
||||
NOUVEAU_ERR("out of registers\n");
|
||||
@@ -874,13 +940,80 @@ pass_linear_scan(struct nv_pc_pass *ctx, int iter)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate values defined by instructions such as TEX, which have to be
|
||||
* assigned to consecutive registers.
|
||||
* Linear scan doesn't really work here since the values can have different
|
||||
* live intervals.
|
||||
*/
|
||||
static int
|
||||
pass_allocate_constrained_values(struct nv_pc_pass *ctx)
|
||||
{
|
||||
struct nv_value regvals, *val;
|
||||
struct nv_instruction *i;
|
||||
struct nv_value *defs[4];
|
||||
struct register_set regs[4];
|
||||
int n, vsize, c;
|
||||
uint32_t mask;
|
||||
boolean mem;
|
||||
|
||||
collect_register_values(ctx, ®vals, TRUE);
|
||||
|
||||
for (n = 0; n < ctx->num_insns; ++n) {
|
||||
i = ctx->insns[n];
|
||||
vsize = nvi_vector_size(i);
|
||||
if (!(vsize > 1))
|
||||
continue;
|
||||
assert(vsize <= 4);
|
||||
for (c = 0; c < vsize; ++c)
|
||||
defs[c] = i->def[c]->join;
|
||||
|
||||
if (defs[0]->reg.id >= 0) {
|
||||
for (c = 1; c < vsize; ++c)
|
||||
assert(defs[c]->reg.id >= 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Compute registers available for this "vector" of consecutive registers.
|
||||
* Each value (component) has its own independent live interval.
|
||||
*/
|
||||
for (c = 0; c < vsize; ++c) {
|
||||
nv50_ctor_register_set(ctx->pc, ®s[c]);
|
||||
|
||||
foreach(val, ®vals) {
|
||||
if (val->reg.id >= 0 && livei_have_overlap(val, defs[c]))
|
||||
reg_occupy(®s[c], val);
|
||||
}
|
||||
/* Only 32 bit GPRs will be allocated here, but register set
|
||||
* granularity for GPRs is 16 bit.
|
||||
*/
|
||||
mask = 0x03030303;
|
||||
if (vsize == 2) /* granularity is 2 and not 4 */
|
||||
mask |= 0x03030303 << 4;
|
||||
mask_register_set(®s[c], 0, mask << (c * 2));
|
||||
|
||||
if (defs[c]->livei)
|
||||
insert_ordered_tail(®vals, defs[c]);
|
||||
}
|
||||
for (c = 1; c < vsize; ++c)
|
||||
intersect_register_sets(®s[0], ®s[0], ®s[c]);
|
||||
|
||||
mem = !reg_assign(®s[0], &defs[0], vsize);
|
||||
|
||||
if (mem) {
|
||||
NOUVEAU_ERR("out of registers\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nv_pc_pass1(struct nv_pc *pc, struct nv_basic_block *root)
|
||||
{
|
||||
struct nv_pc_pass *ctx;
|
||||
int i, ret;
|
||||
|
||||
NV50_DBGMSG("REGISTER ALLOCATION - entering\n");
|
||||
NV50_DBGMSG(PROG_RA, "REGISTER ALLOCATION - entering\n");
|
||||
|
||||
ctx = CALLOC_STRUCT(nv_pc_pass);
|
||||
if (!ctx)
|
||||
@@ -923,16 +1056,16 @@ nv_pc_pass1(struct nv_pc *pc, struct nv_basic_block *root)
|
||||
livei_print(&pc->values[i]);
|
||||
#endif
|
||||
|
||||
ret = pass_join_values(ctx, 0);
|
||||
ret = pass_join_values(ctx, JOIN_MASK_PHI);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = pass_linear_scan(ctx, 0);
|
||||
ret = pass_join_values(ctx, JOIN_MASK_SELECT | JOIN_MASK_TEX);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = pass_join_values(ctx, 1);
|
||||
ret = pass_join_values(ctx, JOIN_MASK_MOV);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = pass_join_values(ctx, 2);
|
||||
ret = pass_allocate_constrained_values(ctx);
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = pass_linear_scan(ctx, 1);
|
||||
@@ -942,7 +1075,7 @@ nv_pc_pass1(struct nv_pc *pc, struct nv_basic_block *root)
|
||||
for (i = 0; i < pc->num_values; ++i)
|
||||
livei_release(&pc->values[i]);
|
||||
|
||||
NV50_DBGMSG("REGISTER ALLOCATION - leaving\n");
|
||||
NV50_DBGMSG(PROG_RA, "REGISTER ALLOCATION - leaving\n");
|
||||
|
||||
out:
|
||||
FREE(ctx->insns);
|
||||
|
@@ -20,8 +20,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* #define NV50_PROGRAM_DEBUG */
|
||||
|
||||
#include "nv50_program.h"
|
||||
#include "nv50_pc.h"
|
||||
#include "nv50_context.h"
|
||||
@@ -486,7 +484,7 @@ nv50_fragprog_prepare(struct nv50_translation_info *ti)
|
||||
++nintp;
|
||||
}
|
||||
|
||||
p->fp.colors = (1 << 24) | 4; /* CLAMP, FFC0_ID = 4 */
|
||||
p->fp.colors = 4 << NV50_3D_MAP_SEMANTIC_0_FFC0_ID__SHIFT; /* after HPOS */
|
||||
|
||||
for (i = 0; i < p->in_nr; ++i) {
|
||||
int j = p->in[i].id;
|
||||
@@ -564,7 +562,7 @@ nv50_prog_scan(struct nv50_translation_info *ti)
|
||||
|
||||
tgsi_scan_shader(p->pipe.tokens, &ti->scan);
|
||||
|
||||
#ifdef NV50_PROGRAM_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
tgsi_dump(p->pipe.tokens, 0);
|
||||
#endif
|
||||
|
||||
|
@@ -108,6 +108,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
return 8;
|
||||
case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
|
||||
return 1;
|
||||
case PIPE_CAP_TIMER_QUERY:
|
||||
case PIPE_CAP_OCCLUSION_QUERY:
|
||||
return 1;
|
||||
@@ -129,6 +131,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_PRIMITIVE_RESTART:
|
||||
case PIPE_CAP_TGSI_INSTANCEID:
|
||||
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
|
||||
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
|
||||
return 1;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
@@ -417,6 +420,10 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
|
||||
OUT_RING (chan, NV50_3D_MULTISAMPLE_MODE_MS1);
|
||||
BEGIN_RING(chan, RING_3D(MULTISAMPLE_CTRL), 1);
|
||||
OUT_RING (chan, 0);
|
||||
BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
|
||||
OUT_RING (chan, 0);
|
||||
BEGIN_RING(chan, RING_3D(BLEND_SEPARATE_ALPHA), 1);
|
||||
OUT_RING (chan, 1);
|
||||
|
||||
BEGIN_RING(chan, RING_3D(SCREEN_Y_CONTROL), 1);
|
||||
OUT_RING (chan, 0);
|
||||
|
@@ -226,7 +226,7 @@ nv50_gmtyprog_validate(struct nv50_context *nv50)
|
||||
OUT_RING (chan, gp->code_base);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nv50_sprite_coords_validate(struct nv50_context *nv50)
|
||||
{
|
||||
struct nouveau_channel *chan = nv50->screen->base.channel;
|
||||
@@ -282,6 +282,39 @@ nv50_sprite_coords_validate(struct nv50_context *nv50)
|
||||
OUT_RINGp (chan, pntc, 8);
|
||||
}
|
||||
|
||||
/* Validate state derived from shaders and the rasterizer cso. */
|
||||
void
|
||||
nv50_validate_derived_rs(struct nv50_context *nv50)
|
||||
{
|
||||
struct nouveau_channel *chan = nv50->screen->base.channel;
|
||||
uint32_t color, psize;
|
||||
|
||||
nv50_sprite_coords_validate(nv50);
|
||||
|
||||
if (nv50->dirty & NV50_NEW_FRAGPROG)
|
||||
return;
|
||||
psize = nv50->state.semantic_psize & ~NV50_3D_MAP_SEMANTIC_3_PTSZ_EN__MASK;
|
||||
color = nv50->state.semantic_color & ~NV50_3D_MAP_SEMANTIC_0_CLMP_EN;
|
||||
|
||||
if (nv50->rast->pipe.clamp_vertex_color)
|
||||
color |= NV50_3D_MAP_SEMANTIC_0_CLMP_EN;
|
||||
|
||||
if (color != nv50->state.semantic_color) {
|
||||
nv50->state.semantic_color = color;
|
||||
BEGIN_RING(chan, RING_3D(MAP_SEMANTIC_0), 1);
|
||||
OUT_RING (chan, color);
|
||||
}
|
||||
|
||||
if (nv50->rast->pipe.point_size_per_vertex)
|
||||
psize |= NV50_3D_MAP_SEMANTIC_3_PTSZ_EN__MASK;
|
||||
|
||||
if (psize != nv50->state.semantic_psize) {
|
||||
nv50->state.semantic_psize = psize;
|
||||
BEGIN_RING(chan, RING_3D(MAP_SEMANTIC_3), 1);
|
||||
OUT_RING (chan, psize);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
nv50_vec4_map(uint8_t *map, int mid, uint32_t lin[4],
|
||||
struct nv50_varying *in, struct nv50_varying *out)
|
||||
@@ -372,6 +405,9 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
|
||||
map[m++] = vp->vp.psiz;
|
||||
}
|
||||
|
||||
if (nv50->rast->pipe.clamp_vertex_color)
|
||||
colors |= NV50_3D_MAP_SEMANTIC_0_CLMP_EN;
|
||||
|
||||
n = (m + 3) / 4;
|
||||
assert(m <= 64);
|
||||
|
||||
@@ -404,6 +440,9 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
|
||||
|
||||
nv50->state.interpolant_ctrl = interp;
|
||||
|
||||
nv50->state.semantic_color = colors;
|
||||
nv50->state.semantic_psize = psiz;
|
||||
|
||||
BEGIN_RING(chan, RING_3D(NOPERSPECTIVE_BITMAP(0)), 4);
|
||||
OUT_RINGp (chan, lin, 4);
|
||||
|
||||
|
@@ -97,8 +97,14 @@ nv50_blend_state_create(struct pipe_context *pipe,
|
||||
|
||||
so->pipe = *cso;
|
||||
|
||||
SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
|
||||
SB_BEGIN_3D(so, COLOR_MASK_COMMON, 1);
|
||||
SB_DATA (so, !cso->independent_blend_enable);
|
||||
|
||||
SB_BEGIN_3D(so, BLEND_ENABLE_COMMON, 1);
|
||||
SB_DATA (so, !cso->independent_blend_enable);
|
||||
|
||||
if (cso->independent_blend_enable) {
|
||||
SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
|
||||
for (i = 0; i < 8; ++i) {
|
||||
SB_DATA(so, cso->rt[i].blend_enable);
|
||||
if (cso->rt[i].blend_enable)
|
||||
@@ -121,8 +127,8 @@ nv50_blend_state_create(struct pipe_context *pipe,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 8; ++i)
|
||||
SB_DATA(so, cso->rt[0].blend_enable);
|
||||
SB_BEGIN_3D(so, BLEND_ENABLE(0), 1);
|
||||
SB_DATA (so, cso->rt[0].blend_enable);
|
||||
}
|
||||
|
||||
if (emit_common_func) {
|
||||
@@ -145,17 +151,16 @@ nv50_blend_state_create(struct pipe_context *pipe,
|
||||
SB_DATA (so, 0);
|
||||
}
|
||||
|
||||
SB_BEGIN_3D(so, COLOR_MASK(0), 8);
|
||||
if (cso->independent_blend_enable) {
|
||||
SB_BEGIN_3D(so, COLOR_MASK(0), 8);
|
||||
for (i = 0; i < 8; ++i)
|
||||
SB_DATA(so, nv50_colormask(cso->rt[i].colormask));
|
||||
} else {
|
||||
uint32_t cmask = nv50_colormask(cso->rt[0].colormask);
|
||||
for (i = 0; i < 8; ++i)
|
||||
SB_DATA(so, cmask);
|
||||
SB_BEGIN_3D(so, COLOR_MASK(0), 1);
|
||||
SB_DATA (so, nv50_colormask(cso->rt[0].colormask));
|
||||
}
|
||||
|
||||
assert(so->size < (sizeof(so->state) / sizeof(so->state[0])));
|
||||
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
|
||||
return so;
|
||||
}
|
||||
|
||||
@@ -174,6 +179,7 @@ nv50_blend_state_delete(struct pipe_context *pipe, void *hwcso)
|
||||
FREE(hwcso);
|
||||
}
|
||||
|
||||
/* NOTE: ignoring line_last_pixel, using FALSE (set on screen init) */
|
||||
static void *
|
||||
nv50_rasterizer_state_create(struct pipe_context *pipe,
|
||||
const struct pipe_rasterizer_state *cso)
|
||||
@@ -198,6 +204,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
|
||||
SB_BEGIN_3D(so, VERTEX_TWO_SIDE_ENABLE, 1);
|
||||
SB_DATA (so, cso->light_twoside);
|
||||
|
||||
SB_BEGIN_3D(so, FRAG_COLOR_CLAMP_EN, 1);
|
||||
SB_DATA (so, cso->clamp_fragment_color ? 0x11111111 : 0x00000000);
|
||||
|
||||
SB_BEGIN_3D(so, LINE_WIDTH, 1);
|
||||
SB_DATA (so, fui(cso->line_width));
|
||||
SB_BEGIN_3D(so, LINE_SMOOTH_ENABLE, 1);
|
||||
@@ -258,7 +267,7 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
|
||||
SB_DATA (so, fui(cso->offset_units * 2.0f));
|
||||
}
|
||||
|
||||
assert(so->size < (sizeof(so->state) / sizeof(so->state[0])));
|
||||
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
|
||||
return (void *)so;
|
||||
}
|
||||
|
||||
@@ -337,7 +346,7 @@ nv50_zsa_state_create(struct pipe_context *pipe,
|
||||
SB_DATA (so, 0);
|
||||
}
|
||||
|
||||
assert(so->size < (sizeof(so->state) / sizeof(so->state[0])));
|
||||
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
|
||||
return (void *)so;
|
||||
}
|
||||
|
||||
|
@@ -309,7 +309,7 @@ static struct state_validate {
|
||||
{ nv50_fp_linkage_validate, NV50_NEW_FRAGPROG | NV50_NEW_VERTPROG |
|
||||
NV50_NEW_GMTYPROG },
|
||||
{ nv50_gp_linkage_validate, NV50_NEW_GMTYPROG | NV50_NEW_VERTPROG },
|
||||
{ nv50_sprite_coords_validate, NV50_NEW_FRAGPROG | NV50_NEW_RASTERIZER |
|
||||
{ nv50_validate_derived_rs, NV50_NEW_FRAGPROG | NV50_NEW_RASTERIZER |
|
||||
NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG },
|
||||
{ nv50_constbufs_validate, NV50_NEW_CONSTBUF },
|
||||
{ nv50_validate_textures, NV50_NEW_TEXTURES },
|
||||
|
@@ -21,13 +21,13 @@
|
||||
struct nv50_blend_stateobj {
|
||||
struct pipe_blend_state pipe;
|
||||
int size;
|
||||
uint32_t state[78];
|
||||
uint32_t state[82]; // TODO: allocate less if !independent_blend_enable
|
||||
};
|
||||
|
||||
struct nv50_rasterizer_stateobj {
|
||||
struct pipe_rasterizer_state pipe;
|
||||
int size;
|
||||
uint32_t state[40];
|
||||
uint32_t state[42];
|
||||
};
|
||||
|
||||
struct nv50_zsa_stateobj {
|
||||
|
@@ -20,8 +20,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* #define NV50_TGSI2NC_DEBUG */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nv50_context.h"
|
||||
@@ -213,7 +211,7 @@ static INLINE void
|
||||
bld_warn_uninitialized(struct bld_context *bld, int kind,
|
||||
struct bld_value_stack *stk, struct nv_basic_block *b)
|
||||
{
|
||||
#ifdef NV50_TGSI2NC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
long i = (stk - &bld->tvs[0][0]) / 4;
|
||||
long c = (stk - &bld->tvs[0][0]) & 3;
|
||||
|
||||
@@ -273,6 +271,12 @@ fetch_by_bb(struct bld_value_stack *stack,
|
||||
fetch_by_bb(stack, vals, n, b->in[i]);
|
||||
}
|
||||
|
||||
static INLINE boolean
|
||||
nvbb_is_terminated(struct nv_basic_block *bb)
|
||||
{
|
||||
return bb->exit && bb->exit->is_terminator;
|
||||
}
|
||||
|
||||
static INLINE struct nv_value *
|
||||
bld_load_imm_u32(struct bld_context *bld, uint32_t u);
|
||||
|
||||
@@ -1556,7 +1560,7 @@ bld_instruction(struct bld_context *bld,
|
||||
int c;
|
||||
uint opcode = translate_opcode(insn->Instruction.Opcode);
|
||||
|
||||
#ifdef NV50_TGSI2NC_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
debug_printf("bld_instruction:"); tgsi_dump_instruction(insn, 1);
|
||||
#endif
|
||||
|
||||
@@ -1727,8 +1731,7 @@ bld_instruction(struct bld_context *bld,
|
||||
{
|
||||
struct nv_basic_block *b = new_basic_block(bld->pc);
|
||||
|
||||
if (bld->pc->current_block->exit &&
|
||||
!bld->pc->current_block->exit->is_terminator)
|
||||
if (!nvbb_is_terminated(bld->pc->current_block))
|
||||
bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, b, FALSE);
|
||||
|
||||
--bld->cond_lvl;
|
||||
@@ -1800,7 +1803,8 @@ bld_instruction(struct bld_context *bld,
|
||||
{
|
||||
struct nv_basic_block *bb = bld->loop_bb[bld->loop_lvl - 1];
|
||||
|
||||
bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, bb, FALSE);
|
||||
if (!nvbb_is_terminated(bld->pc->current_block))
|
||||
bld_flow(bld, NV_OP_BRA, NV_CC_TR, NULL, bb, FALSE);
|
||||
|
||||
nvbb_attach_block(bld->pc->current_block, bb, CFG_EDGE_BACK);
|
||||
|
||||
|
@@ -82,6 +82,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#define NVC0_3D_SERIALIZE 0x00000110
|
||||
|
||||
#define NVC0_3D_LINE_WIDTH_SEPARATE 0x0000020c
|
||||
|
||||
#define NVC0_3D_EARLY_FRAGMENT_TESTS 0x00000210
|
||||
|
||||
#define NVC0_3D_MEM_BARRIER 0x0000021c
|
||||
@@ -342,10 +344,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#define NVC0_3D_VERTEX_RUNOUT_ADDRESS_LOW 0x00000f88
|
||||
|
||||
#define NVC0_3D_COLOR_MASK_COMMON 0x00000f90
|
||||
|
||||
#define NVC0_3D_DEPTH_BOUNDS(i0) (0x00000f9c + 0x4*(i0))
|
||||
#define NVC0_3D_DEPTH_BOUNDS__ESIZE 0x00000004
|
||||
#define NVC0_3D_DEPTH_BOUNDS__LEN 0x00000002
|
||||
|
||||
#define NVC0_3D_RT_SEPARATE_FRAG_DATA 0x00000fac
|
||||
|
||||
#define NVC0_3D_MSAA_MASK(i0) (0x00000fbc + 0x4*(i0))
|
||||
#define NVC0_3D_MSAA_MASK__ESIZE 0x00000004
|
||||
#define NVC0_3D_MSAA_MASK__LEN 0x00000004
|
||||
@@ -561,6 +567,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NVC0_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
|
||||
#define NVC0_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
|
||||
|
||||
#define NVC0_3D_BLEND_SEPARATE_ALPHA 0x0000133c
|
||||
|
||||
#define NVC0_3D_BLEND_EQUATION_RGB 0x00001340
|
||||
#define NVC0_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
|
||||
#define NVC0_3D_BLEND_EQUATION_RGB_MIN 0x00008007
|
||||
@@ -583,6 +591,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#define NVC0_3D_BLEND_FUNC_DST_ALPHA 0x00001358
|
||||
|
||||
#define NVC0_3D_BLEND_ENABLE_COMMON 0x0000135c
|
||||
|
||||
#define NVC0_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
|
||||
#define NVC0_3D_BLEND_ENABLE__ESIZE 0x00000004
|
||||
#define NVC0_3D_BLEND_ENABLE__LEN 0x00000008
|
||||
@@ -651,7 +661,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NVC0_3D_SCREEN_Y_CONTROL_Y_NEGATE 0x00000001
|
||||
#define NVC0_3D_SCREEN_Y_CONTROL_TRIANGLE_RAST_FLIP 0x00000010
|
||||
|
||||
#define NVC0_3D_LINE_WIDTH 0x000013b0
|
||||
#define NVC0_3D_LINE_WIDTH_SMOOTH 0x000013b0
|
||||
|
||||
#define NVC0_3D_LINE_WIDTH_ALIASED 0x000013b4
|
||||
|
||||
#define NVC0_3D_GP_VERTEX_OUTPUT_COUNT 0x00001420
|
||||
#define NVC0_3D_GP_VERTEX_OUTPUT_COUNT__MIN 0x00000001
|
||||
@@ -977,6 +989,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NVC0_3D_CULL_FACE_BACK 0x00000405
|
||||
#define NVC0_3D_CULL_FACE_FRONT_AND_BACK 0x00000408
|
||||
|
||||
#define NVC0_3D_LINE_LAST_PIXEL 0x00001924
|
||||
|
||||
#define NVC0_3D_VIEWPORT_TRANSFORM_EN 0x0000192c
|
||||
|
||||
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL 0x0000193c
|
||||
@@ -1220,8 +1234,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NVC0_3D_TFB_VARYING_LOCS__ESIZE 0x00000004
|
||||
#define NVC0_3D_TFB_VARYING_LOCS__LEN 0x00000020
|
||||
|
||||
#define NVC0_3D_COLOR_MASK_BROADCAST 0x00003808
|
||||
|
||||
#define NVC0_3D_VERTEX_ARRAY_SELECT 0x00003820
|
||||
|
||||
#define NVC0_3D_BLEND_ENABLES 0x00003858
|
||||
|
@@ -46,6 +46,15 @@ nvc0_flush(struct pipe_context *pipe,
|
||||
FIRE_RING(screen->channel);
|
||||
}
|
||||
|
||||
static void
|
||||
nvc0_texture_barrier(struct pipe_context *pipe)
|
||||
{
|
||||
struct nouveau_channel *chan = nvc0_context(pipe)->screen->base.channel;
|
||||
|
||||
IMMED_RING(chan, RING_3D(SERIALIZE), 0);
|
||||
IMMED_RING(chan, RING_3D(TEX_CACHE_CTL), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
nvc0_context_unreference_resources(struct nvc0_context *nvc0)
|
||||
{
|
||||
@@ -128,6 +137,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
|
||||
pipe->clear = nvc0_clear;
|
||||
|
||||
pipe->flush = nvc0_flush;
|
||||
pipe->texture_barrier = nvc0_texture_barrier;
|
||||
|
||||
if (!screen->cur_ctx)
|
||||
screen->cur_ctx = nvc0;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#ifndef __NVC0_CONTEXT_H__
|
||||
#define __NVC0_CONTEXT_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_state.h"
|
||||
@@ -13,6 +12,7 @@
|
||||
|
||||
#include "draw/draw_vertex.h"
|
||||
|
||||
#include "nv50/nv50_debug.h"
|
||||
#include "nvc0_winsys.h"
|
||||
#include "nvc0_stateobj.h"
|
||||
#include "nvc0_screen.h"
|
||||
@@ -26,15 +26,6 @@
|
||||
#include "nvc0_2d.xml.h"
|
||||
#include "nvc0_m2mf.xml.h"
|
||||
|
||||
#define NOUVEAU_ERR(fmt, args...) \
|
||||
fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args);
|
||||
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
# define NOUVEAU_DBG(args...) printf(args);
|
||||
#else
|
||||
# define NOUVEAU_DBG(args...)
|
||||
#endif
|
||||
|
||||
#define NVC0_NEW_BLEND (1 << 0)
|
||||
#define NVC0_NEW_RASTERIZER (1 << 1)
|
||||
#define NVC0_NEW_ZSA (1 << 2)
|
||||
|
@@ -68,19 +68,6 @@ static const uint32_t nvc0_9097_vertex_array_select[] =
|
||||
0x00001841, /* 0x0b: send $r3 */
|
||||
};
|
||||
|
||||
static const uint32_t nvc0_9097_color_mask_brdc[] =
|
||||
{
|
||||
0x05a00021, /* maddr [NVC0_3D_COLOR_MASK(0), increment = 4] */
|
||||
0x00000841, /* send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
0x000008c1, /* exit send $r1 */
|
||||
0x00000841, /* send $r1 */
|
||||
};
|
||||
|
||||
/*
|
||||
* [GL_POLYGON_MODE_FRONT] = arg;
|
||||
*
|
||||
|
@@ -20,8 +20,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#define NOUVEAU_DEBUG 1
|
||||
|
||||
#include "nvc0_pc.h"
|
||||
#include "nvc0_program.h"
|
||||
|
||||
@@ -262,7 +260,7 @@ nvc0_print_program(struct nv_pc *pc)
|
||||
nvc0_print_function(pc->root[i]);
|
||||
}
|
||||
|
||||
#if NOUVEAU_DEBUG > 1
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_CFLOW
|
||||
static void
|
||||
nv_do_print_cfgraph(struct nv_pc *pc, FILE *f, struct nv_basic_block *b)
|
||||
{
|
||||
@@ -327,7 +325,7 @@ nvc0_pc_print_binary(struct nv_pc *pc)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
NOUVEAU_DBG("nvc0_pc_print_binary(%u ops)\n", pc->emit_size / 8);
|
||||
NV50_DBGMSG(SHADER, "nvc0_pc_print_binary(%u ops)\n", pc->emit_size / 8);
|
||||
|
||||
for (i = 0; i < pc->emit_size / 4; i += 2) {
|
||||
debug_printf("0x%08x ", pc->emit[i + 0]);
|
||||
@@ -344,7 +342,7 @@ nvc0_emit_program(struct nv_pc *pc)
|
||||
uint32_t *code = pc->emit;
|
||||
int n;
|
||||
|
||||
NOUVEAU_DBG("emitting program: size = %u\n", pc->emit_size);
|
||||
NV50_DBGMSG(SHADER, "emitting program: size = %u\n", pc->emit_size);
|
||||
|
||||
pc->emit_pos = 0;
|
||||
for (n = 0; n < pc->num_blocks; ++n) {
|
||||
@@ -365,11 +363,10 @@ nvc0_emit_program(struct nv_pc *pc)
|
||||
|
||||
pc->emit = code;
|
||||
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
nvc0_pc_print_binary(pc);
|
||||
#else
|
||||
debug_printf("not printing binary\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -396,7 +393,7 @@ nvc0_generate_code(struct nvc0_translation_info *ti)
|
||||
ret = nvc0_tgsi_to_nc(pc, ti);
|
||||
if (ret)
|
||||
goto out;
|
||||
#if NOUVEAU_DEBUG > 1
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
nvc0_print_program(pc);
|
||||
#endif
|
||||
|
||||
@@ -406,7 +403,7 @@ nvc0_generate_code(struct nvc0_translation_info *ti)
|
||||
ret = nvc0_pc_exec_pass0(pc);
|
||||
if (ret)
|
||||
goto out;
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
nvc0_print_program(pc);
|
||||
#endif
|
||||
|
||||
@@ -414,7 +411,7 @@ nvc0_generate_code(struct nvc0_translation_info *ti)
|
||||
ret = nvc0_pc_exec_pass1(pc);
|
||||
if (ret)
|
||||
goto out;
|
||||
#if NOUVEAU_DEBUG > 1
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_CFLOW
|
||||
nvc0_print_program(pc);
|
||||
nv_print_cfgraph(pc, "nvc0_shader_cfgraph.dot", 0);
|
||||
#endif
|
||||
@@ -444,7 +441,7 @@ nvc0_generate_code(struct nvc0_translation_info *ti)
|
||||
ti->prog->relocs = pc->reloc_entries;
|
||||
ti->prog->num_relocs = pc->num_relocs;
|
||||
|
||||
NOUVEAU_DBG("SHADER TRANSLATION - %s\n", ret ? "failure" : "success");
|
||||
NV50_DBGMSG(SHADER, "SHADER TRANSLATION - %s\n", ret ? "failed" : "success");
|
||||
|
||||
out:
|
||||
nv_pc_free_refs(pc);
|
||||
@@ -573,7 +570,7 @@ nvc0_insn_delete(struct nv_instruction *nvi)
|
||||
|
||||
if (nvi == b->phi) {
|
||||
if (nvi->opcode != NV_OP_PHI)
|
||||
NOUVEAU_DBG("NOTE: b->phi points to non-PHI instruction\n");
|
||||
NV50_DBGMSG(PROG_IR, "NOTE: b->phi points to non-PHI instruction\n");
|
||||
|
||||
assert(!nvi->prev);
|
||||
if (!nvi->next || nvi->next->opcode != NV_OP_PHI)
|
||||
|
@@ -23,20 +23,7 @@
|
||||
#ifndef __NVC0_COMPILER_H__
|
||||
#define __NVC0_COMPILER_H__
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef NOUVEAU_DBG
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
# define NOUVEAU_DBG(args...) debug_printf(args);
|
||||
#else
|
||||
# define NOUVEAU_DBG(args...)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NOUVEAU_ERR
|
||||
#define NOUVEAU_ERR(fmt, args...) \
|
||||
fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args);
|
||||
#endif
|
||||
#include "nv50/nv50_debug.h"
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_inlines.h"
|
||||
|
@@ -715,6 +715,10 @@ emit_interp(struct nv_pc *pc, struct nv_instruction *i)
|
||||
if (i->opcode == NV_OP_PINTERP) {
|
||||
pc->emit[0] |= 0x040;
|
||||
SID(pc, i->src[1], 26);
|
||||
|
||||
if (i->src[0]->value->reg.address >= 0x280 &&
|
||||
i->src[0]->value->reg.address <= 0x29c)
|
||||
pc->emit[0] |= 0x080; /* XXX: ? */
|
||||
} else {
|
||||
SID(pc, NULL, 26);
|
||||
}
|
||||
@@ -875,7 +879,9 @@ emit_st(struct nv_pc *pc, struct nv_instruction *i)
|
||||
void
|
||||
nvc0_emit_instruction(struct nv_pc *pc, struct nv_instruction *i)
|
||||
{
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
debug_printf("EMIT: "); nvc0_print_instruction(i);
|
||||
#endif
|
||||
|
||||
switch (i->opcode) {
|
||||
case NV_OP_VFETCH:
|
||||
|
@@ -115,7 +115,7 @@ inst_is_noop(struct nv_instruction *nvi)
|
||||
return FALSE;
|
||||
|
||||
if (nvi->src[0]->value->join->reg.id < 0) {
|
||||
NOUVEAU_DBG("inst_is_noop: orphaned value detected\n");
|
||||
NV50_DBGMSG(PROG_IR, "inst_is_noop: orphaned value detected\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ nv_pc_pass_pre_emission(void *priv, struct nv_basic_block *b)
|
||||
}
|
||||
pc->emit_size += b->emit_size;
|
||||
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_IR
|
||||
if (!b->entry)
|
||||
debug_printf("BB:%i is now empty\n", b->id);
|
||||
else
|
||||
@@ -206,7 +206,7 @@ nvc0_pc_exec_pass2(struct nv_pc *pc)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
NOUVEAU_DBG("preparing %u blocks for emission\n", pc->num_blocks);
|
||||
NV50_DBGMSG(PROG_IR, "preparing %u blocks for emission\n", pc->num_blocks);
|
||||
|
||||
pc->num_blocks = 0; /* will reorder bb_list */
|
||||
|
||||
|
@@ -20,11 +20,11 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#define NOUVEAU_DEBUG 1
|
||||
|
||||
/* #define NVC0_RA_DEBUG_LIVEI */
|
||||
/* #define NVC0_RA_DEBUG_LIVE_SETS */
|
||||
/* #define NVC0_RA_DEBUG_JOIN */
|
||||
#if NV50_DEBUG & NV50_DEBUG_PROG_RA
|
||||
# define NVC0_RA_DEBUG_LIVEI
|
||||
# define NVC0_RA_DEBUG_LIVE_SETS
|
||||
# define NVC0_RA_DEBUG_JOIN
|
||||
#endif
|
||||
|
||||
#include "nvc0_pc.h"
|
||||
#include "util/u_simple_list.h"
|
||||
@@ -504,7 +504,9 @@ pass_generate_phi_movs(struct nv_pc_pass *ctx, struct nv_basic_block *b)
|
||||
}
|
||||
|
||||
if (pn != p && pn->exit) {
|
||||
ctx->pc->current_block = b->in[n ? 0 : 1];
|
||||
assert(!b->in[!n]->exit || b->in[!n]->exit->terminator);
|
||||
/* insert terminator (branch to ENDIF) in new else block */
|
||||
ctx->pc->current_block = pn;
|
||||
ni = new_instruction(ctx->pc, NV_OP_BRA);
|
||||
ni->target = b;
|
||||
ni->terminator = 1;
|
||||
@@ -965,7 +967,7 @@ nv_pc_pass1(struct nv_pc *pc, struct nv_basic_block *root)
|
||||
struct nv_pc_pass *ctx;
|
||||
int i, ret;
|
||||
|
||||
NOUVEAU_DBG("REGISTER ALLOCATION - entering\n");
|
||||
NV50_DBGMSG(PROG_RA, "REGISTER ALLOCATION - entering\n");
|
||||
|
||||
ctx = CALLOC_STRUCT(nv_pc_pass);
|
||||
if (!ctx)
|
||||
@@ -1031,7 +1033,7 @@ nv_pc_pass1(struct nv_pc *pc, struct nv_basic_block *root)
|
||||
for (i = 0; i < pc->num_values; ++i)
|
||||
livei_release(&pc->values[i]);
|
||||
|
||||
NOUVEAU_DBG("REGISTER ALLOCATION - leaving\n");
|
||||
NV50_DBGMSG(PROG_RA, "REGISTER ALLOCATION - leaving\n");
|
||||
|
||||
out:
|
||||
FREE(ctx->insns);
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
#include "pipe/p_defines.h"
|
||||
|
||||
#define NOUVEAU_DEBUG
|
||||
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
#include "tgsi/tgsi_util.h"
|
||||
#include "tgsi/tgsi_dump.h"
|
||||
@@ -224,6 +222,9 @@ nvc0_interp_mode(const struct tgsi_full_declaration *decl)
|
||||
else
|
||||
if (decl->Declaration.Interpolate == TGSI_INTERPOLATE_PERSPECTIVE)
|
||||
mode = NVC0_INTERP_PERSPECTIVE;
|
||||
else
|
||||
if (decl->Declaration.Semantic && decl->Semantic.Name == TGSI_SEMANTIC_COLOR)
|
||||
mode = NVC0_INTERP_PERSPECTIVE;
|
||||
else
|
||||
mode = NVC0_INTERP_LINEAR;
|
||||
|
||||
@@ -574,7 +575,7 @@ nvc0_prog_scan(struct nvc0_translation_info *ti)
|
||||
int ret;
|
||||
unsigned i;
|
||||
|
||||
#ifdef NOUVEAU_DEBUG
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
tgsi_dump(prog->pipe.tokens, 0);
|
||||
#endif
|
||||
|
||||
@@ -691,12 +692,12 @@ nvc0_program_translate(struct nvc0_program *prog)
|
||||
if (ret)
|
||||
NOUVEAU_ERR("shader translation failed\n");
|
||||
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < sizeof(prog->hdr) / sizeof(prog->hdr[0]); ++i)
|
||||
debug_printf("HDR[%02lx] = 0x%08x\n",
|
||||
i * sizeof(prog->hdr[0]), prog->hdr[i]);
|
||||
}
|
||||
#if NV50_DEBUG & NV50_DEBUG_SHADER
|
||||
unsigned i;
|
||||
for (i = 0; i < sizeof(prog->hdr) / sizeof(prog->hdr[0]); ++i)
|
||||
debug_printf("HDR[%02lx] = 0x%08x\n",
|
||||
i * sizeof(prog->hdr[0]), prog->hdr[i]);
|
||||
#endif
|
||||
|
||||
out:
|
||||
if (ti->immd32)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user