Merge branch 'gallium-msaa'
[mesa.git] / src / gallium / drivers / nvfx / nvfx_state.c
1 #include "pipe/p_state.h"
2 #include "pipe/p_defines.h"
3 #include "util/u_inlines.h"
4
5 #include "draw/draw_context.h"
6
7 #include "tgsi/tgsi_parse.h"
8
9 #include "nvfx_context.h"
10 #include "nvfx_state.h"
11 #include "nvfx_tex.h"
12
13 static void *
14 nvfx_blend_state_create(struct pipe_context *pipe,
15 const struct pipe_blend_state *cso)
16 {
17 struct nvfx_context *nvfx = nvfx_context(pipe);
18 struct nvfx_blend_state *bso = CALLOC(1, sizeof(*bso));
19 struct nouveau_statebuf_builder sb = sb_init(bso->sb);
20
21 if (cso->rt[0].blend_enable) {
22 sb_method(sb, NV34TCL_BLEND_FUNC_ENABLE, 3);
23 sb_data(sb, 1);
24 sb_data(sb, (nvgl_blend_func(cso->rt[0].alpha_src_factor) << 16) |
25 nvgl_blend_func(cso->rt[0].rgb_src_factor));
26 sb_data(sb, nvgl_blend_func(cso->rt[0].alpha_dst_factor) << 16 |
27 nvgl_blend_func(cso->rt[0].rgb_dst_factor));
28 if(nvfx->screen->base.device->chipset < 0x40) {
29 sb_method(sb, NV34TCL_BLEND_EQUATION, 1);
30 sb_data(sb, nvgl_blend_eqn(cso->rt[0].rgb_func));
31 } else {
32 sb_method(sb, NV40TCL_BLEND_EQUATION, 1);
33 sb_data(sb, nvgl_blend_eqn(cso->rt[0].alpha_func) << 16 |
34 nvgl_blend_eqn(cso->rt[0].rgb_func));
35 }
36 } else {
37 sb_method(sb, NV34TCL_BLEND_FUNC_ENABLE, 1);
38 sb_data(sb, 0);
39 }
40
41 sb_method(sb, NV34TCL_COLOR_MASK, 1);
42 sb_data(sb, (((cso->rt[0].colormask & PIPE_MASK_A) ? (0x01 << 24) : 0) |
43 ((cso->rt[0].colormask & PIPE_MASK_R) ? (0x01 << 16) : 0) |
44 ((cso->rt[0].colormask & PIPE_MASK_G) ? (0x01 << 8) : 0) |
45 ((cso->rt[0].colormask & PIPE_MASK_B) ? (0x01 << 0) : 0)));
46
47 /* TODO: add NV40 MRT color mask */
48
49 if (cso->logicop_enable) {
50 sb_method(sb, NV34TCL_COLOR_LOGIC_OP_ENABLE, 2);
51 sb_data(sb, 1);
52 sb_data(sb, nvgl_logicop_func(cso->logicop_func));
53 } else {
54 sb_method(sb, NV34TCL_COLOR_LOGIC_OP_ENABLE, 1);
55 sb_data(sb, 0);
56 }
57
58 sb_method(sb, NV34TCL_DITHER_ENABLE, 1);
59 sb_data(sb, cso->dither ? 1 : 0);
60
61 bso->sb_len = sb_len(sb, bso->sb);
62 bso->pipe = *cso;
63 return (void *)bso;
64 }
65
66 static void
67 nvfx_blend_state_bind(struct pipe_context *pipe, void *hwcso)
68 {
69 struct nvfx_context *nvfx = nvfx_context(pipe);
70
71 nvfx->blend = hwcso;
72 nvfx->dirty |= NVFX_NEW_BLEND;
73 }
74
75 static void
76 nvfx_blend_state_delete(struct pipe_context *pipe, void *hwcso)
77 {
78 struct nvfx_blend_state *bso = hwcso;
79
80 FREE(bso);
81 }
82
83 static void *
84 nvfx_sampler_state_create(struct pipe_context *pipe,
85 const struct pipe_sampler_state *cso)
86 {
87 struct nvfx_context *nvfx = nvfx_context(pipe);
88 struct nvfx_sampler_state *ps;
89
90 ps = MALLOC(sizeof(struct nvfx_sampler_state));
91
92 /* on nv30, we use this as an internal flag */
93 ps->fmt = cso->normalized_coords ? 0 : NV40TCL_TEX_FORMAT_RECT;
94 ps->en = 0;
95 ps->filt = nvfx_tex_filter(cso);
96 ps->wrap = (nvfx_tex_wrap_mode(cso->wrap_s) << NV34TCL_TX_WRAP_S_SHIFT) |
97 (nvfx_tex_wrap_mode(cso->wrap_t) << NV34TCL_TX_WRAP_T_SHIFT) |
98 (nvfx_tex_wrap_mode(cso->wrap_r) << NV34TCL_TX_WRAP_R_SHIFT) |
99 nvfx_tex_wrap_compare_mode(cso);
100 ps->bcol = nvfx_tex_border_color(cso->border_color);
101
102 if(nvfx->is_nv4x)
103 nv40_sampler_state_init(pipe, ps, cso);
104 else
105 nv30_sampler_state_init(pipe, ps, cso);
106
107 return (void *)ps;
108 }
109
110 static void
111 nvfx_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **sampler)
112 {
113 struct nvfx_context *nvfx = nvfx_context(pipe);
114 unsigned unit;
115
116 for (unit = 0; unit < nr; unit++) {
117 nvfx->tex_sampler[unit] = sampler[unit];
118 nvfx->dirty_samplers |= (1 << unit);
119 }
120
121 for (unit = nr; unit < nvfx->nr_samplers; unit++) {
122 nvfx->tex_sampler[unit] = NULL;
123 nvfx->dirty_samplers |= (1 << unit);
124 }
125
126 nvfx->nr_samplers = nr;
127 nvfx->dirty |= NVFX_NEW_SAMPLER;
128 }
129
130 static void
131 nvfx_sampler_state_delete(struct pipe_context *pipe, void *hwcso)
132 {
133 FREE(hwcso);
134 }
135
136 static void
137 nvfx_set_fragment_sampler_views(struct pipe_context *pipe,
138 unsigned nr,
139 struct pipe_sampler_view **views)
140 {
141 struct nvfx_context *nvfx = nvfx_context(pipe);
142 unsigned unit;
143
144 for (unit = 0; unit < nr; unit++) {
145 pipe_sampler_view_reference(&nvfx->fragment_sampler_views[unit],
146 views[unit]);
147 nvfx->dirty_samplers |= (1 << unit);
148 }
149
150 for (unit = nr; unit < nvfx->nr_textures; unit++) {
151 pipe_sampler_view_reference(&nvfx->fragment_sampler_views[unit],
152 NULL);
153 nvfx->dirty_samplers |= (1 << unit);
154 }
155
156 nvfx->nr_textures = nr;
157 nvfx->dirty |= NVFX_NEW_SAMPLER;
158 }
159
160
161 static struct pipe_sampler_view *
162 nvfx_create_sampler_view(struct pipe_context *pipe,
163 struct pipe_resource *texture,
164 const struct pipe_sampler_view *templ)
165 {
166 struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
167
168 if (view) {
169 *view = *templ;
170 view->reference.count = 1;
171 view->texture = NULL;
172 pipe_resource_reference(&view->texture, texture);
173 view->context = pipe;
174 }
175
176 return view;
177 }
178
179
180 static void
181 nvfx_sampler_view_destroy(struct pipe_context *pipe,
182 struct pipe_sampler_view *view)
183 {
184 pipe_resource_reference(&view->texture, NULL);
185 FREE(view);
186 }
187
188 static void *
189 nvfx_rasterizer_state_create(struct pipe_context *pipe,
190 const struct pipe_rasterizer_state *cso)
191 {
192 struct nvfx_rasterizer_state *rsso = CALLOC(1, sizeof(*rsso));
193 struct nouveau_statebuf_builder sb = sb_init(rsso->sb);
194
195 /*XXX: ignored:
196 * point_smooth -nohw
197 * multisample
198 */
199
200 sb_method(sb, NV34TCL_SHADE_MODEL, 1);
201 sb_data(sb, cso->flatshade ? NV34TCL_SHADE_MODEL_FLAT :
202 NV34TCL_SHADE_MODEL_SMOOTH);
203
204 sb_method(sb, NV34TCL_VERTEX_TWO_SIDE_ENABLE, 1);
205 sb_data(sb, cso->light_twoside);
206
207 sb_method(sb, NV34TCL_LINE_WIDTH, 2);
208 sb_data(sb, (unsigned char)(cso->line_width * 8.0) & 0xff);
209 sb_data(sb, cso->line_smooth ? 1 : 0);
210 sb_method(sb, NV34TCL_LINE_STIPPLE_ENABLE, 2);
211 sb_data(sb, cso->line_stipple_enable ? 1 : 0);
212 sb_data(sb, (cso->line_stipple_pattern << 16) |
213 cso->line_stipple_factor);
214
215 sb_method(sb, NV34TCL_POINT_SIZE, 1);
216 sb_data(sb, fui(cso->point_size));
217
218 sb_method(sb, NV34TCL_POLYGON_MODE_FRONT, 6);
219 sb_data(sb, nvgl_polygon_mode(cso->fill_front));
220 sb_data(sb, nvgl_polygon_mode(cso->fill_back));
221 switch (cso->cull_face) {
222 case PIPE_FACE_FRONT:
223 sb_data(sb, NV34TCL_CULL_FACE_FRONT);
224 break;
225 case PIPE_FACE_BACK:
226 sb_data(sb, NV34TCL_CULL_FACE_BACK);
227 break;
228 case PIPE_FACE_FRONT_AND_BACK:
229 sb_data(sb, NV34TCL_CULL_FACE_FRONT_AND_BACK);
230 break;
231 default:
232 sb_data(sb, NV34TCL_CULL_FACE_BACK);
233 break;
234 }
235 if (cso->front_ccw) {
236 sb_data(sb, NV34TCL_FRONT_FACE_CCW);
237 } else {
238 sb_data(sb, NV34TCL_FRONT_FACE_CW);
239 }
240 sb_data(sb, cso->poly_smooth ? 1 : 0);
241 sb_data(sb, (cso->cull_face != PIPE_FACE_NONE) ? 1 : 0);
242
243 sb_method(sb, NV34TCL_POLYGON_STIPPLE_ENABLE, 1);
244 sb_data(sb, cso->poly_stipple_enable ? 1 : 0);
245
246 sb_method(sb, NV34TCL_POLYGON_OFFSET_POINT_ENABLE, 3);
247 sb_data(sb, cso->offset_point);
248 sb_data(sb, cso->offset_line);
249 sb_data(sb, cso->offset_tri);
250
251 if (cso->offset_point || cso->offset_line || cso->offset_tri) {
252 sb_method(sb, NV34TCL_POLYGON_OFFSET_FACTOR, 2);
253 sb_data(sb, fui(cso->offset_scale));
254 sb_data(sb, fui(cso->offset_units * 2));
255 }
256
257 sb_method(sb, NV34TCL_POINT_SPRITE, 1);
258 if (cso->point_quad_rasterization) {
259 unsigned psctl = (1 << 0), i;
260
261 for (i = 0; i < 8; i++) {
262 if ((cso->sprite_coord_enable >> i) & 1)
263 psctl |= (1 << (8 + i));
264 }
265
266 sb_data(sb, psctl);
267 } else {
268 sb_data(sb, 0);
269 }
270
271 rsso->pipe = *cso;
272 rsso->sb_len = sb_len(sb, rsso->sb);
273 return (void *)rsso;
274 }
275
276 static void
277 nvfx_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
278 {
279 struct nvfx_context *nvfx = nvfx_context(pipe);
280
281 if(nvfx->rasterizer && hwcso)
282 {
283 if(!nvfx->rasterizer || ((struct nvfx_rasterizer_state*)hwcso)->pipe.scissor
284 != nvfx->rasterizer->pipe.scissor)
285 {
286 nvfx->dirty |= NVFX_NEW_SCISSOR;
287 nvfx->draw_dirty |= NVFX_NEW_SCISSOR;
288 }
289
290 if(((struct nvfx_rasterizer_state*)hwcso)->pipe.poly_stipple_enable
291 != nvfx->rasterizer->pipe.poly_stipple_enable)
292 {
293 nvfx->dirty |= NVFX_NEW_STIPPLE;
294 nvfx->draw_dirty |= NVFX_NEW_STIPPLE;
295 }
296 }
297
298 nvfx->rasterizer = hwcso;
299 nvfx->dirty |= NVFX_NEW_RAST;
300 nvfx->draw_dirty |= NVFX_NEW_RAST;
301 }
302
303 static void
304 nvfx_rasterizer_state_delete(struct pipe_context *pipe, void *hwcso)
305 {
306 struct nvfx_rasterizer_state *rsso = hwcso;
307
308 FREE(rsso);
309 }
310
311 static void *
312 nvfx_depth_stencil_alpha_state_create(struct pipe_context *pipe,
313 const struct pipe_depth_stencil_alpha_state *cso)
314 {
315 struct nvfx_zsa_state *zsaso = CALLOC(1, sizeof(*zsaso));
316 struct nouveau_statebuf_builder sb = sb_init(zsaso->sb);
317
318 sb_method(sb, NV34TCL_DEPTH_FUNC, 3);
319 sb_data (sb, nvgl_comparison_op(cso->depth.func));
320 sb_data (sb, cso->depth.writemask ? 1 : 0);
321 sb_data (sb, cso->depth.enabled ? 1 : 0);
322
323 sb_method(sb, NV34TCL_ALPHA_FUNC_ENABLE, 3);
324 sb_data (sb, cso->alpha.enabled ? 1 : 0);
325 sb_data (sb, nvgl_comparison_op(cso->alpha.func));
326 sb_data (sb, float_to_ubyte(cso->alpha.ref_value));
327
328 if (cso->stencil[0].enabled) {
329 sb_method(sb, NV34TCL_STENCIL_FRONT_ENABLE, 3);
330 sb_data (sb, cso->stencil[0].enabled ? 1 : 0);
331 sb_data (sb, cso->stencil[0].writemask);
332 sb_data (sb, nvgl_comparison_op(cso->stencil[0].func));
333 sb_method(sb, NV34TCL_STENCIL_FRONT_FUNC_MASK, 4);
334 sb_data (sb, cso->stencil[0].valuemask);
335 sb_data (sb, nvgl_stencil_op(cso->stencil[0].fail_op));
336 sb_data (sb, nvgl_stencil_op(cso->stencil[0].zfail_op));
337 sb_data (sb, nvgl_stencil_op(cso->stencil[0].zpass_op));
338 } else {
339 sb_method(sb, NV34TCL_STENCIL_FRONT_ENABLE, 1);
340 sb_data (sb, 0);
341 }
342
343 if (cso->stencil[1].enabled) {
344 sb_method(sb, NV34TCL_STENCIL_BACK_ENABLE, 3);
345 sb_data (sb, cso->stencil[1].enabled ? 1 : 0);
346 sb_data (sb, cso->stencil[1].writemask);
347 sb_data (sb, nvgl_comparison_op(cso->stencil[1].func));
348 sb_method(sb, NV34TCL_STENCIL_BACK_FUNC_MASK, 4);
349 sb_data (sb, cso->stencil[1].valuemask);
350 sb_data (sb, nvgl_stencil_op(cso->stencil[1].fail_op));
351 sb_data (sb, nvgl_stencil_op(cso->stencil[1].zfail_op));
352 sb_data (sb, nvgl_stencil_op(cso->stencil[1].zpass_op));
353 } else {
354 sb_method(sb, NV34TCL_STENCIL_BACK_ENABLE, 1);
355 sb_data (sb, 0);
356 }
357
358 zsaso->pipe = *cso;
359 zsaso->sb_len = sb_len(sb, zsaso->sb);
360 return (void *)zsaso;
361 }
362
363 static void
364 nvfx_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *hwcso)
365 {
366 struct nvfx_context *nvfx = nvfx_context(pipe);
367
368 nvfx->zsa = hwcso;
369 nvfx->dirty |= NVFX_NEW_ZSA;
370 }
371
372 static void
373 nvfx_depth_stencil_alpha_state_delete(struct pipe_context *pipe, void *hwcso)
374 {
375 struct nvfx_zsa_state *zsaso = hwcso;
376
377 FREE(zsaso);
378 }
379
380 static void *
381 nvfx_vp_state_create(struct pipe_context *pipe,
382 const struct pipe_shader_state *cso)
383 {
384 struct nvfx_context *nvfx = nvfx_context(pipe);
385 struct nvfx_vertex_program *vp;
386
387 vp = CALLOC(1, sizeof(struct nvfx_vertex_program));
388 vp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
389 vp->draw = draw_create_vertex_shader(nvfx->draw, &vp->pipe);
390
391 return (void *)vp;
392 }
393
394 static void
395 nvfx_vp_state_bind(struct pipe_context *pipe, void *hwcso)
396 {
397 struct nvfx_context *nvfx = nvfx_context(pipe);
398
399 nvfx->vertprog = hwcso;
400 nvfx->dirty |= NVFX_NEW_VERTPROG;
401 nvfx->draw_dirty |= NVFX_NEW_VERTPROG;
402 }
403
404 static void
405 nvfx_vp_state_delete(struct pipe_context *pipe, void *hwcso)
406 {
407 struct nvfx_context *nvfx = nvfx_context(pipe);
408 struct nvfx_vertex_program *vp = hwcso;
409
410 draw_delete_vertex_shader(nvfx->draw, vp->draw);
411 nvfx_vertprog_destroy(nvfx, vp);
412 FREE((void*)vp->pipe.tokens);
413 FREE(vp);
414 }
415
416 static void *
417 nvfx_fp_state_create(struct pipe_context *pipe,
418 const struct pipe_shader_state *cso)
419 {
420 struct nvfx_fragment_program *fp;
421
422 fp = CALLOC(1, sizeof(struct nvfx_fragment_program));
423 fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
424
425 tgsi_scan_shader(fp->pipe.tokens, &fp->info);
426
427 return (void *)fp;
428 }
429
430 static void
431 nvfx_fp_state_bind(struct pipe_context *pipe, void *hwcso)
432 {
433 struct nvfx_context *nvfx = nvfx_context(pipe);
434
435 nvfx->fragprog = hwcso;
436 nvfx->dirty |= NVFX_NEW_FRAGPROG;
437 }
438
439 static void
440 nvfx_fp_state_delete(struct pipe_context *pipe, void *hwcso)
441 {
442 struct nvfx_context *nvfx = nvfx_context(pipe);
443 struct nvfx_fragment_program *fp = hwcso;
444
445 nvfx_fragprog_destroy(nvfx, fp);
446 FREE((void*)fp->pipe.tokens);
447 FREE(fp);
448 }
449
450 static void
451 nvfx_set_blend_color(struct pipe_context *pipe,
452 const struct pipe_blend_color *bcol)
453 {
454 struct nvfx_context *nvfx = nvfx_context(pipe);
455
456 nvfx->blend_colour = *bcol;
457 nvfx->dirty |= NVFX_NEW_BCOL;
458 }
459
460 static void
461 nvfx_set_stencil_ref(struct pipe_context *pipe,
462 const struct pipe_stencil_ref *sr)
463 {
464 struct nvfx_context *nvfx = nvfx_context(pipe);
465
466 nvfx->stencil_ref = *sr;
467 nvfx->dirty |= NVFX_NEW_SR;
468 }
469
470 static void
471 nvfx_set_clip_state(struct pipe_context *pipe,
472 const struct pipe_clip_state *clip)
473 {
474 struct nvfx_context *nvfx = nvfx_context(pipe);
475
476 nvfx->clip = *clip;
477 nvfx->dirty |= NVFX_NEW_UCP;
478 nvfx->draw_dirty |= NVFX_NEW_UCP;
479 }
480
481 static void
482 nvfx_set_sample_mask(struct pipe_context *pipe,
483 unsigned sample_mask)
484 {
485 }
486
487 static void
488 nvfx_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
489 struct pipe_resource *buf )
490 {
491 struct nvfx_context *nvfx = nvfx_context(pipe);
492
493 nvfx->constbuf[shader] = buf;
494 nvfx->constbuf_nr[shader] = buf->width0 / (4 * sizeof(float));
495
496 if (shader == PIPE_SHADER_VERTEX) {
497 nvfx->dirty |= NVFX_NEW_VERTCONST;
498 } else
499 if (shader == PIPE_SHADER_FRAGMENT) {
500 nvfx->dirty |= NVFX_NEW_FRAGCONST;
501 }
502 }
503
504 static void
505 nvfx_set_framebuffer_state(struct pipe_context *pipe,
506 const struct pipe_framebuffer_state *fb)
507 {
508 struct nvfx_context *nvfx = nvfx_context(pipe);
509
510 nvfx->framebuffer = *fb;
511 nvfx->dirty |= NVFX_NEW_FB;
512 }
513
514 static void
515 nvfx_set_polygon_stipple(struct pipe_context *pipe,
516 const struct pipe_poly_stipple *stipple)
517 {
518 struct nvfx_context *nvfx = nvfx_context(pipe);
519
520 memcpy(nvfx->stipple, stipple->stipple, 4 * 32);
521 nvfx->dirty |= NVFX_NEW_STIPPLE;
522 }
523
524 static void
525 nvfx_set_scissor_state(struct pipe_context *pipe,
526 const struct pipe_scissor_state *s)
527 {
528 struct nvfx_context *nvfx = nvfx_context(pipe);
529
530 nvfx->scissor = *s;
531 nvfx->dirty |= NVFX_NEW_SCISSOR;
532 }
533
534 static void
535 nvfx_set_viewport_state(struct pipe_context *pipe,
536 const struct pipe_viewport_state *vpt)
537 {
538 struct nvfx_context *nvfx = nvfx_context(pipe);
539
540 nvfx->viewport = *vpt;
541 nvfx->dirty |= NVFX_NEW_VIEWPORT;
542 nvfx->draw_dirty |= NVFX_NEW_VIEWPORT;
543 }
544
545 static void
546 nvfx_set_vertex_buffers(struct pipe_context *pipe, unsigned count,
547 const struct pipe_vertex_buffer *vb)
548 {
549 struct nvfx_context *nvfx = nvfx_context(pipe);
550
551 memcpy(nvfx->vtxbuf, vb, sizeof(*vb) * count);
552 nvfx->vtxbuf_nr = count;
553
554 nvfx->dirty |= NVFX_NEW_ARRAYS;
555 nvfx->draw_dirty |= NVFX_NEW_ARRAYS;
556 }
557
558 static void *
559 nvfx_vtxelts_state_create(struct pipe_context *pipe,
560 unsigned num_elements,
561 const struct pipe_vertex_element *elements)
562 {
563 struct nvfx_vtxelt_state *cso = CALLOC_STRUCT(nvfx_vtxelt_state);
564
565 assert(num_elements < 16); /* not doing fallbacks yet */
566 cso->num_elements = num_elements;
567 memcpy(cso->pipe, elements, num_elements * sizeof(*elements));
568
569 /* nvfx_vtxelt_construct(cso);*/
570
571 return (void *)cso;
572 }
573
574 static void
575 nvfx_vtxelts_state_delete(struct pipe_context *pipe, void *hwcso)
576 {
577 FREE(hwcso);
578 }
579
580 static void
581 nvfx_vtxelts_state_bind(struct pipe_context *pipe, void *hwcso)
582 {
583 struct nvfx_context *nvfx = nvfx_context(pipe);
584
585 nvfx->vtxelt = hwcso;
586 nvfx->dirty |= NVFX_NEW_ARRAYS;
587 /*nvfx->draw_dirty |= NVFX_NEW_ARRAYS;*/
588 }
589
590 void
591 nvfx_init_state_functions(struct nvfx_context *nvfx)
592 {
593 nvfx->pipe.create_blend_state = nvfx_blend_state_create;
594 nvfx->pipe.bind_blend_state = nvfx_blend_state_bind;
595 nvfx->pipe.delete_blend_state = nvfx_blend_state_delete;
596
597 nvfx->pipe.create_sampler_state = nvfx_sampler_state_create;
598 nvfx->pipe.bind_fragment_sampler_states = nvfx_sampler_state_bind;
599 nvfx->pipe.delete_sampler_state = nvfx_sampler_state_delete;
600 nvfx->pipe.set_fragment_sampler_views = nvfx_set_fragment_sampler_views;
601 nvfx->pipe.create_sampler_view = nvfx_create_sampler_view;
602 nvfx->pipe.sampler_view_destroy = nvfx_sampler_view_destroy;
603
604 nvfx->pipe.create_rasterizer_state = nvfx_rasterizer_state_create;
605 nvfx->pipe.bind_rasterizer_state = nvfx_rasterizer_state_bind;
606 nvfx->pipe.delete_rasterizer_state = nvfx_rasterizer_state_delete;
607
608 nvfx->pipe.create_depth_stencil_alpha_state =
609 nvfx_depth_stencil_alpha_state_create;
610 nvfx->pipe.bind_depth_stencil_alpha_state =
611 nvfx_depth_stencil_alpha_state_bind;
612 nvfx->pipe.delete_depth_stencil_alpha_state =
613 nvfx_depth_stencil_alpha_state_delete;
614
615 nvfx->pipe.create_vs_state = nvfx_vp_state_create;
616 nvfx->pipe.bind_vs_state = nvfx_vp_state_bind;
617 nvfx->pipe.delete_vs_state = nvfx_vp_state_delete;
618
619 nvfx->pipe.create_fs_state = nvfx_fp_state_create;
620 nvfx->pipe.bind_fs_state = nvfx_fp_state_bind;
621 nvfx->pipe.delete_fs_state = nvfx_fp_state_delete;
622
623 nvfx->pipe.set_blend_color = nvfx_set_blend_color;
624 nvfx->pipe.set_stencil_ref = nvfx_set_stencil_ref;
625 nvfx->pipe.set_clip_state = nvfx_set_clip_state;
626 nvfx->pipe.set_sample_mask = nvfx_set_sample_mask;
627 nvfx->pipe.set_constant_buffer = nvfx_set_constant_buffer;
628 nvfx->pipe.set_framebuffer_state = nvfx_set_framebuffer_state;
629 nvfx->pipe.set_polygon_stipple = nvfx_set_polygon_stipple;
630 nvfx->pipe.set_scissor_state = nvfx_set_scissor_state;
631 nvfx->pipe.set_viewport_state = nvfx_set_viewport_state;
632
633 nvfx->pipe.create_vertex_elements_state = nvfx_vtxelts_state_create;
634 nvfx->pipe.delete_vertex_elements_state = nvfx_vtxelts_state_delete;
635 nvfx->pipe.bind_vertex_elements_state = nvfx_vtxelts_state_bind;
636
637 nvfx->pipe.set_vertex_buffers = nvfx_set_vertex_buffers;
638 }