summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/common_context.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-01-14 15:12:57 +1000
committerDave Airlie <airlied@redhat.com>2009-01-14 15:14:09 +1000
commit61da612a4f8862e0aac4ff4fc87c133cb8a1c4a5 (patch)
tree33b7a7d7f840048c3f8fab8f8e693dce5ea59dab /src/mesa/drivers/dri/radeon/common_context.h
parent23295cf8e84495af86f62395d32b3116261927e8 (diff)
r300: start moving new r300 cmdbuf into common code
Diffstat (limited to 'src/mesa/drivers/dri/radeon/common_context.h')
-rw-r--r--src/mesa/drivers/dri/radeon/common_context.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/radeon/common_context.h b/src/mesa/drivers/dri/radeon/common_context.h
index e4d210392c..eb95dc9d75 100644
--- a/src/mesa/drivers/dri/radeon/common_context.h
+++ b/src/mesa/drivers/dri/radeon/common_context.h
@@ -1,6 +1,14 @@
#ifndef COMMON_CONTEXT_H
#define COMMON_CONTEXT_H
+
+#include "main/mm.h"
+#include "math/m_vector.h"
+#include "texmem.h"
+#include "tnl/t_context.h"
+#include "main/colormac.h"
+
+
/* This union is used to avoid warnings/miscompilation
with float to uint32_t casts due to strict-aliasing */
typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
@@ -9,11 +17,6 @@ struct radeon_context;
typedef struct radeon_context radeonContextRec;
typedef struct radeon_context *radeonContextPtr;
-#include "main/mm.h"
-#include "math/m_vector.h"
-#include "texmem.h"
-#include "tnl/t_context.h"
-
#define TEX_0 0x1
#define TEX_1 0x2
@@ -256,6 +259,20 @@ struct radeon_state {
struct radeon_stencilbuffer_state stencil;
};
+/**
+ * This structure holds the command buffer while it is being constructed.
+ *
+ * The first batch of commands in the buffer is always the state that needs
+ * to be re-emitted when the context is lost. This batch can be skipped
+ * otherwise.
+ */
+struct radeon_cmdbuf {
+ struct radeon_cs_manager *csm;
+ struct radeon_cs *cs;
+ int size; /** # of dwords total */
+ unsigned int flushing:1; /** whether we're currently in FlushCmdBufLocked */
+};
+
struct radeon_context {
GLcontext *glCtx;
radeonScreenPtr radeonScreen; /* Screen private DRI data */
@@ -308,6 +325,8 @@ struct radeon_context {
*/
driOptionCache optionCache;
+ struct radeon_cmdbuf cmdbuf;
+
struct {
void (*get_lock)(radeonContextPtr radeon);
void (*update_viewport_offset)(GLcontext *ctx);