mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-16 22:16:53 +07:00
use 3.2 opengl instead 4.1 for renderdoc debugging
This commit is contained in:
@@ -880,10 +880,10 @@ namespace e2d
|
|||||||
|
|
||||||
enum class api_profile {
|
enum class api_profile {
|
||||||
unknown,
|
unknown,
|
||||||
opengles2,
|
gles_2_0,
|
||||||
opengles3,
|
gles_3_0,
|
||||||
opengl2_compat,
|
gl_2_1_compat,
|
||||||
opengl4_compat
|
gl_3_2_compat
|
||||||
};
|
};
|
||||||
|
|
||||||
struct device_caps {
|
struct device_caps {
|
||||||
|
|||||||
@@ -19,22 +19,22 @@ namespace
|
|||||||
switch ( profile ) {
|
switch ( profile ) {
|
||||||
case e2d::render::api_profile::unknown:
|
case e2d::render::api_profile::unknown:
|
||||||
return "";
|
return "";
|
||||||
case e2d::render::api_profile::opengles2:
|
case e2d::render::api_profile::gles_2_0:
|
||||||
case e2d::render::api_profile::opengles3:
|
case e2d::render::api_profile::gles_3_0:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
precision highp int;
|
precision highp int;
|
||||||
precision highp float;
|
precision highp float;
|
||||||
)glsl";
|
)glsl";
|
||||||
case e2d::render::api_profile::opengl2_compat:
|
case e2d::render::api_profile::gl_2_1_compat:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
#version 120
|
#version 120
|
||||||
#define highp
|
#define highp
|
||||||
#define mediump
|
#define mediump
|
||||||
#define lowp
|
#define lowp
|
||||||
)glsl";
|
)glsl";
|
||||||
case e2d::render::api_profile::opengl4_compat:
|
case e2d::render::api_profile::gl_3_2_compat:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
#version 410 core
|
#version 150
|
||||||
#define texture2D texture
|
#define texture2D texture
|
||||||
#define varying out
|
#define varying out
|
||||||
#define attribute in
|
#define attribute in
|
||||||
@@ -49,22 +49,22 @@ namespace
|
|||||||
switch ( profile ) {
|
switch ( profile ) {
|
||||||
case e2d::render::api_profile::unknown:
|
case e2d::render::api_profile::unknown:
|
||||||
return "";
|
return "";
|
||||||
case e2d::render::api_profile::opengles2:
|
case e2d::render::api_profile::gles_2_0:
|
||||||
case e2d::render::api_profile::opengles3:
|
case e2d::render::api_profile::gles_3_0:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
precision mediump int;
|
precision mediump int;
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
)glsl";
|
)glsl";
|
||||||
case e2d::render::api_profile::opengl2_compat:
|
case e2d::render::api_profile::gl_2_1_compat:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
#version 120
|
#version 120
|
||||||
#define highp
|
#define highp
|
||||||
#define mediump
|
#define mediump
|
||||||
#define lowp
|
#define lowp
|
||||||
)glsl";
|
)glsl";
|
||||||
case e2d::render::api_profile::opengl4_compat:
|
case e2d::render::api_profile::gl_3_2_compat:
|
||||||
return R"glsl(
|
return R"glsl(
|
||||||
#version 410 core
|
#version 150
|
||||||
#define texture2D texture
|
#define texture2D texture
|
||||||
#define varying in
|
#define varying in
|
||||||
)glsl";
|
)glsl";
|
||||||
|
|||||||
@@ -125,11 +125,34 @@ namespace
|
|||||||
gl_bit_ = 1 << 28,
|
gl_bit_ = 1 << 28,
|
||||||
gles_bit_ = 2 << 28,
|
gles_bit_ = 2 << 28,
|
||||||
|
|
||||||
gl_210 = 210 | gl_bit_,
|
gl_1_0 = 100 | gl_bit_,
|
||||||
gl_300 = 300 | gl_bit_,
|
gl_1_1 = 110 | gl_bit_,
|
||||||
gl_410 = 410 | gl_bit_,
|
gl_1_2 = 120 | gl_bit_,
|
||||||
gles_200 = 200 | gles_bit_,
|
gl_1_3 = 130 | gl_bit_,
|
||||||
gles_300 = 300 | gles_bit_
|
gl_1_4 = 140 | gl_bit_,
|
||||||
|
gl_1_5 = 150 | gl_bit_,
|
||||||
|
|
||||||
|
gl_2_0 = 200 | gl_bit_,
|
||||||
|
gl_2_1 = 210 | gl_bit_,
|
||||||
|
|
||||||
|
gl_3_0 = 300 | gl_bit_,
|
||||||
|
gl_3_1 = 310 | gl_bit_,
|
||||||
|
gl_3_2 = 320 | gl_bit_,
|
||||||
|
gl_3_3 = 330 | gl_bit_,
|
||||||
|
|
||||||
|
gl_4_0 = 400 | gl_bit_,
|
||||||
|
gl_4_1 = 410 | gl_bit_,
|
||||||
|
gl_4_2 = 420 | gl_bit_,
|
||||||
|
gl_4_3 = 430 | gl_bit_,
|
||||||
|
gl_4_4 = 440 | gl_bit_,
|
||||||
|
gl_4_5 = 450 | gl_bit_,
|
||||||
|
gl_4_6 = 460 | gl_bit_,
|
||||||
|
|
||||||
|
gles_2_0 = 200 | gles_bit_,
|
||||||
|
|
||||||
|
gles_3_0 = 300 | gles_bit_,
|
||||||
|
gles_3_1 = 310 | gles_bit_,
|
||||||
|
gles_3_2 = 320 | gles_bit_
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator>=(gl_version lhs, gl_version rhs) noexcept {
|
bool operator>=(gl_version lhs, gl_version rhs) noexcept {
|
||||||
@@ -1395,56 +1418,56 @@ namespace e2d::opengl
|
|||||||
const gl_version version = gl_get_version(debug);
|
const gl_version version = gl_get_version(debug);
|
||||||
|
|
||||||
caps.profile =
|
caps.profile =
|
||||||
version >= gl_version::gles_300 ? render::api_profile::opengles3 :
|
version >= gl_version::gles_3_0 ? render::api_profile::gles_3_0 :
|
||||||
version >= gl_version::gles_200 ? render::api_profile::opengles2 :
|
version >= gl_version::gles_2_0 ? render::api_profile::gles_2_0 :
|
||||||
version >= gl_version::gl_410 ? render::api_profile::opengl4_compat :
|
version >= gl_version::gl_3_2 ? render::api_profile::gl_3_2_compat :
|
||||||
render::api_profile::opengl2_compat;
|
render::api_profile::gl_2_1_compat;
|
||||||
|
|
||||||
caps.npot_texture_supported =
|
caps.npot_texture_supported =
|
||||||
version >= gl_version::gl_210 || // gl_200
|
version >= gl_version::gl_2_0 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_texture_npot",
|
"GL_OES_texture_npot",
|
||||||
"GL_ARB_texture_non_power_of_two");
|
"GL_ARB_texture_non_power_of_two");
|
||||||
|
|
||||||
caps.depth_texture_supported =
|
caps.depth_texture_supported =
|
||||||
version >= gl_version::gl_210 ||
|
version >= gl_version::gl_1_4 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_depth_texture",
|
"GL_OES_depth_texture",
|
||||||
"GL_ARB_depth_texture"); // gl_140
|
"GL_ARB_depth_texture");
|
||||||
|
|
||||||
caps.render_target_supported =
|
caps.render_target_supported =
|
||||||
version >= gl_version::gl_300 || // gl_300
|
version >= gl_version::gl_3_0 ||
|
||||||
version >= gl_version::gles_200 ||
|
version >= gl_version::gles_2_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_framebuffer_object",
|
"GL_OES_framebuffer_object",
|
||||||
"GL_EXT_framebuffer_object",
|
"GL_EXT_framebuffer_object",
|
||||||
"GL_ARB_framebuffer_object");
|
"GL_ARB_framebuffer_object");
|
||||||
|
|
||||||
caps.element_index_uint =
|
caps.element_index_uint =
|
||||||
version >= gl_version::gl_210 || // gl_100
|
version >= gl_version::gl_1_1 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_element_index_uint");
|
"GL_OES_element_index_uint");
|
||||||
|
|
||||||
caps.depth16_supported =
|
caps.depth16_supported =
|
||||||
version >= gl_version::gl_210 || // gl_140
|
version >= gl_version::gl_1_4 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_depth_texture",
|
"GL_OES_depth_texture",
|
||||||
"GL_ARB_depth_texture");
|
"GL_ARB_depth_texture");
|
||||||
|
|
||||||
caps.depth24_supported =
|
caps.depth24_supported =
|
||||||
version >= gl_version::gl_210 || // gl_140
|
version >= gl_version::gl_1_4 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_depth24",
|
"GL_OES_depth24",
|
||||||
"GL_ARB_depth_texture");
|
"GL_ARB_depth_texture");
|
||||||
|
|
||||||
caps.depth24_stencil8_supported =
|
caps.depth24_stencil8_supported =
|
||||||
version >= gl_version::gl_300 || // gl_300
|
version >= gl_version::gl_3_0 ||
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_OES_packed_depth_stencil",
|
"GL_OES_packed_depth_stencil",
|
||||||
"GL_EXT_packed_depth_stencil");
|
"GL_EXT_packed_depth_stencil");
|
||||||
@@ -1458,7 +1481,8 @@ namespace e2d::opengl
|
|||||||
"GL_OES_compressed_ETC1_RGB8_texture");
|
"GL_OES_compressed_ETC1_RGB8_texture");
|
||||||
|
|
||||||
caps.etc2_compression_supported =
|
caps.etc2_compression_supported =
|
||||||
version >= gl_version::gles_300 ||
|
version >= gl_version::gl_4_3 ||
|
||||||
|
version >= gl_version::gles_3_0 ||
|
||||||
gl_has_any_extension(debug,
|
gl_has_any_extension(debug,
|
||||||
"GL_ARB_ES3_compatibility");
|
"GL_ARB_ES3_compatibility");
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace
|
|||||||
"--> Severity: %1\n"
|
"--> Severity: %1\n"
|
||||||
"--> Source: %2\n"
|
"--> Source: %2\n"
|
||||||
"--> Type: %3\n"
|
"--> Type: %3\n"
|
||||||
"--> Message: %4\n",
|
"--> Message: %4",
|
||||||
id,
|
id,
|
||||||
debug_output_severity_to_cstr(severity),
|
debug_output_severity_to_cstr(severity),
|
||||||
debug_output_source_to_cstr(source),
|
debug_output_source_to_cstr(source),
|
||||||
|
|||||||
Reference in New Issue
Block a user