summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915pipe
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-08-01 12:58:38 -0600
committerBrian <brian@i915.localnet.net>2007-08-01 12:58:38 -0600
commitfb206809ba2a131fd9034e10a00592f2d0d81fce (patch)
tree16f5f207e20fdb15e69d6bdca9b078fb425cbe04 /src/mesa/drivers/dri/i915pipe
parente99b673cb062a2fead92d1d7d373926d148ade71 (diff)
Checkpoint: glClear changes - working, bug very rough.
Diffstat (limited to 'src/mesa/drivers/dri/i915pipe')
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_buffers.c29
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_buffers.h5
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_context.c2
3 files changed, 33 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i915pipe/intel_buffers.c b/src/mesa/drivers/dri/i915pipe/intel_buffers.c
index c03c009a3a..fb93151430 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915pipe/intel_buffers.c
@@ -40,6 +40,7 @@
#include "swrast/swrast.h"
#include "vblank.h"
+#include "pipe/p_context.h"
/* This block can be removed when libdrm >= 2.3.1 is required */
@@ -298,9 +299,17 @@ intelWindowMoved(struct intel_context *intel)
/**
* Called by ctx->Driver.Clear.
*/
+#if 0
static void
intelClear(GLcontext *ctx, GLbitfield mask)
+#else
+void
+intelClear(struct pipe_context *pipe,
+ GLboolean color, GLboolean depth,
+ GLboolean stencil, GLboolean accum)
+#endif
{
+ GLcontext *ctx = (GLcontext *) pipe->glctx;
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
GLbitfield tri_mask = 0;
GLbitfield blit_mask = 0;
@@ -308,6 +317,13 @@ intelClear(GLcontext *ctx, GLbitfield mask)
struct gl_framebuffer *fb = ctx->DrawBuffer;
GLuint i;
+ GLbitfield mask;
+
+ if (color)
+ mask = ctx->DrawBuffer->_ColorDrawBufferMask[0]; /*XXX temporary*/
+ else
+ mask = 0x0;
+
if (0)
fprintf(stderr, "%s\n", __FUNCTION__);
@@ -323,7 +339,7 @@ intelClear(GLcontext *ctx, GLbitfield mask)
}
/* HW stencil */
- if (mask & BUFFER_BIT_STENCIL) {
+ if (stencil) {
const struct pipe_region *stencilRegion
= intel_get_rb_region(fb, BUFFER_STENCIL);
if (stencilRegion) {
@@ -340,7 +356,7 @@ intelClear(GLcontext *ctx, GLbitfield mask)
}
/* HW depth */
- if (mask & BUFFER_BIT_DEPTH) {
+ if (depth) {
/* clear depth with whatever method is used for stencil (see above) */
if (tri_mask & BUFFER_BIT_STENCIL)
tri_mask |= BUFFER_BIT_DEPTH;
@@ -368,9 +384,14 @@ intelClear(GLcontext *ctx, GLbitfield mask)
if (blit_mask)
intelClearWithBlit(ctx, blit_mask);
-#if 1
+#if 0
if (swrast_mask | tri_mask)
_swrast_Clear(ctx, swrast_mask | tri_mask);
+#else
+ softpipe_clear(pipe, GL_FALSE,
+ (swrast_mask | tri_mask) & BUFFER_BIT_DEPTH,
+ (swrast_mask | tri_mask) & BUFFER_BIT_STENCIL,
+ (swrast_mask | tri_mask) & BUFFER_BIT_ACCUM);
#endif
}
@@ -786,7 +807,9 @@ intelReadBuffer(GLcontext * ctx, GLenum mode)
void
intelInitBufferFuncs(struct dd_function_table *functions)
{
+#if 0
functions->Clear = intelClear;
+#endif
functions->DrawBuffer = intelDrawBuffer;
functions->ReadBuffer = intelReadBuffer;
}
diff --git a/src/mesa/drivers/dri/i915pipe/intel_buffers.h b/src/mesa/drivers/dri/i915pipe/intel_buffers.h
index 5834e39501..f0602eebae 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_buffers.h
+++ b/src/mesa/drivers/dri/i915pipe/intel_buffers.h
@@ -52,4 +52,9 @@ extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb);
extern void intelInitBufferFuncs(struct dd_function_table *functions);
+extern void
+intelClear(struct pipe_context *pipe,
+ GLboolean color, GLboolean depth,
+ GLboolean stencil, GLboolean accum);
+
#endif /* INTEL_BUFFERS_H */
diff --git a/src/mesa/drivers/dri/i915pipe/intel_context.c b/src/mesa/drivers/dri/i915pipe/intel_context.c
index 0ccd22a4d0..6121f6bc60 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_context.c
+++ b/src/mesa/drivers/dri/i915pipe/intel_context.c
@@ -420,6 +420,8 @@ intelCreateContext(const __GLcontextModes * mesaVis,
intel->pipe = intel->ctx.st->pipe;
intel->pipe->screen = intelScreen;
+ intel->pipe->glctx = ctx;
+ intel->pipe->clear = intelClear;
intelScreen->pipe = intel->pipe;
intel_init_region_functions(intel->pipe);