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