i915g: Move fragment state to its own file
authorJakob Bornecrantz <wallbraker@gmail.com>
Sat, 3 Jul 2010 11:46:42 +0000 (12:46 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Sun, 4 Jul 2010 12:32:01 +0000 (13:32 +0100)
src/gallium/drivers/i915/Makefile
src/gallium/drivers/i915/SConscript
src/gallium/drivers/i915/i915_state.h
src/gallium/drivers/i915/i915_state_derived.c
src/gallium/drivers/i915/i915_state_emit.c
src/gallium/drivers/i915/i915_state_fpc.c [new file with mode: 0644]

index d4d5c48fbb1df670af6eecec76a5d715359dcee8..b3f387f9335774bc34401763855def9d676d7745 100644 (file)
@@ -15,6 +15,7 @@ C_SOURCES = \
        i915_state_dynamic.c \
        i915_state_derived.c \
        i915_state_emit.c \
+       i915_state_fpc.c \
        i915_state_sampler.c \
        i915_state_static.c \
        i915_screen.c \
index a90d094919b10683a846431bafc9bd68cdc95781..d4bf6fef13425c9eab8e0a23dda0d557904f8822 100644 (file)
@@ -24,6 +24,7 @@ i915 = env.ConvenienceLibrary(
                'i915_state.c',
                'i915_state_derived.c',
                'i915_state_dynamic.c',
+               'i915_state_fpc.c',
                'i915_state_emit.c',
                'i915_state_immediate.c',
                'i915_state_sampler.c',
index 7795046f06d966c766eaa6227a81959555a7aaa6..b4074dc35ba9d3964efc0487be0a89b3ae23c783 100644 (file)
@@ -48,6 +48,7 @@ extern struct i915_tracked_state i915_hw_immediate;
 extern struct i915_tracked_state i915_hw_dynamic;
 extern struct i915_tracked_state i915_hw_fs;
 extern struct i915_tracked_state i915_hw_framebuffer;
+extern struct i915_tracked_state i915_hw_constants;
 
 void i915_update_derived(struct i915_context *i915);
 void i915_emit_hardware_state(struct i915_context *i915);
index 38d13f4fc91de32fd8f573bce87879cfd4191421..1d4026a214e9d9e6504d3e4432052a78efe82b09 100644 (file)
@@ -155,22 +155,6 @@ struct i915_tracked_state i915_update_vertex_layout = {
 
 
 
-/***********************************************************************
- * Update fragment state
- */
-static void update_fs(struct i915_context *i915)
-{
-   i915->hardware_dirty |= I915_HW_PROGRAM; /* XXX right? */
-}
-
-struct i915_tracked_state i915_hw_fs = {
-   "fs",
-   update_fs,
-   I915_NEW_FS
-};
-
-
-
 /***********************************************************************
  */
 static struct i915_tracked_state *atoms[] = {
@@ -181,6 +165,7 @@ static struct i915_tracked_state *atoms[] = {
    &i915_hw_dynamic,
    &i915_hw_fs,
    &i915_hw_framebuffer,
+   &i915_hw_constants,
    NULL,
 };
 
index bbf9ff51f5fe04c36d3546ecd177259866946164..3577a336ffa60d3240c1ccbc94d6e4ebae396ad9 100644 (file)
@@ -339,7 +339,7 @@ i915_emit_hardware_state(struct i915_context *i915 )
 
    /* constants */
    /* 2 + I915_MAX_CONSTANT*4 dwords, 0 relocs */
-   if (i915->hardware_dirty & I915_HW_PROGRAM)
+   if (i915->hardware_dirty & I915_HW_CONSTANTS)
    {
       /* Collate the user-defined constants with the fragment shader's
        * immediates according to the constant_flags[] array.
diff --git a/src/gallium/drivers/i915/i915_state_fpc.c b/src/gallium/drivers/i915/i915_state_fpc.c
new file mode 100644 (file)
index 0000000..ec7cec0
--- /dev/null
@@ -0,0 +1,59 @@
+/**************************************************************************
+ *
+ * Copyright © 2010 Jakob Bornecrantz
+ *
+ * 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
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ *
+ **************************************************************************/
+
+
+#include "i915_reg.h"
+#include "i915_context.h"
+#include "i915_state.h"
+
+
+
+/***********************************************************************
+ */
+static void update_hw_constants(struct i915_context *i915)
+{
+   i915->hardware_dirty |= I915_HW_CONSTANTS;
+}
+
+struct i915_tracked_state i915_hw_constants = {
+   "hw_constants",
+   update_hw_constants,
+   I915_NEW_CONSTANTS | I915_NEW_FS
+};
+
+
+
+/***********************************************************************
+ */
+static void update_fs(struct i915_context *i915)
+{
+   i915->hardware_dirty |= I915_HW_PROGRAM;
+}
+
+struct i915_tracked_state i915_hw_fs = {
+   "fs",
+   update_fs,
+   I915_NEW_FS
+};