#include "main/fbobject.h"
#include "main/extensions.h"
#include "main/glthread.h"
-#include "main/imports.h"
#include "main/macros.h"
#include "main/points.h"
#include "main/version.h"
#include "util/ralloc.h"
#include "util/debug.h"
#include "util/disk_cache.h"
+#include "util/u_memory.h"
#include "isl/isl.h"
#include "common/gen_defines.h"
brw->need_flush_throttle = true;
}
+static void
+intel_glEnable(struct gl_context *ctx, GLenum cap, GLboolean state)
+{
+ struct brw_context *brw = brw_context(ctx);
+
+ switch (cap) {
+ case GL_BLACKHOLE_RENDER_INTEL:
+ brw->frontend_noop = state;
+ intel_batchbuffer_flush(brw);
+ intel_batchbuffer_maybe_noop(brw);
+ /* Because we started previous batches with a potential
+ * MI_BATCH_BUFFER_END if NOOP was enabled, that means that anything
+ * that was ever emitted after that never made it to the HW. So when the
+ * blackhole state changes from NOOP->!NOOP reupload the entire state.
+ */
+ if (!brw->frontend_noop) {
+ brw->NewGLState = ~0u;
+ brw->ctx.NewDriverState = ~0ull;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
static void
intel_finish(struct gl_context * ctx)
{
if (!brw->driContext->driScreenPriv->dri2.useInvalidate)
functions->Viewport = intel_viewport;
+ functions->Enable = intel_glEnable;
functions->Flush = intel_glFlush;
functions->Finish = intel_finish;
functions->GetString = intel_get_string;
ctx->Const.MaxIntegerSamples = max_samples;
ctx->Const.MaxImageSamples = 0;
- /* gen6_set_sample_maps() sets SampleMap{2,4,8}x variables which are used
- * to map indices of rectangular grid to sample numbers within a pixel.
- * These variables are used by GL_EXT_framebuffer_multisample_blit_scaled
- * extension implementation. For more details see the comment above
- * gen6_set_sample_maps() definition.
- */
- gen6_set_sample_maps(ctx);
-
ctx->Const.MinLineWidth = 1.0;
ctx->Const.MinLineWidthAA = 1.0;
if (devinfo->gen >= 6) {
ctx->Const.MaxComputeWorkGroupSize[2] = max_invocations;
ctx->Const.MaxComputeWorkGroupInvocations = max_invocations;
ctx->Const.MaxComputeSharedMemorySize = 64 * 1024;
+
+ /* Constants used for ARB_compute_variable_group_size. */
+ if (devinfo->gen >= 7) {
+ assert(max_invocations >= 512);
+ ctx->Const.MaxComputeVariableGroupSize[0] = max_invocations;
+ ctx->Const.MaxComputeVariableGroupSize[1] = max_invocations;
+ ctx->Const.MaxComputeVariableGroupSize[2] = max_invocations;
+ ctx->Const.MaxComputeVariableGroupInvocations = max_invocations;
+ }
}
/**
driOptionCache *options = &brw->optionCache;
driParseConfigFiles(options, &brw->screen->optionCache,
brw->driContext->driScreenPriv->myNum,
- "i965", NULL, NULL, 0);
+ "i965", NULL, NULL, 0, NULL, 0);
if (INTEL_DEBUG & DEBUG_NO_HIZ) {
brw->has_hiz = false;
ctx->Const.ForceGLSLAbsSqrt =
driQueryOptionb(options, "force_glsl_abs_sqrt");
- ctx->Const.GLSLZeroInit = driQueryOptionb(options, "glsl_zero_init");
+ ctx->Const.GLSLZeroInit = driQueryOptionb(options, "glsl_zero_init") ? 1 : 0;
brw->dual_color_blend_by_location =
driQueryOptionb(options, "dual_color_blend_by_location");
ctx->Const.AllowGLSLCrossStageInterpolationMismatch =
driQueryOptionb(options, "allow_glsl_cross_stage_interpolation_mismatch");
+ char *vendor_str = driQueryOptionstr(options, "force_gl_vendor");
+ /* not an empty string */
+ if (*vendor_str)
+ ctx->Const.VendorOverride = vendor_str;
+
ctx->Const.dri_config_options_sha1 = ralloc_array(brw, unsigned char, 20);
driComputeOptionsSha1(&brw->screen->optionCache,
ctx->Const.dri_config_options_sha1);
_swrast_CreateContext(ctx);
}
- _vbo_CreateContext(ctx);
+ _vbo_CreateContext(ctx, true);
if (ctx->swrast_context) {
_tnl_CreateContext(ctx);
TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
if (ctx->Extensions.INTEL_performance_query)
brw_init_performance_queries(brw);
- vbo_use_buffer_objects(ctx);
- vbo_always_unmap_buffers(ctx);
-
brw->ctx.Cache = brw->screen->disk_cache;
if (driContextPriv->driScreenPriv->dri2.backgroundCallable &&
driDestroyOptionCache(&brw->optionCache);
/* free the Mesa context */
- _mesa_free_context_data(&brw->ctx);
+ _mesa_free_context_data(&brw->ctx, true);
ralloc_free(brw);
driContextPriv->driverPrivate = NULL;