b0d75b4f828290b8478dbf24eee8b1423a2925e9
[mesa.git] / src / gallium / drivers / i965 / brw_structs.h
1 /*
2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
13
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26 **********************************************************************/
27 /*
28 * Authors:
29 * Keith Whitwell <keith@tungstengraphics.com>
30 */
31
32
33 #ifndef BRW_STRUCTS_H
34 #define BRW_STRUCTS_H
35
36 #include "brw_types.h"
37
38 /** Number of general purpose registers (VS, WM, etc) */
39 #define BRW_MAX_GRF 128
40
41 /** Number of message register file registers */
42 #define BRW_MAX_MRF 16
43
44
45 /* Command packets:
46 */
47 struct header
48 {
49 GLuint length:16;
50 GLuint opcode:16;
51 };
52
53
54 union header_union
55 {
56 struct header bits;
57 GLuint dword;
58 };
59
60 struct brw_3d_control
61 {
62 struct
63 {
64 GLuint length:8;
65 GLuint notify_enable:1;
66 GLuint pad:3;
67 GLuint wc_flush_enable:1;
68 GLuint depth_stall_enable:1;
69 GLuint operation:2;
70 GLuint opcode:16;
71 } header;
72
73 struct
74 {
75 GLuint pad:2;
76 GLuint dest_addr_type:1;
77 GLuint dest_addr:29;
78 } dest;
79
80 GLuint dword2;
81 GLuint dword3;
82 };
83
84
85 struct brw_3d_primitive
86 {
87 struct
88 {
89 GLuint length:8;
90 GLuint pad:2;
91 GLuint topology:5;
92 GLuint indexed:1;
93 GLuint opcode:16;
94 } header;
95
96 GLuint verts_per_instance;
97 GLuint start_vert_location;
98 GLuint instance_count;
99 GLuint start_instance_location;
100 GLuint base_vert_location;
101 };
102
103 /* These seem to be passed around as function args, so it works out
104 * better to keep them as #defines:
105 */
106 #define BRW_FLUSH_READ_CACHE 0x1
107 #define BRW_FLUSH_STATE_CACHE 0x2
108 #define BRW_INHIBIT_FLUSH_RENDER_CACHE 0x4
109 #define BRW_FLUSH_SNAPSHOT_COUNTERS 0x8
110
111 struct brw_mi_flush
112 {
113 GLuint flags:4;
114 GLuint pad:12;
115 GLuint opcode:16;
116 };
117
118 struct brw_vf_statistics
119 {
120 GLuint statistics_enable:1;
121 GLuint pad:15;
122 GLuint opcode:16;
123 };
124
125
126
127 struct brw_binding_table_pointers
128 {
129 struct header header;
130 GLuint vs;
131 GLuint gs;
132 GLuint clp;
133 GLuint sf;
134 GLuint wm;
135 };
136
137
138 struct brw_blend_constant_color
139 {
140 struct header header;
141 GLfloat blend_constant_color[4];
142 };
143
144
145 struct brw_depthbuffer
146 {
147 union header_union header;
148
149 union {
150 struct {
151 GLuint pitch:18;
152 GLuint format:3;
153 GLuint pad:2;
154 GLuint software_tiled_rendering_mode:2;
155 GLuint depth_offset_disable:1;
156 GLuint tile_walk:1;
157 GLuint tiled_surface:1;
158 GLuint pad2:1;
159 GLuint surface_type:3;
160 } bits;
161 GLuint dword;
162 } dword1;
163
164 GLuint dword2_base_addr;
165
166 union {
167 struct {
168 GLuint pad:1;
169 GLuint mipmap_layout:1;
170 GLuint lod:4;
171 GLuint width:13;
172 GLuint height:13;
173 } bits;
174 GLuint dword;
175 } dword3;
176
177 union {
178 struct {
179 GLuint pad:10;
180 GLuint min_array_element:11;
181 GLuint depth:11;
182 } bits;
183 GLuint dword;
184 } dword4;
185 };
186
187 struct brw_depthbuffer_g4x
188 {
189 union header_union header;
190
191 union {
192 struct {
193 GLuint pitch:18;
194 GLuint format:3;
195 GLuint pad:2;
196 GLuint software_tiled_rendering_mode:2;
197 GLuint depth_offset_disable:1;
198 GLuint tile_walk:1;
199 GLuint tiled_surface:1;
200 GLuint pad2:1;
201 GLuint surface_type:3;
202 } bits;
203 GLuint dword;
204 } dword1;
205
206 GLuint dword2_base_addr;
207
208 union {
209 struct {
210 GLuint pad:1;
211 GLuint mipmap_layout:1;
212 GLuint lod:4;
213 GLuint width:13;
214 GLuint height:13;
215 } bits;
216 GLuint dword;
217 } dword3;
218
219 union {
220 struct {
221 GLuint pad:10;
222 GLuint min_array_element:11;
223 GLuint depth:11;
224 } bits;
225 GLuint dword;
226 } dword4;
227
228 union {
229 struct {
230 GLuint xoffset:16;
231 GLuint yoffset:16;
232 } bits;
233 GLuint dword;
234 } dword5; /* NEW in Integrated Graphics Device */
235 };
236
237 struct brw_drawrect
238 {
239 struct header header;
240 GLuint xmin:16;
241 GLuint ymin:16;
242 GLuint xmax:16;
243 GLuint ymax:16;
244 GLuint xorg:16;
245 GLuint yorg:16;
246 };
247
248
249
250
251 struct brw_global_depth_offset_clamp
252 {
253 struct header header;
254 GLfloat depth_offset_clamp;
255 };
256
257 struct brw_indexbuffer
258 {
259 union {
260 struct
261 {
262 GLuint length:8;
263 GLuint index_format:2;
264 GLuint cut_index_enable:1;
265 GLuint pad:5;
266 GLuint opcode:16;
267 } bits;
268 GLuint dword;
269
270 } header;
271
272 GLuint buffer_start;
273 GLuint buffer_end;
274 };
275
276 /* NEW in Integrated Graphics Device */
277 struct brw_aa_line_parameters
278 {
279 struct header header;
280
281 struct {
282 GLuint aa_coverage_slope:8;
283 GLuint pad0:8;
284 GLuint aa_coverage_bias:8;
285 GLuint pad1:8;
286 } bits0;
287
288 struct {
289 GLuint aa_coverage_endcap_slope:8;
290 GLuint pad0:8;
291 GLuint aa_coverage_endcap_bias:8;
292 GLuint pad1:8;
293 } bits1;
294 };
295
296 struct brw_line_stipple
297 {
298 struct header header;
299
300 struct
301 {
302 GLuint pattern:16;
303 GLuint pad:16;
304 } bits0;
305
306 struct
307 {
308 GLuint repeat_count:9;
309 GLuint pad:7;
310 GLuint inverse_repeat_count:16;
311 } bits1;
312 };
313
314
315 struct brw_pipelined_state_pointers
316 {
317 struct header header;
318
319 struct {
320 GLuint pad:5;
321 GLuint offset:27; /* Offset from GENERAL_STATE_BASE */
322 } vs;
323
324 struct
325 {
326 GLuint enable:1;
327 GLuint pad:4;
328 GLuint offset:27; /* Offset from GENERAL_STATE_BASE */
329 } gs;
330
331 struct
332 {
333 GLuint enable:1;
334 GLuint pad:4;
335 GLuint offset:27; /* Offset from GENERAL_STATE_BASE */
336 } clp;
337
338 struct
339 {
340 GLuint pad:5;
341 GLuint offset:27; /* Offset from GENERAL_STATE_BASE */
342 } sf;
343
344 struct
345 {
346 GLuint pad:5;
347 GLuint offset:27; /* Offset from GENERAL_STATE_BASE */
348 } wm;
349
350 struct
351 {
352 GLuint pad:5;
353 GLuint offset:27; /* Offset from GENERAL_STATE_BASE. KW: check me! */
354 } cc;
355 };
356
357
358 struct brw_polygon_stipple_offset
359 {
360 struct header header;
361
362 struct {
363 GLuint y_offset:5;
364 GLuint pad:3;
365 GLuint x_offset:5;
366 GLuint pad0:19;
367 } bits0;
368 };
369
370
371
372 struct brw_polygon_stipple
373 {
374 struct header header;
375 GLuint stipple[32];
376 };
377
378
379
380 struct brw_pipeline_select
381 {
382 struct
383 {
384 GLuint pipeline_select:1;
385 GLuint pad:15;
386 GLuint opcode:16;
387 } header;
388 };
389
390
391 struct brw_pipe_control
392 {
393 struct
394 {
395 GLuint length:8;
396 GLuint notify_enable:1;
397 GLuint texture_cache_flush_enable:1;
398 GLuint indirect_state_pointers_disable:1;
399 GLuint instruction_state_cache_flush_enable:1;
400 GLuint write_cache_flush_enable:1;
401 GLuint depth_stall_enable:1;
402 GLuint post_sync_operation:2;
403
404 GLuint opcode:16;
405 } header;
406
407 struct
408 {
409 GLuint pad:2;
410 GLuint dest_addr_type:1;
411 GLuint dest_addr:29;
412 } bits1;
413
414 GLuint data0;
415 GLuint data1;
416 };
417
418
419 struct brw_urb_fence
420 {
421 struct
422 {
423 GLuint length:8;
424 GLuint vs_realloc:1;
425 GLuint gs_realloc:1;
426 GLuint clp_realloc:1;
427 GLuint sf_realloc:1;
428 GLuint vfe_realloc:1;
429 GLuint cs_realloc:1;
430 GLuint pad:2;
431 GLuint opcode:16;
432 } header;
433
434 struct
435 {
436 GLuint vs_fence:10;
437 GLuint gs_fence:10;
438 GLuint clp_fence:10;
439 GLuint pad:2;
440 } bits0;
441
442 struct
443 {
444 GLuint sf_fence:10;
445 GLuint vf_fence:10;
446 GLuint cs_fence:11;
447 GLuint pad:1;
448 } bits1;
449 };
450
451 struct brw_cs_urb_state
452 {
453 struct header header;
454
455 struct
456 {
457 GLuint nr_urb_entries:3;
458 GLuint pad:1;
459 GLuint urb_entry_size:5;
460 GLuint pad0:23;
461 } bits0;
462 };
463
464 struct brw_constant_buffer
465 {
466 struct
467 {
468 GLuint length:8;
469 GLuint valid:1;
470 GLuint pad:7;
471 GLuint opcode:16;
472 } header;
473
474 struct
475 {
476 GLuint buffer_length:6;
477 GLuint buffer_address:26;
478 } bits0;
479 };
480
481 struct brw_state_base_address
482 {
483 struct header header;
484
485 struct
486 {
487 GLuint modify_enable:1;
488 GLuint pad:4;
489 GLuint general_state_address:27;
490 } bits0;
491
492 struct
493 {
494 GLuint modify_enable:1;
495 GLuint pad:4;
496 GLuint surface_state_address:27;
497 } bits1;
498
499 struct
500 {
501 GLuint modify_enable:1;
502 GLuint pad:4;
503 GLuint indirect_object_state_address:27;
504 } bits2;
505
506 struct
507 {
508 GLuint modify_enable:1;
509 GLuint pad:11;
510 GLuint general_state_upper_bound:20;
511 } bits3;
512
513 struct
514 {
515 GLuint modify_enable:1;
516 GLuint pad:11;
517 GLuint indirect_object_state_upper_bound:20;
518 } bits4;
519 };
520
521 struct brw_state_prefetch
522 {
523 struct header header;
524
525 struct
526 {
527 GLuint prefetch_count:3;
528 GLuint pad:3;
529 GLuint prefetch_pointer:26;
530 } bits0;
531 };
532
533 struct brw_system_instruction_pointer
534 {
535 struct header header;
536
537 struct
538 {
539 GLuint pad:4;
540 GLuint system_instruction_pointer:28;
541 } bits0;
542 };
543
544
545
546
547 /* State structs for the various fixed function units:
548 */
549
550
551 struct thread0
552 {
553 GLuint pad0:1;
554 GLuint grf_reg_count:3;
555 GLuint pad1:2;
556 GLuint kernel_start_pointer:26; /* Offset from GENERAL_STATE_BASE */
557 };
558
559 struct thread1
560 {
561 GLuint ext_halt_exception_enable:1;
562 GLuint sw_exception_enable:1;
563 GLuint mask_stack_exception_enable:1;
564 GLuint timeout_exception_enable:1;
565 GLuint illegal_op_exception_enable:1;
566 GLuint pad0:3;
567 GLuint depth_coef_urb_read_offset:6; /* WM only */
568 GLuint pad1:2;
569 GLuint floating_point_mode:1;
570 GLuint thread_priority:1;
571 GLuint binding_table_entry_count:8;
572 GLuint pad3:5;
573 GLuint single_program_flow:1;
574 };
575
576 struct thread2
577 {
578 GLuint per_thread_scratch_space:4;
579 GLuint pad0:6;
580 GLuint scratch_space_base_pointer:22;
581 };
582
583
584 struct thread3
585 {
586 GLuint dispatch_grf_start_reg:4;
587 GLuint urb_entry_read_offset:6;
588 GLuint pad0:1;
589 GLuint urb_entry_read_length:6;
590 GLuint pad1:1;
591 GLuint const_urb_entry_read_offset:6;
592 GLuint pad2:1;
593 GLuint const_urb_entry_read_length:6;
594 GLuint pad3:1;
595 };
596
597
598
599 struct brw_clip_unit_state
600 {
601 struct thread0 thread0;
602 struct
603 {
604 GLuint pad0:7;
605 GLuint sw_exception_enable:1;
606 GLuint pad1:3;
607 GLuint mask_stack_exception_enable:1;
608 GLuint pad2:1;
609 GLuint illegal_op_exception_enable:1;
610 GLuint pad3:2;
611 GLuint floating_point_mode:1;
612 GLuint thread_priority:1;
613 GLuint binding_table_entry_count:8;
614 GLuint pad4:5;
615 GLuint single_program_flow:1;
616 } thread1;
617
618 struct thread2 thread2;
619 struct thread3 thread3;
620
621 struct
622 {
623 GLuint pad0:9;
624 GLuint gs_output_stats:1; /* not always */
625 GLuint stats_enable:1;
626 GLuint nr_urb_entries:7;
627 GLuint pad1:1;
628 GLuint urb_entry_allocation_size:5;
629 GLuint pad2:1;
630 GLuint max_threads:5; /* may be less */
631 GLuint pad3:2;
632 } thread4;
633
634 struct
635 {
636 GLuint pad0:13;
637 GLuint clip_mode:3;
638 GLuint userclip_enable_flags:8;
639 GLuint userclip_must_clip:1;
640 GLuint negative_w_clip_test:1;
641 GLuint guard_band_enable:1;
642 GLuint viewport_z_clip_enable:1;
643 GLuint viewport_xy_clip_enable:1;
644 GLuint vertex_position_space:1;
645 GLuint api_mode:1;
646 GLuint pad2:1;
647 } clip5;
648
649 struct
650 {
651 GLuint pad0:5;
652 GLuint clipper_viewport_state_ptr:27;
653 } clip6;
654
655
656 GLfloat viewport_xmin;
657 GLfloat viewport_xmax;
658 GLfloat viewport_ymin;
659 GLfloat viewport_ymax;
660 };
661
662 struct gen6_blend_state
663 {
664 struct {
665 GLuint dest_blend_factor:5;
666 GLuint source_blend_factor:5;
667 GLuint pad3:1;
668 GLuint blend_func:3;
669 GLuint pad2:1;
670 GLuint ia_dest_blend_factor:5;
671 GLuint ia_source_blend_factor:5;
672 GLuint pad1:1;
673 GLuint ia_blend_func:3;
674 GLuint pad0:1;
675 GLuint ia_blend_enable:1;
676 GLuint blend_enable:1;
677 } blend0;
678
679 struct {
680 GLuint post_blend_clamp_enable:1;
681 GLuint pre_blend_clamp_enable:1;
682 GLuint clamp_range:2;
683 GLuint pad0:4;
684 GLuint x_dither_offset:2;
685 GLuint y_dither_offset:2;
686 GLuint dither_enable:1;
687 GLuint alpha_test_func:3;
688 GLuint alpha_test_enable:1;
689 GLuint pad1:1;
690 GLuint logic_op_func:4;
691 GLuint logic_op_enable:1;
692 GLuint pad2:1;
693 GLuint write_disable_b:1;
694 GLuint write_disable_g:1;
695 GLuint write_disable_r:1;
696 GLuint write_disable_a:1;
697 GLuint pad3:1;
698 GLuint alpha_to_coverage_dither:1;
699 GLuint alpha_to_one:1;
700 GLuint alpha_to_coverage:1;
701 } blend1;
702 };
703
704 struct gen6_color_calc_state
705 {
706 struct {
707 GLuint alpha_test_format:1;
708 GLuint pad0:14;
709 GLuint round_disable:1;
710 GLuint bf_stencil_ref:8;
711 GLuint stencil_ref:8;
712 } cc0;
713
714 union {
715 GLfloat alpha_ref_f;
716 struct {
717 GLuint ui:8;
718 GLuint pad0:24;
719 } alpha_ref_fi;
720 } cc1;
721
722 GLfloat constant_r;
723 GLfloat constant_g;
724 GLfloat constant_b;
725 GLfloat constant_a;
726 };
727
728 struct gen6_depth_stencil_state
729 {
730 struct {
731 GLuint pad0:3;
732 GLuint bf_stencil_pass_depth_pass_op:3;
733 GLuint bf_stencil_pass_depth_fail_op:3;
734 GLuint bf_stencil_fail_op:3;
735 GLuint bf_stencil_func:3;
736 GLuint bf_stencil_enable:1;
737 GLuint pad1:2;
738 GLuint stencil_write_enable:1;
739 GLuint stencil_pass_depth_pass_op:3;
740 GLuint stencil_pass_depth_fail_op:3;
741 GLuint stencil_fail_op:3;
742 GLuint stencil_func:3;
743 GLuint stencil_enable:1;
744 } ds0;
745
746 struct {
747 GLuint bf_stencil_write_mask:8;
748 GLuint bf_stencil_test_mask:8;
749 GLuint stencil_write_mask:8;
750 GLuint stencil_test_mask:8;
751 } ds1;
752
753 struct {
754 GLuint pad0:26;
755 GLuint depth_write_enable:1;
756 GLuint depth_test_func:3;
757 GLuint pad1:1;
758 GLuint depth_test_enable:1;
759 } ds2;
760 };
761
762 struct brw_cc_unit_state
763 {
764 struct brw_cc0
765 {
766 GLuint pad0:3;
767 GLuint bf_stencil_pass_depth_pass_op:3;
768 GLuint bf_stencil_pass_depth_fail_op:3;
769 GLuint bf_stencil_fail_op:3;
770 GLuint bf_stencil_func:3;
771 GLuint bf_stencil_enable:1;
772 GLuint pad1:2;
773 GLuint stencil_write_enable:1;
774 GLuint stencil_pass_depth_pass_op:3;
775 GLuint stencil_pass_depth_fail_op:3;
776 GLuint stencil_fail_op:3;
777 GLuint stencil_func:3;
778 GLuint stencil_enable:1;
779 } cc0;
780
781
782 struct brw_cc1
783 {
784 GLuint bf_stencil_ref:8;
785 GLuint stencil_write_mask:8;
786 GLuint stencil_test_mask:8;
787 GLuint stencil_ref:8;
788 } cc1;
789
790
791 struct brw_cc2
792 {
793 GLuint logicop_enable:1;
794 GLuint pad0:10;
795 GLuint depth_write_enable:1;
796 GLuint depth_test_function:3;
797 GLuint depth_test:1;
798 GLuint bf_stencil_write_mask:8;
799 GLuint bf_stencil_test_mask:8;
800 } cc2;
801
802
803 struct brw_cc3
804 {
805 GLuint pad0:8;
806 GLuint alpha_test_func:3;
807 GLuint alpha_test:1;
808 GLuint blend_enable:1;
809 GLuint ia_blend_enable:1;
810 GLuint pad1:1;
811 GLuint alpha_test_format:1;
812 GLuint pad2:16;
813 } cc3;
814
815 struct brw_cc4
816 {
817 GLuint pad0:5;
818 GLuint cc_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */
819 } cc4;
820
821 struct brw_cc5
822 {
823 GLuint pad0:2;
824 GLuint ia_dest_blend_factor:5;
825 GLuint ia_src_blend_factor:5;
826 GLuint ia_blend_function:3;
827 GLuint statistics_enable:1;
828 GLuint logicop_func:4;
829 GLuint pad1:11;
830 GLuint dither_enable:1;
831 } cc5;
832
833 struct brw_cc6
834 {
835 GLuint clamp_post_alpha_blend:1;
836 GLuint clamp_pre_alpha_blend:1;
837 GLuint clamp_range:2;
838 GLuint pad0:11;
839 GLuint y_dither_offset:2;
840 GLuint x_dither_offset:2;
841 GLuint dest_blend_factor:5;
842 GLuint src_blend_factor:5;
843 GLuint blend_function:3;
844 } cc6;
845
846 struct brw_cc7 {
847 union {
848 GLfloat f;
849 GLubyte ub[4];
850 } alpha_ref;
851 } cc7;
852 };
853
854
855
856 struct brw_sf_unit_state
857 {
858 struct thread0 thread0;
859 struct thread1 thread1;
860 struct thread2 thread2;
861 struct thread3 thread3;
862
863 struct
864 {
865 GLuint pad0:10;
866 GLuint stats_enable:1;
867 GLuint nr_urb_entries:7;
868 GLuint pad1:1;
869 GLuint urb_entry_allocation_size:5;
870 GLuint pad2:1;
871 GLuint max_threads:6;
872 GLuint pad3:1;
873 } thread4;
874
875 struct
876 {
877 GLuint front_winding:1;
878 GLuint viewport_transform:1;
879 GLuint pad0:3;
880 GLuint sf_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */
881 } sf5;
882
883 struct
884 {
885 GLuint pad0:9;
886 GLuint dest_org_vbias:4;
887 GLuint dest_org_hbias:4;
888 GLuint scissor:1;
889 GLuint disable_2x2_trifilter:1;
890 GLuint disable_zero_pix_trifilter:1;
891 GLuint point_rast_rule:2;
892 GLuint line_endcap_aa_region_width:2;
893 GLuint line_width:4;
894 GLuint fast_scissor_disable:1;
895 GLuint cull_mode:2;
896 GLuint aa_enable:1;
897 } sf6;
898
899 struct
900 {
901 GLuint point_size:11;
902 GLuint use_point_size_state:1;
903 GLuint subpixel_precision:1;
904 GLuint sprite_point:1;
905 GLuint pad0:10;
906 GLuint aa_line_distance_mode:1;
907 GLuint trifan_pv:2;
908 GLuint linestrip_pv:2;
909 GLuint tristrip_pv:2;
910 GLuint line_last_pixel_enable:1;
911 } sf7;
912
913 };
914
915 struct gen6_scissor_rect
916 {
917 GLuint xmin:16;
918 GLuint ymin:16;
919 GLuint xmax:16;
920 GLuint ymax:16;
921 };
922
923 struct brw_gs_unit_state
924 {
925 struct thread0 thread0;
926 struct thread1 thread1;
927 struct thread2 thread2;
928 struct thread3 thread3;
929
930 struct
931 {
932 GLuint pad0:8;
933 GLuint rendering_enable:1; /* for Ironlake */
934 GLuint pad4:1;
935 GLuint stats_enable:1;
936 GLuint nr_urb_entries:7;
937 GLuint pad1:1;
938 GLuint urb_entry_allocation_size:5;
939 GLuint pad2:1;
940 GLuint max_threads:5;
941 GLuint pad3:2;
942 } thread4;
943
944 struct
945 {
946 GLuint sampler_count:3;
947 GLuint pad0:2;
948 GLuint sampler_state_pointer:27;
949 } gs5;
950
951
952 struct
953 {
954 GLuint max_vp_index:4;
955 GLuint pad0:12;
956 GLuint svbi_post_inc_value:10;
957 GLuint pad1:1;
958 GLuint svbi_post_inc_enable:1;
959 GLuint svbi_payload:1;
960 GLuint discard_adjaceny:1;
961 GLuint reorder_enable:1;
962 GLuint pad2:1;
963 } gs6;
964 };
965
966
967 struct brw_vs_unit_state
968 {
969 struct thread0 thread0;
970 struct thread1 thread1;
971 struct thread2 thread2;
972 struct thread3 thread3;
973
974 struct
975 {
976 GLuint pad0:10;
977 GLuint stats_enable:1;
978 GLuint nr_urb_entries:7;
979 GLuint pad1:1;
980 GLuint urb_entry_allocation_size:5;
981 GLuint pad2:1;
982 GLuint max_threads:6;
983 GLuint pad3:1;
984 } thread4;
985
986 struct
987 {
988 GLuint sampler_count:3;
989 GLuint pad0:2;
990 GLuint sampler_state_pointer:27;
991 } vs5;
992
993 struct
994 {
995 GLuint vs_enable:1;
996 GLuint vert_cache_disable:1;
997 GLuint pad0:30;
998 } vs6;
999 };
1000
1001
1002 struct brw_wm_unit_state
1003 {
1004 struct thread0 thread0;
1005 struct thread1 thread1;
1006 struct thread2 thread2;
1007 struct thread3 thread3;
1008
1009 struct {
1010 GLuint stats_enable:1;
1011 GLuint depth_buffer_clear:1;
1012 GLuint sampler_count:3;
1013 GLuint sampler_state_pointer:27;
1014 } wm4;
1015
1016 struct
1017 {
1018 GLuint enable_8_pix:1;
1019 GLuint enable_16_pix:1;
1020 GLuint enable_32_pix:1;
1021 GLuint enable_con_32_pix:1;
1022 GLuint enable_con_64_pix:1;
1023 GLuint pad0:5;
1024 GLuint legacy_global_depth_bias:1;
1025 GLuint line_stipple:1;
1026 GLuint depth_offset:1;
1027 GLuint polygon_stipple:1;
1028 GLuint line_aa_region_width:2;
1029 GLuint line_endcap_aa_region_width:2;
1030 GLuint early_depth_test:1;
1031 GLuint thread_dispatch_enable:1;
1032 GLuint program_uses_depth:1;
1033 GLuint program_computes_depth:1;
1034 GLuint program_uses_killpixel:1;
1035 GLuint legacy_line_rast: 1;
1036 GLuint transposed_urb_read_enable:1;
1037 GLuint max_threads:7;
1038 } wm5;
1039
1040 GLfloat global_depth_offset_constant;
1041 GLfloat global_depth_offset_scale;
1042
1043 /* for Ironlake only */
1044 struct {
1045 GLuint pad0:1;
1046 GLuint grf_reg_count_1:3;
1047 GLuint pad1:2;
1048 GLuint kernel_start_pointer_1:26;
1049 } wm8;
1050
1051 struct {
1052 GLuint pad0:1;
1053 GLuint grf_reg_count_2:3;
1054 GLuint pad1:2;
1055 GLuint kernel_start_pointer_2:26;
1056 } wm9;
1057
1058 struct {
1059 GLuint pad0:1;
1060 GLuint grf_reg_count_3:3;
1061 GLuint pad1:2;
1062 GLuint kernel_start_pointer_3:26;
1063 } wm10;
1064 };
1065
1066 struct brw_sampler_default_color {
1067 GLfloat color[4];
1068 };
1069
1070 struct gen5_sampler_default_color {
1071 uint8_t ub[4];
1072 float f[4];
1073 uint16_t hf[4];
1074 uint16_t us[4];
1075 int16_t s[4];
1076 uint8_t b[4];
1077 };
1078
1079 struct brw_sampler_state
1080 {
1081
1082 struct brw_ss0
1083 {
1084 GLuint shadow_function:3;
1085 GLuint lod_bias:11;
1086 GLuint min_filter:3;
1087 GLuint mag_filter:3;
1088 GLuint mip_filter:2;
1089 GLuint base_level:5;
1090 GLuint min_mag_neq:1;
1091 GLuint lod_preclamp:1;
1092 GLuint default_color_mode:1;
1093 GLuint pad0:1;
1094 GLuint disable:1;
1095 } ss0;
1096
1097 struct brw_ss1
1098 {
1099 GLuint r_wrap_mode:3;
1100 GLuint t_wrap_mode:3;
1101 GLuint s_wrap_mode:3;
1102 GLuint cube_control_mode:1;
1103 GLuint pad:2;
1104 GLuint max_lod:10;
1105 GLuint min_lod:10;
1106 } ss1;
1107
1108
1109 struct brw_ss2
1110 {
1111 GLuint pad:5;
1112 GLuint default_color_pointer:27;
1113 } ss2;
1114
1115 struct brw_ss3
1116 {
1117 GLuint non_normalized_coord:1;
1118 GLuint pad:12;
1119 GLuint address_round:6;
1120 GLuint max_aniso:3;
1121 GLuint chroma_key_mode:1;
1122 GLuint chroma_key_index:2;
1123 GLuint chroma_key_enable:1;
1124 GLuint monochrome_filter_width:3;
1125 GLuint monochrome_filter_height:3;
1126 } ss3;
1127 };
1128
1129
1130 struct brw_clipper_viewport
1131 {
1132 GLfloat xmin;
1133 GLfloat xmax;
1134 GLfloat ymin;
1135 GLfloat ymax;
1136 };
1137
1138 struct brw_cc_viewport
1139 {
1140 GLfloat min_depth;
1141 GLfloat max_depth;
1142 };
1143
1144 struct brw_sf_viewport
1145 {
1146 struct {
1147 GLfloat m00;
1148 GLfloat m11;
1149 GLfloat m22;
1150 GLfloat m30;
1151 GLfloat m31;
1152 GLfloat m32;
1153 } viewport;
1154
1155 /* scissor coordinates are inclusive */
1156 struct {
1157 GLshort xmin;
1158 GLshort ymin;
1159 GLshort xmax;
1160 GLshort ymax;
1161 } scissor;
1162 };
1163
1164 struct gen6_sf_viewport {
1165 GLfloat m00;
1166 GLfloat m11;
1167 GLfloat m22;
1168 GLfloat m30;
1169 GLfloat m31;
1170 GLfloat m32;
1171 };
1172
1173 /* Documented in the subsystem/shared-functions/sampler chapter...
1174 */
1175 struct brw_surface_state
1176 {
1177 struct brw_surf_ss0 {
1178 GLuint cube_pos_z:1;
1179 GLuint cube_neg_z:1;
1180 GLuint cube_pos_y:1;
1181 GLuint cube_neg_y:1;
1182 GLuint cube_pos_x:1;
1183 GLuint cube_neg_x:1;
1184 GLuint pad:2;
1185 /* Required on gen6 for surfaces accessed through render cache messages.
1186 */
1187 GLuint render_cache_read_write:1;
1188 /* Ironlake and newer: instead of replicating one of the texels */
1189 GLuint cube_corner_average:1;
1190 GLuint mipmap_layout_mode:1;
1191 GLuint vert_line_stride_ofs:1;
1192 GLuint vert_line_stride:1;
1193 GLuint color_blend:1;
1194 GLuint writedisable_blue:1;
1195 GLuint writedisable_green:1;
1196 GLuint writedisable_red:1;
1197 GLuint writedisable_alpha:1;
1198 GLuint surface_format:9; /**< BRW_SURFACEFORMAT_x */
1199 GLuint data_return_format:1;
1200 GLuint pad0:1;
1201 GLuint surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */
1202 } ss0;
1203
1204 struct brw_surf_ss1 {
1205 GLuint base_addr;
1206 } ss1;
1207
1208 struct brw_surf_ss2 {
1209 GLuint pad:2;
1210 GLuint mip_count:4;
1211 GLuint width:13;
1212 GLuint height:13;
1213 } ss2;
1214
1215 struct brw_surf_ss3 {
1216 GLuint tile_walk:1;
1217 GLuint tiled_surface:1;
1218 GLuint pad:1;
1219 GLuint pitch:18;
1220 GLuint depth:11;
1221 } ss3;
1222
1223 struct brw_surf_ss4 {
1224 GLuint multisample_position_palette_index:3;
1225 GLuint pad1:1;
1226 GLuint num_multisamples:3;
1227 GLuint pad0:1;
1228 GLuint render_target_view_extent:9;
1229 GLuint min_array_elt:11;
1230 GLuint min_lod:4;
1231 } ss4;
1232
1233 struct brw_surf_ss5 {
1234 GLuint pad1:16;
1235 GLuint llc_mapping:1;
1236 GLuint mlc_mapping:1;
1237 GLuint gfdt:1;
1238 GLuint gfdt_src:1;
1239 GLuint y_offset:4;
1240 GLuint pad0:1;
1241 GLuint x_offset:7;
1242 } ss5; /* New in G4X */
1243
1244 };
1245
1246
1247
1248 struct brw_vertex_buffer_state
1249 {
1250 struct {
1251 GLuint pitch:11;
1252 GLuint pad:15;
1253 GLuint access_type:1;
1254 GLuint vb_index:5;
1255 } vb0;
1256
1257 GLuint start_addr;
1258 GLuint max_index;
1259 #if 1
1260 GLuint instance_data_step_rate; /* not included for sequential/random vertices? */
1261 #endif
1262 };
1263
1264 #define BRW_VBP_MAX 17
1265
1266 struct brw_vb_array_state {
1267 struct header header;
1268 struct brw_vertex_buffer_state vb[BRW_VBP_MAX];
1269 };
1270
1271
1272 struct brw_vertex_element_state
1273 {
1274 struct
1275 {
1276 GLuint src_offset:11;
1277 GLuint pad:5;
1278 GLuint src_format:9;
1279 GLuint pad0:1;
1280 GLuint valid:1;
1281 GLuint vertex_buffer_index:5;
1282 } ve0;
1283
1284 struct
1285 {
1286 GLuint dst_offset:8;
1287 GLuint pad:8;
1288 GLuint vfcomponent3:4;
1289 GLuint vfcomponent2:4;
1290 GLuint vfcomponent1:4;
1291 GLuint vfcomponent0:4;
1292 } ve1;
1293 };
1294
1295 #define BRW_VEP_MAX 18
1296
1297 struct brw_vertex_element_packet {
1298 struct header header;
1299 struct brw_vertex_element_state ve[BRW_VEP_MAX]; /* note: less than _TNL_ATTRIB_MAX */
1300 };
1301
1302
1303 struct brw_urb_immediate {
1304 GLuint opcode:4;
1305 GLuint offset:6;
1306 GLuint swizzle_control:2;
1307 GLuint pad:1;
1308 GLuint allocate:1;
1309 GLuint used:1;
1310 GLuint complete:1;
1311 GLuint response_length:4;
1312 GLuint msg_length:4;
1313 GLuint msg_target:4;
1314 GLuint pad1:3;
1315 GLuint end_of_thread:1;
1316 };
1317
1318 /* Instruction format for the execution units:
1319 */
1320
1321 struct brw_instruction
1322 {
1323 struct
1324 {
1325 GLuint opcode:7;
1326 GLuint pad:1;
1327 GLuint access_mode:1;
1328 GLuint mask_control:1;
1329 GLuint dependency_control:2;
1330 GLuint compression_control:2;
1331 GLuint thread_control:2;
1332 GLuint predicate_control:4;
1333 GLuint predicate_inverse:1;
1334 GLuint execution_size:3;
1335 GLuint destreg__conditionalmod:4; /* destreg - send, conditionalmod - others */
1336 GLuint acc_wr_control:1;
1337 GLuint cmpt_control:1;
1338 GLuint debug_control:1;
1339 GLuint saturate:1;
1340 } header;
1341
1342 union {
1343 struct
1344 {
1345 GLuint dest_reg_file:2;
1346 GLuint dest_reg_type:3;
1347 GLuint src0_reg_file:2;
1348 GLuint src0_reg_type:3;
1349 GLuint src1_reg_file:2;
1350 GLuint src1_reg_type:3;
1351 GLuint pad:1;
1352 GLuint dest_subreg_nr:5;
1353 GLuint dest_reg_nr:8;
1354 GLuint dest_horiz_stride:2;
1355 GLuint dest_address_mode:1;
1356 } da1;
1357
1358 struct
1359 {
1360 GLuint dest_reg_file:2;
1361 GLuint dest_reg_type:3;
1362 GLuint src0_reg_file:2;
1363 GLuint src0_reg_type:3;
1364 GLuint src1_reg_file:2; /* 0x00000c00 */
1365 GLuint src1_reg_type:3; /* 0x00007000 */
1366 GLuint pad:1;
1367 GLint dest_indirect_offset:10; /* offset against the deref'd address reg */
1368 GLuint dest_subreg_nr:3; /* subnr for the address reg a0.x */
1369 GLuint dest_horiz_stride:2;
1370 GLuint dest_address_mode:1;
1371 } ia1;
1372
1373 struct
1374 {
1375 GLuint dest_reg_file:2;
1376 GLuint dest_reg_type:3;
1377 GLuint src0_reg_file:2;
1378 GLuint src0_reg_type:3;
1379 GLuint src1_reg_file:2;
1380 GLuint src1_reg_type:3;
1381 GLuint pad:1;
1382 GLuint dest_writemask:4;
1383 GLuint dest_subreg_nr:1;
1384 GLuint dest_reg_nr:8;
1385 GLuint dest_horiz_stride:2;
1386 GLuint dest_address_mode:1;
1387 } da16;
1388
1389 struct
1390 {
1391 GLuint dest_reg_file:2;
1392 GLuint dest_reg_type:3;
1393 GLuint src0_reg_file:2;
1394 GLuint src0_reg_type:3;
1395 GLuint pad0:6;
1396 GLuint dest_writemask:4;
1397 GLint dest_indirect_offset:6;
1398 GLuint dest_subreg_nr:3;
1399 GLuint dest_horiz_stride:2;
1400 GLuint dest_address_mode:1;
1401 } ia16;
1402
1403 struct {
1404 GLuint dest_reg_file:2;
1405 GLuint dest_reg_type:3;
1406 GLuint src0_reg_file:2;
1407 GLuint src0_reg_type:3;
1408 GLuint src1_reg_file:2;
1409 GLuint src1_reg_type:3;
1410 GLuint pad:1;
1411
1412 GLint jump_count:16;
1413 } branch_gen6;
1414 } bits1;
1415
1416
1417 union {
1418 struct
1419 {
1420 GLuint src0_subreg_nr:5;
1421 GLuint src0_reg_nr:8;
1422 GLuint src0_abs:1;
1423 GLuint src0_negate:1;
1424 GLuint src0_address_mode:1;
1425 GLuint src0_horiz_stride:2;
1426 GLuint src0_width:3;
1427 GLuint src0_vert_stride:4;
1428 GLuint flag_reg_nr:1;
1429 GLuint pad:6;
1430 } da1;
1431
1432 struct
1433 {
1434 GLint src0_indirect_offset:10;
1435 GLuint src0_subreg_nr:3;
1436 GLuint src0_abs:1;
1437 GLuint src0_negate:1;
1438 GLuint src0_address_mode:1;
1439 GLuint src0_horiz_stride:2;
1440 GLuint src0_width:3;
1441 GLuint src0_vert_stride:4;
1442 GLuint flag_reg_nr:1;
1443 GLuint pad:6;
1444 } ia1;
1445
1446 struct
1447 {
1448 GLuint src0_swz_x:2;
1449 GLuint src0_swz_y:2;
1450 GLuint src0_subreg_nr:1;
1451 GLuint src0_reg_nr:8;
1452 GLuint src0_abs:1;
1453 GLuint src0_negate:1;
1454 GLuint src0_address_mode:1;
1455 GLuint src0_swz_z:2;
1456 GLuint src0_swz_w:2;
1457 GLuint pad0:1;
1458 GLuint src0_vert_stride:4;
1459 GLuint flag_reg_nr:1;
1460 GLuint pad1:6;
1461 } da16;
1462
1463 struct
1464 {
1465 GLuint src0_swz_x:2;
1466 GLuint src0_swz_y:2;
1467 GLint src0_indirect_offset:6;
1468 GLuint src0_subreg_nr:3;
1469 GLuint src0_abs:1;
1470 GLuint src0_negate:1;
1471 GLuint src0_address_mode:1;
1472 GLuint src0_swz_z:2;
1473 GLuint src0_swz_w:2;
1474 GLuint pad0:1;
1475 GLuint src0_vert_stride:4;
1476 GLuint flag_reg_nr:1;
1477 GLuint pad1:6;
1478 } ia16;
1479
1480 struct
1481 {
1482 GLuint pad:26;
1483 GLuint end_of_thread:1;
1484 GLuint pad1:1;
1485 GLuint sfid:4;
1486 } send_gen5; /* for Ironlake only */
1487
1488 } bits2;
1489
1490 union
1491 {
1492 struct
1493 {
1494 GLuint src1_subreg_nr:5;
1495 GLuint src1_reg_nr:8;
1496 GLuint src1_abs:1;
1497 GLuint src1_negate:1;
1498 GLuint src1_address_mode:1;
1499 GLuint src1_horiz_stride:2;
1500 GLuint src1_width:3;
1501 GLuint src1_vert_stride:4;
1502 GLuint pad0:7;
1503 } da1;
1504
1505 struct
1506 {
1507 GLuint src1_swz_x:2;
1508 GLuint src1_swz_y:2;
1509 GLuint src1_subreg_nr:1;
1510 GLuint src1_reg_nr:8;
1511 GLuint src1_abs:1;
1512 GLuint src1_negate:1;
1513 GLuint src1_address_mode:1;
1514 GLuint src1_swz_z:2;
1515 GLuint src1_swz_w:2;
1516 GLuint pad1:1;
1517 GLuint src1_vert_stride:4;
1518 GLuint pad2:7;
1519 } da16;
1520
1521 struct
1522 {
1523 GLint src1_indirect_offset:10;
1524 GLuint src1_subreg_nr:3;
1525 GLuint src1_abs:1;
1526 GLuint src1_negate:1;
1527 GLuint src1_address_mode:1;
1528 GLuint src1_horiz_stride:2;
1529 GLuint src1_width:3;
1530 GLuint src1_vert_stride:4;
1531 GLuint flag_reg_nr:1;
1532 GLuint pad1:6;
1533 } ia1;
1534
1535 struct
1536 {
1537 GLuint src1_swz_x:2;
1538 GLuint src1_swz_y:2;
1539 GLint src1_indirect_offset:6;
1540 GLuint src1_subreg_nr:3;
1541 GLuint src1_abs:1;
1542 GLuint src1_negate:1;
1543 GLuint pad0:1;
1544 GLuint src1_swz_z:2;
1545 GLuint src1_swz_w:2;
1546 GLuint pad1:1;
1547 GLuint src1_vert_stride:4;
1548 GLuint flag_reg_nr:1;
1549 GLuint pad2:6;
1550 } ia16;
1551
1552
1553 struct
1554 {
1555 GLint jump_count:16; /* note: signed */
1556 GLuint pop_count:4;
1557 GLuint pad0:12;
1558 } if_else;
1559
1560 struct
1561 {
1562 /* Signed jump distance to the ip to jump to if all channels
1563 * are disabled after the break or continue. It should point
1564 * to the end of the innermost control flow block, as that's
1565 * where some channel could get re-enabled.
1566 */
1567 int jip:16;
1568
1569 /* Signed jump distance to the location to resume execution
1570 * of this channel if it's enabled for the break or continue.
1571 */
1572 int uip:16;
1573 } break_cont;
1574
1575 struct {
1576 GLuint function:4;
1577 GLuint int_type:1;
1578 GLuint precision:1;
1579 GLuint saturate:1;
1580 GLuint data_type:1;
1581 GLuint pad0:8;
1582 GLuint response_length:4;
1583 GLuint msg_length:4;
1584 GLuint msg_target:4;
1585 GLuint pad1:3;
1586 GLuint end_of_thread:1;
1587 } math;
1588
1589 struct {
1590 GLuint function:4;
1591 GLuint int_type:1;
1592 GLuint precision:1;
1593 GLuint saturate:1;
1594 GLuint data_type:1;
1595 GLuint snapshot:1;
1596 GLuint pad0:10;
1597 GLuint header_present:1;
1598 GLuint response_length:5;
1599 GLuint msg_length:4;
1600 GLuint pad1:2;
1601 GLuint end_of_thread:1;
1602 } math_gen5;
1603
1604 struct {
1605 GLuint binding_table_index:8;
1606 GLuint sampler:4;
1607 GLuint return_format:2;
1608 GLuint msg_type:2;
1609 GLuint response_length:4;
1610 GLuint msg_length:4;
1611 GLuint msg_target:4;
1612 GLuint pad1:3;
1613 GLuint end_of_thread:1;
1614 } sampler;
1615
1616 struct {
1617 GLuint binding_table_index:8;
1618 GLuint sampler:4;
1619 GLuint msg_type:4;
1620 GLuint response_length:4;
1621 GLuint msg_length:4;
1622 GLuint msg_target:4;
1623 GLuint pad1:3;
1624 GLuint end_of_thread:1;
1625 } sampler_g4x;
1626
1627 struct {
1628 GLuint binding_table_index:8;
1629 GLuint sampler:4;
1630 GLuint msg_type:4;
1631 GLuint simd_mode:2;
1632 GLuint pad0:1;
1633 GLuint header_present:1;
1634 GLuint response_length:5;
1635 GLuint msg_length:4;
1636 GLuint pad1:2;
1637 GLuint end_of_thread:1;
1638 } sampler_gen5;
1639
1640 struct brw_urb_immediate urb;
1641
1642 struct {
1643 GLuint opcode:4;
1644 GLuint offset:6;
1645 GLuint swizzle_control:2;
1646 GLuint pad:1;
1647 GLuint allocate:1;
1648 GLuint used:1;
1649 GLuint complete:1;
1650 GLuint pad0:3;
1651 GLuint header_present:1;
1652 GLuint response_length:5;
1653 GLuint msg_length:4;
1654 GLuint pad1:2;
1655 GLuint end_of_thread:1;
1656 } urb_gen5;
1657
1658 struct {
1659 GLuint binding_table_index:8;
1660 GLuint msg_control:4;
1661 GLuint msg_type:2;
1662 GLuint target_cache:2;
1663 GLuint response_length:4;
1664 GLuint msg_length:4;
1665 GLuint msg_target:4;
1666 GLuint pad1:3;
1667 GLuint end_of_thread:1;
1668 } dp_read;
1669
1670 struct {
1671 GLuint binding_table_index:8;
1672 GLuint msg_control:3;
1673 GLuint msg_type:3;
1674 GLuint target_cache:2;
1675 GLuint response_length:4;
1676 GLuint msg_length:4;
1677 GLuint msg_target:4;
1678 GLuint pad1:3;
1679 GLuint end_of_thread:1;
1680 } dp_read_g4x;
1681
1682 struct {
1683 GLuint binding_table_index:8;
1684 GLuint msg_control:3;
1685 GLuint msg_type:3;
1686 GLuint target_cache:2;
1687 GLuint pad0:3;
1688 GLuint header_present:1;
1689 GLuint response_length:5;
1690 GLuint msg_length:4;
1691 GLuint pad1:2;
1692 GLuint end_of_thread:1;
1693 } dp_read_gen5;
1694
1695 struct {
1696 GLuint binding_table_index:8;
1697 GLuint msg_control:3;
1698 GLuint pixel_scoreboard_clear:1;
1699 GLuint msg_type:3;
1700 GLuint send_commit_msg:1;
1701 GLuint response_length:4;
1702 GLuint msg_length:4;
1703 GLuint msg_target:4;
1704 GLuint pad1:3;
1705 GLuint end_of_thread:1;
1706 } dp_write;
1707
1708 struct {
1709 GLuint binding_table_index:8;
1710 GLuint msg_control:3;
1711 GLuint pixel_scoreboard_clear:1;
1712 GLuint msg_type:3;
1713 GLuint send_commit_msg:1;
1714 GLuint pad0:3;
1715 GLuint header_present:1;
1716 GLuint response_length:5;
1717 GLuint msg_length:4;
1718 GLuint pad1:2;
1719 GLuint end_of_thread:1;
1720 } dp_write_gen5;
1721
1722 /* Sandybridge DP for sample cache, constant cache, render cache */
1723 struct {
1724 GLuint binding_table_index:8;
1725 GLuint msg_control:5;
1726 GLuint msg_type:3;
1727 GLuint pad0:3;
1728 GLuint header_present:1;
1729 GLuint response_length:5;
1730 GLuint msg_length:4;
1731 GLuint pad1:2;
1732 GLuint end_of_thread:1;
1733 } dp_sampler_const_cache;
1734
1735 struct {
1736 GLuint binding_table_index:8;
1737 GLuint msg_control:3;
1738 GLuint slot_group_select:1;
1739 GLuint pixel_scoreboard_clear:1;
1740 GLuint msg_type:4;
1741 GLuint send_commit_msg:1;
1742 GLuint pad0:1;
1743 GLuint header_present:1;
1744 GLuint response_length:5;
1745 GLuint msg_length:4;
1746 GLuint pad1:2;
1747 GLuint end_of_thread:1;
1748 } dp_render_cache;
1749
1750 struct {
1751 GLuint function_control:16;
1752 GLuint response_length:4;
1753 GLuint msg_length:4;
1754 GLuint msg_target:4;
1755 GLuint pad1:3;
1756 GLuint end_of_thread:1;
1757 } generic;
1758
1759 /* Of this struct, only end_of_thread is not present for gen6. */
1760 struct {
1761 GLuint function_control:19;
1762 GLuint header_present:1;
1763 GLuint response_length:5;
1764 GLuint msg_length:4;
1765 GLuint pad1:2;
1766 GLuint end_of_thread:1;
1767 } generic_gen5;
1768
1769 GLint d;
1770 GLuint ud;
1771 float f;
1772 } bits3;
1773 };
1774
1775
1776 #endif