- Make point_smooth, polygon_smooth fallbacks per-primitive rather than total.

- Also - disable those fallbacks unless INTEL_STRICT_CONFORMANCE is set.
- Gate some FBO debugging on INTEL_DEBUG=fbo
This commit is contained in:
Keith Whitwell 2006-09-22 14:16:33 +00:00
parent 6abcf6a3d3
commit ceb222798b
5 changed files with 63 additions and 25 deletions

View file

@ -830,11 +830,9 @@ i915Enable(GLcontext * ctx, GLenum cap, GLboolean state)
break;
case GL_POLYGON_SMOOTH:
FALLBACK(&i915->intel, I915_FALLBACK_POLYGON_SMOOTH, state);
break;
case GL_POINT_SMOOTH:
FALLBACK(&i915->intel, I915_FALLBACK_POINT_SMOOTH, state);
break;
default:

View file

@ -233,6 +233,7 @@ static const struct dri_debug_control debug_control[] = {
{"sleep", DEBUG_SLEEP},
{"pix", DEBUG_PIXEL},
{"buf", DEBUG_BUFMGR},
{"fbo", DEBUG_FBO},
{NULL, 0}
};
@ -441,6 +442,13 @@ intelInitContext(struct intel_context *intel,
ctx->Const.MaxTextureMaxAnisotropy = 2.0;
/* This doesn't yet catch all non-conformant rendering, but it's a
* start.
*/
if (getenv("INTEL_STRICT_CONFORMANCE")) {
intel->strict_conformance = 1;
}
ctx->Const.MinLineWidth = 1.0;
ctx->Const.MinLineWidthAA = 1.0;
ctx->Const.MaxLineWidth = 3.0;

View file

@ -212,6 +212,7 @@ struct intel_context
GLfloat polygon_offset_scale; /* dependent on depth_scale, bpp */
GLboolean hw_stipple;
GLboolean strict_conformance;
/* AGP memory buffer manager:
*/
@ -445,6 +446,7 @@ extern int INTEL_DEBUG;
#define DEBUG_SLEEP 0x800
#define DEBUG_PIXEL 0x1000
#define DEBUG_BUFMGR 0x2000
#define DEBUG_FBO 0x4000
#define DBG(...) do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0)

View file

@ -43,6 +43,9 @@
#include "intel_regions.h"
#include "intel_span.h"
#define FILE_DEBUG_FLAG DEBUG_FBO
#define INTEL_RB_CLASS 0x12345678
@ -240,8 +243,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
GLuint pitch = ((cpp * width + 63) & ~63) / cpp;
/* alloc hardware renderbuffer */
_mesa_debug(ctx, "Allocating %d x %d Intel RBO (pitch %d)\n", width,
height, pitch);
DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
height, pitch);
irb->region = intel_region_alloc(intel, cpp, pitch, height);
if (!irb->region)
@ -444,10 +447,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx,
struct gl_framebuffer *fb,
GLenum attachment, struct gl_renderbuffer *rb)
{
/*
_mesa_debug(ctx, "Intel FramebufferRenderbuffer %u %u\n",
fb->Name, rb ? rb->Name : 0);
*/
DBG("Intel FramebufferRenderbuffer %u %u\n", fb->Name, rb ? rb->Name : 0);
intelFlush(ctx);
@ -480,21 +480,21 @@ intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
if (texImage->TexFormat == &_mesa_texformat_argb8888) {
irb->Base._ActualFormat = GL_RGBA8;
irb->Base._BaseFormat = GL_RGBA;
_mesa_debug(ctx, "Render to RGBA8 texture OK\n");
DBG("Render to RGBA8 texture OK\n");
}
else if (texImage->TexFormat == &_mesa_texformat_rgb565) {
irb->Base._ActualFormat = GL_RGB5;
irb->Base._BaseFormat = GL_RGB;
_mesa_debug(ctx, "Render to RGB5 texture OK\n");
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;
_mesa_debug(ctx, "Render to DEPTH16 texture OK\n");
DBG("Render to DEPTH16 texture OK\n");
}
else {
_mesa_debug(ctx, "Render to texture BAD FORMAT %d\n",
texImage->TexFormat->MesaFormat);
DBG("Render to texture BAD FORMAT %d\n",
texImage->TexFormat->MesaFormat);
_mesa_free(irb);
return NULL;
}
@ -553,11 +553,9 @@ intel_render_texture(GLcontext * ctx,
}
}
/*
_mesa_debug(ctx, "Begin render texture tex=%u w=%d h=%d refcount=%d\n",
att->Texture->Name, newImage->Width, newImage->Height,
irb->Base.RefCount);
*/
DBG("Begin render texture tex=%u w=%d h=%d refcount=%d\n",
att->Texture->Name, newImage->Width, newImage->Height,
irb->Base.RefCount);
/* point the renderbufer's region to the texture image region */
intel_image = intel_texture_image(newImage);
@ -593,10 +591,7 @@ intel_finish_render_texture(GLcontext * ctx,
struct intel_context *intel = intel_context(ctx);
struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
/*
_mesa_debug(ctx, "End render texture (tid %u) tex %u\n",
_glthread_GetID(), att->Texture->Name);
*/
DBG("End render texture (tid %u) tex %u\n", _glthread_GetID(), att->Texture->Name);
if (irb) {
/* just release the region */

View file

@ -216,6 +216,9 @@ intel_draw_point(struct intel_context *intel, intelVertexPtr v0)
* Fixup for ARB_point_parameters *
***********************************************************************/
/* Currently not working - VERT_ATTRIB_POINTSIZE isn't correctly
* represented in the fragment program InputsRead field.
*/
static void
intel_atten_point(struct intel_context *intel, intelVertexPtr v0)
{
@ -598,6 +601,24 @@ intel_fallback_line(struct intel_context *intel,
intelSpanRenderFinish(ctx);
}
static void
intel_fallback_point(struct intel_context *intel,
intelVertex * v0)
{
GLcontext *ctx = &intel->ctx;
SWvertex v[1];
if (0)
fprintf(stderr, "\n%s\n", __FUNCTION__);
INTEL_FIREVERTICES(intel);
_swsetup_Translate(ctx, v0, &v[0]);
intelSpanRenderStart(ctx);
_swrast_Point(ctx, &v[0]);
intelSpanRenderFinish(ctx);
}
/**********************************************************************/
/* Render unclipped begin/end objects */
@ -692,7 +713,7 @@ intelFastRenderClippedPoly(GLcontext * ctx, const GLuint * elts, GLuint n)
#define ANY_FALLBACK_FLAGS (DD_LINE_STIPPLE | DD_TRI_STIPPLE | DD_POINT_ATTEN)
#define ANY_FALLBACK_FLAGS (DD_LINE_STIPPLE | DD_TRI_STIPPLE | DD_POINT_ATTEN | DD_POINT_SMOOTH | DD_TRI_SMOOTH)
#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET | DD_TRI_UNFILLED)
void
@ -743,8 +764,22 @@ intelChooseRenderState(GLcontext * ctx)
if ((flags & DD_TRI_STIPPLE) && !intel->hw_stipple)
intel->draw_tri = intel_fallback_tri;
if (flags & DD_POINT_ATTEN)
intel->draw_point = intel_atten_point;
if (flags & DD_TRI_SMOOTH) {
if (intel->strict_conformance)
intel->draw_tri = intel_fallback_tri;
}
if (flags & DD_POINT_ATTEN) {
if (0)
intel->draw_point = intel_atten_point;
else
intel->draw_point = intel_fallback_point;
}
if (flags & DD_POINT_SMOOTH) {
if (intel->strict_conformance)
intel->draw_point = intel_fallback_point;
}
index |= INTEL_FALLBACK_BIT;
}