我正在尝试使用 OpenGL 扩展:GL_INTEL_performance_query 从集成 Intel GPU (HD 500) 读取 Intel 性能计数器。我的硬件支持此扩展,并且从 OGL 开始也可用OpenGL 3.0当我在我的机器上运行以下代码片段时:
if( !IsExtensionSupported("GL_INTEL_performance_query") )
{
printf( "ERROR: extension GL_INTEL_performance_query isn't available, exiting\n" );
return false;
}
我收到错误消息,提示不支持该扩展。OGL 的当前版本是:
Extended renderer info (GLX_MESA_query_renderer):
Vendor: VMware, Inc. (0xffffffff)
Device: llvmpipe (LLVM 8.0, 128 bits) (0xffffffff)
Version: 19.0.8
Accelerated: no
Video memory: 7822MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 8.0, 128 bits)
OpenGL version string: 3.1 Mesa 19.0.8
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
当我尝试列出所有可用的扩展时,我得到了以下列表:
GL_EXT_compiled_vertex_array, GL_EXT_copy_texture, GL_EXT_draw_buffers2,
GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,
GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object,
GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters,
GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil,
GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object,
GL_EXT_point_parameters, GL_EXT_polygon_offset_clamp,
GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shader_integer_mix,
GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap,
GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D,
GL_EXT_texture_array, GL_EXT_texture_compression_dxt1,
GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc,
GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map,
GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_integer, GL_EXT_texture_lod_bias,
GL_EXT_texture_mirror_clamp, GL_EXT_texture_object,
GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode,
GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm,
GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback,
GL_EXT_vertex_array, GL_EXT_vertex_array_bgra,
GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip,
GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate,
GL_KHR_context_flush_control, GL_KHR_debug, GL_KHR_no_error,
GL_KHR_texture_compression_astc_ldr,
GL_KHR_texture_compression_astc_sliced_3d, GL_MESA_pack_invert,
GL_MESA_shader_integer_functions, GL_MESA_texture_signed_rgba,
GL_MESA_window_pos, GL_MESA_ycbcr_texture, GL_NV_blend_square,
GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance,
GL_NV_light_max_exponent, GL_NV_packed_depth_stencil,
GL_NV_primitive_restart, GL_NV_texgen_reflection,
GL_NV_texture_env_combine4, GL_NV_texture_rectangle, GL_OES_EGL_image,
GL_OES_read_format, GL_S3_s3tc, GL_SGIS_generate_mipmap,
GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,
GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays
如果问题与 OGL 版本与硬件有关,是否有办法启用特定的扩展或任何提示?
更新:
- 我在非虚拟化环境中运行。
- 主机是:Ubuntu 18.04.3 LTS
答案1
根据你的信息:
Vendor: VMware, Inc. (0xffffffff) // virtual machine
Device: llvmpipe (LLVM 8.0, 128 bits) (0xffffffff) // Low-Level Virtual Machine pipe
Accelerated: no // no acceleration
OpenGL vendor string: VMware, Inc. // virtual machine
你的 OpenGl 设备似乎不是英特尔高清 500而是一个虚拟的(或者您在虚拟机上工作)。
尝试更新您的显卡驱动程序和/或在虚拟机中激活加速 3D 图形。