mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
r300: Add fragment shader stubs.
Not looking forward to filling these out at all.
This commit is contained in:
parent
471129c7a1
commit
45cb94217e
3 changed files with 46 additions and 9 deletions
|
|
@ -55,6 +55,9 @@ struct r300_dsa_state {
|
|||
uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */
|
||||
};
|
||||
|
||||
struct r300_fs_state {
|
||||
};
|
||||
|
||||
struct r300_rs_state {
|
||||
uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
|
||||
uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
|
||||
|
|
@ -76,13 +79,15 @@ struct r300_scissor_state {
|
|||
uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */
|
||||
};
|
||||
|
||||
#define R300_NEW_BLEND 0x0001
|
||||
#define R300_NEW_BLEND_COLOR 0x0002
|
||||
#define R300_NEW_DSA 0x0004
|
||||
#define R300_NEW_RS 0x0008
|
||||
#define R300_NEW_SAMPLER 0x0010
|
||||
#define R300_NEW_SCISSOR 0x1000
|
||||
#define R300_NEW_KITCHEN_SINK 0x1fff
|
||||
#define R300_NEW_BLEND 0x0001
|
||||
#define R300_NEW_BLEND_COLOR 0x0002
|
||||
#define R300_NEW_DSA 0x0004
|
||||
#define R300_NEW_FRAGMENT_SHADER 0x0008
|
||||
#define R300_NEW_RASTERIZER 0x0010
|
||||
#define R300_NEW_SAMPLER 0x0020
|
||||
#define R300_NEW_SCISSOR 0x2000
|
||||
#define R300_NEW_VERTEX_SHADER 0x4000
|
||||
#define R300_NEW_KITCHEN_SINK 0x7fff
|
||||
|
||||
struct r300_texture {
|
||||
/* Parent class */
|
||||
|
|
@ -114,6 +119,8 @@ struct r300_context {
|
|||
struct r300_blend_color_state* blend_color_state;
|
||||
/* Depth, stencil, and alpha state. */
|
||||
struct r300_dsa_state* dsa_state;
|
||||
/* Fragment shader state. */
|
||||
struct r300_fs_state* fs_state;
|
||||
/* Rasterizer state. */
|
||||
struct r300_rs_state* rs_state;
|
||||
/* Sampler states. */
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ static void r300_emit_dirty_state(struct r300_context* r300)
|
|||
}
|
||||
}
|
||||
|
||||
if (r300->dirty_state & R300_NEW_RS) {
|
||||
if (r300->dirty_state & R300_NEW_RASTERIZER) {
|
||||
struct r300_rs_state* rs = r300->rs_state;
|
||||
OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
|
||||
/* XXX next six are contiguous regs */
|
||||
|
|
|
|||
|
|
@ -357,6 +357,32 @@ static void r300_delete_dsa_state(struct pipe_context* pipe,
|
|||
{
|
||||
FREE(state);
|
||||
}
|
||||
|
||||
/* Create fragment shader state. */
|
||||
static void* r300_create_fs_state(struct pipe_context* pipe,
|
||||
const struct pipe_shader_state* state)
|
||||
{
|
||||
struct r300_fs_state* fs = CALLOC_STRUCT(r300_fs_state);
|
||||
|
||||
return (void*)fs;
|
||||
}
|
||||
|
||||
/* Bind fragment shader state. */
|
||||
static void r300_bind_fs_state(struct pipe_context* pipe, void* state)
|
||||
{
|
||||
struct r300_context* r300 = r300_context(pipe);
|
||||
|
||||
r300->fs_state = (struct r300_fs_state*)state;
|
||||
|
||||
r300->dirty_state |= R300_NEW_FRAGMENT_SHADER;
|
||||
}
|
||||
|
||||
/* Delect fragment shader state. */
|
||||
static void r300_delete_fs_state(struct pipe_context* pipe, void* state)
|
||||
{
|
||||
FREE(state);
|
||||
}
|
||||
|
||||
#if 0
|
||||
struct pipe_rasterizer_state
|
||||
{
|
||||
|
|
@ -449,7 +475,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
|
|||
struct r300_context* r300 = r300_context(pipe);
|
||||
|
||||
r300->rs_state = (struct r300_rs_state*)state;
|
||||
r300->dirty_state |= R300_NEW_RS;
|
||||
r300->dirty_state |= R300_NEW_RASTERIZER;
|
||||
}
|
||||
|
||||
/* Free rasterizer state. */
|
||||
|
|
@ -652,6 +678,10 @@ void r300_init_state_functions(struct r300_context* r300) {
|
|||
r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state;
|
||||
r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state;
|
||||
|
||||
r300->context.create_fs_state = r300_create_fs_state;
|
||||
r300->context.bind_fs_state = r300_bind_fs_state;
|
||||
r300->context.delete_fs_state = r300_delete_fs_state;
|
||||
|
||||
r300->context.create_rasterizer_state = r300_create_rs_state;
|
||||
r300->context.bind_rasterizer_state = r300_bind_rs_state;
|
||||
r300->context.delete_rasterizer_state = r300_delete_rs_state;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue