summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/mga/mgacontext.h
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2003-12-05 00:32:15 +0000
committerAlan Hourihane <[email protected]>2003-12-05 00:32:15 +0000
commiteed5ac284cb4edca5400d55040e83fdf2f329f84 (patch)
treeaddcbdefa6d8fae9635ee830d9d4cd97d096c110 /src/mesa/drivers/dri/mga/mgacontext.h
parent1f2d9ae69fa6d368b1df3f316e7bb7186ca8f746 (diff)
bring over latest mga DRI driver from DRI trunk
Diffstat (limited to 'src/mesa/drivers/dri/mga/mgacontext.h')
-rw-r--r--src/mesa/drivers/dri/mga/mgacontext.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h
index 50efe4c817f..245cb5eb737 100644
--- a/src/mesa/drivers/dri/mga/mgacontext.h
+++ b/src/mesa/drivers/dri/mga/mgacontext.h
@@ -32,10 +32,10 @@
#include <inttypes.h>
#include "dri_util.h"
#include "mtypes.h"
-#include "colormac.h"
#include "xf86drm.h"
#include "mm.h"
#include "mga_sarea.h"
+#include "colormac.h"
#include "texmem.h"
#include "macros.h"
#include "xmlconfig.h"
@@ -57,7 +57,7 @@
#define MGA_FALLBACK_TEXTURE 0x1
#define MGA_FALLBACK_DRAW_BUFFER 0x2
#define MGA_FALLBACK_READ_BUFFER 0x4
-#define MGA_FALLBACK_LOGICOP 0x8
+#define MGA_FALLBACK_BLEND 0x8
#define MGA_FALLBACK_RENDERMODE 0x10
#define MGA_FALLBACK_STENCIL 0x20
#define MGA_FALLBACK_DEPTH 0x40
@@ -80,12 +80,14 @@ typedef void (*mga_point_func)( mgaContextPtr, mgaVertex * );
-/* GL_BLEND has some limitations
+/* Texture environment color
*/
-#define MGA_BLEND_RGB_ZERO 0x1
-#define MGA_BLEND_RGB_ONE 0x2
-#define MGA_BLEND_ALPHA_ZERO 0x4
-#define MGA_BLEND_ALPHA_ONE 0x8
+#define RGB_ZERO(c) (((c) & 0xffffff) == 0x000000)
+#define RGB_ONE(c) (((c) & 0xffffff) == 0xffffff)
+#define ALPHA_ZERO(c) (((c) >> 24) == 0x00)
+#define ALPHA_ONE(c) (((c) >> 24) == 0xff)
+#define RGBA_EQUAL(c) ((c) == PACK_COLOR_8888( (c) & 0xff, (c) & 0xff, \
+ (c) & 0xff, (c) & 0xff ))
struct mga_texture_object_s;
struct mga_screen_private_s;
@@ -197,7 +199,7 @@ struct mga_context_t {
*/
GLuint tmu_source[2];
- GLboolean default32BitTextures;
+ int texture_depth;
/* Manage fallbacks
*/
@@ -209,11 +211,11 @@ struct mga_context_t {
struct gl_client_array UbyteColor;
struct gl_client_array UbyteSecondaryColor;
- /* Support for GL_DECAL and GL_BLEND
+ /* Texture environment color.
*/
- unsigned int blend_flags;
- unsigned int envcolor;
- GLboolean dualtex_env;
+ unsigned int envcolor[2];
+ GLboolean fcol_used;
+ GLboolean force_dualtex;
/* Rasterization state
*/
@@ -299,11 +301,19 @@ struct mga_context_t {
/* Mirrors of some DRI state.
*/
- GLframebuffer *glBuffer;
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
__DRIdrawablePrivate *driDrawable;
+ __DRIdrawablePrivate *driReadable;
+
+ /**
+ * Drawable used by Mesa for software fallbacks for reading and
+ * writing. It is set by Mesa's \c SetBuffer callback, and will always be
+ * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable.
+ */
+ __DRIdrawablePrivate *mesa_drawable;
+
__DRIscreenPrivate *driScreen;
struct mga_screen_private_s *mgaScreen;
MGASAREAPrivPtr sarea;