|
@@ -500,6 +500,7 @@ namespace bgfx { namespace gl
|
|
|
ARB_shader_texture_lod,
|
|
ARB_shader_texture_lod,
|
|
|
ARB_texture_compression_bptc,
|
|
ARB_texture_compression_bptc,
|
|
|
ARB_texture_compression_rgtc,
|
|
ARB_texture_compression_rgtc,
|
|
|
|
|
+ ARB_texture_cube_map_array,
|
|
|
ARB_texture_float,
|
|
ARB_texture_float,
|
|
|
ARB_texture_multisample,
|
|
ARB_texture_multisample,
|
|
|
ARB_texture_rg,
|
|
ARB_texture_rg,
|
|
@@ -555,6 +556,7 @@ namespace bgfx { namespace gl
|
|
|
EXT_texture_compression_latc,
|
|
EXT_texture_compression_latc,
|
|
|
EXT_texture_compression_rgtc,
|
|
EXT_texture_compression_rgtc,
|
|
|
EXT_texture_compression_s3tc,
|
|
EXT_texture_compression_s3tc,
|
|
|
|
|
+ EXT_texture_cube_map_array,
|
|
|
EXT_texture_filter_anisotropic,
|
|
EXT_texture_filter_anisotropic,
|
|
|
EXT_texture_format_BGRA8888,
|
|
EXT_texture_format_BGRA8888,
|
|
|
EXT_texture_rg,
|
|
EXT_texture_rg,
|
|
@@ -614,6 +616,7 @@ namespace bgfx { namespace gl
|
|
|
OES_texture_half_float,
|
|
OES_texture_half_float,
|
|
|
OES_texture_half_float_linear,
|
|
OES_texture_half_float_linear,
|
|
|
OES_texture_stencil8,
|
|
OES_texture_stencil8,
|
|
|
|
|
+ OES_texture_storage_multisample_2d_array,
|
|
|
OES_vertex_array_object,
|
|
OES_vertex_array_object,
|
|
|
OES_vertex_half_float,
|
|
OES_vertex_half_float,
|
|
|
OES_vertex_type_10_10_10_2,
|
|
OES_vertex_type_10_10_10_2,
|
|
@@ -659,185 +662,188 @@ namespace bgfx { namespace gl
|
|
|
//
|
|
//
|
|
|
static Extension s_extension[] =
|
|
static Extension s_extension[] =
|
|
|
{
|
|
{
|
|
|
- { "AMD_conservative_depth", false, true },
|
|
|
|
|
- { "AMD_multi_draw_indirect", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "ANGLE_depth_texture", false, true },
|
|
|
|
|
- { "ANGLE_framebuffer_blit", false, true },
|
|
|
|
|
- { "ANGLE_framebuffer_multisample", false, false },
|
|
|
|
|
- { "ANGLE_instanced_arrays", false, true },
|
|
|
|
|
- { "ANGLE_texture_compression_dxt1", false, true },
|
|
|
|
|
- { "ANGLE_texture_compression_dxt3", false, true },
|
|
|
|
|
- { "ANGLE_texture_compression_dxt5", false, true },
|
|
|
|
|
- { "ANGLE_timer_query", false, true },
|
|
|
|
|
- { "ANGLE_translated_shader_source", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "APPLE_texture_format_BGRA8888", false, true },
|
|
|
|
|
- { "APPLE_texture_max_level", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "ARB_clip_control", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_compute_shader", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_conservative_depth", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
- { "ARB_copy_image", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
- { "ARB_debug_label", false, true },
|
|
|
|
|
- { "ARB_debug_output", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_depth_buffer_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_depth_clamp", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
- { "ARB_draw_buffers_blend", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
|
|
|
|
- { "ARB_draw_indirect", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
|
|
|
|
- { "ARB_draw_instanced", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_ES3_compatibility", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_get_program_binary", BGFX_CONFIG_RENDERER_OPENGL >= 41, true },
|
|
|
|
|
- { "ARB_half_float_pixel", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_half_float_vertex", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_instanced_arrays", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_internalformat_query", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
- { "ARB_internalformat_query2", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_invalidate_subdata", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_map_buffer_range", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_multi_draw_indirect", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_multisample", false, true },
|
|
|
|
|
- { "ARB_occlusion_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_occlusion_query2", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_program_interface_query", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_sampler_objects", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_seamless_cube_map", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
- { "ARB_shader_bit_encoding", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_shader_image_load_store", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
- { "ARB_shader_storage_buffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "ARB_shader_texture_lod", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_texture_compression_bptc", BGFX_CONFIG_RENDERER_OPENGL >= 44, true },
|
|
|
|
|
- { "ARB_texture_compression_rgtc", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_texture_float", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_texture_multisample", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
- { "ARB_texture_rg", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_texture_rgb10_a2ui", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_texture_stencil8", false, true },
|
|
|
|
|
- { "ARB_texture_storage", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
- { "ARB_texture_swizzle", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "ARB_uniform_buffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
|
|
|
|
|
- { "ARB_vertex_array_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "ARB_vertex_type_2_10_10_10_rev", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "ATI_meminfo", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "CHROMIUM_color_buffer_float_rgb", false, true },
|
|
|
|
|
- { "CHROMIUM_color_buffer_float_rgba", false, true },
|
|
|
|
|
- { "CHROMIUM_depth_texture", false, true },
|
|
|
|
|
- { "CHROMIUM_framebuffer_multisample", false, true },
|
|
|
|
|
- { "CHROMIUM_texture_compression_dxt3", false, true },
|
|
|
|
|
- { "CHROMIUM_texture_compression_dxt5", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "EXT_bgra", false, true },
|
|
|
|
|
- { "EXT_blend_color", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
|
|
|
|
|
- { "EXT_blend_minmax", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
|
|
|
|
|
- { "EXT_blend_subtract", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
|
|
|
|
|
- { "EXT_color_buffer_half_float", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_color_buffer_float", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_copy_image", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_compressed_ETC1_RGB8_sub_texture", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_debug_label", false, true },
|
|
|
|
|
- { "EXT_debug_marker", false, true },
|
|
|
|
|
- { "EXT_debug_tool", false, true }, // RenderDoc extension.
|
|
|
|
|
- { "EXT_discard_framebuffer", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_disjoint_timer_query", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_draw_buffers", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_draw_instanced", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_instanced_arrays", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_frag_depth", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_gpu_shader4", false, true },
|
|
|
|
|
- { "EXT_multi_draw_indirect", false, true }, // GLES3.1 extension.
|
|
|
|
|
- { "EXT_occlusion_query_boolean", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_packed_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "EXT_read_format_bgra", false, true },
|
|
|
|
|
- { "EXT_shader_image_load_store", false, true },
|
|
|
|
|
- { "EXT_shader_texture_lod", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_shadow_samplers", false, true },
|
|
|
|
|
- { "EXT_sRGB_write_control", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_texture_array", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_texture_compression_dxt1", false, true },
|
|
|
|
|
- { "EXT_texture_compression_latc", false, true },
|
|
|
|
|
- { "EXT_texture_compression_rgtc", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_texture_compression_s3tc", false, true },
|
|
|
|
|
- { "EXT_texture_filter_anisotropic", false, true },
|
|
|
|
|
- { "EXT_texture_format_BGRA8888", false, true },
|
|
|
|
|
- { "EXT_texture_rg", false, true }, // GLES2 extension.
|
|
|
|
|
- { "EXT_texture_shared_exponent", false, true },
|
|
|
|
|
- { "EXT_texture_snorm", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
- { "EXT_texture_sRGB", false, true },
|
|
|
|
|
- { "EXT_texture_storage", false, true },
|
|
|
|
|
- { "EXT_texture_swizzle", false, true },
|
|
|
|
|
- { "EXT_texture_type_2_10_10_10_REV", false, true },
|
|
|
|
|
- { "EXT_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
- { "EXT_unpack_subimage", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "GOOGLE_depth_texture", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "GREMEDY_string_marker", false, true },
|
|
|
|
|
- { "GREMEDY_frame_terminator", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "IMG_multisampled_render_to_texture", false, true },
|
|
|
|
|
- { "IMG_read_format", false, true },
|
|
|
|
|
- { "IMG_shader_binary", false, true },
|
|
|
|
|
- { "IMG_texture_compression_pvrtc", false, true },
|
|
|
|
|
- { "IMG_texture_compression_pvrtc2", false, true },
|
|
|
|
|
- { "IMG_texture_format_BGRA8888", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "INTEL_fragment_shader_ordering", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "KHR_debug", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
- { "KHR_no_error", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "MOZ_WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
- { "MOZ_WEBGL_depth_texture", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "NV_conservative_raster", false, true },
|
|
|
|
|
- { "NV_copy_image", false, true },
|
|
|
|
|
- { "NV_draw_buffers", false, true }, // GLES2 extension.
|
|
|
|
|
- { "NV_occlusion_query", false, true },
|
|
|
|
|
- { "NV_texture_border_clamp", false, true }, // GLES2 extension.
|
|
|
|
|
- { "NVX_gpu_memory_info", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "OES_copy_image", false, true },
|
|
|
|
|
- { "OES_compressed_ETC1_RGB8_texture", false, true },
|
|
|
|
|
- { "OES_depth24", false, true },
|
|
|
|
|
- { "OES_depth32", false, true },
|
|
|
|
|
- { "OES_depth_texture", false, true },
|
|
|
|
|
- { "OES_element_index_uint", false, true },
|
|
|
|
|
- { "OES_fragment_precision_high", false, true },
|
|
|
|
|
- { "OES_get_program_binary", false, true },
|
|
|
|
|
- { "OES_required_internalformat", false, true },
|
|
|
|
|
- { "OES_packed_depth_stencil", false, true },
|
|
|
|
|
- { "OES_read_format", false, true },
|
|
|
|
|
- { "OES_rgb8_rgba8", false, true },
|
|
|
|
|
- { "OES_standard_derivatives", false, true },
|
|
|
|
|
- { "OES_texture_3D", false, true },
|
|
|
|
|
- { "OES_texture_float", false, true },
|
|
|
|
|
- { "OES_texture_float_linear", false, true },
|
|
|
|
|
- { "OES_texture_npot", false, true },
|
|
|
|
|
- { "OES_texture_half_float", false, true },
|
|
|
|
|
- { "OES_texture_half_float_linear", false, true },
|
|
|
|
|
- { "OES_texture_stencil8", false, true },
|
|
|
|
|
- { "OES_vertex_array_object", false, !BX_PLATFORM_IOS },
|
|
|
|
|
- { "OES_vertex_half_float", false, true },
|
|
|
|
|
- { "OES_vertex_type_10_10_10_2", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "WEBGL_color_buffer_float", false, true },
|
|
|
|
|
- { "WEBGL_compressed_texture_etc1", false, true },
|
|
|
|
|
- { "WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
- { "WEBGL_compressed_texture_pvrtc", false, true },
|
|
|
|
|
- { "WEBGL_depth_texture", false, true },
|
|
|
|
|
- { "WEBGL_draw_buffers", false, true },
|
|
|
|
|
-
|
|
|
|
|
- { "WEBKIT_EXT_texture_filter_anisotropic", false, true },
|
|
|
|
|
- { "WEBKIT_WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
- { "WEBKIT_WEBGL_depth_texture", false, true },
|
|
|
|
|
|
|
+ { "AMD_conservative_depth", false, true },
|
|
|
|
|
+ { "AMD_multi_draw_indirect", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "ANGLE_depth_texture", false, true },
|
|
|
|
|
+ { "ANGLE_framebuffer_blit", false, true },
|
|
|
|
|
+ { "ANGLE_framebuffer_multisample", false, false },
|
|
|
|
|
+ { "ANGLE_instanced_arrays", false, true },
|
|
|
|
|
+ { "ANGLE_texture_compression_dxt1", false, true },
|
|
|
|
|
+ { "ANGLE_texture_compression_dxt3", false, true },
|
|
|
|
|
+ { "ANGLE_texture_compression_dxt5", false, true },
|
|
|
|
|
+ { "ANGLE_timer_query", false, true },
|
|
|
|
|
+ { "ANGLE_translated_shader_source", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "APPLE_texture_format_BGRA8888", false, true },
|
|
|
|
|
+ { "APPLE_texture_max_level", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "ARB_clip_control", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_compute_shader", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_conservative_depth", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
+ { "ARB_copy_image", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
+ { "ARB_debug_label", false, true },
|
|
|
|
|
+ { "ARB_debug_output", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_depth_buffer_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_depth_clamp", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
+ { "ARB_draw_buffers_blend", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
|
|
|
|
+ { "ARB_draw_indirect", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
|
|
|
|
+ { "ARB_draw_instanced", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_ES3_compatibility", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_get_program_binary", BGFX_CONFIG_RENDERER_OPENGL >= 41, true },
|
|
|
|
|
+ { "ARB_half_float_pixel", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_half_float_vertex", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_instanced_arrays", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_internalformat_query", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
+ { "ARB_internalformat_query2", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_invalidate_subdata", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_map_buffer_range", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_multi_draw_indirect", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_multisample", false, true },
|
|
|
|
|
+ { "ARB_occlusion_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_occlusion_query2", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_program_interface_query", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_sampler_objects", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_seamless_cube_map", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
+ { "ARB_shader_bit_encoding", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_shader_image_load_store", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
+ { "ARB_shader_storage_buffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "ARB_shader_texture_lod", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_texture_compression_bptc", BGFX_CONFIG_RENDERER_OPENGL >= 44, true },
|
|
|
|
|
+ { "ARB_texture_compression_rgtc", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_texture_cube_map_array", BGFX_CONFIG_RENDERER_OPENGL >= 40, true },
|
|
|
|
|
+ { "ARB_texture_float", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_texture_multisample", BGFX_CONFIG_RENDERER_OPENGL >= 32, true },
|
|
|
|
|
+ { "ARB_texture_rg", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_texture_rgb10_a2ui", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_texture_stencil8", false, true },
|
|
|
|
|
+ { "ARB_texture_storage", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
|
|
|
|
|
+ { "ARB_texture_swizzle", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "ARB_uniform_buffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
|
|
|
|
|
+ { "ARB_vertex_array_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "ARB_vertex_type_2_10_10_10_rev", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "ATI_meminfo", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "CHROMIUM_color_buffer_float_rgb", false, true },
|
|
|
|
|
+ { "CHROMIUM_color_buffer_float_rgba", false, true },
|
|
|
|
|
+ { "CHROMIUM_depth_texture", false, true },
|
|
|
|
|
+ { "CHROMIUM_framebuffer_multisample", false, true },
|
|
|
|
|
+ { "CHROMIUM_texture_compression_dxt3", false, true },
|
|
|
|
|
+ { "CHROMIUM_texture_compression_dxt5", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "EXT_bgra", false, true },
|
|
|
|
|
+ { "EXT_blend_color", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
|
|
|
|
|
+ { "EXT_blend_minmax", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
|
|
|
|
|
+ { "EXT_blend_subtract", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
|
|
|
|
|
+ { "EXT_color_buffer_half_float", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_color_buffer_float", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_copy_image", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_compressed_ETC1_RGB8_sub_texture", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_debug_label", false, true },
|
|
|
|
|
+ { "EXT_debug_marker", false, true },
|
|
|
|
|
+ { "EXT_debug_tool", false, true }, // RenderDoc extension.
|
|
|
|
|
+ { "EXT_discard_framebuffer", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_disjoint_timer_query", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_draw_buffers", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_draw_instanced", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_instanced_arrays", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_frag_depth", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_gpu_shader4", false, true },
|
|
|
|
|
+ { "EXT_multi_draw_indirect", false, true }, // GLES3.1 extension.
|
|
|
|
|
+ { "EXT_occlusion_query_boolean", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_packed_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "EXT_read_format_bgra", false, true },
|
|
|
|
|
+ { "EXT_shader_image_load_store", false, true },
|
|
|
|
|
+ { "EXT_shader_texture_lod", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_shadow_samplers", false, true },
|
|
|
|
|
+ { "EXT_sRGB_write_control", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_texture_array", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_texture_compression_dxt1", false, true },
|
|
|
|
|
+ { "EXT_texture_compression_latc", false, true },
|
|
|
|
|
+ { "EXT_texture_compression_rgtc", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_texture_compression_s3tc", false, true },
|
|
|
|
|
+ { "EXT_texture_cube_map_array", false, true }, // GLES3.1 extension.
|
|
|
|
|
+ { "EXT_texture_filter_anisotropic", false, true },
|
|
|
|
|
+ { "EXT_texture_format_BGRA8888", false, true },
|
|
|
|
|
+ { "EXT_texture_rg", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "EXT_texture_shared_exponent", false, true },
|
|
|
|
|
+ { "EXT_texture_snorm", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
|
|
|
|
|
+ { "EXT_texture_sRGB", false, true },
|
|
|
|
|
+ { "EXT_texture_storage", false, true },
|
|
|
|
|
+ { "EXT_texture_swizzle", false, true },
|
|
|
|
|
+ { "EXT_texture_type_2_10_10_10_REV", false, true },
|
|
|
|
|
+ { "EXT_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
|
|
|
|
|
+ { "EXT_unpack_subimage", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "GOOGLE_depth_texture", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "GREMEDY_string_marker", false, true },
|
|
|
|
|
+ { "GREMEDY_frame_terminator", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "IMG_multisampled_render_to_texture", false, true },
|
|
|
|
|
+ { "IMG_read_format", false, true },
|
|
|
|
|
+ { "IMG_shader_binary", false, true },
|
|
|
|
|
+ { "IMG_texture_compression_pvrtc", false, true },
|
|
|
|
|
+ { "IMG_texture_compression_pvrtc2", false, true },
|
|
|
|
|
+ { "IMG_texture_format_BGRA8888", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "INTEL_fragment_shader_ordering", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "KHR_debug", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
|
|
|
|
|
+ { "KHR_no_error", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "MOZ_WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
+ { "MOZ_WEBGL_depth_texture", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "NV_conservative_raster", false, true },
|
|
|
|
|
+ { "NV_copy_image", false, true },
|
|
|
|
|
+ { "NV_draw_buffers", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "NV_occlusion_query", false, true },
|
|
|
|
|
+ { "NV_texture_border_clamp", false, true }, // GLES2 extension.
|
|
|
|
|
+ { "NVX_gpu_memory_info", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "OES_copy_image", false, true },
|
|
|
|
|
+ { "OES_compressed_ETC1_RGB8_texture", false, true },
|
|
|
|
|
+ { "OES_depth24", false, true },
|
|
|
|
|
+ { "OES_depth32", false, true },
|
|
|
|
|
+ { "OES_depth_texture", false, true },
|
|
|
|
|
+ { "OES_element_index_uint", false, true },
|
|
|
|
|
+ { "OES_fragment_precision_high", false, true },
|
|
|
|
|
+ { "OES_get_program_binary", false, true },
|
|
|
|
|
+ { "OES_required_internalformat", false, true },
|
|
|
|
|
+ { "OES_packed_depth_stencil", false, true },
|
|
|
|
|
+ { "OES_read_format", false, true },
|
|
|
|
|
+ { "OES_rgb8_rgba8", false, true },
|
|
|
|
|
+ { "OES_standard_derivatives", false, true },
|
|
|
|
|
+ { "OES_texture_3D", false, true },
|
|
|
|
|
+ { "OES_texture_float", false, true },
|
|
|
|
|
+ { "OES_texture_float_linear", false, true },
|
|
|
|
|
+ { "OES_texture_npot", false, true },
|
|
|
|
|
+ { "OES_texture_half_float", false, true },
|
|
|
|
|
+ { "OES_texture_half_float_linear", false, true },
|
|
|
|
|
+ { "OES_texture_stencil8", false, true },
|
|
|
|
|
+ { "OES_texture_storage_multisample_2d_array", false, true },
|
|
|
|
|
+ { "OES_vertex_array_object", false, !BX_PLATFORM_IOS },
|
|
|
|
|
+ { "OES_vertex_half_float", false, true },
|
|
|
|
|
+ { "OES_vertex_type_10_10_10_2", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "WEBGL_color_buffer_float", false, true },
|
|
|
|
|
+ { "WEBGL_compressed_texture_etc1", false, true },
|
|
|
|
|
+ { "WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
+ { "WEBGL_compressed_texture_pvrtc", false, true },
|
|
|
|
|
+ { "WEBGL_depth_texture", false, true },
|
|
|
|
|
+ { "WEBGL_draw_buffers", false, true },
|
|
|
|
|
+
|
|
|
|
|
+ { "WEBKIT_EXT_texture_filter_anisotropic", false, true },
|
|
|
|
|
+ { "WEBKIT_WEBGL_compressed_texture_s3tc", false, true },
|
|
|
|
|
+ { "WEBKIT_WEBGL_depth_texture", false, true },
|
|
|
};
|
|
};
|
|
|
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
|
|
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
|
|
|
|
|
|
|
@@ -910,6 +916,15 @@ namespace bgfx { namespace gl
|
|
|
NULL
|
|
NULL
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ static const char* s_textureArray[] =
|
|
|
|
|
+ {
|
|
|
|
|
+ "sampler2DArray",
|
|
|
|
|
+ "sampler2DMSArray",
|
|
|
|
|
+ "samplerCubeArray",
|
|
|
|
|
+ "sampler2DArrayShadow",
|
|
|
|
|
+ NULL
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
static const char* s_ARB_texture_multisample[] =
|
|
static const char* s_ARB_texture_multisample[] =
|
|
|
{
|
|
{
|
|
|
"sampler2DMS",
|
|
"sampler2DMS",
|
|
@@ -1863,6 +1878,21 @@ namespace bgfx { namespace gl
|
|
|
: 0
|
|
: 0
|
|
|
;
|
|
;
|
|
|
|
|
|
|
|
|
|
+ g_caps.supported |= false
|
|
|
|
|
+ || s_extension[Extension::EXT_texture_array].m_supported
|
|
|
|
|
+ || s_extension[Extension::EXT_gpu_shader4].m_supported
|
|
|
|
|
+ || !!(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
|
|
|
|
|
+ ? BGFX_CAPS_TEXTURE_2D_ARRAY
|
|
|
|
|
+ : 0
|
|
|
|
|
+ ;
|
|
|
|
|
+
|
|
|
|
|
+ g_caps.supported |= false
|
|
|
|
|
+ || s_extension[Extension::ARB_texture_cube_map_array].m_supported
|
|
|
|
|
+ || s_extension[Extension::EXT_texture_cube_map_array].m_supported
|
|
|
|
|
+ ? BGFX_CAPS_TEXTURE_CUBE_ARRAY
|
|
|
|
|
+ : 0
|
|
|
|
|
+ ;
|
|
|
|
|
+
|
|
|
g_caps.maxTextureSize = uint16_t(glGet(GL_MAX_TEXTURE_SIZE) );
|
|
g_caps.maxTextureSize = uint16_t(glGet(GL_MAX_TEXTURE_SIZE) );
|
|
|
|
|
|
|
|
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|
|
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|
|
@@ -3621,8 +3651,19 @@ namespace bgfx { namespace gl
|
|
|
GLSL_TYPE(GL_FLOAT_MAT4);
|
|
GLSL_TYPE(GL_FLOAT_MAT4);
|
|
|
|
|
|
|
|
GLSL_TYPE(GL_SAMPLER_2D);
|
|
GLSL_TYPE(GL_SAMPLER_2D);
|
|
|
|
|
+ GLSL_TYPE(GL_SAMPLER_2D_ARRAY);
|
|
|
|
|
+ GLSL_TYPE(GL_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
+
|
|
|
GLSL_TYPE(GL_INT_SAMPLER_2D);
|
|
GLSL_TYPE(GL_INT_SAMPLER_2D);
|
|
|
|
|
+ GLSL_TYPE(GL_INT_SAMPLER_2D_ARRAY);
|
|
|
|
|
+ GLSL_TYPE(GL_INT_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
+
|
|
|
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D);
|
|
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D);
|
|
|
|
|
+ GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY);
|
|
|
|
|
+ GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
+
|
|
|
|
|
+ GLSL_TYPE(GL_SAMPLER_2D_SHADOW);
|
|
|
|
|
+ GLSL_TYPE(GL_SAMPLER_2D_ARRAY_SHADOW);
|
|
|
|
|
|
|
|
GLSL_TYPE(GL_SAMPLER_3D);
|
|
GLSL_TYPE(GL_SAMPLER_3D);
|
|
|
GLSL_TYPE(GL_INT_SAMPLER_3D);
|
|
GLSL_TYPE(GL_INT_SAMPLER_3D);
|
|
@@ -3632,12 +3673,6 @@ namespace bgfx { namespace gl
|
|
|
GLSL_TYPE(GL_INT_SAMPLER_CUBE);
|
|
GLSL_TYPE(GL_INT_SAMPLER_CUBE);
|
|
|
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_CUBE);
|
|
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_CUBE);
|
|
|
|
|
|
|
|
- GLSL_TYPE(GL_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
- GLSL_TYPE(GL_INT_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
- GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE);
|
|
|
|
|
-
|
|
|
|
|
- GLSL_TYPE(GL_SAMPLER_2D_SHADOW);
|
|
|
|
|
-
|
|
|
|
|
GLSL_TYPE(GL_IMAGE_1D);
|
|
GLSL_TYPE(GL_IMAGE_1D);
|
|
|
GLSL_TYPE(GL_INT_IMAGE_1D);
|
|
GLSL_TYPE(GL_INT_IMAGE_1D);
|
|
|
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D);
|
|
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D);
|
|
@@ -3713,8 +3748,19 @@ namespace bgfx { namespace gl
|
|
|
return UniformType::Mat4;
|
|
return UniformType::Mat4;
|
|
|
|
|
|
|
|
case GL_SAMPLER_2D:
|
|
case GL_SAMPLER_2D:
|
|
|
|
|
+ case GL_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
case GL_INT_SAMPLER_2D:
|
|
case GL_INT_SAMPLER_2D:
|
|
|
|
|
+ case GL_INT_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
case GL_UNSIGNED_INT_SAMPLER_2D:
|
|
case GL_UNSIGNED_INT_SAMPLER_2D:
|
|
|
|
|
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
|
|
+ case GL_SAMPLER_2D_SHADOW:
|
|
|
|
|
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
|
|
|
|
|
|
|
|
case GL_SAMPLER_3D:
|
|
case GL_SAMPLER_3D:
|
|
|
case GL_INT_SAMPLER_3D:
|
|
case GL_INT_SAMPLER_3D:
|
|
@@ -3724,12 +3770,6 @@ namespace bgfx { namespace gl
|
|
|
case GL_INT_SAMPLER_CUBE:
|
|
case GL_INT_SAMPLER_CUBE:
|
|
|
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
|
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
|
|
|
|
|
|
|
- case GL_SAMPLER_2D_SHADOW:
|
|
|
|
|
-
|
|
|
|
|
- case GL_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
- case GL_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
- case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
-
|
|
|
|
|
case GL_IMAGE_1D:
|
|
case GL_IMAGE_1D:
|
|
|
case GL_INT_IMAGE_1D:
|
|
case GL_INT_IMAGE_1D:
|
|
|
case GL_UNSIGNED_INT_IMAGE_1D:
|
|
case GL_UNSIGNED_INT_IMAGE_1D:
|
|
@@ -3968,8 +4008,19 @@ namespace bgfx { namespace gl
|
|
|
switch (gltype)
|
|
switch (gltype)
|
|
|
{
|
|
{
|
|
|
case GL_SAMPLER_2D:
|
|
case GL_SAMPLER_2D:
|
|
|
|
|
+ case GL_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
case GL_INT_SAMPLER_2D:
|
|
case GL_INT_SAMPLER_2D:
|
|
|
|
|
+ case GL_INT_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
case GL_UNSIGNED_INT_SAMPLER_2D:
|
|
case GL_UNSIGNED_INT_SAMPLER_2D:
|
|
|
|
|
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
|
|
|
|
|
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
|
|
|
|
|
+
|
|
|
|
|
+ case GL_SAMPLER_2D_SHADOW:
|
|
|
|
|
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
|
|
|
|
|
|
|
|
case GL_SAMPLER_3D:
|
|
case GL_SAMPLER_3D:
|
|
|
case GL_INT_SAMPLER_3D:
|
|
case GL_INT_SAMPLER_3D:
|
|
@@ -3979,8 +4030,6 @@ namespace bgfx { namespace gl
|
|
|
case GL_INT_SAMPLER_CUBE:
|
|
case GL_INT_SAMPLER_CUBE:
|
|
|
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
|
case GL_UNSIGNED_INT_SAMPLER_CUBE:
|
|
|
|
|
|
|
|
- case GL_SAMPLER_2D_SHADOW:
|
|
|
|
|
-
|
|
|
|
|
case GL_IMAGE_1D:
|
|
case GL_IMAGE_1D:
|
|
|
case GL_INT_IMAGE_1D:
|
|
case GL_INT_IMAGE_1D:
|
|
|
case GL_UNSIGNED_INT_IMAGE_1D:
|
|
case GL_UNSIGNED_INT_IMAGE_1D:
|
|
@@ -4211,60 +4260,214 @@ namespace bgfx { namespace gl
|
|
|
m_vcref.invalidate(s_renderGL->m_vaoStateCache);
|
|
m_vcref.invalidate(s_renderGL->m_vaoStateCache);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- static void texImage(GLenum _target, uint32_t _msaaQuality, GLint _level, GLint _internalFormat, GLsizei _width, GLsizei _height, GLsizei _depth, GLint _border, GLenum _format, GLenum _type, const GLvoid* _data)
|
|
|
|
|
|
|
+ static void texImage(
|
|
|
|
|
+ GLenum _target
|
|
|
|
|
+ , uint32_t _msaaQuality
|
|
|
|
|
+ , GLint _level
|
|
|
|
|
+ , GLint _internalFormat
|
|
|
|
|
+ , GLsizei _width
|
|
|
|
|
+ , GLsizei _height
|
|
|
|
|
+ , GLsizei _depth
|
|
|
|
|
+ , GLint _border
|
|
|
|
|
+ , GLenum _format
|
|
|
|
|
+ , GLenum _type
|
|
|
|
|
+ , const GLvoid* _data
|
|
|
|
|
+ )
|
|
|
{
|
|
{
|
|
|
- if (_target == GL_TEXTURE_3D)
|
|
|
|
|
|
|
+ if (_target == GL_TEXTURE_3D
|
|
|
|
|
+ || _target == GL_TEXTURE_2D_ARRAY
|
|
|
|
|
+ || _target == GL_TEXTURE_CUBE_MAP_ARRAY)
|
|
|
|
|
+ {
|
|
|
|
|
+ GL_CHECK(glTexImage3D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _internalFormat
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _depth
|
|
|
|
|
+ , _border
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _type
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (_target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glTexImage3D(_target, _level, _internalFormat, _width, _height, _depth, _border, _format, _type, _data) );
|
|
|
|
|
}
|
|
}
|
|
|
else if (_target == GL_TEXTURE_2D_MULTISAMPLE)
|
|
else if (_target == GL_TEXTURE_2D_MULTISAMPLE)
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glTexImage2DMultisample(_target, _msaaQuality, _internalFormat, _width, _height, false) );
|
|
|
|
|
|
|
+ GL_CHECK(glTexImage2DMultisample(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _msaaQuality
|
|
|
|
|
+ , _internalFormat
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , false
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glTexImage2D(_target, _level, _internalFormat, _width, _height, _border, _format, _type, _data) );
|
|
|
|
|
|
|
+ GL_CHECK(glTexImage2D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _internalFormat
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _border
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _type
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
BX_UNUSED(_msaaQuality, _depth, _border, _data);
|
|
BX_UNUSED(_msaaQuality, _depth, _border, _data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- static void texSubImage(GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, GLint _zoffset, GLsizei _width, GLsizei _height, GLsizei _depth, GLenum _format, GLenum _type, const GLvoid* _data)
|
|
|
|
|
|
|
+ static void texSubImage(
|
|
|
|
|
+ GLenum _target
|
|
|
|
|
+ , GLint _level
|
|
|
|
|
+ , GLint _xoffset
|
|
|
|
|
+ , GLint _yoffset
|
|
|
|
|
+ , GLint _zoffset
|
|
|
|
|
+ , GLsizei _width
|
|
|
|
|
+ , GLsizei _height
|
|
|
|
|
+ , GLsizei _depth
|
|
|
|
|
+ , GLenum _format
|
|
|
|
|
+ , GLenum _type
|
|
|
|
|
+ , const GLvoid* _data
|
|
|
|
|
+ )
|
|
|
{
|
|
{
|
|
|
- if (_target == GL_TEXTURE_3D)
|
|
|
|
|
|
|
+ if (_target == GL_TEXTURE_3D
|
|
|
|
|
+ || _target == GL_TEXTURE_2D_ARRAY
|
|
|
|
|
+ || _target == GL_TEXTURE_CUBE_MAP_ARRAY)
|
|
|
|
|
+ {
|
|
|
|
|
+BX_TRACE("zoffset %d, depth %d", _zoffset, _depth);
|
|
|
|
|
+
|
|
|
|
|
+ GL_CHECK(glTexSubImage3D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _xoffset
|
|
|
|
|
+ , _yoffset
|
|
|
|
|
+ , _zoffset
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _depth
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _type
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (_target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glTexSubImage3D(_target, _level, _xoffset, _yoffset, _zoffset, _width, _height, _depth, _format, _type, _data) );
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
BX_UNUSED(_zoffset, _depth);
|
|
BX_UNUSED(_zoffset, _depth);
|
|
|
- GL_CHECK(glTexSubImage2D(_target, _level, _xoffset, _yoffset, _width, _height, _format, _type, _data) );
|
|
|
|
|
|
|
+ GL_CHECK(glTexSubImage2D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _xoffset
|
|
|
|
|
+ , _yoffset
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _type
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- static void compressedTexImage(GLenum _target, GLint _level, GLenum _internalformat, GLsizei _width, GLsizei _height, GLsizei _depth, GLint _border, GLsizei _imageSize, const GLvoid* _data)
|
|
|
|
|
|
|
+ static void compressedTexImage(
|
|
|
|
|
+ GLenum _target
|
|
|
|
|
+ , GLint _level
|
|
|
|
|
+ , GLenum _internalformat
|
|
|
|
|
+ , GLsizei _width
|
|
|
|
|
+ , GLsizei _height
|
|
|
|
|
+ , GLsizei _depth
|
|
|
|
|
+ , GLint _border
|
|
|
|
|
+ , GLsizei _imageSize
|
|
|
|
|
+ , const GLvoid* _data
|
|
|
|
|
+ )
|
|
|
{
|
|
{
|
|
|
- if (_target == GL_TEXTURE_3D)
|
|
|
|
|
|
|
+ if (_target == GL_TEXTURE_3D
|
|
|
|
|
+ || _target == GL_TEXTURE_2D_ARRAY
|
|
|
|
|
+ || _target == GL_TEXTURE_CUBE_MAP_ARRAY)
|
|
|
|
|
+ {
|
|
|
|
|
+ GL_CHECK(glCompressedTexImage3D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _internalformat
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _depth
|
|
|
|
|
+ , _border
|
|
|
|
|
+ , _imageSize
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (_target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glCompressedTexImage3D(_target, _level, _internalformat, _width, _height, _depth, _border, _imageSize, _data) );
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
BX_UNUSED(_depth);
|
|
BX_UNUSED(_depth);
|
|
|
- GL_CHECK(glCompressedTexImage2D(_target, _level, _internalformat, _width, _height, _border, _imageSize, _data) );
|
|
|
|
|
|
|
+ GL_CHECK(glCompressedTexImage2D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _internalformat
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _border
|
|
|
|
|
+ , _imageSize
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- static void compressedTexSubImage(GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, GLint _zoffset, GLsizei _width, GLsizei _height, GLsizei _depth, GLenum _format, GLsizei _imageSize, const GLvoid* _data)
|
|
|
|
|
|
|
+ static void compressedTexSubImage(
|
|
|
|
|
+ GLenum _target
|
|
|
|
|
+ , GLint _level
|
|
|
|
|
+ , GLint _xoffset
|
|
|
|
|
+ , GLint _yoffset
|
|
|
|
|
+ , GLint _zoffset
|
|
|
|
|
+ , GLsizei _width
|
|
|
|
|
+ , GLsizei _height
|
|
|
|
|
+ , GLsizei _depth
|
|
|
|
|
+ , GLenum _format
|
|
|
|
|
+ , GLsizei _imageSize
|
|
|
|
|
+ , const GLvoid* _data
|
|
|
|
|
+ )
|
|
|
{
|
|
{
|
|
|
if (_target == GL_TEXTURE_3D)
|
|
if (_target == GL_TEXTURE_3D)
|
|
|
{
|
|
{
|
|
|
- GL_CHECK(glCompressedTexSubImage3D(_target, _level, _xoffset, _yoffset, _zoffset, _width, _height, _depth, _format, _imageSize, _data) );
|
|
|
|
|
|
|
+ GL_CHECK(glCompressedTexSubImage3D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _xoffset
|
|
|
|
|
+ , _yoffset
|
|
|
|
|
+ , _zoffset
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _depth
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _imageSize
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
BX_UNUSED(_zoffset, _depth);
|
|
BX_UNUSED(_zoffset, _depth);
|
|
|
- GL_CHECK(glCompressedTexSubImage2D(_target, _level, _xoffset, _yoffset, _width, _height, _format, _imageSize, _data) );
|
|
|
|
|
|
|
+ GL_CHECK(glCompressedTexSubImage2D(
|
|
|
|
|
+ _target
|
|
|
|
|
+ , _level
|
|
|
|
|
+ , _xoffset
|
|
|
|
|
+ , _yoffset
|
|
|
|
|
+ , _width
|
|
|
|
|
+ , _height
|
|
|
|
|
+ , _format
|
|
|
|
|
+ , _imageSize
|
|
|
|
|
+ , _data
|
|
|
|
|
+ ) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -4408,7 +4611,10 @@ namespace bgfx { namespace gl
|
|
|
const ImageBlockInfo& ibi = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) );
|
|
const ImageBlockInfo& ibi = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) );
|
|
|
textureWidth = bx::uint32_max(ibi.blockWidth, imageContainer.m_width >>startLod);
|
|
textureWidth = bx::uint32_max(ibi.blockWidth, imageContainer.m_width >>startLod);
|
|
|
textureHeight = bx::uint32_max(ibi.blockHeight, imageContainer.m_height>>startLod);
|
|
textureHeight = bx::uint32_max(ibi.blockHeight, imageContainer.m_height>>startLod);
|
|
|
- textureDepth = imageContainer.m_depth;
|
|
|
|
|
|
|
+ textureDepth = 1 < imageContainer.m_depth
|
|
|
|
|
+ ? imageContainer.m_depth
|
|
|
|
|
+ : imageContainer.m_numLayers
|
|
|
|
|
+ ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
m_requestedFormat = uint8_t(imageContainer.m_format);
|
|
m_requestedFormat = uint8_t(imageContainer.m_format);
|
|
@@ -4431,6 +4637,16 @@ namespace bgfx { namespace gl
|
|
|
target = GL_TEXTURE_3D;
|
|
target = GL_TEXTURE_3D;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (1 < imageContainer.m_numLayers)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (target)
|
|
|
|
|
+ {
|
|
|
|
|
+ case GL_TEXTURE_CUBE_MAP: target = GL_TEXTURE_CUBE_MAP_ARRAY;
|
|
|
|
|
+ case GL_TEXTURE_2D_MULTISAMPLE: target = GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
|
|
|
|
|
+ default: target = GL_TEXTURE_2D_ARRAY;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!init(target
|
|
if (!init(target
|
|
|
, textureWidth
|
|
, textureWidth
|
|
|
, textureHeight
|
|
, textureHeight
|
|
@@ -4442,7 +4658,10 @@ namespace bgfx { namespace gl
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- target = GL_TEXTURE_CUBE_MAP == m_target ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : m_target;
|
|
|
|
|
|
|
+ target = isCubeMap()
|
|
|
|
|
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X
|
|
|
|
|
+ : m_target
|
|
|
|
|
+ ;
|
|
|
|
|
|
|
|
const GLenum internalFmt = srgb
|
|
const GLenum internalFmt = srgb
|
|
|
? s_textureFormat[m_textureFormat].m_internalFmtSrgb
|
|
? s_textureFormat[m_textureFormat].m_internalFmtSrgb
|
|
@@ -4460,11 +4679,12 @@ namespace bgfx { namespace gl
|
|
|
|| swizzle
|
|
|| swizzle
|
|
|
;
|
|
;
|
|
|
|
|
|
|
|
- BX_TRACE("Texture%-4s %3d: %s (requested: %s), %dx%dx%d%s."
|
|
|
|
|
|
|
+ BX_TRACE("Texture%-4s %3d: %s (requested: %s), layers %d, %dx%dx%d%s."
|
|
|
, imageContainer.m_cubeMap ? "Cube" : (1 < imageContainer.m_depth ? "3D" : "2D")
|
|
, imageContainer.m_cubeMap ? "Cube" : (1 < imageContainer.m_depth ? "3D" : "2D")
|
|
|
, this - s_renderGL->m_textures
|
|
, this - s_renderGL->m_textures
|
|
|
, getName( (TextureFormat::Enum)m_textureFormat)
|
|
, getName( (TextureFormat::Enum)m_textureFormat)
|
|
|
, getName( (TextureFormat::Enum)m_requestedFormat)
|
|
, getName( (TextureFormat::Enum)m_requestedFormat)
|
|
|
|
|
+ , imageContainer.m_numLayers
|
|
|
, textureWidth
|
|
, textureWidth
|
|
|
, textureHeight
|
|
, textureHeight
|
|
|
, imageContainer.m_cubeMap ? 6 : (1 < imageContainer.m_depth ? imageContainer.m_depth : 0)
|
|
, imageContainer.m_cubeMap ? 6 : (1 < imageContainer.m_depth ? imageContainer.m_depth : 0)
|
|
@@ -4495,7 +4715,10 @@ namespace bgfx { namespace gl
|
|
|
{
|
|
{
|
|
|
width = bx::uint32_max(1, width);
|
|
width = bx::uint32_max(1, width);
|
|
|
height = bx::uint32_max(1, height);
|
|
height = bx::uint32_max(1, height);
|
|
|
- depth = bx::uint32_max(1, depth);
|
|
|
|
|
|
|
+ depth = 1 < imageContainer.m_depth
|
|
|
|
|
+ ? bx::uint32_max(1, depth)
|
|
|
|
|
+ : imageContainer.m_numLayers
|
|
|
|
|
+ ;
|
|
|
|
|
|
|
|
ImageMip mip;
|
|
ImageMip mip;
|
|
|
if (imageGetRawData(imageContainer, side, lod+startLod, _mem->data, _mem->size, mip) )
|
|
if (imageGetRawData(imageContainer, side, lod+startLod, _mem->data, _mem->size, mip) )
|
|
@@ -4622,8 +4845,6 @@ namespace bgfx { namespace gl
|
|
|
|
|
|
|
|
void TextureGL::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
|
|
void TextureGL::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
|
|
|
{
|
|
{
|
|
|
- BX_UNUSED(_z, _depth);
|
|
|
|
|
-
|
|
|
|
|
const uint32_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
|
|
const uint32_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
|
|
|
const uint32_t rectpitch = _rect.m_width*bpp/8;
|
|
const uint32_t rectpitch = _rect.m_width*bpp/8;
|
|
|
uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
|
|
uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
|
|
@@ -4631,7 +4852,10 @@ namespace bgfx { namespace gl
|
|
|
GL_CHECK(glBindTexture(m_target, m_id) );
|
|
GL_CHECK(glBindTexture(m_target, m_id) );
|
|
|
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
|
|
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
|
|
|
|
|
|
|
|
- GLenum target = GL_TEXTURE_CUBE_MAP == m_target ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : m_target;
|
|
|
|
|
|
|
+ GLenum target = isCubeMap()
|
|
|
|
|
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X
|
|
|
|
|
+ : m_target
|
|
|
|
|
+ ;
|
|
|
|
|
|
|
|
const bool swizzle = true
|
|
const bool swizzle = true
|
|
|
&& TextureFormat::BGRA8 == m_requestedFormat
|
|
&& TextureFormat::BGRA8 == m_requestedFormat
|
|
@@ -5132,11 +5356,12 @@ namespace bgfx { namespace gl
|
|
|
&& s_extension[Extension::ARB_shader_texture_lod].m_supported
|
|
&& s_extension[Extension::ARB_shader_texture_lod].m_supported
|
|
|
&& bx::findIdentifierMatch(code, s_ARB_shader_texture_lod)
|
|
&& bx::findIdentifierMatch(code, s_ARB_shader_texture_lod)
|
|
|
;
|
|
;
|
|
|
- const bool usesGpuShader5 = !!bx::findIdentifierMatch(code, s_ARB_gpu_shader5);
|
|
|
|
|
- const bool usesIUsamplers = !!bx::findIdentifierMatch(code, s_uisamplers);
|
|
|
|
|
- const bool usesTexelFetch = !!bx::findIdentifierMatch(code, s_texelFetch);
|
|
|
|
|
- const bool usesTextureMS = !!bx::findIdentifierMatch(code, s_ARB_texture_multisample);
|
|
|
|
|
- const bool usesPacking = !!bx::findIdentifierMatch(code, s_ARB_shading_language_packing);
|
|
|
|
|
|
|
+ const bool usesGpuShader5 = !!bx::findIdentifierMatch(code, s_ARB_gpu_shader5);
|
|
|
|
|
+ const bool usesIUsamplers = !!bx::findIdentifierMatch(code, s_uisamplers);
|
|
|
|
|
+ const bool usesTexelFetch = !!bx::findIdentifierMatch(code, s_texelFetch);
|
|
|
|
|
+ const bool usesTextureArray = !!bx::findIdentifierMatch(code, s_textureArray);
|
|
|
|
|
+ const bool usesTextureMS = !!bx::findIdentifierMatch(code, s_ARB_texture_multisample);
|
|
|
|
|
+ const bool usesPacking = !!bx::findIdentifierMatch(code, s_ARB_shading_language_packing);
|
|
|
|
|
|
|
|
uint32_t version =
|
|
uint32_t version =
|
|
|
usesIUsamplers || usesTexelFetch ? 130
|
|
usesIUsamplers || usesTexelFetch ? 130
|
|
@@ -5172,6 +5397,11 @@ namespace bgfx { namespace gl
|
|
|
writeString(&writer, "#extension GL_ARB_texture_multisample : enable\n");
|
|
writeString(&writer, "#extension GL_ARB_texture_multisample : enable\n");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (usesTextureArray)
|
|
|
|
|
+ {
|
|
|
|
|
+ writeString(&writer, "#extension GL_EXT_texture_array : enable\n");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (130 <= version)
|
|
if (130 <= version)
|
|
|
{
|
|
{
|
|
|
if (m_type == GL_FRAGMENT_SHADER)
|
|
if (m_type == GL_FRAGMENT_SHADER)
|
|
@@ -5460,7 +5690,7 @@ namespace bgfx { namespace gl
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- GLenum target = GL_TEXTURE_CUBE_MAP == texture.m_target
|
|
|
|
|
|
|
+ GLenum target = texture.isCubeMap()
|
|
|
? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
|
|
? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
|
|
|
: texture.m_target
|
|
: texture.m_target
|
|
|
;
|
|
;
|
|
@@ -5521,7 +5751,7 @@ namespace bgfx { namespace gl
|
|
|
{
|
|
{
|
|
|
++colorIdx;
|
|
++colorIdx;
|
|
|
|
|
|
|
|
- GLenum target = GL_TEXTURE_CUBE_MAP == texture.m_target
|
|
|
|
|
|
|
+ GLenum target = texture.isCubeMap()
|
|
|
? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
|
|
? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
|
|
|
: texture.m_target
|
|
: texture.m_target
|
|
|
;
|
|
;
|