Compare commits
32 Commits
mesa-20.1.
...
mesa-8.0-r
Author | SHA1 | Date | |
---|---|---|---|
|
c85402aba9 | ||
|
9c81e4eed1 | ||
|
daa2545508 | ||
|
baaa30ad52 | ||
|
b178514e24 | ||
|
48e72b6605 | ||
|
89fdeab1a2 | ||
|
504eaa1212 | ||
|
399b9799de | ||
|
2c1ee157c7 | ||
|
8b7f6de8b9 | ||
|
eb8063361e | ||
|
b26682e12e | ||
|
deff0244ed | ||
|
830688b36a | ||
|
cd56917a50 | ||
|
867fdbd36d | ||
|
d7a4eb331b | ||
|
ee5b35c568 | ||
|
a748a9f8ee | ||
|
f1ff449120 | ||
|
af33e16eab | ||
|
89a1e7caf4 | ||
|
ad77e2fb78 | ||
|
1e51d4b4f6 | ||
|
0b9e6d2017 | ||
|
57665cb09e | ||
|
372b7f1d35 | ||
|
4b86bd1347 | ||
|
7465c5d976 | ||
|
9489ae8938 | ||
|
b8af8b83cf |
2
Makefile
2
Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
PACKAGE_VERSION=8.0-devel
|
||||
PACKAGE_VERSION=8.0-rc1
|
||||
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
|
||||
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
||||
|
||||
|
@@ -70,7 +70,6 @@ INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel)
|
||||
NOUVEAU_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_nouveau)
|
||||
NOUVEAU_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_nouveau)
|
||||
|
||||
LIBDRM_RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
|
||||
LIBDRM_RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
|
||||
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
|
||||
RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
|
||||
RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
|
||||
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)
|
||||
|
@@ -662,7 +662,7 @@ AC_ARG_ENABLE([gallium_gbm],
|
||||
[enable_gallium_gbm=auto])
|
||||
|
||||
# Option for Gallium drivers
|
||||
GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
|
||||
GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
|
||||
|
||||
AC_ARG_WITH([gallium-drivers],
|
||||
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
|
||||
|
@@ -63,6 +63,7 @@ a:visited {
|
||||
<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>
|
||||
<LI><A href="vmware-guest.html" target="MainFrame">VMware SVGA3D guest driver</a>
|
||||
<LI><A href="postprocess.html" target="MainFrame">Gallium post-processing</A>
|
||||
<LI><A href="viewperf.html" target="MainFrame">Viewperf Issues</A>
|
||||
</ul>
|
||||
|
@@ -132,12 +132,26 @@ June 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
|
||||
and OpenGL Shading Language.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
2008: Keith Whitwell and other Tungsten Graphics employees develop
|
||||
<a href="http://en.wikipedia.org/wiki/Gallium3D" target="_parent">Gallium</a>
|
||||
- a new GPU abstraction layer. The latest Mesa drivers are based on
|
||||
Gallium and other APIs such as OpenVG are implemented on top of Gallium.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
|
||||
the XFree86 and X.org X servers within the
|
||||
<A href="http://dri.freedesktop.org/" target="_parent">DRI project</A>.
|
||||
I continue to enhance Mesa with new extensions and features.
|
||||
February 2012: Mesa 8.0 is released, implementing the OpenGL 3.0 specification
|
||||
and version 1.30 of the OpenGL Shading Language.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Ongoing: Mesa is the OpenGL implementation for several types of hardware
|
||||
made by Intel, AMD and NVIDIA, plus the VMware virtual GPU.
|
||||
There's also several software-based renderers: swrast (the legacy
|
||||
Mesa rasterizer), softpipe (a gallium reference driver) and llvmpipe
|
||||
(LLVM/JIT-based high-speed rasterizer).
|
||||
Work continues on the drivers and core Mesa to implement newer versions
|
||||
of the OpenGL specification.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -151,6 +165,15 @@ of the OpenGL specification is implemented.
|
||||
</p>
|
||||
|
||||
|
||||
<H2>Version 8.x features</H2>
|
||||
<p>
|
||||
Version 8.x of Mesa implements the OpenGL 3.0 API.
|
||||
The developers at Intel deserve a lot of credit for implementing most
|
||||
of the OpenGL 3.0 features in core Mesa, the GLSL compiler as well as
|
||||
the i965 driver.
|
||||
</p>
|
||||
|
||||
|
||||
<H2>Version 7.x features</H2>
|
||||
<p>
|
||||
Version 7.x of Mesa implements the OpenGL 2.1 API. The main feature
|
||||
|
194
docs/vmware-guest.html
Normal file
194
docs/vmware-guest.html
Normal file
@@ -0,0 +1,194 @@
|
||||
<html>
|
||||
|
||||
<title>VMware guest GL driver</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<h1>VMware guest GL driver</h1>
|
||||
|
||||
<p>
|
||||
This page describes how to build, install and use the VMware guest GL driver
|
||||
(aka the SVGA or SVGA3D driver) for Linux using the latest source code.
|
||||
This driver gives a Linux virtual machine access to the host's GPU for
|
||||
hardware-accelerated 3D.
|
||||
VMware Workstation running on Linux or Windows and VMware Fusion running on
|
||||
MacOS are all supported.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
End users shouldn't have to go through all these steps once the driver is
|
||||
included in newer Linux distributions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For more information about the X components see these wiki pages at x.org:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="http://wiki.x.org/wiki/vmware" target="_parent">
|
||||
Driver Overview</a>
|
||||
<li><a href="http://wiki.x.org/wiki/vmware/vmware3D" target="_parent">
|
||||
xf86-video-vmware Details</a>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Components</h2>
|
||||
|
||||
The components involved in this include:
|
||||
<ul>
|
||||
<li>Linux kernel module: vmwgfx
|
||||
<li>X server 2D driver: xf86-video-vmware
|
||||
<li>User-space libdrm library
|
||||
<li>Mesa/gallium OpenGL driver: "svga"
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Prerequisites</h2>
|
||||
|
||||
<ul>
|
||||
<li>Kernel version at least 2.6.25
|
||||
<li>Xserver version at least 1.7
|
||||
<li>Ubuntu: For ubuntu you need to install a number of build dependencies.
|
||||
<pre>
|
||||
sudo apt-get install git-core
|
||||
sudo apt-get install automake libtool libpthread-stubs0-dev
|
||||
sudo apt-get install xserver-xorg-dev x11proto-xinerama-dev
|
||||
sudo apt-get build-dep libgl1-mesa-dri libxcb-glx0-dev
|
||||
</pre>
|
||||
<li>Fedora: For Fedora you also need to install a number of build dependencies.
|
||||
<pre>
|
||||
sudo yum install mesa-libGL-devel xorg-x11-server-devel xorg-x11-util-macros
|
||||
sudo yum install automake gcc libtool expat-devel kernel-devel git-core
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Depending on your Linux distro, other packages may be needed.
|
||||
The configure scripts should tell you what's missing.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h2>Getting the Latest Source Code</h2>
|
||||
|
||||
Begin by saving your current directory location:
|
||||
<pre>
|
||||
export TOP=$PWD
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li>Mesa/Gallium master branch. This code is used to build libGL, and the direct rendering svga driver for libGL, vmwgfx_dri.so, and the X acceleration library libxatracker.so.x.x.x.
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||
</pre>
|
||||
<li>VMware Linux guest kernel module. Note that this repo contains the complete DRM and TTM code. The vmware-specific driver is really only the files prefixed with vmwgfx.
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/vmwgfx
|
||||
</pre>
|
||||
|
||||
<li>libdrm, A user-space library that interfaces with drm. Most distros ship with this driver. Safest bet is really to replace the system one. Optionally you can point LIBDRM_CFLAGS and LIBDRM_LIBS to the libdrm-2.4.22 package in toolchain. But here, we replace:
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/drm
|
||||
</pre>
|
||||
<li>xf86-video-vmware. The chainloading driver, vmware_drv.so, the legacy driver vmwlegacy_drv.so, and the vmwgfx driver vmwgfx_drv.so.
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-vmware
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Building the Code</h2>
|
||||
|
||||
<ul>
|
||||
<li>Build libdrm: If you're on a 32-bit system, you should skip the --libdir configure option. Note also the comment about toolchain libdrm above.
|
||||
<pre>
|
||||
cd $TOP/drm
|
||||
./autogen.sh --prefix=/usr --enable-vmwgfx-experimental-api --libdir=/usr/lib64
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
<li>Build Mesa and the vmwgfx_dri.so driver, the vmwgfx_drv.so xorg driver, the X acceleration library libxatracker.
|
||||
The vmwgfx_dri.so is used by the OpenGL libraries during direct rendering,
|
||||
and by the Xorg server during accelerated indirect GL rendering.
|
||||
The libxatracker library is used exclusively by the X server to do render,
|
||||
copy and video acceleration:
|
||||
<br>
|
||||
The following configure options doesn't build the EGL system.
|
||||
<br>
|
||||
As before, if you're on a 32-bit system, you should skip the --libdir
|
||||
configure option.
|
||||
<pre>
|
||||
cd $TOP/mesa
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
|
||||
Note that you may have to install other packages that Mesa depends upon
|
||||
if they're not installed in your system. You should be told what's missing.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<li>xf86-video-vmware: Now, once libxatracker is installed, we proceed with building and replacing the current Xorg driver. First check if your system is 32- or 64-bit. If you're building for a 32-bit system, you will not be needing the --libdir=/usr/lib64 option to autogen.
|
||||
<pre>
|
||||
cd $TOP/xf86-video-vmware
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
<li>vmwgfx kernel module. First make sure that any old version of this kernel module is removed from the system by issuing
|
||||
<pre>
|
||||
sudo rm /lib/modules/`uname -r`/kernel/drivers/gpu/drm/vmwgfx.ko*
|
||||
</pre>
|
||||
Then
|
||||
<pre>
|
||||
cd $TOP/vmwgfx
|
||||
make
|
||||
sudo make install
|
||||
sudo cp 00-vmwgfx.rules /etc/udev/rules.d
|
||||
sudo depmod -ae
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
|
||||
Now try to load the kernel module by issuing
|
||||
<pre>
|
||||
sudo modprobe vmwgfx</pre>
|
||||
Then type
|
||||
<pre>
|
||||
dmesg</pre>
|
||||
to watch the debug output. It should contain a number of lines prefixed with "[vmwgfx]".
|
||||
|
||||
<p>
|
||||
Then restart the Xserver (or reboot).
|
||||
The lines starting with "vmwlegacy" or "VMWARE" in the file /var/log/Xorg.0.log
|
||||
should now have been replaced with lines starting with "vmwgfx", indicating that
|
||||
the new Xorg driver is in use.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Running OpenGL Programs</h2>
|
||||
|
||||
<p>
|
||||
In a shell, run 'glxinfo' and look for the following to verify that the
|
||||
driver is working:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
OpenGL vendor string: VMware, Inc.
|
||||
OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE;
|
||||
OpenGL version string: 2.1 Mesa 8.0
|
||||
</pre>
|
||||
|
||||
If you don't see this, try setting this environment variable:
|
||||
<pre>
|
||||
export LIBGL_DEBUG=verbose</pre>
|
||||
then rerun glxinfo and examine the output for error messages.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -505,8 +505,6 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
|
||||
case PIPE_SHADER_CAP_SUBROUTINES:
|
||||
return 0;
|
||||
case PIPE_SHADER_CAP_INTEGERS:
|
||||
if (rscreen->chip_class == EVERGREEN)
|
||||
return 1;
|
||||
return 0;
|
||||
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
|
||||
return 16;
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#include "sp_fence.h"
|
||||
#include "sp_public.h"
|
||||
|
||||
DEBUG_GET_ONCE_BOOL_OPTION(use_llvm, "SOFTPIPE_USE_LLVM", FALSE);
|
||||
DEBUG_GET_ONCE_BOOL_OPTION(use_llvm, "SOFTPIPE_USE_LLVM", FALSE)
|
||||
|
||||
static const char *
|
||||
softpipe_get_vendor(struct pipe_screen *screen)
|
||||
@@ -121,7 +121,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
|
||||
return 1;
|
||||
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
|
||||
return 64; /* matches core Mesa defaults */
|
||||
return 256; /* for GL3 */
|
||||
case PIPE_CAP_MIN_TEXEL_OFFSET:
|
||||
return -8;
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
|
@@ -454,16 +454,19 @@ svga_texture_create(struct pipe_screen *screen,
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX: Never pass the SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot
|
||||
* Note: Previously we never passed the
|
||||
* SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot
|
||||
* know beforehand whether a texture will be used as a rendertarget or not
|
||||
* and it always requests PIPE_BIND_RENDER_TARGET, therefore
|
||||
* passing the SVGA3D_SURFACE_HINT_RENDERTARGET here defeats its purpose.
|
||||
*
|
||||
* However, this was changed since other state trackers
|
||||
* (XA for example) uses it accurately and certain device versions
|
||||
* relies on it in certain situations to render correctly.
|
||||
*/
|
||||
#if 0
|
||||
if((template->bind & PIPE_BIND_RENDER_TARGET) &&
|
||||
!util_format_is_s3tc(template->format))
|
||||
tex->key.flags |= SVGA3D_SURFACE_HINT_RENDERTARGET;
|
||||
#endif
|
||||
|
||||
if(template->bind & PIPE_BIND_DEPTH_STENCIL)
|
||||
tex->key.flags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;
|
||||
|
@@ -477,7 +477,7 @@ emit_clip_planes( struct svga_context *svga,
|
||||
|
||||
/* TODO: just emit directly from svga_set_clip_state()?
|
||||
*/
|
||||
for (i = 0; i < 6; i++) {
|
||||
for (i = 0; i < SVGA3D_MAX_CLIP_PLANES; i++) {
|
||||
/* need to express the plane in D3D-style coordinate space.
|
||||
* GL coords get converted to D3D coords with the matrix:
|
||||
* [ 1 0 0 0 ]
|
||||
|
@@ -244,8 +244,8 @@ static int emit_rss( struct svga_context *svga,
|
||||
EMIT_RS_FLOAT( svga, bias, DEPTHBIAS, fail );
|
||||
}
|
||||
|
||||
if (dirty & SVGA_NEW_CLIP) {
|
||||
/* the number of clip planes is how many planes to enable */
|
||||
if (dirty & SVGA_NEW_RAST) {
|
||||
/* bitmask of the enabled clip planes */
|
||||
unsigned enabled = svga->curr.rast->templ.clip_plane_enable;
|
||||
EMIT_RS( svga, enabled, CLIPPLANEENABLE, fail );
|
||||
}
|
||||
@@ -285,7 +285,6 @@ struct svga_tracked_state svga_hw_rss =
|
||||
|
||||
(SVGA_NEW_BLEND |
|
||||
SVGA_NEW_BLEND_COLOR |
|
||||
SVGA_NEW_CLIP |
|
||||
SVGA_NEW_DEPTH_STENCIL |
|
||||
SVGA_NEW_STENCIL_REF |
|
||||
SVGA_NEW_RAST |
|
||||
|
@@ -36,8 +36,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define XA_TRACKER_VERSION_MAJOR 0
|
||||
#define XA_TRACKER_VERSION_MINOR 6
|
||||
#define XA_TRACKER_VERSION_MAJOR 1
|
||||
#define XA_TRACKER_VERSION_MINOR 0
|
||||
#define XA_TRACKER_VERSION_PATCH 0
|
||||
|
||||
#define XA_FLAG_SHARED (1 << 0)
|
||||
|
@@ -3,8 +3,8 @@ include $(TOP)/configs/current
|
||||
|
||||
##### MACROS #####
|
||||
|
||||
XA_MAJOR = 0
|
||||
XA_MINOR = 6
|
||||
XA_MAJOR = 1
|
||||
XA_MINOR = 0
|
||||
XA_TINY = 0
|
||||
XA_CFLAGS = -Wall -pedantic
|
||||
|
||||
|
@@ -2920,8 +2920,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
|
||||
|
||||
/* setup texcoords (XXX what about border?) */
|
||||
setup_texture_coords(faceTarget,
|
||||
0.0f, 0.0f, /* width, height never used here */
|
||||
slice,
|
||||
0, 0, /* width, height never used here */
|
||||
verts[0].tex,
|
||||
verts[1].tex,
|
||||
verts[2].tex,
|
||||
@@ -3071,6 +3071,8 @@ get_temp_image_type(struct gl_context *ctx, GLenum baseFormat)
|
||||
switch (baseFormat) {
|
||||
case GL_RGBA:
|
||||
case GL_RGB:
|
||||
case GL_RG:
|
||||
case GL_RED:
|
||||
case GL_ALPHA:
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
@@ -3086,7 +3088,8 @@ get_temp_image_type(struct gl_context *ctx, GLenum baseFormat)
|
||||
case GL_DEPTH_STENCIL:
|
||||
return GL_UNSIGNED_INT_24_8;
|
||||
default:
|
||||
_mesa_problem(ctx, "Unexpected format in get_temp_image_type()");
|
||||
_mesa_problem(ctx, "Unexpected format %d in get_temp_image_type()",
|
||||
baseFormat);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -376,8 +376,8 @@ static void emit_depthbuffer(struct brw_context *brw)
|
||||
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
|
||||
offset);
|
||||
OUT_BATCH((BRW_SURFACE_MIPMAPLAYOUT_BELOW << 1) |
|
||||
((depth_irb->Base.Width - 1) << 6) |
|
||||
((depth_irb->Base.Height - 1) << 19));
|
||||
(((depth_irb->Base.Width + tile_x)- 1) << 6) |
|
||||
(((depth_irb->Base.Height + tile_y) - 1) << 19));
|
||||
OUT_BATCH(0);
|
||||
|
||||
if (intel->is_g4x || intel->gen >= 5)
|
||||
|
@@ -109,6 +109,24 @@ static const uint32_t gen6_hiz_meta_save =
|
||||
|
||||
MESA_META_SELECT_FEEDBACK;
|
||||
|
||||
static void
|
||||
gen6_hiz_get_framebuffer_enum(struct gl_context *ctx,
|
||||
GLenum *bind_enum,
|
||||
GLenum *get_enum)
|
||||
{
|
||||
/* If the blit framebuffer extension isn't supported then Mesa will
|
||||
report an error if we try to bind GL_DRAW_FRAMEBUFFER. However in
|
||||
that case it should be safe to just save and restore
|
||||
GL_FRAMEBUFFER instead. */
|
||||
if (ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL) {
|
||||
*bind_enum = GL_DRAW_FRAMEBUFFER;
|
||||
*get_enum = GL_DRAW_FRAMEBUFFER_BINDING;
|
||||
} else {
|
||||
*bind_enum = GL_FRAMEBUFFER;
|
||||
*get_enum = GL_FRAMEBUFFER_BINDING;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize static data needed for HiZ operations.
|
||||
*/
|
||||
@@ -117,10 +135,13 @@ gen6_hiz_init(struct brw_context *brw)
|
||||
{
|
||||
struct gl_context *ctx = &brw->intel.ctx;
|
||||
struct brw_hiz_state *hiz = &brw->hiz;
|
||||
GLenum fb_bind_enum, fb_get_enum;
|
||||
|
||||
if (hiz->fbo != 0)
|
||||
return;
|
||||
|
||||
gen6_hiz_get_framebuffer_enum(ctx, &fb_bind_enum, &fb_get_enum);
|
||||
|
||||
/* Create depthbuffer.
|
||||
*
|
||||
* Until glRenderbufferStorage is called, the renderbuffer hash table
|
||||
@@ -139,8 +160,8 @@ gen6_hiz_init(struct brw_context *brw)
|
||||
|
||||
/* Setup FBO. */
|
||||
_mesa_GenFramebuffersEXT(1, &hiz->fbo);
|
||||
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, hiz->fbo);
|
||||
_mesa_FramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER,
|
||||
_mesa_BindFramebufferEXT(fb_bind_enum, hiz->fbo);
|
||||
_mesa_FramebufferRenderbufferEXT(fb_bind_enum,
|
||||
GL_DEPTH_ATTACHMENT,
|
||||
GL_RENDERBUFFER,
|
||||
hiz->depth_rb->Name);
|
||||
@@ -241,6 +262,7 @@ gen6_resolve_slice(struct intel_context *intel,
|
||||
struct gl_context *ctx = &intel->ctx;
|
||||
struct brw_context *brw = brw_context(ctx);
|
||||
struct brw_hiz_state *hiz = &brw->hiz;
|
||||
GLenum fb_bind_enum, fb_get_enum;
|
||||
|
||||
/* Do not recurse. */
|
||||
assert(!brw->hiz.op);
|
||||
@@ -250,11 +272,13 @@ gen6_resolve_slice(struct intel_context *intel,
|
||||
assert(level <= mt->last_level);
|
||||
assert(layer < mt->level[level].depth);
|
||||
|
||||
gen6_hiz_get_framebuffer_enum(ctx, &fb_bind_enum, &fb_get_enum);
|
||||
|
||||
/* Save state. */
|
||||
GLint save_drawbuffer;
|
||||
GLint save_renderbuffer;
|
||||
_mesa_meta_begin(ctx, gen6_hiz_meta_save);
|
||||
_mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &save_drawbuffer);
|
||||
_mesa_GetIntegerv(fb_get_enum, &save_drawbuffer);
|
||||
_mesa_GetIntegerv(GL_RENDERBUFFER_BINDING, &save_renderbuffer);
|
||||
|
||||
/* Initialize context data for HiZ operations. */
|
||||
@@ -272,7 +296,7 @@ gen6_resolve_slice(struct intel_context *intel,
|
||||
|
||||
/* Setup FBO. */
|
||||
gen6_hiz_setup_depth_buffer(brw, mt, level, layer);
|
||||
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, hiz->fbo);
|
||||
_mesa_BindFramebufferEXT(fb_bind_enum, hiz->fbo);
|
||||
|
||||
|
||||
/* A rectangle primitive (3DPRIM_RECTLIST) consists of only three vertices.
|
||||
@@ -316,7 +340,7 @@ gen6_resolve_slice(struct intel_context *intel,
|
||||
*/
|
||||
gen6_hiz_teardown_depth_buffer(hiz->depth_rb);
|
||||
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER, save_renderbuffer);
|
||||
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, save_drawbuffer);
|
||||
_mesa_BindFramebufferEXT(fb_bind_enum, save_drawbuffer);
|
||||
_mesa_meta_end(ctx);
|
||||
}
|
||||
|
||||
|
@@ -107,8 +107,8 @@ static void emit_depthbuffer(struct brw_context *brw)
|
||||
OUT_RELOC(region->bo,
|
||||
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
|
||||
offset);
|
||||
OUT_BATCH(((drb->Base.Width - 1) << 4) |
|
||||
((drb->Base.Height - 1) << 18));
|
||||
OUT_BATCH((((drb->Base.Width + tile_x) - 1) << 4) |
|
||||
(((drb->Base.Height + tile_y) - 1) << 18));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(tile_x | (tile_y << 16));
|
||||
OUT_BATCH(0);
|
||||
|
@@ -132,6 +132,15 @@ intel_map_renderbuffer(struct gl_context *ctx,
|
||||
void *map;
|
||||
int stride;
|
||||
|
||||
if (!irb && rb->Data) {
|
||||
/* this is a malloc'd renderbuffer (accum buffer) */
|
||||
GLint bpp = _mesa_get_format_bytes(rb->Format);
|
||||
GLint rowStride = rb->RowStride * bpp;
|
||||
*out_map = (GLubyte *) rb->Data + y * rowStride + x * bpp;
|
||||
*out_stride = rowStride;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We sometimes get called with this by our intel_span.c usage. */
|
||||
if (!irb->mt) {
|
||||
*out_map = NULL;
|
||||
@@ -176,6 +185,12 @@ intel_unmap_renderbuffer(struct gl_context *ctx,
|
||||
DBG("%s: rb %d (%s)\n", __FUNCTION__,
|
||||
rb->Name, _mesa_get_format_name(rb->Format));
|
||||
|
||||
if (!irb && rb->Data) {
|
||||
/* this is a malloc'd renderbuffer (accum buffer) */
|
||||
/* nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
intel_miptree_unmap(intel, irb->mt, irb->mt_level, irb->mt_layer);
|
||||
}
|
||||
|
||||
@@ -636,10 +651,10 @@ intel_render_texture(struct gl_context * ctx,
|
||||
struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
|
||||
struct intel_texture_image *intel_image = intel_texture_image(image);
|
||||
struct intel_mipmap_tree *mt = intel_image->mt;
|
||||
int layer;
|
||||
|
||||
(void) fb;
|
||||
|
||||
int layer;
|
||||
if (att->CubeMapFace > 0) {
|
||||
assert(att->Zoffset == 0);
|
||||
layer = att->CubeMapFace;
|
||||
|
@@ -56,6 +56,8 @@
|
||||
#include "vbo/vbo.h"
|
||||
|
||||
|
||||
#define OSMESA_RENDERBUFFER_CLASS 0x053
|
||||
|
||||
|
||||
/**
|
||||
* OSMesa rendering context, derived from core Mesa struct gl_context.
|
||||
@@ -721,9 +723,8 @@ osmesa_choose_line( struct gl_context *ctx )
|
||||
static void
|
||||
compute_row_addresses( OSMesaContext osmesa )
|
||||
{
|
||||
GLint bytesPerPixel, bytesPerRow, i;
|
||||
GLint bytesPerRow, i;
|
||||
GLubyte *origin = (GLubyte *) osmesa->rb->Data;
|
||||
GLint bpc; /* bytes per channel */
|
||||
GLint rowlength; /* in pixels */
|
||||
GLint height = osmesa->rb->Height;
|
||||
|
||||
@@ -732,32 +733,7 @@ compute_row_addresses( OSMesaContext osmesa )
|
||||
else
|
||||
rowlength = osmesa->rb->Width;
|
||||
|
||||
if (osmesa->rb->DataType == GL_UNSIGNED_BYTE)
|
||||
bpc = 1;
|
||||
else if (osmesa->rb->DataType == GL_UNSIGNED_SHORT)
|
||||
bpc = 2;
|
||||
else if (osmesa->rb->DataType == GL_FLOAT)
|
||||
bpc = 4;
|
||||
else {
|
||||
_mesa_problem(&osmesa->mesa,
|
||||
"Unexpected datatype in osmesa::compute_row_addresses");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) {
|
||||
/* RGB mode */
|
||||
bytesPerPixel = 3 * bpc;
|
||||
}
|
||||
else if (osmesa->format == OSMESA_RGB_565) {
|
||||
/* 5/6/5 RGB pixel in 16 bits */
|
||||
bytesPerPixel = 2;
|
||||
}
|
||||
else {
|
||||
/* RGBA mode */
|
||||
bytesPerPixel = 4 * bpc;
|
||||
}
|
||||
|
||||
bytesPerRow = rowlength * bytesPerPixel;
|
||||
bytesPerRow = rowlength * _mesa_get_format_bytes(osmesa->rb->Format);
|
||||
|
||||
if (osmesa->yup) {
|
||||
/* Y=0 is bottom line of window */
|
||||
@@ -800,20 +776,33 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
/* Note: we can ignoring internalFormat for "window-system" renderbuffers */
|
||||
(void) internalFormat;
|
||||
|
||||
/* Given the user-provided format and type, figure out which MESA_FORMAT_x
|
||||
* to use.
|
||||
* XXX There aren't Mesa formats for all the possible combinations here!
|
||||
* XXX Specifically, there's only RGBA-order 16-bit/channel and float
|
||||
* XXX formats.
|
||||
* XXX The 8-bit/channel formats should all be OK.
|
||||
*/
|
||||
if (osmesa->format == OSMESA_RGBA) {
|
||||
if (rb->DataType == GL_UNSIGNED_BYTE) {
|
||||
if (_mesa_little_endian())
|
||||
rb->Format = MESA_FORMAT_RGBA8888_REV;
|
||||
else
|
||||
rb->Format = MESA_FORMAT_RGBA8888;
|
||||
rb->GetRow = get_row_RGBA8;
|
||||
rb->GetValues = get_values_RGBA8;
|
||||
rb->PutRow = put_row_RGBA8;
|
||||
rb->PutValues = put_values_RGBA8;
|
||||
}
|
||||
else if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
rb->Format = MESA_FORMAT_RGBA_16;
|
||||
rb->GetRow = get_row_RGBA16;
|
||||
rb->GetValues = get_values_RGBA16;
|
||||
rb->PutRow = put_row_RGBA16;
|
||||
rb->PutValues = put_values_RGBA16;
|
||||
}
|
||||
else {
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32;
|
||||
rb->GetRow = get_row_RGBA32;
|
||||
rb->GetValues = get_values_RGBA32;
|
||||
rb->PutRow = put_row_RGBA32;
|
||||
@@ -822,18 +811,26 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
}
|
||||
else if (osmesa->format == OSMESA_BGRA) {
|
||||
if (rb->DataType == GL_UNSIGNED_BYTE) {
|
||||
if (_mesa_little_endian())
|
||||
rb->Format = MESA_FORMAT_ARGB8888;
|
||||
else
|
||||
rb->Format = MESA_FORMAT_ARGB8888_REV;
|
||||
rb->GetRow = get_row_BGRA8;
|
||||
rb->GetValues = get_values_BGRA8;
|
||||
rb->PutRow = put_row_BGRA8;
|
||||
rb->PutValues = put_values_BGRA8;
|
||||
}
|
||||
else if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLushort");
|
||||
rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
|
||||
rb->GetRow = get_row_BGRA16;
|
||||
rb->GetValues = get_values_BGRA16;
|
||||
rb->PutRow = put_row_BGRA16;
|
||||
rb->PutValues = put_values_BGRA16;
|
||||
}
|
||||
else {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLfloat");
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32; /* not exactly right */
|
||||
rb->GetRow = get_row_BGRA32;
|
||||
rb->GetValues = get_values_BGRA32;
|
||||
rb->PutRow = put_row_BGRA32;
|
||||
@@ -842,18 +839,26 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
}
|
||||
else if (osmesa->format == OSMESA_ARGB) {
|
||||
if (rb->DataType == GL_UNSIGNED_BYTE) {
|
||||
if (_mesa_little_endian())
|
||||
rb->Format = MESA_FORMAT_ARGB8888_REV;
|
||||
else
|
||||
rb->Format = MESA_FORMAT_ARGB8888;
|
||||
rb->GetRow = get_row_ARGB8;
|
||||
rb->GetValues = get_values_ARGB8;
|
||||
rb->PutRow = put_row_ARGB8;
|
||||
rb->PutValues = put_values_ARGB8;
|
||||
}
|
||||
else if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLushort");
|
||||
rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
|
||||
rb->GetRow = get_row_ARGB16;
|
||||
rb->GetValues = get_values_ARGB16;
|
||||
rb->PutRow = put_row_ARGB16;
|
||||
rb->PutValues = put_values_ARGB16;
|
||||
}
|
||||
else {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLfloat");
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32; /* not exactly right */
|
||||
rb->GetRow = get_row_ARGB32;
|
||||
rb->GetValues = get_values_ARGB32;
|
||||
rb->PutRow = put_row_ARGB32;
|
||||
@@ -862,18 +867,23 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
}
|
||||
else if (osmesa->format == OSMESA_RGB) {
|
||||
if (rb->DataType == GL_UNSIGNED_BYTE) {
|
||||
rb->Format = MESA_FORMAT_RGB888;
|
||||
rb->GetRow = get_row_RGB8;
|
||||
rb->GetValues = get_values_RGB8;
|
||||
rb->PutRow = put_row_RGB8;
|
||||
rb->PutValues = put_values_RGB8;
|
||||
}
|
||||
else if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format RGB/GLushort");
|
||||
rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
|
||||
rb->GetRow = get_row_RGB16;
|
||||
rb->GetValues = get_values_RGB16;
|
||||
rb->PutRow = put_row_RGB16;
|
||||
rb->PutValues = put_values_RGB16;
|
||||
}
|
||||
else {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format RGB/GLfloat");
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32; /* not exactly right */
|
||||
rb->GetRow = get_row_RGB32;
|
||||
rb->GetValues = get_values_RGB32;
|
||||
rb->PutRow = put_row_RGB32;
|
||||
@@ -882,18 +892,23 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
}
|
||||
else if (osmesa->format == OSMESA_BGR) {
|
||||
if (rb->DataType == GL_UNSIGNED_BYTE) {
|
||||
rb->Format = MESA_FORMAT_BGR888;
|
||||
rb->GetRow = get_row_BGR8;
|
||||
rb->GetValues = get_values_BGR8;
|
||||
rb->PutRow = put_row_BGR8;
|
||||
rb->PutValues = put_values_BGR8;
|
||||
}
|
||||
else if (rb->DataType == GL_UNSIGNED_SHORT) {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format BGR/GLushort");
|
||||
rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
|
||||
rb->GetRow = get_row_BGR16;
|
||||
rb->GetValues = get_values_BGR16;
|
||||
rb->PutRow = put_row_BGR16;
|
||||
rb->PutValues = put_values_BGR16;
|
||||
}
|
||||
else {
|
||||
_mesa_warning(ctx, "Unsupported OSMesa format BGR/GLfloat");
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32; /* not exactly right */
|
||||
rb->GetRow = get_row_BGR32;
|
||||
rb->GetValues = get_values_BGR32;
|
||||
rb->PutRow = put_row_BGR32;
|
||||
@@ -902,6 +917,7 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
||||
}
|
||||
else if (osmesa->format == OSMESA_RGB_565) {
|
||||
ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
|
||||
rb->Format = MESA_FORMAT_RGB565;
|
||||
rb->GetRow = get_row_RGB_565;
|
||||
rb->GetValues = get_values_RGB_565;
|
||||
rb->PutRow = put_row_RGB_565;
|
||||
@@ -932,26 +948,9 @@ new_osmesa_renderbuffer(struct gl_context *ctx, GLenum format, GLenum type)
|
||||
rb->RefCount = 1;
|
||||
rb->Delete = osmesa_delete_renderbuffer;
|
||||
rb->AllocStorage = osmesa_renderbuffer_storage;
|
||||
rb->ClassID = OSMESA_RENDERBUFFER_CLASS;
|
||||
|
||||
rb->InternalFormat = GL_RGBA;
|
||||
switch (type) {
|
||||
case GL_UNSIGNED_BYTE:
|
||||
rb->Format = MESA_FORMAT_RGBA8888;
|
||||
break;
|
||||
case GL_UNSIGNED_SHORT:
|
||||
rb->Format = MESA_FORMAT_RGBA_16;
|
||||
break;
|
||||
case GL_UNSIGNED_SHORT_5_6_5:
|
||||
rb->Format = MESA_FORMAT_RGB565;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case GL_FLOAT:
|
||||
rb->Format = MESA_FORMAT_RGBA_FLOAT32;
|
||||
break;
|
||||
default:
|
||||
assert(0 && "Unexpected type in new_osmesa_renderbuffer()");
|
||||
rb->Format = MESA_FORMAT_RGBA8888;
|
||||
}
|
||||
rb->_BaseFormat = GL_RGBA;
|
||||
rb->DataType = type;
|
||||
}
|
||||
@@ -959,6 +958,56 @@ new_osmesa_renderbuffer(struct gl_context *ctx, GLenum format, GLenum type)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
osmesa_MapRenderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint x, GLuint y, GLuint w, GLuint h,
|
||||
GLbitfield mode,
|
||||
GLubyte **mapOut, GLint *rowStrideOut)
|
||||
{
|
||||
const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
|
||||
|
||||
if (rb->ClassID == OSMESA_RENDERBUFFER_CLASS) {
|
||||
/* this is an OSMesa renderbuffer which wraps user memory */
|
||||
const GLuint bpp = _mesa_get_format_bytes(rb->Format);
|
||||
GLint rowStride; /* in bytes */
|
||||
|
||||
if (osmesa->userRowLength)
|
||||
rowStride = osmesa->userRowLength * bpp;
|
||||
else
|
||||
rowStride = rb->Width * bpp;
|
||||
|
||||
if (!osmesa->yup) {
|
||||
/* Y=0 is top line of window */
|
||||
y = rb->Height - y - 1;
|
||||
*rowStrideOut = -rowStride;
|
||||
}
|
||||
else {
|
||||
*rowStrideOut = rowStride;
|
||||
}
|
||||
|
||||
*mapOut = (GLubyte *) rb->Data + y * rowStride + x * bpp;
|
||||
}
|
||||
else {
|
||||
_swrast_map_soft_renderbuffer(ctx, rb, x, y, w, h, mode,
|
||||
mapOut, rowStrideOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
osmesa_UnmapRenderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||
{
|
||||
if (rb->ClassID == OSMESA_RENDERBUFFER_CLASS) {
|
||||
/* no-op */
|
||||
}
|
||||
else {
|
||||
_swrast_unmap_soft_renderbuffer(ctx, rb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Public Functions *****/
|
||||
/**********************************************************************/
|
||||
@@ -1157,6 +1206,9 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
||||
tnl = TNL_CONTEXT(ctx);
|
||||
tnl->Driver.RunPipeline = _tnl_run_pipeline;
|
||||
|
||||
ctx->Driver.MapRenderbuffer = osmesa_MapRenderbuffer;
|
||||
ctx->Driver.UnmapRenderbuffer = osmesa_UnmapRenderbuffer;
|
||||
|
||||
/* Extend the software rasterizer with our optimized line and triangle
|
||||
* drawing functions.
|
||||
*/
|
||||
|
@@ -203,6 +203,12 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
|
||||
"glCopyPixels(multisample FBO)");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!_mesa_source_buffer_exists(ctx, type) ||
|
||||
!_mesa_dest_buffer_exists(ctx, type)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
|
@@ -1395,7 +1395,8 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
|
||||
|
||||
if (rb->InternalFormat == internalFormat &&
|
||||
rb->Width == (GLuint) width &&
|
||||
rb->Height == (GLuint) height) {
|
||||
rb->Height == (GLuint) height &&
|
||||
rb->NumSamples == samples) {
|
||||
/* no change in allocation needed */
|
||||
return;
|
||||
}
|
||||
|
@@ -528,7 +528,7 @@ struct texenv_fragment_program {
|
||||
*/
|
||||
|
||||
/* Texcoord override from bumpmapping. */
|
||||
struct ir_variable *texcoord_tex[MAX_TEXTURE_COORD_UNITS];
|
||||
ir_variable *texcoord_tex[MAX_TEXTURE_COORD_UNITS];
|
||||
|
||||
/* Reg containing texcoord for a texture unit,
|
||||
* needed for bump mapping, else undef.
|
||||
|
@@ -636,7 +636,7 @@ pack_float_ARGB1555_REV(const GLfloat src[4], void *dst)
|
||||
static void
|
||||
pack_ubyte_AL44(const GLubyte src[4], void *dst)
|
||||
{
|
||||
GLushort *d = ((GLushort *) dst);
|
||||
GLubyte *d = ((GLubyte *) dst);
|
||||
*d = PACK_COLOR_44(src[ACOMP], src[RCOMP]);
|
||||
}
|
||||
|
||||
|
@@ -476,7 +476,7 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
|
||||
GLuint *dst = (GLuint *) dstRow;
|
||||
for (i = j = 0, k = k0; i < (GLuint) dstWidth;
|
||||
i++, j += colStride, k += colStride) {
|
||||
dst[i] = (GLfloat)(rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4);
|
||||
dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -782,6 +782,11 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(multisample FBO)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_mesa_source_buffer_exists(ctx, format)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
|
||||
return;
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include "main/mtypes.h"
|
||||
#include "main/shaderapi.h"
|
||||
#include "main/shaderobj.h"
|
||||
#include "main/uniforms.h"
|
||||
#include "program/program.h"
|
||||
#include "program/prog_parameter.h"
|
||||
#include "ralloc.h"
|
||||
@@ -936,8 +937,6 @@ static GLboolean
|
||||
validate_shader_program(const struct gl_shader_program *shProg,
|
||||
char *errMsg)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if (!shProg->LinkStatus) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
@@ -228,7 +228,7 @@ update_program(struct gl_context *ctx)
|
||||
{
|
||||
const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram;
|
||||
const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram;
|
||||
const struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
|
||||
struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
|
||||
const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
|
||||
const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
|
||||
const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
|
||||
|
@@ -1909,6 +1909,13 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
|
||||
"glCopyTexImage%dD(invalid readbuffer)", dimensions);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->Visual.samples > 0) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
|
||||
"glCopyTexImage%dD(multisample FBO)",
|
||||
dimensions);
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check border */
|
||||
@@ -2008,6 +2015,13 @@ copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions,
|
||||
"glCopyTexImage%dD(invalid readbuffer)", dimensions);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer->Visual.samples > 0) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
|
||||
"glCopyTexSubImage%dD(multisample FBO)",
|
||||
dimensions);
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* check target (proxies not allowed) */
|
||||
|
@@ -515,9 +515,9 @@ make_temp_uint_image(struct gl_context *ctx, GLuint dims,
|
||||
for (k = 0; k < texComponents; k++) {
|
||||
GLint j = map[k];
|
||||
if (j == ZERO)
|
||||
newImage[i * texComponents + k] = 0.0F;
|
||||
newImage[i * texComponents + k] = 0;
|
||||
else if (j == ONE)
|
||||
newImage[i * texComponents + k] = 1.0F;
|
||||
newImage[i * texComponents + k] = 1;
|
||||
else
|
||||
newImage[i * texComponents + k] = tempImage[i * logComponents + j];
|
||||
}
|
||||
@@ -4094,7 +4094,7 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
|
||||
_mesa_unpack_depth_span(ctx, srcWidth,
|
||||
GL_FLOAT_32_UNSIGNED_INT_24_8_REV, /* dst type */
|
||||
dstRow, /* dst addr */
|
||||
1.0f, srcType, src, srcPacking);
|
||||
~0U, srcType, src, srcPacking);
|
||||
|
||||
if (srcFormat != GL_DEPTH_COMPONENT)
|
||||
_mesa_unpack_stencil_span(ctx, srcWidth,
|
||||
|
@@ -35,7 +35,7 @@ struct gl_context;
|
||||
#define MESA_MAJOR 8
|
||||
#define MESA_MINOR 0
|
||||
#define MESA_PATCH 0
|
||||
#define MESA_VERSION_STRING "8.0-devel"
|
||||
#define MESA_VERSION_STRING "8.0-rc1"
|
||||
|
||||
/* To make version comparison easy */
|
||||
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
|
@@ -5093,7 +5093,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
}
|
||||
|
||||
void
|
||||
st_translate_stream_output_info(struct glsl_to_tgsi_visitor *glsl_to_tgsi,
|
||||
st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi,
|
||||
const GLuint outputMapping[],
|
||||
struct pipe_stream_output_info *so)
|
||||
{
|
||||
|
@@ -175,7 +175,7 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
|
||||
line.attrPlane[attr][c]);
|
||||
}
|
||||
}
|
||||
line.span.arrayAttribs |= (1 << attr);
|
||||
line.span.arrayAttribs |= BITFIELD64_BIT(attr);
|
||||
if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) {
|
||||
const GLuint u = attr - FRAG_ATTRIB_TEX0;
|
||||
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
|
||||
|
@@ -531,7 +531,7 @@ _swrast_update_active_attribs(struct gl_context *ctx)
|
||||
{
|
||||
GLuint i, num = 0;
|
||||
for (i = 0; i < FRAG_ATTRIB_MAX; i++) {
|
||||
if (attribsMask & (1 << i)) {
|
||||
if (attribsMask & BITFIELD64_BIT(i)) {
|
||||
swrast->_ActiveAttribs[num++] = i;
|
||||
/* how should this attribute be interpolated? */
|
||||
if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1)
|
||||
|
@@ -175,7 +175,7 @@ interpolate_active_attribs(struct gl_context *ctx, SWspan *span,
|
||||
attrMask &= ~span->arrayAttribs;
|
||||
|
||||
ATTRIB_LOOP_BEGIN
|
||||
if (attrMask & (1 << attr)) {
|
||||
if (attrMask & BITFIELD64_BIT(attr)) {
|
||||
const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3];
|
||||
GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3];
|
||||
const GLfloat dv0dx = span->attrStepX[attr][0];
|
||||
@@ -199,8 +199,8 @@ interpolate_active_attribs(struct gl_context *ctx, SWspan *span,
|
||||
v3 += dv3dx;
|
||||
w += dwdx;
|
||||
}
|
||||
ASSERT((span->arrayAttribs & (1 << attr)) == 0);
|
||||
span->arrayAttribs |= (1 << attr);
|
||||
ASSERT((span->arrayAttribs & BITFIELD64_BIT(attr)) == 0);
|
||||
span->arrayAttribs |= BITFIELD64_BIT(attr);
|
||||
}
|
||||
ATTRIB_LOOP_END
|
||||
}
|
||||
|
Reference in New Issue
Block a user