2 * Copyright © 2011 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 #include "brw_shader.h"
29 #include "main/compiler.h"
30 #include "program/hash_table.h"
31 #include "brw_program.h"
37 #include "brw_context.h"
39 #include "intel_asm_annotation.h"
48 struct brw_vec4_compile
{
49 GLuint last_scratch
; /**< measured in 32-byte (register size) units */
53 struct brw_vec4_prog_key
{
54 GLuint program_string_id
;
57 * True if at least one clip flag is enabled, regardless of whether the
58 * shader uses clip planes or gl_ClipDistance.
60 GLuint userclip_active
:1;
63 * How many user clipping planes are being uploaded to the vertex shader as
66 GLuint nr_userclip_plane_consts
:4;
68 GLuint clamp_vertex_color
:1;
70 struct brw_sampler_prog_key_data tex
;
79 brw_vec4_setup_prog_key_for_precompile(struct gl_context
*ctx
,
80 struct brw_vec4_prog_key
*key
,
81 GLuint id
, struct gl_program
*prog
);
91 swizzle_for_size(int size
);
93 class src_reg
: public backend_reg
96 DECLARE_RALLOC_CXX_OPERATORS(src_reg
)
100 src_reg(register_file file
, int reg
, const glsl_type
*type
);
105 src_reg(struct brw_reg reg
);
107 bool equals(const src_reg
&r
) const;
109 src_reg(class vec4_visitor
*v
, const struct glsl_type
*type
);
110 src_reg(class vec4_visitor
*v
, const struct glsl_type
*type
, int size
);
112 explicit src_reg(dst_reg reg
);
114 GLuint swizzle
; /**< BRW_SWIZZLE_XYZW macros from brw_reg.h. */
119 static inline src_reg
120 retype(src_reg reg
, enum brw_reg_type type
)
122 reg
.fixed_hw_reg
.type
= reg
.type
= type
;
126 static inline src_reg
127 offset(src_reg reg
, unsigned delta
)
129 assert(delta
== 0 || (reg
.file
!= HW_REG
&& reg
.file
!= IMM
));
130 reg
.reg_offset
+= delta
;
135 * Reswizzle a given source register.
138 static inline src_reg
139 swizzle(src_reg reg
, unsigned swizzle
)
141 assert(reg
.file
!= HW_REG
);
142 reg
.swizzle
= BRW_SWIZZLE4(
143 BRW_GET_SWZ(reg
.swizzle
, BRW_GET_SWZ(swizzle
, 0)),
144 BRW_GET_SWZ(reg
.swizzle
, BRW_GET_SWZ(swizzle
, 1)),
145 BRW_GET_SWZ(reg
.swizzle
, BRW_GET_SWZ(swizzle
, 2)),
146 BRW_GET_SWZ(reg
.swizzle
, BRW_GET_SWZ(swizzle
, 3)));
150 static inline src_reg
153 assert(reg
.file
!= HW_REG
&& reg
.file
!= IMM
);
154 reg
.negate
= !reg
.negate
;
158 class dst_reg
: public backend_reg
161 DECLARE_RALLOC_CXX_OPERATORS(dst_reg
)
166 dst_reg(register_file file
, int reg
);
167 dst_reg(register_file file
, int reg
, const glsl_type
*type
, int writemask
);
168 dst_reg(struct brw_reg reg
);
169 dst_reg(class vec4_visitor
*v
, const struct glsl_type
*type
);
171 explicit dst_reg(src_reg reg
);
173 int writemask
; /**< Bitfield of WRITEMASK_[XYZW] */
178 static inline dst_reg
179 retype(dst_reg reg
, enum brw_reg_type type
)
181 reg
.fixed_hw_reg
.type
= reg
.type
= type
;
185 static inline dst_reg
186 offset(dst_reg reg
, unsigned delta
)
188 assert(delta
== 0 || (reg
.file
!= HW_REG
&& reg
.file
!= IMM
));
189 reg
.reg_offset
+= delta
;
193 static inline dst_reg
194 writemask(dst_reg reg
, unsigned mask
)
196 assert(reg
.file
!= HW_REG
&& reg
.file
!= IMM
);
197 assert((reg
.writemask
& mask
) != 0);
198 reg
.writemask
&= mask
;
202 class vec4_instruction
: public backend_instruction
{
204 DECLARE_RALLOC_CXX_OPERATORS(vec4_instruction
)
206 vec4_instruction(vec4_visitor
*v
, enum opcode opcode
,
207 const dst_reg
&dst
= dst_reg(),
208 const src_reg
&src0
= src_reg(),
209 const src_reg
&src1
= src_reg(),
210 const src_reg
&src2
= src_reg());
212 struct brw_reg
get_dst(void);
213 struct brw_reg
get_src(const struct brw_vec4_prog_data
*prog_data
, int i
);
220 enum brw_urb_write_flags urb_write_flags
;
223 unsigned sol_binding
; /**< gen6: SOL binding table index */
224 bool sol_final_write
; /**< gen6: send commit message */
225 unsigned sol_vertex
; /**< gen6: used for setting dst index in SVB header */
227 bool is_send_from_grf();
228 bool can_reswizzle(int dst_writemask
, int swizzle
, int swizzle_mask
);
229 void reswizzle(int dst_writemask
, int swizzle
);
230 bool can_do_source_mods(struct brw_context
*brw
);
234 return predicate
|| opcode
== VS_OPCODE_UNPACK_FLAGS_SIMD4X2
;
239 return conditional_mod
&& opcode
!= BRW_OPCODE_SEL
;
244 * The vertex shader front-end.
246 * Translates either GLSL IR or Mesa IR (for ARB_vertex_program and
247 * fixed-function) into VS IR.
249 class vec4_visitor
: public backend_visitor
252 vec4_visitor(struct brw_context
*brw
,
253 struct brw_vec4_compile
*c
,
254 struct gl_program
*prog
,
255 const struct brw_vec4_prog_key
*key
,
256 struct brw_vec4_prog_data
*prog_data
,
257 struct gl_shader_program
*shader_prog
,
258 gl_shader_stage stage
,
262 shader_time_shader_type st_base
,
263 shader_time_shader_type st_written
,
264 shader_time_shader_type st_reset
);
269 return dst_reg(brw_null_reg());
274 return dst_reg(retype(brw_null_reg(), BRW_REGISTER_TYPE_D
));
277 dst_reg
dst_null_ud()
279 return dst_reg(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD
));
282 struct brw_vec4_compile
* const c
;
283 const struct brw_vec4_prog_key
* const key
;
284 struct brw_vec4_prog_data
* const prog_data
;
285 unsigned int sanity_param_count
;
291 * GLSL IR currently being processed, which is associated with our
292 * driver IR instructions for debugging purposes.
295 const char *current_annotation
;
297 int *virtual_grf_sizes
;
298 int virtual_grf_count
;
299 int virtual_grf_array_size
;
300 int first_non_payload_grf
;
301 unsigned int max_grf
;
302 int *virtual_grf_start
;
303 int *virtual_grf_end
;
304 dst_reg userplane
[MAX_CLIP_PLANES
];
307 * This is the size to be used for an array with an element per
310 int virtual_grf_reg_count
;
311 /** Per-virtual-grf indices into an array of size virtual_grf_reg_count */
312 int *virtual_grf_reg_map
;
314 bool live_intervals_valid
;
316 dst_reg
*variable_storage(ir_variable
*var
);
318 void reladdr_to_temp(ir_instruction
*ir
, src_reg
*reg
, int *num_reladdr
);
320 bool need_all_constants_in_pull_buffer
;
323 * \name Visit methods
325 * As typical for the visitor pattern, there must be one \c visit method for
326 * each concrete subclass of \c ir_instruction. Virtual base classes within
327 * the hierarchy should not have \c visit methods.
330 virtual void visit(ir_variable
*);
331 virtual void visit(ir_loop
*);
332 virtual void visit(ir_loop_jump
*);
333 virtual void visit(ir_function_signature
*);
334 virtual void visit(ir_function
*);
335 virtual void visit(ir_expression
*);
336 virtual void visit(ir_swizzle
*);
337 virtual void visit(ir_dereference_variable
*);
338 virtual void visit(ir_dereference_array
*);
339 virtual void visit(ir_dereference_record
*);
340 virtual void visit(ir_assignment
*);
341 virtual void visit(ir_constant
*);
342 virtual void visit(ir_call
*);
343 virtual void visit(ir_return
*);
344 virtual void visit(ir_discard
*);
345 virtual void visit(ir_texture
*);
346 virtual void visit(ir_if
*);
347 virtual void visit(ir_emit_vertex
*);
348 virtual void visit(ir_end_primitive
*);
353 /* Regs for vertex results. Generated at ir_variable visiting time
354 * for the ir->location's used.
356 dst_reg output_reg
[BRW_VARYING_SLOT_COUNT
];
357 const char *output_reg_annotation
[BRW_VARYING_SLOT_COUNT
];
359 int *uniform_vector_size
;
360 int uniform_array_size
; /*< Size of uniform_[vector_]size arrays */
363 src_reg shader_start_time
;
365 struct hash_table
*variable_ht
;
368 void fail(const char *msg
, ...);
370 int virtual_grf_alloc(int size
);
371 void setup_uniform_clipplane_values();
372 void setup_uniform_values(ir_variable
*ir
);
373 void setup_builtin_uniform_values(ir_variable
*ir
);
374 int setup_uniforms(int payload_reg
);
375 bool reg_allocate_trivial();
377 void evaluate_spill_costs(float *spill_costs
, bool *no_spill
);
378 int choose_spill_reg(struct ra_graph
*g
);
379 void spill_reg(int spill_reg
);
380 void move_grf_array_access_to_scratch();
381 void move_uniform_array_access_to_pull_constants();
382 void move_push_constants_to_pull_constants();
383 void split_uniform_registers();
384 void pack_uniform_registers();
385 void calculate_live_intervals();
386 void invalidate_live_intervals(bool invalidate_cfg
= true);
387 void split_virtual_grfs();
388 bool opt_reduce_swizzle();
389 bool dead_code_eliminate();
390 bool virtual_grf_interferes(int a
, int b
);
391 bool opt_copy_propagation();
392 bool opt_cse_local(bblock_t
*block
);
394 bool opt_algebraic();
395 bool opt_register_coalesce();
396 void opt_set_dependency_control();
397 void opt_schedule_instructions();
399 vec4_instruction
*emit(vec4_instruction
*inst
);
401 vec4_instruction
*emit(enum opcode opcode
);
403 vec4_instruction
*emit(enum opcode opcode
, dst_reg dst
);
405 vec4_instruction
*emit(enum opcode opcode
, dst_reg dst
, src_reg src0
);
407 vec4_instruction
*emit(enum opcode opcode
, dst_reg dst
,
408 src_reg src0
, src_reg src1
);
410 vec4_instruction
*emit(enum opcode opcode
, dst_reg dst
,
411 src_reg src0
, src_reg src1
, src_reg src2
);
413 vec4_instruction
*emit_before(vec4_instruction
*inst
,
414 vec4_instruction
*new_inst
);
416 vec4_instruction
*MOV(const dst_reg
&dst
, const src_reg
&src0
);
417 vec4_instruction
*NOT(const dst_reg
&dst
, const src_reg
&src0
);
418 vec4_instruction
*RNDD(const dst_reg
&dst
, const src_reg
&src0
);
419 vec4_instruction
*RNDE(const dst_reg
&dst
, const src_reg
&src0
);
420 vec4_instruction
*RNDZ(const dst_reg
&dst
, const src_reg
&src0
);
421 vec4_instruction
*FRC(const dst_reg
&dst
, const src_reg
&src0
);
422 vec4_instruction
*F32TO16(const dst_reg
&dst
, const src_reg
&src0
);
423 vec4_instruction
*F16TO32(const dst_reg
&dst
, const src_reg
&src0
);
424 vec4_instruction
*ADD(const dst_reg
&dst
, const src_reg
&src0
,
425 const src_reg
&src1
);
426 vec4_instruction
*MUL(const dst_reg
&dst
, const src_reg
&src0
,
427 const src_reg
&src1
);
428 vec4_instruction
*MACH(const dst_reg
&dst
, const src_reg
&src0
,
429 const src_reg
&src1
);
430 vec4_instruction
*MAC(const dst_reg
&dst
, const src_reg
&src0
,
431 const src_reg
&src1
);
432 vec4_instruction
*AND(const dst_reg
&dst
, const src_reg
&src0
,
433 const src_reg
&src1
);
434 vec4_instruction
*OR(const dst_reg
&dst
, const src_reg
&src0
,
435 const src_reg
&src1
);
436 vec4_instruction
*XOR(const dst_reg
&dst
, const src_reg
&src0
,
437 const src_reg
&src1
);
438 vec4_instruction
*DP3(const dst_reg
&dst
, const src_reg
&src0
,
439 const src_reg
&src1
);
440 vec4_instruction
*DP4(const dst_reg
&dst
, const src_reg
&src0
,
441 const src_reg
&src1
);
442 vec4_instruction
*DPH(const dst_reg
&dst
, const src_reg
&src0
,
443 const src_reg
&src1
);
444 vec4_instruction
*SHL(const dst_reg
&dst
, const src_reg
&src0
,
445 const src_reg
&src1
);
446 vec4_instruction
*SHR(const dst_reg
&dst
, const src_reg
&src0
,
447 const src_reg
&src1
);
448 vec4_instruction
*ASR(const dst_reg
&dst
, const src_reg
&src0
,
449 const src_reg
&src1
);
450 vec4_instruction
*CMP(dst_reg dst
, src_reg src0
, src_reg src1
,
451 enum brw_conditional_mod condition
);
452 vec4_instruction
*IF(src_reg src0
, src_reg src1
,
453 enum brw_conditional_mod condition
);
454 vec4_instruction
*IF(enum brw_predicate predicate
);
455 vec4_instruction
*PULL_CONSTANT_LOAD(const dst_reg
&dst
,
456 const src_reg
&index
);
457 vec4_instruction
*SCRATCH_READ(const dst_reg
&dst
, const src_reg
&index
);
458 vec4_instruction
*SCRATCH_WRITE(const dst_reg
&dst
, const src_reg
&src
,
459 const src_reg
&index
);
460 vec4_instruction
*LRP(const dst_reg
&dst
, const src_reg
&a
,
461 const src_reg
&y
, const src_reg
&x
);
462 vec4_instruction
*BFREV(const dst_reg
&dst
, const src_reg
&value
);
463 vec4_instruction
*BFE(const dst_reg
&dst
, const src_reg
&bits
,
464 const src_reg
&offset
, const src_reg
&value
);
465 vec4_instruction
*BFI1(const dst_reg
&dst
, const src_reg
&bits
,
466 const src_reg
&offset
);
467 vec4_instruction
*BFI2(const dst_reg
&dst
, const src_reg
&bfi1_dst
,
468 const src_reg
&insert
, const src_reg
&base
);
469 vec4_instruction
*FBH(const dst_reg
&dst
, const src_reg
&value
);
470 vec4_instruction
*FBL(const dst_reg
&dst
, const src_reg
&value
);
471 vec4_instruction
*CBIT(const dst_reg
&dst
, const src_reg
&value
);
472 vec4_instruction
*MAD(const dst_reg
&dst
, const src_reg
&c
,
473 const src_reg
&b
, const src_reg
&a
);
474 vec4_instruction
*ADDC(const dst_reg
&dst
, const src_reg
&src0
,
475 const src_reg
&src1
);
476 vec4_instruction
*SUBB(const dst_reg
&dst
, const src_reg
&src0
,
477 const src_reg
&src1
);
479 int implied_mrf_writes(vec4_instruction
*inst
);
481 bool try_rewrite_rhs_to_dst(ir_assignment
*ir
,
484 vec4_instruction
*pre_rhs_inst
,
485 vec4_instruction
*last_rhs_inst
);
487 /** Walks an exec_list of ir_instruction and sends it through this visitor. */
488 void visit_instructions(const exec_list
*list
);
490 void emit_vp_sop(enum brw_conditional_mod condmod
, dst_reg dst
,
491 src_reg src0
, src_reg src1
, src_reg one
);
493 void emit_bool_to_cond_code(ir_rvalue
*ir
, enum brw_predicate
*predicate
);
494 void emit_if_gen6(ir_if
*ir
);
496 void emit_minmax(enum brw_conditional_mod conditionalmod
, dst_reg dst
,
497 src_reg src0
, src_reg src1
);
499 void emit_lrp(const dst_reg
&dst
,
500 const src_reg
&x
, const src_reg
&y
, const src_reg
&a
);
502 void emit_block_move(dst_reg
*dst
, src_reg
*src
,
503 const struct glsl_type
*type
, brw_predicate predicate
);
505 void emit_constant_values(dst_reg
*dst
, ir_constant
*value
);
508 * Emit the correct dot-product instruction for the type of arguments
510 void emit_dp(dst_reg dst
, src_reg src0
, src_reg src1
, unsigned elements
);
512 void emit_scalar(ir_instruction
*ir
, enum prog_opcode op
,
513 dst_reg dst
, src_reg src0
);
515 void emit_scalar(ir_instruction
*ir
, enum prog_opcode op
,
516 dst_reg dst
, src_reg src0
, src_reg src1
);
518 void emit_scs(ir_instruction
*ir
, enum prog_opcode op
,
519 dst_reg dst
, const src_reg
&src
);
521 src_reg
fix_3src_operand(src_reg src
);
523 void emit_math1_gen6(enum opcode opcode
, dst_reg dst
, src_reg src
);
524 void emit_math1_gen4(enum opcode opcode
, dst_reg dst
, src_reg src
);
525 void emit_math(enum opcode opcode
, dst_reg dst
, src_reg src
);
526 void emit_math2_gen6(enum opcode opcode
, dst_reg dst
, src_reg src0
, src_reg src1
);
527 void emit_math2_gen4(enum opcode opcode
, dst_reg dst
, src_reg src0
, src_reg src1
);
528 void emit_math(enum opcode opcode
, dst_reg dst
, src_reg src0
, src_reg src1
);
529 src_reg
fix_math_operand(src_reg src
);
531 void emit_pack_half_2x16(dst_reg dst
, src_reg src0
);
532 void emit_unpack_half_2x16(dst_reg dst
, src_reg src0
);
534 uint32_t gather_channel(ir_texture
*ir
, uint32_t sampler
);
535 src_reg
emit_mcs_fetch(ir_texture
*ir
, src_reg coordinate
, src_reg sampler
);
536 void emit_gen6_gather_wa(uint8_t wa
, dst_reg dst
);
537 void swizzle_result(ir_texture
*ir
, src_reg orig_val
, uint32_t sampler
);
539 void emit_ndc_computation();
540 void emit_psiz_and_flags(dst_reg reg
);
541 void emit_clip_distances(dst_reg reg
, int offset
);
542 void emit_generic_urb_slot(dst_reg reg
, int varying
);
543 void emit_urb_slot(dst_reg reg
, int varying
);
545 void emit_shader_time_begin();
546 void emit_shader_time_end();
547 void emit_shader_time_write(enum shader_time_shader_type type
,
550 void emit_untyped_atomic(unsigned atomic_op
, unsigned surf_index
,
551 dst_reg dst
, src_reg offset
, src_reg src0
,
554 void emit_untyped_surface_read(unsigned surf_index
, dst_reg dst
,
557 src_reg
get_scratch_offset(vec4_instruction
*inst
,
558 src_reg
*reladdr
, int reg_offset
);
559 src_reg
get_pull_constant_offset(vec4_instruction
*inst
,
560 src_reg
*reladdr
, int reg_offset
);
561 void emit_scratch_read(vec4_instruction
*inst
,
565 void emit_scratch_write(vec4_instruction
*inst
,
567 void emit_pull_constant_load(vec4_instruction
*inst
,
572 bool try_emit_mad(ir_expression
*ir
);
573 bool try_emit_b2f_of_compare(ir_expression
*ir
);
574 void resolve_ud_negate(src_reg
*reg
);
576 src_reg
get_timestamp();
578 bool process_move_condition(ir_rvalue
*ir
);
580 void dump_instruction(backend_instruction
*inst
);
581 void dump_instruction(backend_instruction
*inst
, FILE *file
);
583 void visit_atomic_counter_intrinsic(ir_call
*ir
);
587 void lower_attributes_to_hw_regs(const int *attribute_map
,
589 void setup_payload_interference(struct ra_graph
*g
, int first_payload_node
,
591 virtual dst_reg
*make_reg_for_system_value(ir_variable
*ir
) = 0;
592 virtual void assign_binding_table_offsets();
593 virtual void setup_payload() = 0;
594 virtual void emit_prolog() = 0;
595 virtual void emit_program_code() = 0;
596 virtual void emit_thread_end() = 0;
597 virtual void emit_urb_write_header(int mrf
) = 0;
598 virtual vec4_instruction
*emit_urb_write_opcode(bool complete
) = 0;
599 virtual int compute_array_stride(ir_dereference_array
*ir
);
601 const bool debug_flag
;
605 * If true, then register allocation should fail instead of spilling.
607 const bool no_spills
;
609 const shader_time_shader_type st_base
;
610 const shader_time_shader_type st_written
;
611 const shader_time_shader_type st_reset
;
616 * The vertex shader code generator.
618 * Translates VS IR to actual i965 assembly code.
623 vec4_generator(struct brw_context
*brw
,
624 struct gl_shader_program
*shader_prog
,
625 struct gl_program
*prog
,
626 struct brw_vec4_prog_data
*prog_data
,
631 const unsigned *generate_assembly(const cfg_t
*cfg
, unsigned *asm_size
);
634 void generate_code(const cfg_t
*cfg
);
636 void generate_math1_gen4(vec4_instruction
*inst
,
639 void generate_math2_gen4(vec4_instruction
*inst
,
642 struct brw_reg src1
);
643 void generate_math_gen6(vec4_instruction
*inst
,
646 struct brw_reg src1
);
648 void generate_tex(vec4_instruction
*inst
,
651 struct brw_reg sampler_index
);
653 void generate_vs_urb_write(vec4_instruction
*inst
);
654 void generate_gs_urb_write(vec4_instruction
*inst
);
655 void generate_gs_urb_write_allocate(vec4_instruction
*inst
);
656 void generate_gs_thread_end(vec4_instruction
*inst
);
657 void generate_gs_set_write_offset(struct brw_reg dst
,
659 struct brw_reg src1
);
660 void generate_gs_set_vertex_count(struct brw_reg dst
,
662 void generate_gs_svb_write(vec4_instruction
*inst
,
665 struct brw_reg src1
);
666 void generate_gs_svb_set_destination_index(vec4_instruction
*inst
,
669 void generate_gs_set_dword_2(struct brw_reg dst
, struct brw_reg src
);
670 void generate_gs_prepare_channel_masks(struct brw_reg dst
);
671 void generate_gs_set_channel_masks(struct brw_reg dst
, struct brw_reg src
);
672 void generate_gs_get_instance_id(struct brw_reg dst
);
673 void generate_gs_ff_sync_set_primitives(struct brw_reg dst
,
676 struct brw_reg src2
);
677 void generate_gs_ff_sync(vec4_instruction
*inst
,
680 struct brw_reg src1
);
681 void generate_gs_set_primitive_id(struct brw_reg dst
);
682 void generate_oword_dual_block_offsets(struct brw_reg m1
,
683 struct brw_reg index
);
684 void generate_scratch_write(vec4_instruction
*inst
,
687 struct brw_reg index
);
688 void generate_scratch_read(vec4_instruction
*inst
,
690 struct brw_reg index
);
691 void generate_pull_constant_load(vec4_instruction
*inst
,
693 struct brw_reg index
,
694 struct brw_reg offset
);
695 void generate_pull_constant_load_gen7(vec4_instruction
*inst
,
697 struct brw_reg surf_index
,
698 struct brw_reg offset
);
699 void generate_unpack_flags(vec4_instruction
*inst
,
702 void generate_untyped_atomic(vec4_instruction
*inst
,
704 struct brw_reg atomic_op
,
705 struct brw_reg surf_index
);
707 void generate_untyped_surface_read(vec4_instruction
*inst
,
709 struct brw_reg surf_index
);
711 struct brw_context
*brw
;
713 struct brw_compile
*p
;
715 struct gl_shader_program
*shader_prog
;
716 const struct gl_program
*prog
;
718 struct brw_vec4_prog_data
*prog_data
;
721 const bool debug_flag
;
724 } /* namespace brw */
725 #endif /* __cplusplus */
727 #endif /* BRW_VEC4_H */