blob: 15fcd306e43f3340f9bbe9e0a27b9daf9d6e35fa [file] [log] [blame]
Brian Paul4006c5e2009-01-26 12:22:04 -07001/**************************************************************************
Kenneth Graunkea7bdd4c2013-11-25 15:46:34 -08002 *
José Fonseca87712852014-01-17 16:27:50 +00003 * Copyright 2003 VMware, Inc.
Brian Paul4006c5e2009-01-26 12:22:04 -07004 * All Rights Reserved.
Kenneth Graunkea7bdd4c2013-11-25 15:46:34 -08005 *
Brian Paul4006c5e2009-01-26 12:22:04 -07006 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
Kenneth Graunkea7bdd4c2013-11-25 15:46:34 -080013 *
Brian Paul4006c5e2009-01-26 12:22:04 -070014 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
Kenneth Graunkea7bdd4c2013-11-25 15:46:34 -080017 *
Brian Paul4006c5e2009-01-26 12:22:04 -070018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
José Fonseca87712852014-01-17 16:27:50 +000021 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
Brian Paul4006c5e2009-01-26 12:22:04 -070022 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Kenneth Graunkea7bdd4c2013-11-25 15:46:34 -080025 *
Brian Paul4006c5e2009-01-26 12:22:04 -070026 **************************************************************************/
27
Brian Paule4394fb2011-09-29 16:29:30 -060028#include "main/version.h"
Vinson Lee45a56e42011-01-09 01:25:54 -080029
Kenneth Graunkea6927442013-07-02 18:56:43 -070030#include "brw_context.h"
Kenneth Graunke129da5b2013-05-27 20:09:56 -070031#include "intel_batchbuffer.h"
Eric Anholtf0159012012-07-18 10:18:26 -070032#include "intel_reg.h"
Chia-I Wu17ef1f62009-10-08 10:33:57 +080033#include "utils.h"
Brian Paul4006c5e2009-01-26 12:22:04 -070034
Brian Paul4006c5e2009-01-26 12:22:04 -070035/**
Kenneth Graunke129da5b2013-05-27 20:09:56 -070036 * Test if we can use MI_LOAD_REGISTER_MEM from an untrusted batchbuffer.
37 *
38 * Some combinations of hardware and kernel versions allow this feature,
39 * while others don't. Instead of trying to enumerate every case, just
40 * try and write a register and see if works.
41 */
42static bool
43can_do_pipelined_register_writes(struct brw_context *brw)
44{
Kenneth Graunkedecf0702013-11-04 14:09:07 -080045 /* Supposedly, Broadwell just works. */
46 if (brw->gen >= 8)
47 return true;
48
Kenneth Graunke129da5b2013-05-27 20:09:56 -070049 /* We use SO_WRITE_OFFSET0 since you're supposed to write it (unlike the
50 * statistics registers), and we already reset it to zero before using it.
51 */
52 const int reg = GEN7_SO_WRITE_OFFSET(0);
53 const int expected_value = 0x1337d0d0;
54 const int offset = 100;
55
56 /* The register we picked only exists on Gen7+. */
Kenneth Graunkedecf0702013-11-04 14:09:07 -080057 assert(brw->gen == 7);
Kenneth Graunke129da5b2013-05-27 20:09:56 -070058
59 uint32_t *data;
60 /* Set a value in a BO to a known quantity. The workaround BO already
61 * exists and doesn't contain anything important, so we may as well use it.
62 */
63 drm_intel_bo_map(brw->batch.workaround_bo, true);
64 data = brw->batch.workaround_bo->virtual;
65 data[offset] = 0xffffffff;
66 drm_intel_bo_unmap(brw->batch.workaround_bo);
67
68 /* Write the register. */
69 BEGIN_BATCH(3);
70 OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
71 OUT_BATCH(reg);
72 OUT_BATCH(expected_value);
73 ADVANCE_BATCH();
74
75 intel_batchbuffer_emit_mi_flush(brw);
76
77 /* Save the register's value back to the buffer. */
78 BEGIN_BATCH(3);
79 OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
80 OUT_BATCH(reg);
81 OUT_RELOC(brw->batch.workaround_bo,
82 I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
83 offset * sizeof(uint32_t));
84 ADVANCE_BATCH();
85
86 intel_batchbuffer_flush(brw);
87
88 /* Check whether the value got written. */
89 drm_intel_bo_map(brw->batch.workaround_bo, false);
90 bool success = data[offset] == expected_value;
91 drm_intel_bo_unmap(brw->batch.workaround_bo);
92
93 return success;
94}
95
Kenneth Graunke7a70f032013-11-13 15:42:57 -080096static bool
97can_write_oacontrol(struct brw_context *brw)
98{
99 if (brw->gen < 6 || brw->gen >= 8)
100 return false;
101
102 /* Set "Select Context ID" to a particular address (which is likely not a
103 * context), but leave all counting disabled. This should be harmless.
104 */
105 const int expected_value = 0x31337000;
106 const int offset = 110;
107
108 uint32_t *data;
109 /* Set a value in a BO to a known quantity. The workaround BO already
110 * exists and doesn't contain anything important, so we may as well use it.
111 */
112 drm_intel_bo_map(brw->batch.workaround_bo, true);
113 data = brw->batch.workaround_bo->virtual;
114 data[offset] = 0xffffffff;
115 drm_intel_bo_unmap(brw->batch.workaround_bo);
116
117 /* Write OACONTROL. */
118 BEGIN_BATCH(3);
119 OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
120 OUT_BATCH(OACONTROL);
121 OUT_BATCH(expected_value);
122 ADVANCE_BATCH();
123
124 intel_batchbuffer_emit_mi_flush(brw);
125
126 /* Save the register's value back to the buffer. */
127 BEGIN_BATCH(3);
128 OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
129 OUT_BATCH(OACONTROL);
130 OUT_RELOC(brw->batch.workaround_bo,
131 I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
132 offset * sizeof(uint32_t));
133 ADVANCE_BATCH();
134
135 intel_batchbuffer_emit_mi_flush(brw);
136
137 /* Set OACONTROL back to zero (everything off). */
138 BEGIN_BATCH(3);
139 OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
140 OUT_BATCH(OACONTROL);
141 OUT_BATCH(0);
142 ADVANCE_BATCH();
143
144 intel_batchbuffer_flush(brw);
145
146 /* Check whether the value got written. */
147 drm_intel_bo_map(brw->batch.workaround_bo, false);
148 bool success = data[offset] == expected_value;
149 drm_intel_bo_unmap(brw->batch.workaround_bo);
150
151 return success;
152}
153
Kenneth Graunke129da5b2013-05-27 20:09:56 -0700154/**
Brian Paul4006c5e2009-01-26 12:22:04 -0700155 * Initializes potential list of extensions if ctx == NULL, or actually enables
156 * extensions for a context.
157 */
158void
Kristian Høgsbergf9995b32010-10-12 12:26:10 -0400159intelInitExtensions(struct gl_context *ctx)
Brian Paul4006c5e2009-01-26 12:22:04 -0700160{
Kenneth Graunkefbdd3892013-07-03 10:57:11 -0700161 struct brw_context *brw = brw_context(ctx);
Brian Paul4006c5e2009-01-26 12:22:04 -0700162
Kenneth Graunke53631be2013-07-06 00:36:46 -0700163 assert(brw->gen >= 4);
Ian Romanick4ed976f2013-06-27 18:20:15 -0700164
Eric Anholt2f879352014-02-25 14:25:46 -0800165 ctx->Extensions.ARB_buffer_storage = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700166 ctx->Extensions.ARB_depth_buffer_float = true;
167 ctx->Extensions.ARB_depth_clamp = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700168 ctx->Extensions.ARB_depth_texture = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700169 ctx->Extensions.ARB_draw_elements_base_vertex = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700170 ctx->Extensions.ARB_draw_instanced = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700171 ctx->Extensions.ARB_ES2_compatibility = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700172 ctx->Extensions.ARB_explicit_attrib_location = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700173 ctx->Extensions.ARB_fragment_coord_conventions = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700174 ctx->Extensions.ARB_fragment_program = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700175 ctx->Extensions.ARB_fragment_program_shadow = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700176 ctx->Extensions.ARB_fragment_shader = true;
Ian Romanickbdba4b32012-12-01 10:56:40 -0800177 ctx->Extensions.ARB_framebuffer_object = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700178 ctx->Extensions.ARB_half_float_vertex = true;
179 ctx->Extensions.ARB_instanced_arrays = true;
Ian Romanick3c00a522012-12-01 11:06:31 -0800180 ctx->Extensions.ARB_internalformat_query = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700181 ctx->Extensions.ARB_map_buffer_range = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700182 ctx->Extensions.ARB_occlusion_query = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700183 ctx->Extensions.ARB_occlusion_query2 = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700184 ctx->Extensions.ARB_point_sprite = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700185 ctx->Extensions.ARB_seamless_cube_map = true;
186 ctx->Extensions.ARB_shader_bit_encoding = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700187 ctx->Extensions.ARB_shader_texture_lod = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700188 ctx->Extensions.ARB_shadow = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700189 ctx->Extensions.ARB_sync = true;
190 ctx->Extensions.ARB_texture_border_clamp = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700191 ctx->Extensions.ARB_texture_compression_rgtc = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700192 ctx->Extensions.ARB_texture_cube_map = true;
193 ctx->Extensions.ARB_texture_env_combine = true;
194 ctx->Extensions.ARB_texture_env_crossbar = true;
195 ctx->Extensions.ARB_texture_env_dot3 = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700196 ctx->Extensions.ARB_texture_float = true;
Kenneth Graunke2d328212013-10-20 20:19:53 -0700197 ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700198 ctx->Extensions.ARB_texture_non_power_of_two = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700199 ctx->Extensions.ARB_texture_rg = true;
200 ctx->Extensions.ARB_texture_rgb10_a2ui = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700201 ctx->Extensions.ARB_vertex_program = true;
202 ctx->Extensions.ARB_vertex_shader = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700203 ctx->Extensions.ARB_vertex_type_2_10_10_10_rev = true;
Chris Forbes351e13c2014-03-21 23:00:58 +1300204 ctx->Extensions.ARB_vertex_type_10f_11f_11f_rev = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700205 ctx->Extensions.EXT_blend_color = true;
206 ctx->Extensions.EXT_blend_equation_separate = true;
207 ctx->Extensions.EXT_blend_func_separate = true;
208 ctx->Extensions.EXT_blend_minmax = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700209 ctx->Extensions.EXT_draw_buffers2 = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700210 ctx->Extensions.EXT_framebuffer_sRGB = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700211 ctx->Extensions.EXT_gpu_program_parameters = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700212 ctx->Extensions.EXT_packed_float = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700213 ctx->Extensions.EXT_pixel_buffer_object = true;
214 ctx->Extensions.EXT_point_parameters = true;
215 ctx->Extensions.EXT_provoking_vertex = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700216 ctx->Extensions.EXT_separate_shader_objects = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700217 ctx->Extensions.EXT_texture_array = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700218 ctx->Extensions.EXT_texture_env_dot3 = true;
219 ctx->Extensions.EXT_texture_filter_anisotropic = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700220 ctx->Extensions.EXT_texture_integer = true;
221 ctx->Extensions.EXT_texture_shared_exponent = true;
222 ctx->Extensions.EXT_texture_snorm = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700223 ctx->Extensions.EXT_texture_sRGB = true;
224 ctx->Extensions.EXT_texture_sRGB_decode = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700225 ctx->Extensions.EXT_texture_swizzle = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700226 ctx->Extensions.EXT_stencil_two_side = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700227 ctx->Extensions.EXT_vertex_array_bgra = true;
Ian Romanick2937d702013-09-04 11:15:15 -0700228 ctx->Extensions.AMD_seamless_cubemap_per_texture = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700229 ctx->Extensions.APPLE_object_purgeable = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700230 ctx->Extensions.ATI_envmap_bumpmap = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700231 ctx->Extensions.ATI_separate_stencil = true;
232 ctx->Extensions.ATI_texture_env_combine3 = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700233 ctx->Extensions.MESA_pack_invert = true;
234 ctx->Extensions.MESA_ycbcr_texture = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700235 ctx->Extensions.NV_conditional_render = true;
236 ctx->Extensions.NV_primitive_restart = true;
Ian Romanick4ed976f2013-06-27 18:20:15 -0700237 ctx->Extensions.NV_texture_env_combine4 = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700238 ctx->Extensions.NV_texture_rectangle = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700239 ctx->Extensions.TDFX_texture_compression_FXT1 = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700240 ctx->Extensions.OES_compressed_ETC1_RGB8_texture = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700241 ctx->Extensions.OES_EGL_image = true;
Kenneth Graunke88128512012-05-23 17:06:45 -0700242 ctx->Extensions.OES_draw_texture = true;
Ian Romanickae66a652013-06-27 18:20:16 -0700243 ctx->Extensions.OES_standard_derivatives = true;
Topi Pohjolainenf5947c22012-11-12 13:38:08 +0200244 ctx->Extensions.OES_EGL_image_external = true;
Chad Versacea3481792010-10-07 16:04:30 -0700245
Paul Berryb6d6ea32013-03-22 14:41:17 -0700246 if (brw->gen >= 7)
Kenneth Graunke567445e2013-10-17 23:14:23 -0700247 ctx->Const.GLSLVersion = 330;
Paul Berryb6d6ea32013-03-22 14:41:17 -0700248 else if (brw->gen >= 6)
Marek Olšák0ac83a22012-12-08 22:48:47 +0100249 ctx->Const.GLSLVersion = 140;
Eric Anholt87278072011-11-08 19:17:47 -0800250 else
251 ctx->Const.GLSLVersion = 120;
Chad Versacea1eff552011-09-27 13:53:11 -0700252 _mesa_override_glsl_version(ctx);
Kristian Høgsbergb91dba42010-09-22 11:01:11 -0400253
Kenneth Graunke53631be2013-07-06 00:36:46 -0700254 if (brw->gen >= 6) {
Ian Romanick0b9398c2013-06-27 18:20:17 -0700255 uint64_t dummy;
256
Paul Berrydc92b2d2013-01-28 11:13:07 -0800257 ctx->Extensions.EXT_framebuffer_multisample = true;
Kenneth Graunke50e60bf2013-04-06 10:27:28 -0700258 ctx->Extensions.EXT_transform_feedback = true;
Anuj Phogat722721d2013-05-14 08:15:59 -0700259 ctx->Extensions.EXT_framebuffer_multisample_blit_scaled = true;
Kenneth Graunkefbdd3892013-07-03 10:57:11 -0700260 ctx->Extensions.ARB_blend_func_extended = !driQueryOptionb(&brw->optionCache, "disable_blend_func_extended");
Eric Anholtb7932e12012-04-25 13:19:28 -0700261 ctx->Extensions.ARB_draw_buffers_blend = true;
Paul Berrye4f661a2012-08-07 12:39:30 -0700262 ctx->Extensions.ARB_ES3_compatibility = true;
Eric Anholt4a078512012-06-27 13:46:26 -0700263 ctx->Extensions.ARB_uniform_buffer_object = true;
Kenneth Graunke46d9baf2013-07-17 18:18:00 -0700264 ctx->Extensions.ARB_shading_language_420pack = true;
Marek Olšákafa902a2012-12-08 22:53:23 +0100265 ctx->Extensions.ARB_texture_buffer_object = true;
Eric Anholt5e529d72013-01-10 14:53:12 -0800266 ctx->Extensions.ARB_texture_buffer_object_rgb32 = true;
Eric Anholta5e2e7f2013-10-04 17:46:04 -0700267 ctx->Extensions.ARB_texture_buffer_range = true;
Chris Forbes2f7f0952012-11-22 19:24:22 +1300268 ctx->Extensions.ARB_texture_cube_map_array = true;
Ian Romanick285fe322013-01-18 15:44:38 -0800269 ctx->Extensions.OES_depth_texture_cube_map = true;
Matt Turner9aadc3a2013-01-22 21:06:12 -0800270 ctx->Extensions.ARB_shading_language_packing = true;
Chris Forbes1d4dbee2012-12-29 21:28:57 +1300271 ctx->Extensions.ARB_texture_multisample = true;
Anuj Phogat625a6312013-08-30 13:13:15 -0700272 ctx->Extensions.ARB_sample_shading = true;
Chris Forbes0c14c5c2014-02-02 22:00:18 +1300273 ctx->Extensions.ARB_texture_gather = true;
Ian Romanick0b9398c2013-06-27 18:20:17 -0700274
275 /* Test if the kernel has the ioctl. */
Kenneth Graunkeeeb75b42013-07-03 14:09:51 -0700276 if (drm_intel_reg_read(brw->bufmgr, TIMESTAMP, &dummy) == 0)
Ian Romanick0b9398c2013-06-27 18:20:17 -0700277 ctx->Extensions.ARB_timer_query = true;
Eric Anholtb7932e12012-04-25 13:19:28 -0700278 }
279
Kenneth Graunke53631be2013-07-06 00:36:46 -0700280 if (brw->gen >= 5) {
Matt Turnered6186f2013-03-06 14:54:27 -0800281 ctx->Extensions.ARB_texture_query_lod = true;
Ian Romanick71cecca2011-08-22 13:15:42 -0700282 ctx->Extensions.EXT_timer_query = true;
Ian Romanickea373f02013-09-12 11:40:00 -0500283 ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
Chris Forbes317e1722013-10-05 17:11:57 +1300284 ctx->Extensions.ARB_texture_query_levels = ctx->Const.GLSLVersion >= 130;
Matt Turnered6186f2013-03-06 14:54:27 -0800285 }
Eric Anholt3b68b6c2010-05-25 15:32:54 -0700286
Chris Forbes7df985a2013-03-24 20:18:55 +1300287 if (brw->gen >= 7) {
Chris Forbes7ec46682013-10-05 21:40:57 +1300288 ctx->Extensions.ARB_conservative_depth = true;
Jordan Justenbd00c662013-03-27 13:58:52 -0700289 ctx->Extensions.AMD_vertex_shader_layer = true;
Kenneth Graunke129da5b2013-05-27 20:09:56 -0700290 if (can_do_pipelined_register_writes(brw)) {
291 ctx->Extensions.ARB_transform_feedback2 = true;
Kenneth Graunkec4ec0ad2013-10-26 13:20:02 -0700292 ctx->Extensions.ARB_transform_feedback3 = true;
Kenneth Graunke0eeaf112013-10-26 13:27:18 -0700293 ctx->Extensions.ARB_transform_feedback_instanced = true;
Chris Forbese6a0eca2013-09-30 21:16:40 +1300294 ctx->Extensions.ARB_draw_indirect = true;
Kenneth Graunke129da5b2013-05-27 20:09:56 -0700295 }
Courtney Goeltzenleuchter7837f422013-11-13 13:15:19 -0700296
297 /* Only enable this in core profile because other parts of Mesa behave
298 * slightly differently when the extension is enabled.
299 */
300 if (ctx->API == API_OPENGL_CORE)
301 ctx->Extensions.ARB_viewport_array = true;
Paul Berry25268b92014-01-06 15:12:05 -0800302
303 if (getenv("INTEL_COMPUTE_SHADER"))
304 ctx->Extensions.ARB_compute_shader = true;
Chris Forbes7df985a2013-03-24 20:18:55 +1300305 }
306
Kenneth Graunkedfa1ab02014-02-23 21:59:25 -0800307 if (brw->gen >= 8) {
308 ctx->Extensions.ARB_stencil_texturing = true;
309 }
310
Kenneth Graunke7a70f032013-11-13 15:42:57 -0800311 if (brw->gen == 5 || can_write_oacontrol(brw))
312 ctx->Extensions.AMD_performance_monitor = true;
313
Ian Romanickae66a652013-06-27 18:20:16 -0700314 if (ctx->API == API_OPENGL_CORE)
315 ctx->Extensions.ARB_base_instance = true;
316 if (ctx->API != API_OPENGL_CORE)
317 ctx->Extensions.ARB_color_buffer_float = true;
Ian Romanick425c8032009-01-27 23:44:18 -0800318
Kenneth Graunkee3c2bb12013-07-03 23:32:20 -0700319 if (ctx->Mesa_DXTn || driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))
Ian Romanick0a5478c2011-08-22 13:18:06 -0700320 ctx->Extensions.EXT_texture_compression_s3tc = true;
Ian Romanick5bd86b22012-08-21 15:33:04 -0700321
322 ctx->Extensions.ANGLE_texture_compression_dxt = true;
Francisco Jerez59763452013-10-20 14:11:27 -0700323
324 if (brw->gen >= 7)
325 ctx->Extensions.ARB_shader_atomic_counters = true;
Brian Paul4006c5e2009-01-26 12:22:04 -0700326}