/* Common inputs for merged shaders. */
struct ac_arg merged_wave_info;
struct ac_arg merged_scratch_offset;
+ struct ac_arg small_prim_cull_info;
/* API VS */
struct ac_arg vertex_buffers;
struct ac_arg vb_descriptors[5];
* [2:3] = NGG: output primitive type
* [4:5] = NGG: provoking vertex index
* [6] = NGG: streamout queries enabled
+ * [7:10] = NGG: small prim filter precision = num_samples / quant_mode,
+ * but in reality it's: 1/2^n, from 1/16 to 1/4096 = 1/2^4 to 1/2^12
+ * Only the first 4 bits of the exponent are stored.
+ * Set it like this: (fui(num_samples / quant_mode) >> 23)
+ * Expand to FP32 like this: ((0x70 | value) << 23);
+ * With 0x70 = 112, we get 2^(112 + value - 127) = 2^(value - 15)
+ * = 1/2^(15 - value) in FP32
* [11:23] = stride between patches in DW = num_inputs * num_vertices * 4
* max = 32*32*4 + 32*4
* [24:31] = stride between vertices in DW = num_inputs * 4
*/
struct ac_arg vs_state_bits;
struct ac_arg vs_blit_inputs;
+ struct ac_arg ngg_old_thread_id; /* generated by the NGG cull shader */
/* HW VS */
struct ac_arg streamout_config;
struct ac_arg streamout_write_index;
void si_llvm_emit_streamout(struct si_shader_context *ctx,
struct si_shader_output_values *outputs,
unsigned noutput, unsigned stream);
-void si_create_function(struct si_shader_context *ctx);
+void si_create_function(struct si_shader_context *ctx, bool ngg_cull_shader);
bool gfx10_ngg_export_prim_early(struct si_shader *shader);
void gfx10_ngg_build_sendmsg_gs_alloc_req(struct si_shader_context *ctx);
void gfx10_ngg_build_export_prim(struct si_shader_context *ctx,
- LLVMValueRef user_edgeflags[3]);
+ LLVMValueRef user_edgeflags[3],
+ LLVMValueRef prim_passthrough);
+void gfx10_emit_ngg_culling_epilogue_4x_wave32(struct ac_shader_abi *abi,
+ unsigned max_outputs,
+ LLVMValueRef *addrs);
void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi,
unsigned max_outputs,
LLVMValueRef *addrs);