}
-brw_blorp_params::brw_blorp_params()
- : x0(0),
- y0(0),
- x1(0),
- y1(0),
- depth_format(0),
- hiz_op(GEN6_HIZ_OP_NONE),
- fast_clear_op(0),
- num_varyings(0),
- num_draw_buffers(1),
- num_layers(1),
- wm_prog_kernel(0),
- wm_prog_data(NULL)
+void
+brw_blorp_params_init(struct brw_blorp_params *params)
{
- memset(&src, 0, sizeof(src));
- memset(&dst, 0, sizeof(dst));
- memset(&depth, 0, sizeof(depth));
- color_write_disable[0] = false;
- color_write_disable[1] = false;
- color_write_disable[2] = false;
- color_write_disable[3] = false;
+ memset(params, 0, sizeof(*params));
+ params->hiz_op = GEN6_HIZ_OP_NONE;
+ params->fast_clear_op = 0;
+ params->num_varyings = 0;
+ params->num_draw_buffers = 1;
+ params->num_layers = 1;
}
extern "C" {
} /* extern "C" */
void
-brw_blorp_exec(struct brw_context *brw, const brw_blorp_params *params)
+brw_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params)
{
struct gl_context *ctx = &brw->ctx;
const uint32_t estimated_max_batch_usage = brw->gen >= 8 ? 1800 : 1500;
gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
unsigned int level, unsigned int layer, enum gen6_hiz_op op)
{
- brw_blorp_params params;
+ struct brw_blorp_params params;
+ brw_blorp_params_init(¶ms);
params.hiz_op = op;
bool persample_msaa_dispatch;
};
-class brw_blorp_params
+struct brw_blorp_params
{
-public:
- brw_blorp_params();
-
uint32_t x0;
uint32_t y0;
uint32_t x1;
enum gen6_hiz_op hiz_op;
unsigned fast_clear_op;
bool color_write_disable[4];
- brw_blorp_wm_push_constants wm_push_consts;
- const unsigned num_varyings;
- const unsigned num_draw_buffers;
- const unsigned num_layers;
+ struct brw_blorp_wm_push_constants wm_push_consts;
+ unsigned num_varyings;
+ unsigned num_draw_buffers;
+ unsigned num_layers;
uint32_t wm_prog_kernel;
struct brw_blorp_prog_data *wm_prog_data;
};
+void
+brw_blorp_params_init(struct brw_blorp_params *params);
void
-brw_blorp_exec(struct brw_context *brw, const brw_blorp_params *params);
+brw_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params);
void
gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
void
gen6_blorp_exec(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
gen7_blorp_exec(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
-gen8_blorp_exec(struct brw_context *brw, const brw_blorp_params *params);
+gen8_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params);
struct brw_blorp_blit_prog_key
{
void
gen6_blorp_emit_vertices(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
uint32_t
gen6_blorp_emit_blend_state(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
uint32_t
gen6_blorp_emit_cc_state(struct brw_context *brw);
uint32_t
gen6_blorp_emit_wm_constants(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
gen6_blorp_emit_vs_disable(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
uint32_t
gen6_blorp_emit_binding_table(struct brw_context *brw,
uint32_t
gen6_blorp_emit_depth_stencil_state(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
gen6_blorp_emit_gs_disable(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
gen6_blorp_emit_clip_disable(struct brw_context *brw);
void
gen6_blorp_emit_drawing_rectangle(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
uint32_t
gen6_blorp_emit_sampler_state(struct brw_context *brw,
void
gen7_blorp_emit_clear_params(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
void
gen7_blorp_emit_constant_ps(struct brw_context *brw,
void
gen7_blorp_emit_primitive(struct brw_context *brw,
- const brw_blorp_params *params);
+ const struct brw_blorp_params *params);
/** \} */
if (!encode_srgb && _mesa_get_format_color_encoding(dst_format) == GL_SRGB)
dst_format = _mesa_get_srgb_format_linear(dst_format);
- brw_blorp_params params;
+ struct brw_blorp_params params;
+ brw_blorp_params_init(¶ms);
brw_blorp_surface_info_init(brw, ¶ms.src, src_mt, src_level,
src_layer, src_format, false);
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
mesa_format format = irb->mt->format;
- brw_blorp_params params;
+ struct brw_blorp_params params;
+ brw_blorp_params_init(¶ms);
if (!encode_srgb && _mesa_get_format_color_encoding(format) == GL_SRGB)
format = _mesa_get_srgb_format_linear(format);
const mesa_format format = _mesa_get_srgb_format_linear(mt->format);
- brw_blorp_params params;
+ struct brw_blorp_params params;
+ brw_blorp_params_init(¶ms);
brw_blorp_surface_info_init(brw, ¶ms.dst, mt,
0 /* level */, 0 /* layer */, format, true);
void
gen6_blorp_emit_vertices(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t vertex_offset;
*/
static void
gen6_blorp_emit_urb_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(3);
OUT_BATCH(_3DSTATE_URB << 16 | (3 - 2));
/* BLEND_STATE */
uint32_t
gen6_blorp_emit_blend_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t cc_blend_state_offset;
*/
uint32_t
gen6_blorp_emit_depth_stencil_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t depthstencil_offset;
*/
static void
gen6_blorp_emit_cc_state_pointers(struct brw_context *brw,
- const brw_blorp_params *params,
+ const struct brw_blorp_params *params,
uint32_t cc_blend_state_offset,
uint32_t depthstencil_offset,
uint32_t cc_state_offset)
/* WM push constants */
uint32_t
gen6_blorp_emit_wm_constants(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t wm_push_const_offset;
*/
static uint32_t
gen6_blorp_emit_surface_state(struct brw_context *brw,
- const brw_blorp_params *params,
+ const struct brw_blorp_params *params,
const struct brw_blorp_surface_info *surface,
uint32_t read_domains, uint32_t write_domain)
{
*/
void
gen6_blorp_emit_vs_disable(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
/* From the BSpec, 3D Pipeline > Geometry > Vertex Shader > State,
* 3DSTATE_VS, Dword 5.0 "VS Function Enable":
*/
void
gen6_blorp_emit_gs_disable(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
/* Disable all the constant buffers. */
BEGIN_BATCH(5);
*/
static void
gen6_blorp_emit_sf_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(20);
OUT_BATCH(_3DSTATE_SF << 16 | (20 - 2));
*/
static void
gen6_blorp_emit_wm_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const struct brw_blorp_prog_data *prog_data = params->wm_prog_data;
uint32_t dw2, dw4, dw5, dw6;
static void
gen6_blorp_emit_constant_ps(struct brw_context *brw,
- const brw_blorp_params *params,
+ const struct brw_blorp_params *params,
uint32_t wm_push_const_offset)
{
/* Make sure the push constants fill an exact integer number of
static void
gen6_blorp_emit_constant_ps_disable(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
/* Disable the push constant buffers. */
BEGIN_BATCH(5);
static void
gen6_blorp_emit_depth_stencil_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t surfwidth, surfheight;
uint32_t surftype;
static void
gen6_blorp_emit_depth_disable(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
brw_emit_depth_stall_flushes(brw);
*/
static void
gen6_blorp_emit_clear_params(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(2);
OUT_BATCH(_3DSTATE_CLEAR_PARAMS << 16 |
/* 3DSTATE_DRAWING_RECTANGLE */
void
gen6_blorp_emit_drawing_rectangle(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(4);
OUT_BATCH(_3DSTATE_DRAWING_RECTANGLE << 16 | (4 - 2));
/* 3DSTATE_VIEWPORT_STATE_POINTERS */
void
gen6_blorp_emit_viewport_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
struct brw_cc_viewport *ccv;
uint32_t cc_vp_offset;
/* 3DPRIMITIVE */
static void
gen6_blorp_emit_primitive(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(6);
OUT_BATCH(CMD_3D_PRIM << 16 | (6 - 2) |
*/
void
gen6_blorp_exec(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t cc_blend_state_offset = 0;
uint32_t cc_state_offset = 0;
static void
gen7_blorp_emit_sf_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
/* 3DSTATE_SF
*
*/
static void
gen7_blorp_emit_wm_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const struct brw_blorp_prog_data *prog_data = params->wm_prog_data;
uint32_t dw1 = 0, dw2 = 0;
*/
static void
gen7_blorp_emit_ps_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const struct brw_blorp_prog_data *prog_data = params->wm_prog_data;
uint32_t dw2, dw4, dw5;
static void
gen7_blorp_emit_depth_stencil_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const uint8_t mocs = GEN7_MOCS_L3;
uint32_t surfwidth, surfheight;
*/
void
gen7_blorp_emit_clear_params(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(3);
OUT_BATCH(GEN7_3DSTATE_CLEAR_PARAMS << 16 | (3 - 2));
/* 3DPRIMITIVE */
void
gen7_blorp_emit_primitive(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
BEGIN_BATCH(7);
OUT_BATCH(CMD_3D_PRIM << 16 | (7 - 2));
*/
void
gen7_blorp_exec(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
if (brw->gen >= 8)
return;
static uint32_t
gen8_blorp_emit_blend_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t blend_state_offset;
static void
gen8_blorp_emit_sbe_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
/* 3DSTATE_SBE */
{
*/
static void
gen8_blorp_emit_ps_config(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const struct brw_blorp_prog_data *prog_data = params->wm_prog_data;
uint32_t dw3, dw5, dw6, dw7;
static void
gen8_blorp_emit_ps_extra(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const struct brw_blorp_prog_data *prog_data = params->wm_prog_data;
uint32_t dw1 = 0;
static void
gen8_blorp_emit_depth_stencil_state(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
const unsigned pkt_len = brw->gen >= 9 ? 4 : 3;
static uint32_t
gen8_blorp_emit_surface_states(struct brw_context *brw,
- const brw_blorp_params *params)
+ const struct brw_blorp_params *params)
{
uint32_t wm_surf_offset_renderbuffer;
uint32_t wm_surf_offset_texture = 0;
* \copydoc gen6_blorp_exec()
*/
void
-gen8_blorp_exec(struct brw_context *brw, const brw_blorp_params *params)
+gen8_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params)
{
uint32_t wm_bind_bo_offset = 0;