Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
[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 /* Command packets:
37 */
38 struct header
39 {
40 GLuint length:16;
41 GLuint opcode:16;
42 };
43
44
45 union header_union
46 {
47 struct header bits;
48 GLuint dword;
49 };
50
51 struct brw_3d_control
52 {
53 struct
54 {
55 GLuint length:8;
56 GLuint notify_enable:1;
57 GLuint pad:3;
58 GLuint wc_flush_enable:1;
59 GLuint depth_stall_enable:1;
60 GLuint operation:2;
61 GLuint opcode:16;
62 } header;
63
64 struct
65 {
66 GLuint pad:2;
67 GLuint dest_addr_type:1;
68 GLuint dest_addr:29;
69 } dest;
70
71 GLuint dword2;
72 GLuint dword3;
73 };
74
75
76 struct brw_3d_primitive
77 {
78 struct
79 {
80 GLuint length:8;
81 GLuint pad:2;
82 GLuint topology:5;
83 GLuint indexed:1;
84 GLuint opcode:16;
85 } header;
86
87 GLuint verts_per_instance;
88 GLuint start_vert_location;
89 GLuint instance_count;
90 GLuint start_instance_location;
91 GLuint base_vert_location;
92 };
93
94 /* These seem to be passed around as function args, so it works out
95 * better to keep them as #defines:
96 */
97 #define BRW_FLUSH_READ_CACHE 0x1
98 #define BRW_FLUSH_STATE_CACHE 0x2
99 #define BRW_INHIBIT_FLUSH_RENDER_CACHE 0x4
100 #define BRW_FLUSH_SNAPSHOT_COUNTERS 0x8
101
102 struct brw_mi_flush
103 {
104 GLuint flags:4;
105 GLuint pad:12;
106 GLuint opcode:16;
107 };
108
109 struct brw_vf_statistics
110 {
111 GLuint statistics_enable:1;
112 GLuint pad:15;
113 GLuint opcode:16;
114 };
115
116
117
118 struct brw_binding_table_pointers
119 {
120 struct header header;
121 GLuint vs;
122 GLuint gs;
123 GLuint clp;
124 GLuint sf;
125 GLuint wm;
126 };
127
128
129 struct brw_blend_constant_color
130 {
131 struct header header;
132 GLfloat blend_constant_color[4];
133 };
134
135
136 struct brw_depthbuffer
137 {
138 union header_union header;
139
140 union {
141 struct {
142 GLuint pitch:18;
143 GLuint format:3;
144 GLuint pad:4;
145 GLuint depth_offset_disable:1;
146 GLuint tile_walk:1;
147 GLuint tiled_surface:1;
148 GLuint pad2:1;
149 GLuint surface_type:3;
150 } bits;
151 GLuint dword;
152 } dword1;
153
154 GLuint dword2_base_addr;
155
156 union {
157 struct {
158 GLuint pad:1;
159 GLuint mipmap_layout:1;
160 GLuint lod:4;
161 GLuint width:13;
162 GLuint height:13;
163 } bits;
164 GLuint dword;
165 } dword3;
166
167 union {
168 struct {
169 GLuint pad:12;
170 GLuint min_array_element:9;
171 GLuint depth:11;
172 } bits;
173 GLuint dword;
174 } dword4;
175 };
176
177 struct brw_drawrect
178 {
179 struct header header;
180 GLuint xmin:16;
181 GLuint ymin:16;
182 GLuint xmax:16;
183 GLuint ymax:16;
184 GLuint xorg:16;
185 GLuint yorg:16;
186 };
187
188
189
190
191 struct brw_global_depth_offset_clamp
192 {
193 struct header header;
194 GLfloat depth_offset_clamp;
195 };
196
197 struct brw_indexbuffer
198 {
199 union {
200 struct
201 {
202 GLuint length:8;
203 GLuint index_format:2;
204 GLuint cut_index_enable:1;
205 GLuint pad:5;
206 GLuint opcode:16;
207 } bits;
208 GLuint dword;
209
210 } header;
211
212 GLuint buffer_start;
213 GLuint buffer_end;
214 };
215
216
217 struct brw_line_stipple
218 {
219 struct header header;
220
221 struct
222 {
223 GLuint pattern:16;
224 GLuint pad:16;
225 } bits0;
226
227 struct
228 {
229 GLuint repeat_count:9;
230 GLuint pad:7;
231 GLuint inverse_repeat_count:16;
232 } bits1;
233 };
234
235
236 struct brw_pipelined_state_pointers
237 {
238 struct header header;
239
240 struct {
241 GLuint pad:5;
242 GLuint offset:27;
243 } vs;
244
245 struct
246 {
247 GLuint enable:1;
248 GLuint pad:4;
249 GLuint offset:27;
250 } gs;
251
252 struct
253 {
254 GLuint enable:1;
255 GLuint pad:4;
256 GLuint offset:27;
257 } clp;
258
259 struct
260 {
261 GLuint pad:5;
262 GLuint offset:27;
263 } sf;
264
265 struct
266 {
267 GLuint pad:5;
268 GLuint offset:27;
269 } wm;
270
271 struct
272 {
273 GLuint pad:5;
274 GLuint offset:27; /* KW: check me! */
275 } cc;
276 };
277
278
279 struct brw_polygon_stipple_offset
280 {
281 struct header header;
282
283 struct {
284 GLuint y_offset:5;
285 GLuint pad:3;
286 GLuint x_offset:5;
287 GLuint pad0:19;
288 } bits0;
289 };
290
291
292
293 struct brw_polygon_stipple
294 {
295 struct header header;
296 GLuint stipple[32];
297 };
298
299
300
301 struct brw_pipeline_select
302 {
303 struct
304 {
305 GLuint pipeline_select:1;
306 GLuint pad:15;
307 GLuint opcode:16;
308 } header;
309 };
310
311
312 struct brw_pipe_control
313 {
314 struct
315 {
316 GLuint length:8;
317 GLuint notify_enable:1;
318 GLuint pad:2;
319 GLuint instruction_state_cache_flush_enable:1;
320 GLuint write_cache_flush_enable:1;
321 GLuint depth_stall_enable:1;
322 GLuint post_sync_operation:2;
323
324 GLuint opcode:16;
325 } header;
326
327 struct
328 {
329 GLuint pad:2;
330 GLuint dest_addr_type:1;
331 GLuint dest_addr:29;
332 } bits1;
333
334 GLuint data0;
335 GLuint data1;
336 };
337
338
339 struct brw_urb_fence
340 {
341 struct
342 {
343 GLuint length:8;
344 GLuint vs_realloc:1;
345 GLuint gs_realloc:1;
346 GLuint clp_realloc:1;
347 GLuint sf_realloc:1;
348 GLuint vfe_realloc:1;
349 GLuint cs_realloc:1;
350 GLuint pad:2;
351 GLuint opcode:16;
352 } header;
353
354 struct
355 {
356 GLuint vs_fence:10;
357 GLuint gs_fence:10;
358 GLuint clp_fence:10;
359 GLuint pad:2;
360 } bits0;
361
362 struct
363 {
364 GLuint sf_fence:10;
365 GLuint vf_fence:10;
366 GLuint cs_fence:10;
367 GLuint pad:2;
368 } bits1;
369 };
370
371 struct brw_constant_buffer_state /* previously brw_command_streamer */
372 {
373 struct header header;
374
375 struct
376 {
377 GLuint nr_urb_entries:3;
378 GLuint pad:1;
379 GLuint urb_entry_size:5;
380 GLuint pad0:23;
381 } bits0;
382 };
383
384 struct brw_constant_buffer
385 {
386 struct
387 {
388 GLuint length:8;
389 GLuint valid:1;
390 GLuint pad:7;
391 GLuint opcode:16;
392 } header;
393
394 struct
395 {
396 GLuint buffer_length:6;
397 GLuint buffer_address:26;
398 } bits0;
399 };
400
401 struct brw_state_base_address
402 {
403 struct header header;
404
405 struct
406 {
407 GLuint modify_enable:1;
408 GLuint pad:4;
409 GLuint general_state_address:27;
410 } bits0;
411
412 struct
413 {
414 GLuint modify_enable:1;
415 GLuint pad:4;
416 GLuint surface_state_address:27;
417 } bits1;
418
419 struct
420 {
421 GLuint modify_enable:1;
422 GLuint pad:4;
423 GLuint indirect_object_state_address:27;
424 } bits2;
425
426 struct
427 {
428 GLuint modify_enable:1;
429 GLuint pad:11;
430 GLuint general_state_upper_bound:20;
431 } bits3;
432
433 struct
434 {
435 GLuint modify_enable:1;
436 GLuint pad:11;
437 GLuint indirect_object_state_upper_bound:20;
438 } bits4;
439 };
440
441 struct brw_state_prefetch
442 {
443 struct header header;
444
445 struct
446 {
447 GLuint prefetch_count:3;
448 GLuint pad:3;
449 GLuint prefetch_pointer:26;
450 } bits0;
451 };
452
453 struct brw_system_instruction_pointer
454 {
455 struct header header;
456
457 struct
458 {
459 GLuint pad:4;
460 GLuint system_instruction_pointer:28;
461 } bits0;
462 };
463
464
465
466
467 /* State structs for the various fixed function units:
468 */
469
470
471 struct thread0
472 {
473 GLuint pad0:1;
474 GLuint grf_reg_count:3;
475 GLuint pad1:2;
476 GLuint kernel_start_pointer:26;
477 };
478
479 struct thread1
480 {
481 GLuint ext_halt_exception_enable:1;
482 GLuint sw_exception_enable:1;
483 GLuint mask_stack_exception_enable:1;
484 GLuint timeout_exception_enable:1;
485 GLuint illegal_op_exception_enable:1;
486 GLuint pad0:3;
487 GLuint depth_coef_urb_read_offset:6; /* WM only */
488 GLuint pad1:2;
489 GLuint floating_point_mode:1;
490 GLuint thread_priority:1;
491 GLuint binding_table_entry_count:8;
492 GLuint pad3:5;
493 GLuint single_program_flow:1;
494 };
495
496 struct thread2
497 {
498 GLuint per_thread_scratch_space:4;
499 GLuint pad0:6;
500 GLuint scratch_space_base_pointer:22;
501 };
502
503
504 struct thread3
505 {
506 GLuint dispatch_grf_start_reg:4;
507 GLuint urb_entry_read_offset:6;
508 GLuint pad0:1;
509 GLuint urb_entry_read_length:6;
510 GLuint pad1:1;
511 GLuint const_urb_entry_read_offset:6;
512 GLuint pad2:1;
513 GLuint const_urb_entry_read_length:6;
514 GLuint pad3:1;
515 };
516
517
518
519 struct brw_clip_unit_state
520 {
521 struct thread0 thread0;
522 struct
523 {
524 GLuint pad0:7;
525 GLuint sw_exception_enable:1;
526 GLuint pad1:3;
527 GLuint mask_stack_exception_enable:1;
528 GLuint pad2:1;
529 GLuint illegal_op_exception_enable:1;
530 GLuint pad3:2;
531 GLuint floating_point_mode:1;
532 GLuint thread_priority:1;
533 GLuint binding_table_entry_count:8;
534 GLuint pad4:5;
535 GLuint single_program_flow:1;
536 } thread1;
537
538 struct thread2 thread2;
539 struct thread3 thread3;
540
541 struct
542 {
543 GLuint pad0:9;
544 GLuint gs_output_stats:1; /* not always */
545 GLuint stats_enable:1;
546 GLuint nr_urb_entries:7;
547 GLuint pad1:1;
548 GLuint urb_entry_allocation_size:5;
549 GLuint pad2:1;
550 GLuint max_threads:1; /* may be less */
551 GLuint pad3:6;
552 } thread4;
553
554 struct
555 {
556 GLuint pad0:13;
557 GLuint clip_mode:3;
558 GLuint userclip_enable_flags:8;
559 GLuint userclip_must_clip:1;
560 GLuint pad1:1;
561 GLuint guard_band_enable:1;
562 GLuint viewport_z_clip_enable:1;
563 GLuint viewport_xy_clip_enable:1;
564 GLuint vertex_position_space:1;
565 GLuint api_mode:1;
566 GLuint pad2:1;
567 } clip5;
568
569 struct
570 {
571 GLuint pad0:5;
572 GLuint clipper_viewport_state_ptr:27;
573 } clip6;
574
575
576 GLfloat viewport_xmin;
577 GLfloat viewport_xmax;
578 GLfloat viewport_ymin;
579 GLfloat viewport_ymax;
580 };
581
582
583
584 struct brw_cc_unit_state
585 {
586 struct
587 {
588 GLuint pad0:3;
589 GLuint bf_stencil_pass_depth_pass_op:3;
590 GLuint bf_stencil_pass_depth_fail_op:3;
591 GLuint bf_stencil_fail_op:3;
592 GLuint bf_stencil_func:3;
593 GLuint bf_stencil_enable:1;
594 GLuint pad1:2;
595 GLuint stencil_write_enable:1;
596 GLuint stencil_pass_depth_pass_op:3;
597 GLuint stencil_pass_depth_fail_op:3;
598 GLuint stencil_fail_op:3;
599 GLuint stencil_func:3;
600 GLuint stencil_enable:1;
601 } cc0;
602
603
604 struct
605 {
606 GLuint bf_stencil_ref:8;
607 GLuint stencil_write_mask:8;
608 GLuint stencil_test_mask:8;
609 GLuint stencil_ref:8;
610 } cc1;
611
612
613 struct
614 {
615 GLuint logicop_enable:1;
616 GLuint pad0:10;
617 GLuint depth_write_enable:1;
618 GLuint depth_test_function:3;
619 GLuint depth_test:1;
620 GLuint bf_stencil_write_mask:8;
621 GLuint bf_stencil_test_mask:8;
622 } cc2;
623
624
625 struct
626 {
627 GLuint pad0:8;
628 GLuint alpha_test_func:3;
629 GLuint alpha_test:1;
630 GLuint blend_enable:1;
631 GLuint ia_blend_enable:1;
632 GLuint pad1:1;
633 GLuint alpha_test_format:1;
634 GLuint pad2:16;
635 } cc3;
636
637 struct
638 {
639 GLuint pad0:5;
640 GLuint cc_viewport_state_offset:27;
641 } cc4;
642
643 struct
644 {
645 GLuint pad0:2;
646 GLuint ia_dest_blend_factor:5;
647 GLuint ia_src_blend_factor:5;
648 GLuint ia_blend_function:3;
649 GLuint statistics_enable:1;
650 GLuint logicop_func:4;
651 GLuint pad1:11;
652 GLuint dither_enable:1;
653 } cc5;
654
655 struct
656 {
657 GLuint clamp_post_alpha_blend:1;
658 GLuint clamp_pre_alpha_blend:1;
659 GLuint clamp_range:2;
660 GLuint pad0:11;
661 GLuint y_dither_offset:2;
662 GLuint x_dither_offset:2;
663 GLuint dest_blend_factor:5;
664 GLuint src_blend_factor:5;
665 GLuint blend_function:3;
666 } cc6;
667
668 struct {
669 union {
670 GLfloat f;
671 GLubyte ub[4];
672 } alpha_ref;
673 } cc7;
674 };
675
676
677
678 struct brw_sf_unit_state
679 {
680 struct thread0 thread0;
681 struct thread1 thread1;
682 struct thread2 thread2;
683 struct thread3 thread3;
684
685 struct
686 {
687 GLuint pad0:10;
688 GLuint stats_enable:1;
689 GLuint nr_urb_entries:7;
690 GLuint pad1:1;
691 GLuint urb_entry_allocation_size:5;
692 GLuint pad2:1;
693 GLuint max_threads:6;
694 GLuint pad3:1;
695 } thread4;
696
697 struct
698 {
699 GLuint front_winding:1;
700 GLuint viewport_transform:1;
701 GLuint pad0:3;
702 GLuint sf_viewport_state_offset:27;
703 } sf5;
704
705 struct
706 {
707 GLuint pad0:9;
708 GLuint dest_org_vbias:4;
709 GLuint dest_org_hbias:4;
710 GLuint scissor:1;
711 GLuint disable_2x2_trifilter:1;
712 GLuint disable_zero_pix_trifilter:1;
713 GLuint point_rast_rule:2;
714 GLuint line_endcap_aa_region_width:2;
715 GLuint line_width:4;
716 GLuint fast_scissor_disable:1;
717 GLuint cull_mode:2;
718 GLuint aa_enable:1;
719 } sf6;
720
721 struct
722 {
723 GLuint point_size:11;
724 GLuint use_point_size_state:1;
725 GLuint subpixel_precision:1;
726 GLuint sprite_point:1;
727 GLuint pad0:11;
728 GLuint trifan_pv:2;
729 GLuint linestrip_pv:2;
730 GLuint tristrip_pv:2;
731 GLuint line_last_pixel_enable:1;
732 } sf7;
733
734 };
735
736
737 struct brw_gs_unit_state
738 {
739 struct thread0 thread0;
740 struct thread1 thread1;
741 struct thread2 thread2;
742 struct thread3 thread3;
743
744 struct
745 {
746 GLuint pad0:10;
747 GLuint stats_enable:1;
748 GLuint nr_urb_entries:7;
749 GLuint pad1:1;
750 GLuint urb_entry_allocation_size:5;
751 GLuint pad2:1;
752 GLuint max_threads:1;
753 GLuint pad3:6;
754 } thread4;
755
756 struct
757 {
758 GLuint sampler_count:3;
759 GLuint pad0:2;
760 GLuint sampler_state_pointer:27;
761 } gs5;
762
763
764 struct
765 {
766 GLuint max_vp_index:4;
767 GLuint pad0:26;
768 GLuint reorder_enable:1;
769 GLuint pad1:1;
770 } gs6;
771 };
772
773
774 struct brw_vs_unit_state
775 {
776 struct thread0 thread0;
777 struct thread1 thread1;
778 struct thread2 thread2;
779 struct thread3 thread3;
780
781 struct
782 {
783 GLuint pad0:10;
784 GLuint stats_enable:1;
785 GLuint nr_urb_entries:7;
786 GLuint pad1:1;
787 GLuint urb_entry_allocation_size:5;
788 GLuint pad2:1;
789 GLuint max_threads:4;
790 GLuint pad3:3;
791 } thread4;
792
793 struct
794 {
795 GLuint sampler_count:3;
796 GLuint pad0:2;
797 GLuint sampler_state_pointer:27;
798 } vs5;
799
800 struct
801 {
802 GLuint vs_enable:1;
803 GLuint vert_cache_disable:1;
804 GLuint pad0:30;
805 } vs6;
806 };
807
808
809 struct brw_wm_unit_state
810 {
811 struct thread0 thread0;
812 struct thread1 thread1;
813 struct thread2 thread2;
814 struct thread3 thread3;
815
816 struct {
817 GLuint stats_enable:1;
818 GLuint pad0:1;
819 GLuint sampler_count:3;
820 GLuint sampler_state_pointer:27;
821 } wm4;
822
823 struct
824 {
825 GLuint enable_8_pix:1;
826 GLuint enable_16_pix:1;
827 GLuint enable_32_pix:1;
828 GLuint pad0:7;
829 GLuint legacy_global_depth_bias:1;
830 GLuint line_stipple:1;
831 GLuint depth_offset:1;
832 GLuint polygon_stipple:1;
833 GLuint line_aa_region_width:2;
834 GLuint line_endcap_aa_region_width:2;
835 GLuint early_depth_test:1;
836 GLuint thread_dispatch_enable:1;
837 GLuint program_uses_depth:1;
838 GLuint program_computes_depth:1;
839 GLuint program_uses_killpixel:1;
840 GLuint legacy_line_rast: 1;
841 GLuint pad1:1;
842 GLuint max_threads:6;
843 GLuint pad2:1;
844 } wm5;
845
846 GLfloat global_depth_offset_constant;
847 GLfloat global_depth_offset_scale;
848 };
849
850 struct brw_sampler_default_color {
851 GLfloat color[4];
852 };
853
854 struct brw_sampler_state
855 {
856
857 struct
858 {
859 GLuint shadow_function:3;
860 GLuint lod_bias:11;
861 GLuint min_filter:3;
862 GLuint mag_filter:3;
863 GLuint mip_filter:2;
864 GLuint base_level:5;
865 GLuint pad:1;
866 GLuint lod_preclamp:1;
867 GLuint default_color_mode:1;
868 GLuint pad0:1;
869 GLuint disable:1;
870 } ss0;
871
872 struct
873 {
874 GLuint r_wrap_mode:3;
875 GLuint t_wrap_mode:3;
876 GLuint s_wrap_mode:3;
877 GLuint pad:3;
878 GLuint max_lod:10;
879 GLuint min_lod:10;
880 } ss1;
881
882
883 struct
884 {
885 GLuint pad:5;
886 GLuint default_color_pointer:27;
887 } ss2;
888
889 struct
890 {
891 GLuint pad:19;
892 GLuint max_aniso:3;
893 GLuint chroma_key_mode:1;
894 GLuint chroma_key_index:2;
895 GLuint chroma_key_enable:1;
896 GLuint monochrome_filter_width:3;
897 GLuint monochrome_filter_height:3;
898 } ss3;
899 };
900
901
902 struct brw_clipper_viewport
903 {
904 GLfloat xmin;
905 GLfloat xmax;
906 GLfloat ymin;
907 GLfloat ymax;
908 };
909
910 struct brw_cc_viewport
911 {
912 GLfloat min_depth;
913 GLfloat max_depth;
914 };
915
916 struct brw_sf_viewport
917 {
918 struct {
919 GLfloat m00;
920 GLfloat m11;
921 GLfloat m22;
922 GLfloat m30;
923 GLfloat m31;
924 GLfloat m32;
925 } viewport;
926
927 struct {
928 GLshort xmin;
929 GLshort ymin;
930 GLshort xmax;
931 GLshort ymax;
932 } scissor;
933 };
934
935 /* Documented in the subsystem/shared-functions/sampler chapter...
936 */
937 struct brw_surface_state
938 {
939 struct {
940 GLuint cube_pos_z:1;
941 GLuint cube_neg_z:1;
942 GLuint cube_pos_y:1;
943 GLuint cube_neg_y:1;
944 GLuint cube_pos_x:1;
945 GLuint cube_neg_x:1;
946 GLuint pad:4;
947 GLuint mipmap_layout_mode:1;
948 GLuint vert_line_stride_ofs:1;
949 GLuint vert_line_stride:1;
950 GLuint color_blend:1;
951 GLuint writedisable_blue:1;
952 GLuint writedisable_green:1;
953 GLuint writedisable_red:1;
954 GLuint writedisable_alpha:1;
955 GLuint surface_format:9;
956 GLuint data_return_format:1;
957 GLuint pad0:1;
958 GLuint surface_type:3;
959 } ss0;
960
961 struct {
962 GLuint base_addr;
963 } ss1;
964
965 struct {
966 GLuint pad:2;
967 GLuint mip_count:4;
968 GLuint width:13;
969 GLuint height:13;
970 } ss2;
971
972 struct {
973 GLuint tile_walk:1;
974 GLuint tiled_surface:1;
975 GLuint pad:1;
976 GLuint pitch:18;
977 GLuint depth:11;
978 } ss3;
979
980 struct {
981 GLuint pad:19;
982 GLuint min_array_elt:9;
983 GLuint min_lod:4;
984 } ss4;
985 };
986
987
988
989 struct brw_vertex_buffer_state
990 {
991 struct {
992 GLuint pitch:11;
993 GLuint pad:15;
994 GLuint access_type:1;
995 GLuint vb_index:5;
996 } vb0;
997
998 GLuint start_addr;
999 GLuint max_index;
1000 #if 1
1001 GLuint instance_data_step_rate; /* not included for sequential/random vertices? */
1002 #endif
1003 };
1004
1005 #define BRW_VBP_MAX 17
1006
1007 struct brw_vb_array_state {
1008 struct header header;
1009 struct brw_vertex_buffer_state vb[BRW_VBP_MAX];
1010 };
1011
1012
1013 struct brw_vertex_element_state
1014 {
1015 struct
1016 {
1017 GLuint src_offset:11;
1018 GLuint pad:5;
1019 GLuint src_format:9;
1020 GLuint pad0:1;
1021 GLuint valid:1;
1022 GLuint vertex_buffer_index:5;
1023 } ve0;
1024
1025 struct
1026 {
1027 GLuint dst_offset:8;
1028 GLuint pad:8;
1029 GLuint vfcomponent3:4;
1030 GLuint vfcomponent2:4;
1031 GLuint vfcomponent1:4;
1032 GLuint vfcomponent0:4;
1033 } ve1;
1034 };
1035
1036 #define BRW_VEP_MAX 18
1037
1038 struct brw_vertex_element_packet {
1039 struct header header;
1040 struct brw_vertex_element_state ve[BRW_VEP_MAX]; /* note: less than _TNL_ATTRIB_MAX */
1041 };
1042
1043
1044 struct brw_urb_immediate {
1045 GLuint opcode:4;
1046 GLuint offset:6;
1047 GLuint swizzle_control:2;
1048 GLuint pad:1;
1049 GLuint allocate:1;
1050 GLuint used:1;
1051 GLuint complete:1;
1052 GLuint response_length:4;
1053 GLuint msg_length:4;
1054 GLuint msg_target:4;
1055 GLuint pad1:3;
1056 GLuint end_of_thread:1;
1057 };
1058
1059 /* Instruction format for the execution units:
1060 */
1061
1062 struct brw_instruction
1063 {
1064 struct
1065 {
1066 GLuint opcode:7;
1067 GLuint pad:1;
1068 GLuint access_mode:1;
1069 GLuint mask_control:1;
1070 GLuint dependency_control:2;
1071 GLuint compression_control:2;
1072 GLuint thread_control:2;
1073 GLuint predicate_control:4;
1074 GLuint predicate_inverse:1;
1075 GLuint execution_size:3;
1076 GLuint destreg__conditonalmod:4; /* destreg - send, conditionalmod - others */
1077 GLuint pad0:2;
1078 GLuint debug_control:1;
1079 GLuint saturate:1;
1080 } header;
1081
1082 union {
1083 struct
1084 {
1085 GLuint dest_reg_file:2;
1086 GLuint dest_reg_type:3;
1087 GLuint src0_reg_file:2;
1088 GLuint src0_reg_type:3;
1089 GLuint src1_reg_file:2;
1090 GLuint src1_reg_type:3;
1091 GLuint pad:1;
1092 GLuint dest_subreg_nr:5;
1093 GLuint dest_reg_nr:8;
1094 GLuint dest_horiz_stride:2;
1095 GLuint dest_address_mode:1;
1096 } da1;
1097
1098 struct
1099 {
1100 GLuint dest_reg_file:2;
1101 GLuint dest_reg_type:3;
1102 GLuint src0_reg_file:2;
1103 GLuint src0_reg_type:3;
1104 GLuint pad:6;
1105 GLint dest_indirect_offset:10; /* offset against the deref'd address reg */
1106 GLuint dest_subreg_nr:3; /* subnr for the address reg a0.x */
1107 GLuint dest_horiz_stride:2;
1108 GLuint dest_address_mode:1;
1109 } ia1;
1110
1111 struct
1112 {
1113 GLuint dest_reg_file:2;
1114 GLuint dest_reg_type:3;
1115 GLuint src0_reg_file:2;
1116 GLuint src0_reg_type:3;
1117 GLuint src1_reg_file:2;
1118 GLuint src1_reg_type:3;
1119 GLuint pad0:1;
1120 GLuint dest_writemask:4;
1121 GLuint dest_subreg_nr:1;
1122 GLuint dest_reg_nr:8;
1123 GLuint pad1:2;
1124 GLuint dest_address_mode:1;
1125 } da16;
1126
1127 struct
1128 {
1129 GLuint dest_reg_file:2;
1130 GLuint dest_reg_type:3;
1131 GLuint src0_reg_file:2;
1132 GLuint src0_reg_type:3;
1133 GLuint pad0:6;
1134 GLuint dest_writemask:4;
1135 GLint dest_indirect_offset:6;
1136 GLuint dest_subreg_nr:3;
1137 GLuint pad1:2;
1138 GLuint dest_address_mode:1;
1139 } ia16;
1140 } bits1;
1141
1142
1143 union {
1144 struct
1145 {
1146 GLuint src0_subreg_nr:5;
1147 GLuint src0_reg_nr:8;
1148 GLuint src0_abs:1;
1149 GLuint src0_negate:1;
1150 GLuint src0_address_mode:1;
1151 GLuint src0_horiz_stride:2;
1152 GLuint src0_width:3;
1153 GLuint src0_vert_stride:4;
1154 GLuint flag_reg_nr:1;
1155 GLuint pad:6;
1156 } da1;
1157
1158 struct
1159 {
1160 GLint src0_indirect_offset:10;
1161 GLuint src0_subreg_nr:3;
1162 GLuint src0_abs:1;
1163 GLuint src0_negate:1;
1164 GLuint src0_address_mode:1;
1165 GLuint src0_horiz_stride:2;
1166 GLuint src0_width:3;
1167 GLuint src0_vert_stride:4;
1168 GLuint flag_reg_nr:1;
1169 GLuint pad:6;
1170 } ia1;
1171
1172 struct
1173 {
1174 GLuint src0_swz_x:2;
1175 GLuint src0_swz_y:2;
1176 GLuint src0_subreg_nr:1;
1177 GLuint src0_reg_nr:8;
1178 GLuint src0_abs:1;
1179 GLuint src0_negate:1;
1180 GLuint src0_address_mode:1;
1181 GLuint src0_swz_z:2;
1182 GLuint src0_swz_w:2;
1183 GLuint pad0:1;
1184 GLuint src0_vert_stride:4;
1185 GLuint flag_reg_nr:1;
1186 GLuint pad1:6;
1187 } da16;
1188
1189 struct
1190 {
1191 GLuint src0_swz_x:2;
1192 GLuint src0_swz_y:2;
1193 GLint src0_indirect_offset:6;
1194 GLuint src0_subreg_nr:3;
1195 GLuint src0_abs:1;
1196 GLuint src0_negate:1;
1197 GLuint src0_address_mode:1;
1198 GLuint src0_swz_z:2;
1199 GLuint src0_swz_w:2;
1200 GLuint pad0:1;
1201 GLuint src0_vert_stride:4;
1202 GLuint flag_reg_nr:1;
1203 GLuint pad1:6;
1204 } ia16;
1205
1206 } bits2;
1207
1208 union
1209 {
1210 struct
1211 {
1212 GLuint src1_subreg_nr:5;
1213 GLuint src1_reg_nr:8;
1214 GLuint src1_abs:1;
1215 GLuint src1_negate:1;
1216 GLuint pad:1;
1217 GLuint src1_horiz_stride:2;
1218 GLuint src1_width:3;
1219 GLuint src1_vert_stride:4;
1220 GLuint pad0:7;
1221 } da1;
1222
1223 struct
1224 {
1225 GLuint src1_swz_x:2;
1226 GLuint src1_swz_y:2;
1227 GLuint src1_subreg_nr:1;
1228 GLuint src1_reg_nr:8;
1229 GLuint src1_abs:1;
1230 GLuint src1_negate:1;
1231 GLuint pad0:1;
1232 GLuint src1_swz_z:2;
1233 GLuint src1_swz_w:2;
1234 GLuint pad1:1;
1235 GLuint src1_vert_stride:4;
1236 GLuint pad2:7;
1237 } da16;
1238
1239 struct
1240 {
1241 GLint src1_indirect_offset:10;
1242 GLuint src1_subreg_nr:3;
1243 GLuint src1_abs:1;
1244 GLuint src1_negate:1;
1245 GLuint pad0:1;
1246 GLuint src1_horiz_stride:2;
1247 GLuint src1_width:3;
1248 GLuint src1_vert_stride:4;
1249 GLuint flag_reg_nr:1;
1250 GLuint pad1:6;
1251 } ia1;
1252
1253 struct
1254 {
1255 GLuint src1_swz_x:2;
1256 GLuint src1_swz_y:2;
1257 GLint src1_indirect_offset:6;
1258 GLuint src1_subreg_nr:3;
1259 GLuint src1_abs:1;
1260 GLuint src1_negate:1;
1261 GLuint pad0:1;
1262 GLuint src1_swz_z:2;
1263 GLuint src1_swz_w:2;
1264 GLuint pad1:1;
1265 GLuint src1_vert_stride:4;
1266 GLuint flag_reg_nr:1;
1267 GLuint pad2:6;
1268 } ia16;
1269
1270
1271 struct
1272 {
1273 GLint jump_count:16; /* note: signed */
1274 GLuint pop_count:4;
1275 GLuint pad0:12;
1276 } if_else;
1277
1278 struct {
1279 GLuint function:4;
1280 GLuint int_type:1;
1281 GLuint precision:1;
1282 GLuint saturate:1;
1283 GLuint data_type:1;
1284 GLuint pad0:8;
1285 GLuint response_length:4;
1286 GLuint msg_length:4;
1287 GLuint msg_target:4;
1288 GLuint pad1:3;
1289 GLuint end_of_thread:1;
1290 } math;
1291
1292 struct {
1293 GLuint binding_table_index:8;
1294 GLuint sampler:4;
1295 GLuint return_format:2;
1296 GLuint msg_type:2;
1297 GLuint response_length:4;
1298 GLuint msg_length:4;
1299 GLuint msg_target:4;
1300 GLuint pad1:3;
1301 GLuint end_of_thread:1;
1302 } sampler;
1303
1304 struct brw_urb_immediate urb;
1305
1306 struct {
1307 GLuint binding_table_index:8;
1308 GLuint msg_control:4;
1309 GLuint msg_type:2;
1310 GLuint target_cache:2;
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 } dp_read;
1317
1318 struct {
1319 GLuint binding_table_index:8;
1320 GLuint msg_control:3;
1321 GLuint pixel_scoreboard_clear:1;
1322 GLuint msg_type:3;
1323 GLuint send_commit_msg:1;
1324 GLuint response_length:4;
1325 GLuint msg_length:4;
1326 GLuint msg_target:4;
1327 GLuint pad1:3;
1328 GLuint end_of_thread:1;
1329 } dp_write;
1330
1331 struct {
1332 GLuint pad:16;
1333 GLuint response_length:4;
1334 GLuint msg_length:4;
1335 GLuint msg_target:4;
1336 GLuint pad1:3;
1337 GLuint end_of_thread:1;
1338 } generic;
1339
1340 GLint d;
1341 GLuint ud;
1342 } bits3;
1343 };
1344
1345
1346 #endif