Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /**************************************************************************
  2.  *
  3.  * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
  4.  * All Rights Reserved.
  5.  *
  6.  * 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:
  13.  *
  14.  * 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.
  17.  *
  18.  * 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.
  21.  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
  22.  * 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.
  25.  *
  26.  **************************************************************************/
  27.  
  28. #include "main/version.h"
  29.  
  30. #include "brw_context.h"
  31. #include "intel_chipset.h"
  32. #include "intel_reg.h"
  33. #include "utils.h"
  34.  
  35. /**
  36.  * Initializes potential list of extensions if ctx == NULL, or actually enables
  37.  * extensions for a context.
  38.  */
  39. void
  40. intelInitExtensions(struct gl_context *ctx)
  41. {
  42.    struct brw_context *brw = brw_context(ctx);
  43.  
  44.    assert(brw->gen >= 4);
  45.  
  46.    ctx->Extensions.ARB_depth_buffer_float = true;
  47.    ctx->Extensions.ARB_depth_clamp = true;
  48.    ctx->Extensions.ARB_depth_texture = true;
  49.    ctx->Extensions.ARB_draw_elements_base_vertex = true;
  50.    ctx->Extensions.ARB_draw_instanced = true;
  51.    ctx->Extensions.ARB_ES2_compatibility = true;
  52.    ctx->Extensions.ARB_explicit_attrib_location = true;
  53.    ctx->Extensions.ARB_fragment_coord_conventions = true;
  54.    ctx->Extensions.ARB_fragment_program = true;
  55.    ctx->Extensions.ARB_fragment_program_shadow = true;
  56.    ctx->Extensions.ARB_fragment_shader = true;
  57.    ctx->Extensions.ARB_framebuffer_object = true;
  58.    ctx->Extensions.ARB_half_float_pixel = true;
  59.    ctx->Extensions.ARB_half_float_vertex = true;
  60.    ctx->Extensions.ARB_instanced_arrays = true;
  61.    ctx->Extensions.ARB_internalformat_query = true;
  62.    ctx->Extensions.ARB_map_buffer_range = true;
  63.    ctx->Extensions.ARB_occlusion_query = true;
  64.    ctx->Extensions.ARB_occlusion_query2 = true;
  65.    ctx->Extensions.ARB_point_sprite = true;
  66.    ctx->Extensions.ARB_seamless_cube_map = true;
  67.    ctx->Extensions.ARB_shader_bit_encoding = true;
  68.    ctx->Extensions.ARB_shader_texture_lod = true;
  69.    ctx->Extensions.ARB_shadow = true;
  70.    ctx->Extensions.ARB_sync = true;
  71.    ctx->Extensions.ARB_texture_border_clamp = true;
  72.    ctx->Extensions.ARB_texture_compression_rgtc = true;
  73.    ctx->Extensions.ARB_texture_cube_map = true;
  74.    ctx->Extensions.ARB_texture_env_combine = true;
  75.    ctx->Extensions.ARB_texture_env_crossbar = true;
  76.    ctx->Extensions.ARB_texture_env_dot3 = true;
  77.    ctx->Extensions.ARB_texture_float = true;
  78.    ctx->Extensions.ARB_texture_non_power_of_two = true;
  79.    ctx->Extensions.ARB_texture_rg = true;
  80.    ctx->Extensions.ARB_texture_rgb10_a2ui = true;
  81.    ctx->Extensions.ARB_vertex_program = true;
  82.    ctx->Extensions.ARB_vertex_shader = true;
  83.    ctx->Extensions.ARB_vertex_type_2_10_10_10_rev = true;
  84.    ctx->Extensions.EXT_blend_color = true;
  85.    ctx->Extensions.EXT_blend_equation_separate = true;
  86.    ctx->Extensions.EXT_blend_func_separate = true;
  87.    ctx->Extensions.EXT_blend_minmax = true;
  88.    ctx->Extensions.EXT_draw_buffers2 = true;
  89.    ctx->Extensions.EXT_framebuffer_blit = true;
  90.    ctx->Extensions.EXT_framebuffer_sRGB = true;
  91.    ctx->Extensions.EXT_gpu_program_parameters = true;
  92.    ctx->Extensions.EXT_packed_depth_stencil = true;
  93.    ctx->Extensions.EXT_packed_float = true;
  94.    ctx->Extensions.EXT_pixel_buffer_object = true;
  95.    ctx->Extensions.EXT_point_parameters = true;
  96.    ctx->Extensions.EXT_provoking_vertex = true;
  97.    ctx->Extensions.EXT_separate_shader_objects = true;
  98.    ctx->Extensions.EXT_texture_array = true;
  99.    ctx->Extensions.EXT_texture_env_dot3 = true;
  100.    ctx->Extensions.EXT_texture_filter_anisotropic = true;
  101.    ctx->Extensions.EXT_texture_integer = true;
  102.    ctx->Extensions.EXT_texture_shared_exponent = true;
  103.    ctx->Extensions.EXT_texture_snorm = true;
  104.    ctx->Extensions.EXT_texture_sRGB = true;
  105.    ctx->Extensions.EXT_texture_sRGB_decode = true;
  106.    ctx->Extensions.EXT_texture_swizzle = true;
  107.    ctx->Extensions.EXT_stencil_two_side = true;
  108.    ctx->Extensions.EXT_vertex_array_bgra = true;
  109.    ctx->Extensions.APPLE_object_purgeable = true;
  110.    ctx->Extensions.ATI_envmap_bumpmap = true;
  111.    ctx->Extensions.ATI_separate_stencil = true;
  112.    ctx->Extensions.ATI_texture_env_combine3 = true;
  113.    ctx->Extensions.MESA_pack_invert = true;
  114.    ctx->Extensions.MESA_texture_array = true;
  115.    ctx->Extensions.MESA_ycbcr_texture = true;
  116.    ctx->Extensions.NV_conditional_render = true;
  117.    ctx->Extensions.NV_primitive_restart = true;
  118.    ctx->Extensions.NV_texture_env_combine4 = true;
  119.    ctx->Extensions.NV_texture_rectangle = true;
  120.    ctx->Extensions.TDFX_texture_compression_FXT1 = true;
  121.    ctx->Extensions.OES_compressed_ETC1_RGB8_texture = true;
  122.    ctx->Extensions.OES_EGL_image = true;
  123.    ctx->Extensions.OES_draw_texture = true;
  124.    ctx->Extensions.OES_standard_derivatives = true;
  125.  
  126.    if (brw->gen >= 6)
  127.       ctx->Const.GLSLVersion = 140;
  128.    else
  129.       ctx->Const.GLSLVersion = 120;
  130.    _mesa_override_glsl_version(ctx);
  131.  
  132.    if (brw->gen >= 6) {
  133.       uint64_t dummy;
  134.  
  135.       ctx->Extensions.EXT_framebuffer_multisample = true;
  136.       ctx->Extensions.EXT_transform_feedback = true;
  137.       ctx->Extensions.EXT_framebuffer_multisample_blit_scaled = true;
  138.       ctx->Extensions.ARB_blend_func_extended = !driQueryOptionb(&brw->optionCache, "disable_blend_func_extended");
  139.       ctx->Extensions.ARB_draw_buffers_blend = true;
  140.       ctx->Extensions.ARB_ES3_compatibility = true;
  141.       ctx->Extensions.ARB_uniform_buffer_object = true;
  142.       ctx->Extensions.ARB_shading_language_420pack = true;
  143.       ctx->Extensions.ARB_texture_buffer_object = true;
  144.       ctx->Extensions.ARB_texture_buffer_object_rgb32 = true;
  145.       ctx->Extensions.ARB_texture_cube_map_array = true;
  146.       ctx->Extensions.OES_depth_texture_cube_map = true;
  147.       ctx->Extensions.ARB_shading_language_packing = true;
  148.       ctx->Extensions.ARB_texture_multisample = true;
  149.  
  150.       /* Test if the kernel has the ioctl. */
  151.       if (drm_intel_reg_read(brw->bufmgr, TIMESTAMP, &dummy) == 0)
  152.          ctx->Extensions.ARB_timer_query = true;
  153.    }
  154.  
  155.    if (brw->gen >= 5) {
  156.       ctx->Extensions.ARB_texture_query_lod = true;
  157.       ctx->Extensions.EXT_timer_query = true;
  158.    }
  159.  
  160.    if (ctx->API == API_OPENGL_CORE)
  161.       ctx->Extensions.ARB_base_instance = true;
  162.    if (ctx->API != API_OPENGL_CORE)
  163.       ctx->Extensions.ARB_color_buffer_float = true;
  164.  
  165.    if (ctx->Mesa_DXTn || driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))
  166.       ctx->Extensions.EXT_texture_compression_s3tc = true;
  167.  
  168.    ctx->Extensions.ANGLE_texture_compression_dxt = true;
  169. }
  170.