nvfx: refactor to support multiple fragment program versions
[mesa.git] / src / gallium / drivers / nvfx / nvfx_context.h
index 83c44ef477cd2b18f0cf595cb70c82533b1908d5..2134f3c3865d3c4e56637ea39b1d9de10c91ad6e 100644 (file)
@@ -68,7 +68,6 @@ struct nvfx_blend_state {
 
 struct nvfx_state {
        unsigned scissor_enabled;
-       unsigned stipple_enabled;
        unsigned fp_samplers;
        unsigned render_temps;
 };
@@ -162,7 +161,7 @@ struct nvfx_context {
        unsigned stipple[32];
        struct pipe_clip_state clip;
        struct nvfx_vertex_program *vertprog;
-       struct nvfx_fragment_program *fragprog;
+       struct nvfx_pipe_fragment_program *fragprog;
        struct pipe_resource *constbuf[PIPE_SHADER_TYPES];
        unsigned constbuf_nr[PIPE_SHADER_TYPES];
        struct nvfx_rasterizer_state *rasterizer;
@@ -175,6 +174,8 @@ struct nvfx_context {
        struct pipe_index_buffer idxbuf;
        struct nvfx_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
        struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
+       struct nvfx_pipe_fragment_program* dummy_fs;
+
        unsigned nr_samplers;
        unsigned nr_textures;
        unsigned dirty_samplers;
@@ -194,6 +195,9 @@ struct nvfx_context {
        uint32_t hw_txf[8];
        struct nvfx_render_target hw_rt[4];
        struct nvfx_render_target hw_zeta;
+       int hw_pointsprite_control;
+       int hw_vp_output;
+       struct nvfx_fragment_program* hw_fragprog;
 };
 
 static INLINE struct nvfx_context *
@@ -243,8 +247,8 @@ nvfx_framebuffer_relocate(struct nvfx_context *nvfx);
 extern void nvfx_fragprog_destroy(struct nvfx_context *,
                                    struct nvfx_fragment_program *);
 extern void nvfx_fragprog_validate(struct nvfx_context *nvfx);
-extern void
-nvfx_fragprog_relocate(struct nvfx_context *nvfx);
+extern void nvfx_fragprog_relocate(struct nvfx_context *nvfx);
+extern void nvfx_init_fragprog_functions(struct nvfx_context *nvfx);
 
 /* nvfx_fragtex.c */
 extern void nvfx_init_sampling_functions(struct nvfx_context *nvfx);
@@ -307,6 +311,7 @@ extern unsigned nvfx_vertex_formats[];
 extern boolean nvfx_vertprog_validate(struct nvfx_context *nvfx);
 extern void nvfx_vertprog_destroy(struct nvfx_context *,
                                  struct nvfx_vertex_program *);
+extern void nvfx_init_vertprog_functions(struct nvfx_context *nvfx);
 
 /* nvfx_push.c */
 extern void nvfx_push_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info);