Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Add optional ANGLE support for Windows desktop. #44845

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion drivers/gl_context/SCsub
Expand Up @@ -2,7 +2,12 @@

Import("env")

if env["platform"] in ["haiku", "osx", "windows", "x11"]:
if env["platform"] in ["windows"] and env["use_angle"]:
# ANGLE on windows desktop
thirdparty_dir = "#thirdparty/angle/include"
env.Prepend(CPPPATH=[thirdparty_dir])
env.Append(LIBPATH=["#thirdparty/angle/out/Release"])
elif env["platform"] in ["windows", "haiku", "osx", "x11"]:
# Thirdparty source files
thirdparty_dir = "#thirdparty/glad/"
thirdparty_sources = [
Expand Down
3 changes: 3 additions & 0 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Expand Up @@ -88,7 +88,10 @@ GLuint RasterizerStorageGLES2::system_fbo = 0;

// enable extensions manually for android and ios
#ifndef UWP_ENABLED
#ifndef WINDOWS_ENABLED
#include <dlfcn.h> // needed to load extensions

#endif // !WINDOWS_ENABLED
#endif

#ifdef IPHONE_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/shaders/blend_shape.glsl
Expand Up @@ -103,7 +103,7 @@ out vec2 uv2_out; //tfb:ENABLE_UV2
#endif

#ifdef ENABLE_SKELETON
out ivec4 bone_out; //tfb:ENABLE_SKELETON
flat out ivec4 bone_out; //tfb:ENABLE_SKELETON
fire marked this conversation as resolved.
Show resolved Hide resolved
out vec4 weight_out; //tfb:ENABLE_SKELETON
#endif

Expand Down
8 changes: 4 additions & 4 deletions drivers/gles3/shaders/scene.glsl
Expand Up @@ -114,7 +114,7 @@ uniform highp mat4 world_transform;
layout(std140) uniform DirectionalLightData { //ubo:3

highp vec4 light_pos_inv_radius;
mediump vec4 light_direction_attenuation;
highp vec4 light_direction_attenuation;
mediump vec4 light_color_energy;
mediump vec4 light_params; // cone attenuation, angle, specular, shadow enabled,
mediump vec4 light_clamp;
Expand All @@ -134,7 +134,7 @@ layout(std140) uniform DirectionalLightData { //ubo:3
struct LightData {

highp vec4 light_pos_inv_radius;
mediump vec4 light_direction_attenuation;
highp vec4 light_direction_attenuation;
mediump vec4 light_color_energy;
mediump vec4 light_params; // cone attenuation, angle, specular, shadow enabled,
mediump vec4 light_clamp;
Expand Down Expand Up @@ -752,7 +752,7 @@ layout(std140) uniform SceneData {
layout(std140) uniform DirectionalLightData {

highp vec4 light_pos_inv_radius;
mediump vec4 light_direction_attenuation;
highp vec4 light_direction_attenuation;
mediump vec4 light_color_energy;
mediump vec4 light_params; // cone attenuation, angle, specular, shadow enabled,
mediump vec4 light_clamp;
Expand All @@ -777,7 +777,7 @@ in vec4 specular_light_interp;
struct LightData {

highp vec4 light_pos_inv_radius;
mediump vec4 light_direction_attenuation;
highp vec4 light_direction_attenuation;
mediump vec4 light_color_energy;
mediump vec4 light_params; // cone attenuation, angle, specular, shadow enabled,
mediump vec4 light_clamp;
Expand Down
3 changes: 2 additions & 1 deletion gles_builders.py
Expand Up @@ -158,8 +158,9 @@ def include_file_in_legacygl_header(filename, header_data, depth):
bind = bind.replace("attrib:", "").strip()
header_data.attributes += [(name, bind)]

if line.strip().find("out ") == 0 and line.find("tfb:") != -1:
if (line.strip().find("out ") == 0 or line.strip().find("flat out ") == 0) and line.find("tfb:") != -1:
uline = line.replace("out ", "")
uline = uline.replace("flat ", "")
uline = uline.replace("highp ", "")
uline = uline.replace(";", "")
uline = uline[uline.find(" ") :].strip()
Expand Down
6 changes: 5 additions & 1 deletion platform/windows/SCsub
Expand Up @@ -8,7 +8,6 @@ import platform_windows_builders

common_win = [
"godot_windows.cpp",
"context_gl_windows.cpp",
"crash_handler_windows.cpp",
"os_windows.cpp",
"key_mapping_windows.cpp",
Expand All @@ -17,6 +16,11 @@ common_win = [
"windows_terminal_logger.cpp",
]

if env["use_angle"]:
common_win.append("context_gl_windows_angle.cpp")
else:
common_win.append("context_gl_windows.cpp")

res_file = "godot_res.rc"
res_target = "godot_res" + env["OBJSUFFIX"]
res_obj = env.RES(res_target, res_file)
Expand Down