r300g: put common defines into one file
authorMarek Olšák <maraeo@gmail.com>
Sun, 21 Mar 2010 20:34:18 +0000 (21:34 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 21 Mar 2010 20:54:06 +0000 (21:54 +0100)
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_defines.h [new file with mode: 0644]
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_screen.h
src/gallium/drivers/r300/r300_winsys.h

index edebeab86fdd159b4e31e9fd9356c52b6b2a03ed..4bb385238ede0b8e1eb5dc0d37c4abaa802de1aa 100644 (file)
@@ -30,6 +30,7 @@
 #include "pipe/p_context.h"
 #include "util/u_inlines.h"
 
+#include "r300_defines.h"
 #include "r300_screen.h"
 
 struct u_upload_mgr;
@@ -135,8 +136,6 @@ struct r300_texture_format_state {
     uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */
 };
 
-#define R300_MAX_TEXTURE_LEVELS 13
-
 struct r300_texture_fb_state {
     /* Colorbuffer. */
     uint32_t colorpitch[R300_MAX_TEXTURE_LEVELS]; /* R300_RB3D_COLORPITCH[0-3]*/
@@ -195,12 +194,6 @@ struct r300_ztop_state {
     uint32_t z_buffer_top;      /* R300_ZB_ZTOP: 0x4f14 */
 };
 
-#define R300_NEW_FRAGMENT_SHADER 0x00000020
-#define R300_NEW_FRAGMENT_SHADER_CONSTANTS    0x00000040
-#define R300_NEW_VERTEX_SHADER_CONSTANTS    0x10000000
-#define R300_NEW_QUERY           0x40000000
-#define R300_NEW_KITCHEN_SINK    0x7fffffff
-
 /* The next several objects are not pure Radeon state; they inherit from
  * various Gallium classes. */
 
@@ -238,12 +231,6 @@ struct r300_query {
     struct r300_query* next;
 };
 
-enum r300_buffer_tiling {
-    R300_BUFFER_LINEAR = 0,
-    R300_BUFFER_TILED,
-    R300_BUFFER_SQUARETILED
-};
-
 struct r300_texture {
     /* Parent class */
     struct pipe_texture tex;
@@ -444,4 +431,3 @@ static INLINE void CTX_DBG(struct r300_context * ctx, unsigned flags,
 #define DBG     CTX_DBG
 
 #endif /* R300_CONTEXT_H */
-
diff --git a/src/gallium/drivers/r300/r300_defines.h b/src/gallium/drivers/r300/r300_defines.h
new file mode 100644 (file)
index 0000000..2e04876
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2010 Marek Olšák <maraeo@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_DEFINES_H
+#define R300_DEFINES_H
+
+#include "pipe/p_defines.h"
+
+#define R300_MAX_TEXTURE_LEVELS         13
+#define R300_MAX_DRAW_VBO_SIZE          (1024 * 1024)
+
+#define R300_TEXTURE_USAGE_TRANSFER     PIPE_TEXTURE_USAGE_CUSTOM
+
+/* Non-atom dirty state flags. */
+#define R300_NEW_FRAGMENT_SHADER                0x00000020
+#define R300_NEW_FRAGMENT_SHADER_CONSTANTS      0x00000040
+#define R300_NEW_VERTEX_SHADER_CONSTANTS        0x10000000
+#define R300_NEW_QUERY                          0x40000000
+#define R300_NEW_KITCHEN_SINK                   0x7fffffff
+
+/* Tiling flags. */
+enum r300_buffer_tiling {
+    R300_BUFFER_LINEAR = 0,
+    R300_BUFFER_TILED,
+    R300_BUFFER_SQUARETILED
+};
+
+#endif
index 2fed263a7a90508d542f688f839cf0390b9e4c3d..93bf388776c7b70279c86b7cdd08c845116aeb6e 100644 (file)
@@ -41,9 +41,6 @@
 #include "r300_render.h"
 #include "r300_state_derived.h"
 
-/* r300_render: Vertex and index buffer primitive emission. */
-#define R300_MAX_VBO_SIZE  (1024 * 1024)
-
 /* XXX The DRM rejects VAP_ALT_NUM_VERTICES.. */
 //#define ENABLE_ALT_NUM_VERTS
 
@@ -689,9 +686,9 @@ static boolean r300_render_allocate_vertices(struct vbuf_render* render,
         r300render->vbo = pipe_buffer_create(screen,
                                              64,
                                              PIPE_BUFFER_USAGE_VERTEX,
-                                             R300_MAX_VBO_SIZE);
+                                             R300_MAX_DRAW_VBO_SIZE);
         r300render->vbo_offset = 0;
-        r300render->vbo_size = R300_MAX_VBO_SIZE;
+        r300render->vbo_size = R300_MAX_DRAW_VBO_SIZE;
     }
 
     r300render->vertex_size = vertex_size;
index c31f39e6917f6b6b1a0446fa2a0a3cf372ff4a5a..a055159c93b783b2e0ae2ce4fc2ff4d6e17e4317 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "r300_chipset.h"
 
-#define R300_TEXTURE_USAGE_TRANSFER PIPE_TEXTURE_USAGE_CUSTOM
-
 struct r300_screen {
     /* Parent class */
     struct pipe_screen screen;
index 1e6d43bea31a02d2246b78ada3a413992400d06e..cd03355ab3e8a16f5123d11d4bcfb70c95112494 100644 (file)
@@ -30,6 +30,8 @@
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
 
+#include "r300_defines.h"
+
 struct r300_winsys_screen;
 
 /* Creates a new r300 screen. */