#define BRW_COMPILER_H
#include <stdio.h>
-#include "common/gen_device_info.h"
-#include "main/mtypes.h"
+#include "dev/gen_device_info.h"
#include "main/macros.h"
#include "util/ralloc.h"
struct brw_sampler_prog_key_data tex;
};
+/* brw_any_prog_key is any of the keys that map to an API stage */
+union brw_any_prog_key {
+ struct brw_vs_prog_key vs;
+ struct brw_tcs_prog_key tcs;
+ struct brw_tes_prog_key tes;
+ struct brw_gs_prog_key gs;
+ struct brw_wm_prog_key wm;
+ struct brw_cs_prog_key cs;
+};
+
/*
* Image metadata structure as laid out in the shader parameter
* buffer. Entries have to be 16B-aligned for the vec4 back-end to be
BRW_PARAM_BUILTIN_TESS_LEVEL_INNER_X,
BRW_PARAM_BUILTIN_TESS_LEVEL_INNER_Y,
- BRW_PARAM_BUILTIN_THREAD_LOCAL_ID,
+ BRW_PARAM_BUILTIN_SUBGROUP_ID,
};
#define BRW_PARAM_BUILTIN_CLIP_PLANE(idx, comp) \
uint32_t gather_texture_start;
uint32_t ubo_start;
uint32_t ssbo_start;
- uint32_t abo_start;
uint32_t image_start;
uint32_t shader_time_start;
uint32_t plane_start[3];
unsigned total_scratch;
unsigned total_shared;
+ unsigned program_size;
+
/**
* Register where the thread expects to find input data from the URB
* (typically uniforms, followed by vertex or fragment attributes).
/** @{
* surface indices the WM-specific surfaces
*/
- uint32_t render_target_start;
uint32_t render_target_read_start;
/** @} */
} binding_table;
struct brw_cs_prog_data {
struct brw_stage_prog_data base;
- GLuint dispatch_grf_start_reg_16;
unsigned local_size[3];
unsigned simd_size;
unsigned threads;
uint32_t total_grf;
};
+/* brw_any_prog_data is prog_data for any stage that maps to an API stage */
+union brw_any_prog_data {
+ struct brw_stage_prog_data base;
+ struct brw_vue_prog_data vue;
+ struct brw_vs_prog_data vs;
+ struct brw_tcs_prog_data tcs;
+ struct brw_tes_prog_data tes;
+ struct brw_gs_prog_data gs;
+ struct brw_wm_prog_data wm;
+ struct brw_cs_prog_data cs;
+};
+
#define DEFINE_PROG_DATA_DOWNCAST(stage) \
static inline struct brw_##stage##_prog_data * \
brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data) \
struct brw_compiler *
brw_compiler_create(void *mem_ctx, const struct gen_device_info *devinfo);
+unsigned
+brw_prog_data_size(gl_shader_stage stage);
+
+unsigned
+brw_prog_key_size(gl_shader_stage stage);
+
/**
* Compile a vertex shader.
*
const struct brw_vs_prog_key *key,
struct brw_vs_prog_data *prog_data,
const struct nir_shader *shader,
- bool use_legacy_snorm_formula,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
struct brw_tcs_prog_data *prog_data,
const struct nir_shader *nir,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
const struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
const struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
/**
int shader_time_index16,
bool allow_spilling,
bool use_rep_send, struct brw_vue_map *vue_map,
- unsigned *final_assembly_size,
char **error_str);
/**
struct brw_cs_prog_data *prog_data,
const struct nir_shader *shader,
int shader_time_index,
- unsigned *final_assembly_size,
char **error_str);
static inline uint32_t
* '2^n - 1' for some n.
*/
static inline bool
-brw_stage_has_packed_dispatch(const struct gen_device_info *devinfo,
+brw_stage_has_packed_dispatch(MAYBE_UNUSED const struct gen_device_info *devinfo,
gl_shader_stage stage,
const struct brw_stage_prog_data *prog_data)
{