i915g: Move fragment state to its own file

This commit is contained in:
Jakob Bornecrantz 2010-07-03 12:46:42 +01:00
parent d64561472b
commit 8b122bdf6c
6 changed files with 64 additions and 17 deletions

View 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 \

View 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',

View 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);

View 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,
};

View 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.

View file

@ -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
};