misc changes to support vertex shaders (disabled by default)
This commit is contained in:
@@ -269,6 +269,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
|
|||||||
softpipe->pipe.set_depth_state = softpipe_set_depth_test_state;
|
softpipe->pipe.set_depth_state = softpipe_set_depth_test_state;
|
||||||
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
|
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
|
||||||
softpipe->pipe.set_fs_state = softpipe_set_fs_state;
|
softpipe->pipe.set_fs_state = softpipe_set_fs_state;
|
||||||
|
softpipe->pipe.set_vs_state = softpipe_set_vs_state;
|
||||||
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
|
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
|
||||||
softpipe->pipe.set_sampler_state = softpipe_set_sampler_state;
|
softpipe->pipe.set_sampler_state = softpipe_set_sampler_state;
|
||||||
softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
|
softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
|
||||||
|
@@ -134,6 +134,9 @@ static void update_vs( struct st_context *st )
|
|||||||
struct st_vertex_program *vp = NULL;
|
struct st_vertex_program *vp = NULL;
|
||||||
struct gl_program_parameter_list *params = NULL;
|
struct gl_program_parameter_list *params = NULL;
|
||||||
|
|
||||||
|
if (st->ctx->VertexProgram._MaintainTnlProgram)
|
||||||
|
_tnl_UpdateFixedFunctionProgram( st->ctx );
|
||||||
|
|
||||||
if (st->ctx->Shader.CurrentProgram &&
|
if (st->ctx->Shader.CurrentProgram &&
|
||||||
st->ctx->Shader.CurrentProgram->LinkStatus &&
|
st->ctx->Shader.CurrentProgram->LinkStatus &&
|
||||||
st->ctx->Shader.CurrentProgram->VertexProgram) {
|
st->ctx->Shader.CurrentProgram->VertexProgram) {
|
||||||
@@ -148,11 +151,15 @@ static void update_vs( struct st_context *st )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXXX temp */
|
/* XXXX temp */
|
||||||
|
#if 1
|
||||||
if (!vp)
|
if (!vp)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
if (vp && params) {
|
if (vp && params) {
|
||||||
/* load program's constants array */
|
/* load program's constants array */
|
||||||
|
|
||||||
|
_mesa_load_state_parameters(st->ctx, params);
|
||||||
|
|
||||||
vp->constants.nr_constants = params->NumParameters;
|
vp->constants.nr_constants = params->NumParameters;
|
||||||
memcpy(vp->constants.constant,
|
memcpy(vp->constants.constant,
|
||||||
params->ParameterValues,
|
params->ParameterValues,
|
||||||
@@ -179,7 +186,7 @@ static void update_vs( struct st_context *st )
|
|||||||
|
|
||||||
const struct st_tracked_state st_update_vs = {
|
const struct st_tracked_state st_update_vs = {
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_PROGRAM,
|
.mesa = _NEW_PROGRAM | _NEW_MODELVIEW,
|
||||||
.st = ST_NEW_VERTEX_PROGRAM,
|
.st = ST_NEW_VERTEX_PROGRAM,
|
||||||
},
|
},
|
||||||
.update = update_vs
|
.update = update_vs
|
||||||
|
@@ -73,6 +73,9 @@ struct st_context *st_create_context( GLcontext *ctx,
|
|||||||
st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
st->ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
st->ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||||
|
|
||||||
|
st->ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
st_init_cb_clear( st );
|
st_init_cb_clear( st );
|
||||||
st_init_cb_program( st );
|
st_init_cb_program( st );
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include "tnl/t_context.h"
|
#include "tnl/t_context.h"
|
||||||
#include "tnl/t_pipeline.h"
|
#include "tnl/t_pipeline.h"
|
||||||
|
#include "tnl/t_vp_build.h" /* USE_NEW_DRAW */
|
||||||
|
|
||||||
#include "st_context.h"
|
#include "st_context.h"
|
||||||
#include "st_atom.h"
|
#include "st_atom.h"
|
||||||
@@ -89,6 +90,9 @@ const struct tnl_pipeline_stage st_draw = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct tnl_pipeline_stage *st_pipeline[] = {
|
static const struct tnl_pipeline_stage *st_pipeline[] = {
|
||||||
|
#if USE_NEW_DRAW
|
||||||
|
&_tnl_vertex_program_stage,
|
||||||
|
#else
|
||||||
&_tnl_vertex_transform_stage,
|
&_tnl_vertex_transform_stage,
|
||||||
&_tnl_vertex_cull_stage,
|
&_tnl_vertex_cull_stage,
|
||||||
&_tnl_normal_transform_stage,
|
&_tnl_normal_transform_stage,
|
||||||
@@ -98,6 +102,7 @@ static const struct tnl_pipeline_stage *st_pipeline[] = {
|
|||||||
&_tnl_texture_transform_stage,
|
&_tnl_texture_transform_stage,
|
||||||
&_tnl_point_attenuation_stage,
|
&_tnl_point_attenuation_stage,
|
||||||
&_tnl_vertex_program_stage,
|
&_tnl_vertex_program_stage,
|
||||||
|
#endif
|
||||||
&st_draw, /* ADD: escape to pipe */
|
&st_draw, /* ADD: escape to pipe */
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
@@ -146,6 +151,9 @@ draw_vbo(GLcontext *ctx,
|
|||||||
struct pipe_context *pipe = ctx->st->pipe;
|
struct pipe_context *pipe = ctx->st->pipe;
|
||||||
GLuint attr, i;
|
GLuint attr, i;
|
||||||
|
|
||||||
|
st_validate_state(ctx->st);
|
||||||
|
|
||||||
|
|
||||||
/* tell pipe about the vertex array element/attributes */
|
/* tell pipe about the vertex array element/attributes */
|
||||||
for (attr = 0; attr < 16; attr++) {
|
for (attr = 0; attr < 16; attr++) {
|
||||||
struct gl_buffer_object *bufobj = arrays[attr]->BufferObj;
|
struct gl_buffer_object *bufobj = arrays[attr]->BufferObj;
|
||||||
@@ -205,11 +213,12 @@ void st_init_draw( struct st_context *st )
|
|||||||
assert(vbo->draw_prims);
|
assert(vbo->draw_prims);
|
||||||
vbo->draw_prims = draw_vbo;
|
vbo->draw_prims = draw_vbo;
|
||||||
|
|
||||||
#else
|
#endif
|
||||||
_tnl_destroy_pipeline( ctx );
|
_tnl_destroy_pipeline( ctx );
|
||||||
_tnl_install_pipeline( ctx, st_pipeline );
|
_tnl_install_pipeline( ctx, st_pipeline );
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* USE_NEW_DRAW */
|
||||||
|
_tnl_ProgramCacheInit( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user