summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_depthstencil.c13
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c15
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_bitmap.c20
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_copy.c6
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c12
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_format.c10
8 files changed, 65 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 44b276a123..7b7f7d8c14 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -95,7 +95,7 @@ int INTEL_DEBUG = (0);
#include "extension_helper.h"
-#define DRIVER_DATE "20080716"
+#define DRIVER_DATE "20090114"
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
static const GLubyte *
diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.c b/src/mesa/drivers/dri/intel/intel_depthstencil.c
index c2b4d7728b..354b3bf0d7 100644
--- a/src/mesa/drivers/dri/intel/intel_depthstencil.c
+++ b/src/mesa/drivers/dri/intel/intel_depthstencil.c
@@ -110,7 +110,10 @@ intel_unpair_depth_stencil(GLcontext *ctx, struct intel_renderbuffer *irb)
ASSERT(stencilIrb->PairedDepth == rb->Name);
intel_renderbuffer_map(intel, rb);
intel_renderbuffer_map(intel, stencilRb);
+#if 0
+ /* disable for now */
_mesa_extract_stencil(ctx, rb, stencilRb);
+#endif
intel_renderbuffer_unmap(intel, stencilRb);
intel_renderbuffer_unmap(intel, rb);
stencilIrb->PairedDepth = 0;
@@ -132,7 +135,10 @@ intel_unpair_depth_stencil(GLcontext *ctx, struct intel_renderbuffer *irb)
ASSERT(depthIrb->PairedStencil == rb->Name);
intel_renderbuffer_map(intel, rb);
intel_renderbuffer_map(intel, depthRb);
+#if 0
+ /* disable for now */
_mesa_extract_stencil(ctx, depthRb, rb);
+#endif
intel_renderbuffer_unmap(intel, depthRb);
intel_renderbuffer_unmap(intel, rb);
depthIrb->PairedStencil = 0;
@@ -177,8 +183,11 @@ intel_validate_paired_depth_stencil(GLcontext * ctx,
}
else {
/* Separate depth/stencil buffers, need to interleave now */
- ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT);
- ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX);
+ ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT ||
+ depthRb->Base._BaseFormat == GL_DEPTH_STENCIL);
+ ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX ||
+ stencilRb->Base._BaseFormat == GL_DEPTH_STENCIL);
+
/* may need to interleave depth/stencil now */
if (depthRb->PairedStencil == stencilRb->Base.Name) {
/* OK, the depth and stencil buffers are already interleaved */
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 7453b96dc5..54f2fa5287 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -248,11 +248,18 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
cpp = 4;
break;
case GL_DEPTH_COMPONENT16:
+#if 0
rb->_ActualFormat = GL_DEPTH_COMPONENT16;
rb->DataType = GL_UNSIGNED_SHORT;
rb->DepthBits = 16;
cpp = 2;
break;
+#else
+ /* fall-through.
+ * 16bpp depth renderbuffer can't be paired with a stencil buffer so
+ * always used combined depth/stencil format.
+ */
+#endif
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
@@ -529,20 +536,25 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
if (texImage->TexFormat == &_mesa_texformat_argb8888) {
irb->Base._ActualFormat = GL_RGBA8;
irb->Base._BaseFormat = GL_RGBA;
+ irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to RGBA8 texture OK\n");
}
else if (texImage->TexFormat == &_mesa_texformat_rgb565) {
irb->Base._ActualFormat = GL_RGB5;
irb->Base._BaseFormat = GL_RGB;
+ irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to RGB5 texture OK\n");
}
else if (texImage->TexFormat == &_mesa_texformat_z16) {
irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to DEPTH16 texture OK\n");
- } else if (texImage->TexFormat == &_mesa_texformat_s8_z24) {
+ }
+ else if (texImage->TexFormat == &_mesa_texformat_s8_z24) {
irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
+ irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
DBG("Render to DEPTH_STENCIL texture OK\n");
}
else {
@@ -554,7 +566,6 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
irb->Base.InternalFormat = irb->Base._ActualFormat;
irb->Base.Width = texImage->Width;
irb->Base.Height = texImage->Height;
- irb->Base.DataType = GL_UNSIGNED_BYTE; /* FBO XXX fix */
irb->Base.RedBits = texImage->TexFormat->RedBits;
irb->Base.GreenBits = texImage->TexFormat->GreenBits;
irb->Base.BlueBits = texImage->TexFormat->BlueBits;
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index 1d7f15f10a..3a01f63dc7 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -204,6 +204,14 @@ do_blit_bitmap( GLcontext *ctx,
/* Update draw buffer bounds */
_mesa_update_state(ctx);
+ if (ctx->Depth.Test) {
+ /* The blit path produces incorrect results when depth testing is on.
+ * It seems the blit Z coord is always 1.0 (the far plane) so fragments
+ * will likely be obscured by other, closer geometry.
+ */
+ return GL_FALSE;
+ }
+
if (!dst)
return GL_FALSE;
@@ -357,6 +365,7 @@ intel_texture_bitmap(GLcontext * ctx,
GLubyte *unpacked_bitmap;
GLubyte *a8_bitmap;
int x, y;
+ GLfloat dst_z;
/* We need a fragment program for the KIL effect */
if (!ctx->Extensions.ARB_fragment_program ||
@@ -456,21 +465,24 @@ intel_texture_bitmap(GLcontext * ctx,
intel_meta_set_passthrough_vertex_program(intel);
intel_meta_set_passthrough_transform(intel);
+ /* convert rasterpos Z from [0,1] to NDC coord in [-1,1] */
+ dst_z = -1.0 + 2.0 * ctx->Current.RasterPos[2];
+
vertices[0][0] = dst_x;
vertices[0][1] = dst_y;
- vertices[0][2] = ctx->Current.RasterPos[2];
+ vertices[0][2] = dst_z;
vertices[0][3] = 1.0;
vertices[1][0] = dst_x + width;
vertices[1][1] = dst_y;
- vertices[1][2] = ctx->Current.RasterPos[2];
+ vertices[1][2] = dst_z;
vertices[1][3] = 1.0;
vertices[2][0] = dst_x + width;
vertices[2][1] = dst_y + height;
- vertices[2][2] = ctx->Current.RasterPos[2];
+ vertices[2][2] = dst_z;
vertices[2][3] = 1.0;
vertices[3][0] = dst_x;
vertices[3][1] = dst_y + height;
- vertices[3][2] = ctx->Current.RasterPos[2];
+ vertices[3][2] = dst_z;
vertices[3][3] = 1.0;
texcoords[0][0] = 0.0;
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index 447c6494e7..7c7aa6097c 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -119,6 +119,12 @@ do_texture_copypixels(GLcontext * ctx,
if (!src || !dst || type != GL_COLOR)
return GL_FALSE;
+ if (ctx->_ImageTransferState) {
+ if (INTEL_DEBUG & DEBUG_PIXEL)
+ fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+
/* Can't handle overlapping regions. Don't have sufficient control
* over rasterization to pull it off in-place. Punt on these for
* now.
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index 2af839b803..0e83afa645 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -71,6 +71,7 @@ intel_texture_drawpixels(GLcontext * ctx,
GLuint texname;
GLfloat vertices[4][4];
GLfloat texcoords[4][2];
+ GLfloat z;
/* We're going to mess with texturing with no regard to existing texture
* state, so if there is some set up we have to bail.
@@ -140,6 +141,9 @@ intel_texture_drawpixels(GLcontext * ctx,
intel_meta_set_passthrough_transform(intel);
+ /* convert rasterpos Z from [0,1] to NDC coord in [-1,1] */
+ z = -1.0 + 2.0 * ctx->Current.RasterPos[2];
+
/* Create the vertex buffer based on the current raster pos. The x and y
* we're handed are ctx->Current.RasterPos[0,1] rounded to integers.
* We also apply the depth. However, the W component is already multiplied
@@ -147,19 +151,19 @@ intel_texture_drawpixels(GLcontext * ctx,
*/
vertices[0][0] = x;
vertices[0][1] = y;
- vertices[0][2] = ctx->Current.RasterPos[2];
+ vertices[0][2] = z;
vertices[0][3] = 1.0;
vertices[1][0] = x + width * ctx->Pixel.ZoomX;
vertices[1][1] = y;
- vertices[1][2] = ctx->Current.RasterPos[2];
+ vertices[1][2] = z;
vertices[1][3] = 1.0;
vertices[2][0] = x + width * ctx->Pixel.ZoomX;
vertices[2][1] = y + height * ctx->Pixel.ZoomY;
- vertices[2][2] = ctx->Current.RasterPos[2];
+ vertices[2][2] = z;
vertices[2][3] = 1.0;
vertices[3][0] = x;
vertices[3][1] = y + height * ctx->Pixel.ZoomY;
- vertices[3][2] = ctx->Current.RasterPos[2];
+ vertices[3][2] = z;
vertices[3][3] = 1.0;
texcoords[0][0] = 0.0;
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 8f4e681ffe..d9315043e6 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -633,7 +633,7 @@ intelSpanRenderStart(GLcontext * ctx)
intelFlush(&intel->ctx);
LOCK_HARDWARE(intel);
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled) {
struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
intel_tex_map_images(intel, intel_texture_object(texObj));
@@ -655,7 +655,7 @@ intelSpanRenderFinish(GLcontext * ctx)
_swrast_flush(ctx);
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled) {
struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
intel_tex_unmap_images(intel, intel_texture_object(texObj));
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index 2be060dd3e..5e418ac446 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -134,8 +134,14 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
+#if 0
return &_mesa_texformat_z16;
-
+#else
+ /* fall-through.
+ * 16bpp depth texture can't be paired with a stencil buffer so
+ * always used combined depth/stencil format.
+ */
+#endif
case GL_DEPTH_STENCIL_EXT:
case GL_DEPTH24_STENCIL8_EXT:
return &_mesa_texformat_s8_z24;
@@ -158,7 +164,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
- return &_mesa_texformat_srgb_dxt1;
+ return &_mesa_texformat_srgb_dxt1;
#endif
default: