BRW_STATE_RASTERIZER_DISCARD,
BRW_STATE_STATS_WM,
BRW_STATE_UNIFORM_BUFFER,
+ BRW_STATE_ATOMIC_BUFFER,
BRW_STATE_META_IN_PROGRESS,
BRW_STATE_INTERPOLATION_MAP,
BRW_STATE_PUSH_CONSTANT_ALLOCATION,
#define BRW_NEW_RASTERIZER_DISCARD (1 << BRW_STATE_RASTERIZER_DISCARD)
#define BRW_NEW_STATS_WM (1 << BRW_STATE_STATS_WM)
#define BRW_NEW_UNIFORM_BUFFER (1 << BRW_STATE_UNIFORM_BUFFER)
+#define BRW_NEW_ATOMIC_BUFFER (1 << BRW_STATE_ATOMIC_BUFFER)
#define BRW_NEW_META_IN_PROGRESS (1 << BRW_STATE_META_IN_PROGRESS)
#define BRW_NEW_INTERPOLATION_MAP (1 << BRW_STATE_INTERPOLATION_MAP)
#define BRW_NEW_PUSH_CONSTANT_ALLOCATION (1 << BRW_STATE_PUSH_CONSTANT_ALLOCATION)
uint32_t texture_start;
uint32_t gather_texture_start;
uint32_t ubo_start;
+ uint32_t abo_start;
uint32_t shader_time_start;
/** @} */
} binding_table;
GLuint nr_params; /**< number of float params/constants */
GLuint nr_pull_params;
bool dual_src_blend;
+ bool uses_pos_offset;
+ bool uses_omask;
uint32_t prog_offset_16;
/**
unsigned control_data_format;
bool include_primitive_id;
+
+ /**
+ * True if the thread should be dispatched in DUAL_INSTANCE mode, false if
+ * it should be dispatched in DUAL_OBJECT mode.
+ */
+ bool dual_instanced_dispatch;
};
/** Number of texture sampler units */
/** Max number of render targets in a shader */
#define BRW_MAX_DRAW_BUFFERS 8
+/** Max number of atomic counter buffer objects in a shader */
+#define BRW_MAX_ABO 4
+
/**
* Max number of binding table entries used for stream output.
*
#define BRW_MAX_SURFACES (BRW_MAX_DRAW_BUFFERS + \
BRW_MAX_TEX_UNIT * 2 + /* normal, gather */ \
12 + /* ubo */ \
+ BRW_MAX_ABO + \
2 /* shader time, pull constants */)
#define SURF_INDEX_GEN6_SOL_BINDING(t) (t)
} saved;
};
+#define BRW_MAX_XFB_STREAMS 4
+
+struct brw_transform_feedback_object {
+ struct gl_transform_feedback_object base;
+
+ /** A buffer to hold SO_WRITE_OFFSET(n) values while paused. */
+ drm_intel_bo *offset_bo;
+
+ /** The most recent primitive mode (GL_TRIANGLES/GL_POINTS/GL_LINES). */
+ GLenum primitive_mode;
+
+ /**
+ * Count of primitives generated during this transform feedback operation.
+ * @{
+ */
+ uint64_t prims_generated[BRW_MAX_XFB_STREAMS];
+ drm_intel_bo *prim_count_bo;
+ unsigned prim_count_buffer_index; /**< in number of uint64_t units */
+ /** @} */
+
+ /**
+ * Number of vertices written between last Begin/EndTransformFeedback().
+ *
+ * Used to implement DrawTransformFeedback().
+ */
+ uint64_t vertices_written[BRW_MAX_XFB_STREAMS];
+ bool vertices_written_valid;
+};
+
/**
* Data shared between each programmable stage in the pipeline (vs, gs, and
* wm).
struct
{
- void (*destroy) (struct brw_context * brw);
-
void (*update_texture_surface)(struct gl_context *ctx,
unsigned unit,
uint32_t *surf_offset,
unsigned unit);
void (*update_null_renderbuffer_surface)(struct brw_context *brw,
unsigned unit);
- void (*create_constant_surface)(struct brw_context *brw,
- drm_intel_bo *bo,
- uint32_t offset,
- uint32_t size,
- uint32_t *out_offset,
- bool dword_pitch);
+
+ void (*create_raw_surface)(struct brw_context *brw,
+ drm_intel_bo *bo,
+ uint32_t offset,
+ uint32_t size,
+ uint32_t *out_offset,
+ bool rw);
+ void (*emit_buffer_surface_state)(struct brw_context *brw,
+ uint32_t *out_offset,
+ drm_intel_bo *bo,
+ unsigned buffer_offset,
+ unsigned surface_format,
+ unsigned buffer_size,
+ unsigned pitch,
+ unsigned mocs,
+ bool rw);
/** Upload a SAMPLER_STATE table. */
void (*upload_sampler_state_table)(struct brw_context *brw,
__DRIcontext *driContext;
struct intel_screen *intelScreen;
- void (*saved_viewport)(struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height);
};
static INLINE bool
void intel_resolve_for_dri2_flush(struct brw_context *brw,
__DRIdrawable *drawable);
-bool brwCreateContext(gl_api api,
+GLboolean brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
__DRIcontext *driContextPriv,
unsigned major_version,
/** gen6_queryobj.c */
void gen6_init_queryobj_functions(struct dd_function_table *functions);
+void brw_store_register_mem64(struct brw_context *brw,
+ drm_intel_bo *bo, uint32_t reg, int idx);
/*======================================================================
* brw_state_dump.c
/* brw_wm_surface_state.c */
void brw_init_surface_formats(struct brw_context *brw);
+void brw_create_constant_surface(struct brw_context *brw,
+ drm_intel_bo *bo,
+ uint32_t offset,
+ uint32_t size,
+ uint32_t *out_offset,
+ bool dword_pitch);
+void brw_update_buffer_texture_surface(struct gl_context *ctx,
+ unsigned unit,
+ uint32_t *surf_offset);
void
brw_update_sol_surface(struct brw_context *brw,
struct gl_buffer_object *buffer_obj,
struct gl_shader *shader,
struct brw_stage_state *stage_state,
struct brw_stage_prog_data *prog_data);
+void brw_upload_abo_surfaces(struct brw_context *brw,
+ struct gl_shader_program *prog,
+ struct brw_stage_state *stage_state,
+ struct brw_stage_prog_data *prog_data);
/* brw_surface_formats.c */
bool brw_is_hiz_depth_format(struct brw_context *ctx, gl_format format);
void intel_init_syncobj_functions(struct dd_function_table *functions);
/* gen6_sol.c */
+struct gl_transform_feedback_object *
+brw_new_transform_feedback(struct gl_context *ctx, GLuint name);
+void
+brw_delete_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
void
brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
struct gl_transform_feedback_object *obj);
void
brw_end_transform_feedback(struct gl_context *ctx,
struct gl_transform_feedback_object *obj);
+GLsizei
+brw_get_transform_feedback_vertex_count(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj,
+ GLuint stream);
/* gen7_sol_state.c */
void
void
gen7_end_transform_feedback(struct gl_context *ctx,
struct gl_transform_feedback_object *obj);
+void
+gen7_pause_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+void
+gen7_resume_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
/* brw_blorp_blit.cpp */
GLbitfield
return (const struct brw_vertex_program *) p;
}
+static INLINE struct brw_geometry_program *
+brw_geometry_program(struct gl_geometry_program *p)
+{
+ return (struct brw_geometry_program *) p;
+}
+
static INLINE struct brw_fragment_program *
brw_fragment_program(struct gl_fragment_program *p)
{
bool brw_do_cubemap_normalize(struct exec_list *instructions);
bool brw_lower_texture_gradients(struct brw_context *brw,
struct exec_list *instructions);
+bool brw_do_lower_offset_arrays(struct exec_list *instructions);
+bool brw_do_lower_unnormalized_offset(struct exec_list *instructions);
struct opcode_desc {
char *name;