diff options
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/r128/r128_dd.c')
-rw-r--r-- | xc/lib/GL/mesa/src/drv/r128/r128_dd.c | 75 |
1 files changed, 51 insertions, 24 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c index 04745d240..230205783 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_dd.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_dd.c @@ -37,8 +37,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_cce.h" #include "r128_clear.h" #include "r128_vb.h" +#include "r128_pipeline.h" #include "r128_dd.h" +/* Driver entry point for clearing color and ancillary buffers */ static GLbitfield r128DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height) { @@ -55,6 +57,7 @@ static GLbitfield r128DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, } #if 0 + /* FIXME: Add stencil support */ if (mask & GL_STENCIL_BUFFER_BIT) { r128ClearStencilBuffer(r128ctx, all, x, y, width, height); mask &= ~GL_STENCIL_BUFFER_BIT; @@ -64,6 +67,7 @@ static GLbitfield r128DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, return mask; } +/* Return the current color buffer size */ static void r128DDGetBufferSize(GLcontext *ctx, GLuint *width, GLuint *height) { r128ContextPtr r128ctx = R128_CONTEXT(ctx); @@ -72,6 +76,7 @@ static void r128DDGetBufferSize(GLcontext *ctx, GLuint *width, GLuint *height) *height = r128ctx->driDrawable->h; } +/* Return various strings for glGetString() */ static const GLubyte *r128DDGetString(GLcontext *ctx, GLenum name) { switch (name) { @@ -84,53 +89,75 @@ static const GLubyte *r128DDGetString(GLcontext *ctx, GLenum name) } } +/* Send all commands to the hardware. If vertex buffers or indirect + buffers are in use, then we need to make sure they are sent to the + hardware. All commands that are normally sent to the ring are + already considered `flushed'. */ +static void r128DDFlush(GLcontext *ctx) +{ + R128_FLUSH_VB(R128_CONTEXT(ctx)); +} + +/* Make sure all commands have been sent to the hardware and have + completed processing. */ static void r128DDFinish(GLcontext *ctx) { r128ContextPtr r128ctx = R128_CONTEXT(ctx); + r128DDFlush(ctx); R128CCEWaitForIdle(r128ctx->r128Screen); } -static void r128DDFlush(GLcontext *ctx) -{ - /* Nothing to do here since all commands are automatically flushed */ -} - +/* Return various parameters requested by Mesa */ static GLint r128DDGetParameteri(const GLcontext *ctx, GLint param) { switch (param) { #if 0 - case DD_MAX_TEXTURE_SIZE: - return 2048; /* FIXME ?? */ - case DD_MAX_TEXTURES: - return 2; /* FIXME ?? */ - case DD_HAVE_HARDWARE_FOG: - return 1; /* FIXME ?? */ + /* FIXME: Support for these needs to be added to Mesa */ + case DD_MAX_TEXTURE_SIZE: return 1024; + case DD_MAX_TEXTURES: return 2; #endif - default: - return 0; +#if 0 + case DD_HAVE_HARDWARE_FOG: return 1; /* FIXME: Add HW fog support */ +#endif + default: return 0; } } +/* Initialize the extensions supported by this driver */ void r128DDInitExtensions(GLcontext *ctx) { + /* FIXME: Are there other extensions to enable/disable??? */ + gl_extensions_disable(ctx, "GL_EXT_shared_texture_palette"); + gl_extensions_disable(ctx, "GL_EXT_paletted_texture"); + gl_extensions_disable(ctx, "GL_EXT_point_parameters"); + gl_extensions_disable(ctx, "ARB_imaging"); + gl_extensions_disable(ctx, "GL_EXT_blend_minmax"); + gl_extensions_disable(ctx, "GL_EXT_blend_logic_op"); + gl_extensions_disable(ctx, "GL_EXT_blend_subtract"); + gl_extensions_disable(ctx, "GL_INGR_blend_func_separate"); + + if (getenv("LIBGL_NO_MULTITEXTURE")) + gl_extensions_disable(ctx, "GL_ARB_multitexture"); } +/* Initialize the driver's misc functions */ void r128DDInitDriverFuncs(GLcontext *ctx) { - ctx->Driver.Clear = r128DDClear; + ctx->Driver.Clear = r128DDClear; - ctx->Driver.GetBufferSize = r128DDGetBufferSize; - ctx->Driver.GetString = r128DDGetString; - ctx->Driver.Finish = r128DDFinish; - ctx->Driver.Flush = r128DDFlush; + ctx->Driver.GetBufferSize = r128DDGetBufferSize; + ctx->Driver.GetString = r128DDGetString; + ctx->Driver.Finish = r128DDFinish; + ctx->Driver.Flush = r128DDFlush; - ctx->Driver.Error = NULL; - ctx->Driver.GetParameteri = r128DDGetParameteri; + ctx->Driver.Error = NULL; + ctx->Driver.GetParameteri = r128DDGetParameteri; - ctx->Driver.DrawPixels = NULL; - ctx->Driver.Bitmap = NULL; + ctx->Driver.DrawPixels = NULL; + ctx->Driver.Bitmap = NULL; - ctx->Driver.RegisterVB = r128DDRegisterVB; - ctx->Driver.UnregisterVB = r128DDUnregisterVB; + ctx->Driver.RegisterVB = r128DDRegisterVB; + ctx->Driver.UnregisterVB = r128DDUnregisterVB; + ctx->Driver.BuildPrecalcPipeline = r128DDBuildPrecalcPipeline; } |