gl_format format,
const union gl_color_union *color)
{
- struct intel_context *intel = &brw->intel;
if (_mesa_is_format_integer_color(format))
return false;
ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
/* Turn on some extra GL_ARB_debug_output generation. */
- intel->perf_debug = true;
+ brw->perf_debug = true;
}
brw_fs_alloc_reg_sets(brw);
GLenum reduced_primitive;
+ /**
+ * Set if we're either a debug context or the INTEL_DEBUG=perf environment
+ * variable is set, this is the flag indicating to do expensive work that
+ * might lead to a perf_debug() call.
+ */
+ bool perf_debug;
+
bool emit_state_always;
bool has_surface_tile_offset;
bool has_compr4;
GLuint max_index,
struct gl_transform_feedback_object *tfb_vertcount )
{
- struct intel_context *intel = intel_context(ctx);
+ struct brw_context *brw = brw_context(ctx);
const struct gl_client_array **arrays = ctx->Array._DrawArrays;
if (!_mesa_check_conditional_render(ctx))
static void brw_upload_indices(struct brw_context *brw)
{
struct gl_context *ctx = &brw->intel.ctx;
- struct intel_context *intel = &brw->intel;
const struct _mesa_index_buffer *index_buffer = brw->ib.ib;
GLuint ib_size;
drm_intel_bo *bo = NULL;
bool start_busy = false;
float start_time = 0;
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
start_busy = (brw->batch.last_bo &&
drm_intel_bo_busy(brw->batch.last_bo));
start_time = get_time();
simd16_instructions,
final_assembly_size);
- if (unlikely(intel->perf_debug) && shader) {
+ if (unlikely(brw->perf_debug) && shader) {
if (shader->compiled_once)
brw_wm_debug_recompile(brw, prog, &c->key);
shader->compiled_once = true;
if (drm_intel_bo_references(brw->batch.bo, query->bo))
intel_batchbuffer_flush(brw);
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
if (drm_intel_bo_busy(query->bo)) {
perf_debug("Stalling on the GPU waiting for a query object.\n");
}
lower_variable_index_to_cond_assign(shader->ir,
input, output, temp, uniform);
- if (unlikely((intel->perf_debug) && lowered_variable_indexing)) {
+ if (unlikely(brw->perf_debug && lowered_variable_indexing)) {
perf_debug("Unsupported form of variable indexing in FS; falling "
"back to very inefficient code generation\n");
}
void
brw_state_cache_check_size(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
-
/* un-tuned guess. Each object is generally a page, so 2000 of them is 8 MB of
* state cache.
*/
void *mem_ctx,
unsigned *final_assembly_size)
{
- struct intel_context *intel = &brw->intel;
bool start_busy = false;
float start_time = 0;
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
start_busy = (brw->batch.last_bo &&
drm_intel_bo_busy(brw->batch.last_bo));
start_time = get_time();
const unsigned *generated =g.generate_assembly(&v.instructions,
final_assembly_size);
- if (unlikely(intel->perf_debug) && shader) {
+ if (unlikely(brw->perf_debug) && shader) {
if (shader->compiled_once) {
brw_vs_debug_recompile(brw, prog, &c->key);
}
static bool
key_debug(struct brw_context *brw, const char *name, int a, int b)
{
- struct intel_context *intel = &brw->intel;
if (a != b) {
perf_debug(" %s %d->%d\n", name, a, b);
return true;
struct gl_shader_program *prog,
const struct brw_vs_prog_key *key)
{
- struct intel_context *intel = &brw->intel;
struct brw_cache_item *c = NULL;
const struct brw_vs_prog_key *old_key = NULL;
bool found = false;
struct brw_fragment_program *fp,
struct brw_wm_prog_key *key)
{
- struct intel_context *intel = &brw->intel;
struct brw_wm_compile *c;
const GLuint *program;
struct gl_shader *fs = NULL;
static bool
key_debug(struct brw_context *brw, const char *name, int a, int b)
{
- struct intel_context *intel = &brw->intel;
if (a != b) {
perf_debug(" %s %d->%d\n", name, a, b);
return true;
struct gl_shader_program *prog,
const struct brw_wm_prog_key *key)
{
- struct intel_context *intel = &brw->intel;
struct brw_cache_item *c = NULL;
const struct brw_wm_prog_key *old_key = NULL;
bool found = false;
struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
if (query->bo == NULL)
return;
if (drm_intel_bo_references(brw->batch.bo, query->bo))
intel_batchbuffer_flush(brw);
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
if (drm_intel_bo_busy(query->bo)) {
perf_debug("Stalling on the GPU waiting for a query object.\n");
}
uint32_t width, uint32_t height,
GLenum logicop)
{
- struct intel_context *intel = &brw->intel;
/* No sRGB decode or encode is done by the hardware blitter, which is
* consistent with what we want in the callers (glCopyTexSubImage(),
* glBlitFramebuffer(), texture validation, etc.).
const GLvoid * data, struct gl_buffer_object *obj)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
bool busy;
GLbitfield access, struct gl_buffer_object *obj)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
assert(intel_obj);
INTEL_DEBUG &= ~DEBUG_SHADER_TIME;
}
if (INTEL_DEBUG & DEBUG_PERF)
- intel->perf_debug = true;
+ brw->perf_debug = true;
if (INTEL_DEBUG & DEBUG_AUB)
drm_intel_bufmgr_gem_set_aub_dump(brw->bufmgr, true);
bool has_llc;
bool has_swizzling;
- /**
- * Set if we're either a debug context or the INTEL_DEBUG=perf environment
- * variable is set, this is the flag indicating to do expensive work that
- * might lead to a perf_debug() call.
- */
- bool perf_debug;
-
struct {
drm_intel_bo *bo;
GLuint offset;
static GLuint msg_id = 0; \
if (unlikely(INTEL_DEBUG & DEBUG_PERF)) \
dbg_printf(__VA_ARGS__); \
- if (intel->perf_debug) \
- _mesa_gl_debug(&intel->ctx, &msg_id, \
+ if (brw->perf_debug) \
+ _mesa_gl_debug(&brw->intel.ctx, &msg_id, \
MESA_DEBUG_TYPE_PERFORMANCE, \
MESA_DEBUG_SEVERITY_MEDIUM, \
__VA_ARGS__); \
GLbitfield mask, GLenum filter)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
if (mask & GL_COLOR_BUFFER_BIT) {
GLint i;
int depth)
{
- struct intel_context *intel = &brw->intel;
gl_format format = src_mt->format;
uint32_t width = src_mt->level[level].width;
uint32_t height = src_mt->level[level].height;
const GLubyte *bitmap )
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct intel_renderbuffer *irb;
GLfloat tmpColor[4];
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
bool dirty;
DBG("%s\n", __FUNCTION__);
GLsizei width, GLsizei height)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
/* Try BLORP first. It can handle almost everything. */
if (brw_blorp_copytexsubimage(brw, rb, texImage, slice, x, y,
intel_batchbuffer_flush(brw);
}
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
if (drm_intel_bo_busy(bo)) {
perf_debug("Mapping a busy BO, causing a stall on the GPU.\n");
}