Squashed commit of the following:
[mesa.git] / src / gallium / drivers / nvfx / nvfx_context.h
index 46cc7362eabaac9c99c17f85a5f5989cafa304e9..9d988b015c2f10b1f634a8029c52f97a37649773 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "nouveau/nouveau_winsys.h"
 #include "nouveau/nouveau_gldefs.h"
-#include "nouveau/nouveau_context.h"
 #include "nouveau/nouveau_stateobj.h"
 
 #include "nvfx_state.h"
@@ -146,7 +145,7 @@ struct nvfx_context {
        struct pipe_clip_state clip;
        struct nvfx_vertex_program *vertprog;
        struct nvfx_fragment_program *fragprog;
-       struct pipe_buffer *constbuf[PIPE_SHADER_TYPES];
+       struct pipe_resource *constbuf[PIPE_SHADER_TYPES];
        unsigned constbuf_nr[PIPE_SHADER_TYPES];
        struct nvfx_rasterizer_state *rasterizer;
        struct nvfx_zsa_state *zsa;
@@ -155,10 +154,10 @@ struct nvfx_context {
        struct pipe_stencil_ref stencil_ref;
        struct pipe_viewport_state viewport;
        struct pipe_framebuffer_state framebuffer;
-       struct pipe_buffer *idxbuf;
+       struct pipe_resource *idxbuf;
        unsigned idxbuf_format;
        struct nvfx_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
-       struct nvfx_miptree *tex_miptree[PIPE_MAX_SAMPLERS];
+       struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
        unsigned nr_samplers;
        unsigned nr_textures;
        unsigned dirty_samplers;
@@ -184,6 +183,7 @@ struct nvfx_state_entry {
 extern struct nvfx_state_entry nvfx_state_blend;
 extern struct nvfx_state_entry nvfx_state_blend_colour;
 extern struct nvfx_state_entry nvfx_state_fragprog;
+extern struct nvfx_state_entry nvfx_state_fragtex;
 extern struct nvfx_state_entry nvfx_state_framebuffer;
 extern struct nvfx_state_entry nvfx_state_rasterizer;
 extern struct nvfx_state_entry nvfx_state_scissor;
@@ -198,13 +198,9 @@ extern struct nvfx_state_entry nvfx_state_zsa;
 extern void nvfx_init_query_functions(struct nvfx_context *nvfx);
 extern void nvfx_init_surface_functions(struct nvfx_context *nvfx);
 
-/* nv30_context.c */
+/* nvfx_context.c */
 struct pipe_context *
-nv30_create(struct pipe_screen *pscreen, void *priv);
-
-/* nv40_context.c */
-struct pipe_context *
-nv40_create(struct pipe_screen *pscreen, void *priv);
+nvfx_create(struct pipe_screen *pscreen, void *priv);
 
 /* nvfx_clear.c */
 extern void nvfx_clear(struct pipe_context *pipe, unsigned buffers,
@@ -213,7 +209,7 @@ extern void nvfx_clear(struct pipe_context *pipe, unsigned buffers,
 /* nvfx_draw.c */
 extern struct draw_stage *nvfx_draw_render_stage(struct nvfx_context *nvfx);
 extern void nvfx_draw_elements_swtnl(struct pipe_context *pipe,
-                                       struct pipe_buffer *idxbuf,
+                                       struct pipe_resource *idxbuf,
                                        unsigned ib_size, unsigned mode,
                                        unsigned start, unsigned count);
 
@@ -222,14 +218,22 @@ extern void nvfx_fragprog_destroy(struct nvfx_context *,
                                    struct nvfx_fragment_program *);
 
 /* nv30_fragtex.c */
-extern void nv30_init_sampler_functions(struct nvfx_context *nvfx);
+extern void
+nv30_sampler_state_init(struct pipe_context *pipe,
+                         struct nvfx_sampler_state *ps,
+                         const struct pipe_sampler_state *cso);
 extern void nv30_fragtex_bind(struct nvfx_context *);
-extern struct nvfx_state_entry nv30_state_fragtex;
+extern struct nouveau_stateobj *
+nv30_fragtex_build(struct nvfx_context *nvfx, int unit);
 
 /* nv40_fragtex.c */
-extern void nv40_init_sampler_functions(struct nvfx_context *nvfx);
+extern void
+nv40_sampler_state_init(struct pipe_context *pipe,
+                         struct nvfx_sampler_state *ps,
+                         const struct pipe_sampler_state *cso);
 extern void nv40_fragtex_bind(struct nvfx_context *);
-extern struct nvfx_state_entry nv40_state_fragtex;
+extern struct nouveau_stateobj *
+nv40_fragtex_build(struct nvfx_context *nvfx, int unit);
 
 /* nvfx_state.c */
 extern void nvfx_init_state_functions(struct nvfx_context *nvfx);
@@ -247,7 +251,7 @@ extern void nvfx_init_transfer_functions(struct nvfx_context *nvfx);
 extern void nvfx_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
 extern void nvfx_draw_elements(struct pipe_context *pipe,
-                                 struct pipe_buffer *indexBuffer,
+                                 struct pipe_resource *indexBuffer,
                                  unsigned indexSize,
                                  unsigned mode, unsigned start,
                                  unsigned count);