已实现OpenGL命令,但未使用扩展名/版本进行广告宣传

时间:2017-02-28 20:46:32

标签: opengl opengl-3

我正在尝试支持Optimus系统,它允许我在英特尔GPU或NVIDIA GPU上运行我的框架。自从我尝试使用实例化数组支持实例化绘图以来没有问题。

虽然NVIDIA支持 OpenGL 4.5 ,但英特尔卡支持 OpenGL 3.1 ,扩展程度很低。在此调试会话期间,我发现{em> GL_ARB_instanced_arrays 定义了glVertexAttribDivisor,而不是像我一直认为的 GL_ARB_draw_instanced

但是我注意到glVertexAttribDivisor目前正在实施(它确实有效!),但不会公布相对扩展名。在调查这个问题时,我发现目前实现的其他函数很少,而没有通过扩展机制声明支持。

以下是扩展程序检索的日志:

glGetString(Version) = 3.1.0 - Build 8.15.10.2622
glGetError() = NoError
glGetIntegerv(NumExtensions, 117)
glGetError() = NoError
glGetStringi(0x1F03, 0) = GL_EXT_blend_minmax
glGetError() = NoError
glGetStringi(0x1F03, 1) = GL_EXT_blend_subtract
glGetError() = NoError
glGetStringi(0x1F03, 2) = GL_EXT_blend_color
glGetError() = NoError
glGetStringi(0x1F03, 3) = GL_EXT_abgr
glGetError() = NoError
glGetStringi(0x1F03, 4) = GL_EXT_texture3D
glGetError() = NoError
glGetStringi(0x1F03, 5) = GL_EXT_clip_volume_hint
glGetError() = NoError
glGetStringi(0x1F03, 6) = GL_EXT_compiled_vertex_array
glGetError() = NoError
glGetStringi(0x1F03, 7) = GL_SGIS_texture_edge_clamp
glGetError() = NoError
glGetStringi(0x1F03, 8) = GL_SGIS_generate_mipmap
glGetError() = NoError
glGetStringi(0x1F03, 9) = GL_EXT_draw_range_elements
glGetError() = NoError
glGetStringi(0x1F03, 10) = GL_SGIS_texture_lod
glGetError() = NoError
glGetStringi(0x1F03, 11) = GL_EXT_rescale_normal
glGetError() = NoError
glGetStringi(0x1F03, 12) = GL_EXT_packed_pixels
glGetError() = NoError
glGetStringi(0x1F03, 13) = GL_EXT_texture_edge_clamp
glGetError() = NoError
glGetStringi(0x1F03, 14) = GL_EXT_separate_specular_color
glGetError() = NoError
glGetStringi(0x1F03, 15) = GL_ARB_multitexture
glGetError() = NoError
glGetStringi(0x1F03, 16) = GL_EXT_texture_env_combine
glGetError() = NoError
glGetStringi(0x1F03, 17) = GL_EXT_bgra
glGetError() = NoError
glGetStringi(0x1F03, 18) = GL_EXT_blend_func_separate
glGetError() = NoError
glGetStringi(0x1F03, 19) = GL_EXT_secondary_color
glGetError() = NoError
glGetStringi(0x1F03, 20) = GL_EXT_fog_coord
glGetError() = NoError
glGetStringi(0x1F03, 21) = GL_EXT_tIl thread 0xe14 è terminato con il codice 0 (0x0).
exture_env_add
glGetError() = NoError
glGetStringi(0x1F03, 22) = GL_ARB_texture_cube_map
glGetError() = NoError
glGetStringi(0x1F03, 23) = GL_ARB_transpose_matrix
glGetError() = NoError
glGetStringi(0x1F03, 24) = GL_ARB_texture_env_add
glGetError() = NoError
glGetStringi(0x1F03, 25) = GL_IBM_texture_mirrored_repeat
glGetError() = NoError
glGetStringi(0x1F03, 26) = GL_EXT_multi_draw_arrays
glGetError() = NoError
glGetStringi(0x1F03, 27) = GL_NV_blend_square
glGetError() = NoError
glGetStringi(0x1F03, 28) = GL_ARB_texture_compression
glGetError() = NoError
glGetStringi(0x1F03, 29) = GL_3DFX_texture_compression_FXT1
glGetError() = NoError
glGetStringi(0x1F03, 30) = GL_EXT_texture_filter_anisotropic
glGetError() = NoError
glGetStringi(0x1F03, 31) = GL_ARB_texture_border_clamp
glGetError() = NoError
glGetStringi(0x1F03, 32) = GL_ARB_point_parameters
glGetError() = NoError
glGetStringi(0x1F03, 33) = GL_ARB_texture_env_combine
glGetError() = NoError
glGetStringi(0x1F03, 34) = GL_ARB_texture_env_dot3
glGetError() = NoError
glGetStringi(0x1F03, 35) = GL_ARB_texture_env_crossbar
glGetError() = NoError
glGetStringi(0x1F03, 36) = GL_EXT_texture_compression_s3tc
glGetError() = NoError
glGetStringi(0x1F03, 37) = GL_ARB_shadow
glGetError() = NoError
glGetStringi(0x1F03, 38) = GL_ARB_window_pos
glGetError() = NoError
glGetStringi(0x1F03, 39) = GL_EXT_shadow_funcs
glGetError() = NoError
glGetStringi(0x1F03, 40) = GL_EXT_stencil_wrap
glGetError() = NoError
glGetStringi(0x1F03, 41) = GL_ARB_vertex_program
glGetError() = NoError
glGetStringi(0x1F03, 42) = GL_EXT_texture_rectangle
glGetError() = NoError
glGetStringi(0x1F03, 43) = GL_ARB_fragment_program
glGetError() = NoError
glGetStringi(0x1F03, 44) = GL_EXT_stencil_two_side
glGetError() = NoError
glGetStringi(0x1F03, 45) = GL_ATI_separate_stencil
glGetError() = NoError
glGetStringi(0x1F03, 46) = GL_ARB_vertex_buffer_object
glGetError() = NoError
glGetStringi(0x1F03, 47) = GL_EXT_texture_lod_bias
glGetError() = NoError
glGetStringi(0x1F03, 48) = GL_ARB_occlusion_query
glGetError() = NoError
glGetStringi(0x1F03, 49) = GL_ARB_fragment_shader
glGetError() = NoError
glGetStringi(0x1F03, 50) = GL_ARB_shader_objects
glGetError() = NoError
glGetStringi(0x1F03, 51) = GL_ARB_shading_language_100
glGetError() = NoError
glGetStringi(0x1F03, 52) = GL_ARB_texture_non_power_of_two
glGetError() = NoError
glGetStringi(0x1F03, 53) = GL_ARB_vertex_shader
glGetError() = NoError
glGetStringi(0x1F03, 54) = GL_NV_texgen_reflection
glGetError() = NoError
glGetStringi(0x1F03, 55) = GL_ARB_point_sprite
glGetError() = NoError
glGetStringi(0x1F03, 56) = GL_ARB_fragment_program_shadow
glGetError() = NoError
glGetStringi(0x1F03, 57) = GL_EXT_blend_equation_separate
glGetError() = NoError
glGetStringi(0x1F03, 58) = GL_ARB_depth_texture
glGetError() = NoError
glGetStringi(0x1F03, 59) = GL_ARB_texture_rectangle
glGetError() = NoError
glGetStringi(0x1F03, 60) = GL_ARB_draw_buffers
glGetError() = NoError
glGetStringi(0x1F03, 61) = GL_ARB_color_buffer_float
glGetError() = NoError
glGetStringi(0x1F03, 62) = GL_ARB_half_float_pixel
glGetError() = NoError
glGetStringi(0x1F03, 63) = GL_ARB_texture_float
glGetError() = NoError
glGetStringi(0x1F03, 64) = GL_ARB_pixel_buffer_object
glGetError() = NoError
glGetStringi(0x1F03, 65) = GL_EXT_framebuffer_object
glGetError() = NoError
glGetStringi(0x1F03, 66) = GL_ARB_draw_instanced
glGetError() = NoError
glGetStringi(0x1F03, 67) = GL_ARB_half_float_vertex
glGetError() = NoError
glGetStringi(0x1F03, 68) = GL_EXT_draw_buffers2
glGetError() = NoError
glGetStringi(0x1F03, 69) = GL_WIN_swap_hint
glGetError() = NoError
glGetStringi(0x1F03, 70) = GL_EXT_texture_sRGB
glGetError() = NoError
glGetStringi(0x1F03, 71) = GL_ARB_multisample
glGetError() = NoError
glGetStringi(0x1F03, 72) = GL_EXT_packed_float
glGetError() = NoError
glGetStringi(0x1F03, 73) = GL_EXT_texture_shared_exponent
glGetError() = NoError
glGetStringi(0x1F03, 74) = GL_ARB_texture_rg
glGetError() = NoError
glGetStringi(0x1F03, 75) = GL_ARB_texture_compression_rgtc
glGetError() = NoError
glGetStringi(0x1F03, 76) = GL_NV_conditional_render
glGetError() = NoError
glGetStringi(0x1F03, 77) = GL_EXT_texture_swizzle
glGetError() = NoError
glGetStringi(0x1F03, 78) = GL_ARB_sync
glGetError() = NoError
glGetStringi(0x1F03, 79) = GL_ARB_framebuffer_sRGB
glGetError() = NoError
glGetStringi(0x1F03, 80) = GL_EXT_packed_depth_stencil
glGetError() = NoError
glGetStringi(0x1F03, 81) = GL_ARB_depth_buffer_float
glGetError() = NoError
glGetStringi(0x1F03, 82) = GL_EXT_transform_feedback
glGetError() = NoError
glGetStringi(0x1F03, 83) = GL_EXT_framebuffer_blit
glGetError() = NoError
glGetStringi(0x1F03, 84) = GL_EXT_framebuffer_multisample
glGetError() = NoError
glGetStringi(0x1F03, 85) = GL_ARB_framebuffer_object
glGetError() = NoError
glGetStringi(0x1F03, 86) = GL_EXT_texture_array
glGetError() = NoError
glGetStringi(0x1F03, 87) = GL_EXT_texture_integer
glGetError() = NoError
glGetStringi(0x1F03, 88) = GL_ARB_map_buffer_range
glGetError() = NoError
glGetStringi(0x1F03, 89) = GL_EXT_texture_snorm
glGetError() = NoError
glGetStringi(0x1F03, 90) = GL_INTEL_performance_queries
glGetError() = NoError
glGetStringi(0x1F03, 91) = GL_ARB_copy_buffer
glGetError() = NoError
glGetStringi(0x1F03, 92) = GL_ARB_sampler_objects
glGetError() = NoError
glGetStringi(0x1F03, 93) = GL_NV_primitive_restart
glGetError() = NoError
glGetStringi(0x1F03, 94) = GL_ARB_seamless_cube_map
glGetError() = NoError
glGetStringi(0x1F03, 95) = GL_ARB_uniform_buffer_object
glGetError() = NoError
glGetStringi(0x1F03, 96) = GL_ARB_depth_clamp
glGetError() = NoError
glGetStringi(0x1F03, 97) = GL_ARB_vertex_array_bgra
glGetError() = NoError
glGetStringi(0x1F03, 98) = GL_ARB_draw_elements_base_vertex
glGetError() = NoError
glGetStringi(0x1F03, 99) = GL_ARB_fragment_coord_conventions
glGetError() = NoError
glGetStringi(0x1F03, 100) = GL_EXT_gpu_program_parameters
glGetError() = NoError
glGetStringi(0x1F03, 101) = GL_ARB_compatibility
glGetError() = NoError
glGetStringi(0x1F03, 102) = GL_ARB_vertex_array_object
glGetError() = NoError
glGetStringi(0x1F03, 103) = WGL_EXT_depth_float
glGetError() = NoError
glGetStringi(0x1F03, 104) = WGL_ARB_buffer_region
glGetError() = NoError
glGetStringi(0x1F03, 105) = WGL_ARB_extensions_string
glGetError() = NoError
glGetStringi(0x1F03, 106) = WGL_ARB_make_current_read
glGetError() = NoError
glGetStringi(0x1F03, 107) = WGL_ARB_pixel_format
glGetError() = NoError
glGetStringi(0x1F03, 108) = WGL_ARB_pbuffer
glGetError() = NoError
glGetStringi(0x1F03, 109) = WGL_EXT_extensions_string
glGetError() = NoError
glGetStringi(0x1F03, 110) = WGL_EXT_swap_control
glGetError() = NoError
glGetStringi(0x1F03, 111) = WGL_EXT_swap_control_tear
glGetError() = NoError
glGetStringi(0x1F03, 112) = WGL_ARB_multisample
glGetError() = NoError
glGetStringi(0x1F03, 113) = WGL_ARB_pixel_format_float
glGetError() = NoError
glGetStringi(0x1F03, 114) = WGL_ARB_framebuffer_sRGB
glGetError() = NoError

glGetStringi(0x1F03, 115) = WGL_ARB_create_context
glGetError() = NoError
glGetStringi(0x1F03, 116) = WGL_EXT_pixel_format_packed_float
glGetError() = NoError

这里有一个函数不匹配的日志:

// The command FramebufferTextureFaceARB is defined, but not supported by any feature.
// The command CullParameterdvEXT is defined, but not supported by any feature.
// The command CullParameterfvEXT is defined, but not supported by any feature.
// The command TransformFeedbackVaryings_Unmanaged is defined, but not supported by any feature.
// The command FramebufferTexture is defined, but not supported by any feature.
// The command TexImage2DMultisample is defined, but not supported by any feature.
// The command TexImage3DMultisample is defined, but not supported by any feature.
// The command GetMultisamplefv is defined, but not supported by any feature.
// The command SampleMaski is defined, but not supported by any feature.
// The command VertexAttribDivisor is defined, but not supported by any feature.
// The command ProgramParameteri is defined, but not supported by any feature.
// The command BeginPerfQueryINTEL is defined, but not supported by any feature.
// The command CreatePerfQueryINTEL is defined, but not supported by any feature.
// The command DeletePerfQueryINTEL is defined, but not supported by any feature.
// The command EndPerfQueryINTEL is defined, but not supported by any feature.
// The command GetFirstPerfQueryIdINTEL is defined, but not supported by any feature.
// The command GetNextPerfQueryIdINTEL is defined, but not supported by any feature.
// The command GetPerfCounterInfoINTEL is defined, but not supported by any feature.
// The command GetPerfQueryDataINTEL is defined, but not supported by any feature.
// The command GetPerfQueryIdByNameINTEL is defined, but not supported by any feature.
// The command GetPerfQueryInfoINTEL is defined, but not supported by any feature.

我的问题是:是否可以使用上述功能,即使任何扩展程序都不支持它们?

我的第一个想法是,这是驱动程序实现者避免使用这些功能的一种方式。

但是,我想使用glVertexAttribDivisor来避免多个着色器定义......

2 个答案:

答案 0 :(得分:3)

有可能吗?是。使用它是个好主意吗?否。

如果某个实现在实现广告的扩展实现方面没有足够的信心,那么你就不应该有足够的信心来使用它。

答案 1 :(得分:0)

在我的盒子(Optimus with Nvidia M1000M和Intel HD graphics 530)上,我观察到intel驱动程序也支持OpenGL 4.5,但它需要创建一个"核心配置文件" OpenGL上下文(使用"兼容性配置文件"上下文仅报告OpenGL 3.1)。这可以解释为什么功能在那里。我认为这将是正确的"广告"通过核心概况上下文。