summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/SCsub5
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp2
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp18
-rw-r--r--drivers/unix/os_unix.cpp2
-rw-r--r--drivers/wasapi/audio_driver_wasapi.cpp19
5 files changed, 27 insertions, 19 deletions
diff --git a/drivers/SCsub b/drivers/SCsub
index 714d4110de..dd81fc645c 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -25,10 +25,9 @@ SConscript("winmidi/SCsub")
# Graphics drivers
if env["vulkan"]:
SConscript("vulkan/SCsub")
- SConscript("gles3/SCsub")
+if env["opengl3"]:
SConscript("gl_context/SCsub")
-else:
- SConscript("dummy/SCsub")
+ SConscript("gles3/SCsub")
# Core dependencies
SConscript("png/SCsub")
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 10093d42a3..92c9dfb9ae 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -68,7 +68,7 @@
#endif
#endif
-#ifndef IPHONE_ENABLED
+#if !defined(IPHONE_ENABLED) && !defined(JAVASCRIPT_ENABLED)
// We include EGL below to get debug callback on GLES2 platforms,
// but EGL is not available on iOS.
#define CAN_DEBUG
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index fa607472d3..f9443e11db 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -65,6 +65,13 @@ static String _prestr(SL::DataPrecision p_pres) {
return "";
}
+static String _constr(bool p_is_const) {
+ if (p_is_const) {
+ return "const ";
+ }
+ return "";
+}
+
static String _qualstr(SL::ArgumentQualifier p_qual) {
switch (p_qual) {
case SL::ARGUMENT_QUALIFIER_IN:
@@ -246,9 +253,10 @@ void ShaderCompilerGLES3::_dump_function_deps(SL::ShaderNode *p_node, const Stri
header += "(";
for (int i = 0; i < fnode->arguments.size(); i++) {
- if (i > 0)
+ if (i > 0) {
header += ", ";
-
+ }
+ header += _constr(fnode->arguments[i].is_const);
header += _qualstr(fnode->arguments[i].qualifier);
header += _prestr(fnode->arguments[i].precision);
header += _typestr(fnode->arguments[i].type);
@@ -365,7 +373,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
for (int i = 0; i < snode->vconstants.size(); i++) {
String gcode;
- gcode += "const ";
+ gcode += _constr(true);
gcode += _prestr(snode->vconstants[i].precision);
gcode += _typestr(snode->vconstants[i].type);
gcode += " " + _mkid(String(snode->vconstants[i].name));
@@ -446,9 +454,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
SL::VariableDeclarationNode *var_dec_node = (SL::VariableDeclarationNode *)p_node;
StringBuffer<> declaration;
- if (var_dec_node->is_const) {
- declaration += "const ";
- }
+ declaration += _constr(var_dec_node->is_const);
declaration += _prestr(var_dec_node->precision);
declaration += _typestr(var_dec_node->datatype);
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 1bc88a86f7..1ebc8cca5e 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -473,7 +473,7 @@ String OS_Unix::get_user_data_dir() const {
}
}
- return ProjectSettings::get_singleton()->get_resource_path();
+ return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file("[unnamed project]");
}
String OS_Unix::get_executable_path() const {
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp
index 520d4808fb..403feb149e 100644
--- a/drivers/wasapi/audio_driver_wasapi.cpp
+++ b/drivers/wasapi/audio_driver_wasapi.cpp
@@ -387,14 +387,17 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c
ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN);
// Due to WASAPI Shared Mode we have no control of the buffer size
- buffer_frames = max_frames;
-
- int64_t latency = 0;
- audio_output.audio_client->GetStreamLatency(&latency);
- // WASAPI REFERENCE_TIME units are 100 nanoseconds per unit
- // https://docs.microsoft.com/en-us/windows/win32/directshow/reference-time
- // Convert REFTIME to seconds as godot uses for latency
- real_latency = (float)latency / (float)REFTIMES_PER_SEC;
+ if (!p_capture) {
+ buffer_frames = max_frames;
+
+ int64_t latency = 0;
+ audio_output.audio_client->GetStreamLatency(&latency);
+ // WASAPI REFERENCE_TIME units are 100 nanoseconds per unit
+ // https://docs.microsoft.com/en-us/windows/win32/directshow/reference-time
+ // Convert REFTIME to seconds as godot uses for latency
+ real_latency = (float)latency / (float)REFTIMES_PER_SEC;
+ }
+
} else {
IAudioClient3 *device_audio_client_3 = (IAudioClient3 *)p_device->audio_client;