summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/alsamidi/midi_driver_alsamidi.cpp23
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.cpp14
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp43
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp22
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp2
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp17
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp71
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp12
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp43
-rw-r--r--drivers/gles3/shaders/scene.glsl29
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp20
-rw-r--r--drivers/unix/os_unix.h2
-rw-r--r--drivers/wasapi/audio_driver_wasapi.cpp10
13 files changed, 81 insertions, 227 deletions
diff --git a/drivers/alsamidi/midi_driver_alsamidi.cpp b/drivers/alsamidi/midi_driver_alsamidi.cpp
index 10581a460c..68a34fe485 100644
--- a/drivers/alsamidi/midi_driver_alsamidi.cpp
+++ b/drivers/alsamidi/midi_driver_alsamidi.cpp
@@ -43,12 +43,30 @@ static int get_message_size(uint8_t message) {
case 0x90: // note on
case 0xA0: // aftertouch
case 0xB0: // continuous controller
+ case 0xE0: // pitch bend
+ case 0xF2: // song position pointer
return 3;
case 0xC0: // patch change
case 0xD0: // channel pressure
- case 0xE0: // pitch bend
+ case 0xF1: // time code quarter frame
+ case 0xF3: // song select
return 2;
+
+ case 0xF0: // SysEx start
+ case 0xF4: // reserved
+ case 0xF5: // reserved
+ case 0xF6: // tune request
+ case 0xF7: // SysEx end
+ case 0xF8: // timing clock
+ case 0xF9: // reserved
+ case 0xFA: // start
+ case 0xFB: // continue
+ case 0xFC: // stop
+ case 0xFD: // reserved
+ case 0xFE: // active sensing
+ case 0xFF: // reset
+ return 1;
}
return 256;
@@ -83,6 +101,9 @@ void MIDIDriverALSAMidi::thread_func(void *p_udata) {
bytes = 0;
}
expected_size = get_message_size(byte);
+ // After a SysEx start, all bytes are data until a SysEx end, so
+ // we're going to end the command at the SES, and let the common
+ // driver ignore the following data bytes.
}
if (bytes < 256) {
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp
index 1e97100a32..c67e90c1df 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.cpp
+++ b/drivers/coreaudio/audio_driver_coreaudio.cpp
@@ -233,11 +233,11 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
if (result == noErr) {
for (unsigned int i = 0; i < inNumberFrames * ad->capture_channels; i++) {
int32_t sample = ad->input_buf[i] << 16;
- ad->capture_buffer_write(sample);
+ ad->input_buffer_write(sample);
if (ad->capture_channels == 1) {
- // In case capture device is single channel convert it to Stereo
- ad->capture_buffer_write(sample);
+ // In case input device is single channel convert it to Stereo
+ ad->input_buffer_write(sample);
}
}
} else {
@@ -487,7 +487,7 @@ void AudioDriverCoreAudio::capture_finish() {
Error AudioDriverCoreAudio::capture_start() {
- capture_buffer_init(buffer_frames);
+ input_buffer_init(buffer_frames);
OSStatus result = AudioOutputUnitStart(input_unit);
if (result != noErr) {
@@ -642,9 +642,9 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
ERR_FAIL_COND(result != noErr);
if (capture) {
- // Reset audio capture to keep synchronisation.
- capture_position = 0;
- capture_size = 0;
+ // Reset audio input to keep synchronisation.
+ input_position = 0;
+ input_size = 0;
}
}
}
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 6b1574bbbd..c0ba93db6a 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -557,15 +557,16 @@ bool RasterizerSceneGLES2::reflection_probe_instance_begin_render(RID p_instance
glGenTextures(1, &rpi->cubemap);
glBindTexture(GL_TEXTURE_CUBE_MAP, rpi->cubemap);
-#if 1
- //Mobile hardware (PowerVR specially) prefers this approach, the other one kills the game
+
+ // Mobile hardware (PowerVR specially) prefers this approach,
+ // the previous approach with manual lod levels kills the game.
for (int i = 0; i < 6; i++) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internal_format, size, size, 0, format, type, NULL);
}
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
- //Generate framebuffers for rendering
+ // Generate framebuffers for rendering
for (int i = 0; i < 6; i++) {
glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]);
glBindTexture(GL_TEXTURE_2D, rpi->color[i]);
@@ -576,34 +577,6 @@ bool RasterizerSceneGLES2::reflection_probe_instance_begin_render(RID p_instance
ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
}
-#else
- int lod = 0;
-
- //the approach below is fatal for powervr
-
- // Set the initial (empty) mipmaps, all need to be set for this to work in GLES2, even if they won't be used later.
- while (size >= 1) {
-
- for (int i = 0; i < 6; i++) {
- glTexImage2D(_cube_side_enum[i], lod, internal_format, size, size, 0, format, type, NULL);
- if (size == rpi->current_resolution) {
- //adjust framebuffer
- glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _cube_side_enum[i], rpi->cubemap, 0);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rpi->depth);
-
-#ifdef DEBUG_ENABLED
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
-#endif
- }
- }
-
- lod++;
-
- size >>= 1;
- }
-#endif
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -2685,14 +2658,14 @@ void RasterizerSceneGLES2::_draw_sky(RasterizerStorageGLES2::Sky *p_sky, const C
};
if (!asymmetrical) {
- float vw, vh, zn;
- camera.get_viewport_size(vw, vh);
+ Vector2 vp_he = camera.get_viewport_half_extents();
+ float zn;
zn = p_projection.get_z_near();
for (int i = 0; i < 4; i++) {
Vector3 uv = vertices[i * 2 + 1];
- uv.x = (uv.x * 2.0 - 1.0) * vw;
- uv.y = -(uv.y * 2.0 - 1.0) * vh;
+ uv.x = (uv.x * 2.0 - 1.0) * vp_he.x;
+ uv.y = -(uv.y * 2.0 - 1.0) * vp_he.y;
uv.z = -zn;
vertices[i * 2 + 1] = p_transform.basis.xform(uv).normalized();
vertices[i * 2 + 1].z = -vertices[i * 2 + 1].z;
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 7980c43517..cd6a7d86c6 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -1206,32 +1206,21 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
GLenum type = GL_UNSIGNED_BYTE;
// Set the initial (empty) mipmaps
-#if 1
- //Mobile hardware (PowerVR specially) prefers this approach, the other one kills the game
+ // Mobile hardware (PowerVR specially) prefers this approach,
+ // the previous approach with manual lod levels kills the game.
for (int i = 0; i < 6; i++) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internal_format, size, size, 0, format, type, NULL);
}
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
- //no filters for now
+
+ // No filters for now
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-#else
- while (size >= 1) {
-
- for (int i = 0; i < 6; i++) {
- glTexImage2D(_cube_side_enum[i], lod, internal_format, size, size, 0, format, type, NULL);
- }
-
- lod++;
-
- size >>= 1;
- }
-#endif
- //framebuffer
+ // Framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, resources.mipmap_blur_fbo);
@@ -2703,6 +2692,7 @@ void RasterizerStorageGLES2::mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb
ERR_FAIL_COND(!mesh);
mesh->custom_aabb = p_aabb;
+ mesh->instance_change_notify(true, false);
}
AABB RasterizerStorageGLES2::mesh_get_custom_aabb(RID p_mesh) const {
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 24b89aedc2..5dec6f2fee 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -80,7 +80,7 @@ static String _opstr(SL::Operator p_op) {
static String _mkid(const String &p_id) {
- String id = "m_" + p_id;
+ String id = "m_" + p_id.replace("__", "_dus_");
return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl
}
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index ef2c318807..a24147146f 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -339,8 +339,6 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
RasterizerStorageGLES3::RenderTarget *rt = storage->render_target_owner.getornull(p_render_target);
ERR_FAIL_COND(!rt);
-#if 1
-
Size2 win_size = OS::get_singleton()->get_window_size();
if (rt->external.fbo != 0) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->external.fbo);
@@ -350,21 +348,6 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glBlitFramebuffer(0, 0, rt->width, rt->height, p_screen_rect.position.x, win_size.height - p_screen_rect.position.y - p_screen_rect.size.height, p_screen_rect.position.x + p_screen_rect.size.width, win_size.height - p_screen_rect.position.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);
-
-#else
- canvas->canvas_begin();
- glDisable(GL_BLEND);
- glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, rt->color);
- //glBindTexture(GL_TEXTURE_2D, rt->effects.mip_maps[0].color);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, storage->resources.normal_tex);
-
- canvas->draw_generic_textured_rect(p_screen_rect, Rect2(0, 0, 1, -1));
- glBindTexture(GL_TEXTURE_2D, 0);
- canvas->canvas_end();
-#endif
}
void RasterizerGLES3::output_lens_distorted_to_screen(RID p_render_target, const Rect2 &p_screen_rect, float p_k1, float p_k2, const Vector2 &p_eye_center, float p_oversample) {
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 0ed2637a11..27173d317b 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1146,47 +1146,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
state.current_depth_draw = p_material->shader->spatial.depth_draw_mode;
}
-#if 0
- //blend mode
- if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) {
-
- switch(p_material->shader->spatial.blend_mode) {
-
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX: {
- glBlendEquation(GL_FUNC_ADD);
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_ADD: {
-
- glBlendEquation(GL_FUNC_ADD);
- glBlendFunc(p_alpha_pass?GL_SRC_ALPHA:GL_ONE,GL_ONE);
-
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_SUB: {
-
- glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MUL: {
- glBlendEquation(GL_FUNC_ADD);
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- } break;
- }
-
- state.current_blend_mode=p_material->shader->spatial.blend_mode;
-
- }
-#endif
//material parameters
state.scene_shader.set_custom_shader(p_material->shader->custom_code_id);
@@ -2538,14 +2497,14 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C
};
if (!asymmetrical) {
- float vw, vh, zn;
- camera.get_viewport_size(vw, vh);
+ Vector2 vp_he = camera.get_viewport_half_extents();
+ float zn;
zn = p_projection.get_z_near();
for (int i = 0; i < 4; i++) {
Vector3 uv = vertices[i * 2 + 1];
- uv.x = (uv.x * 2.0 - 1.0) * vw;
- uv.y = -(uv.y * 2.0 - 1.0) * vh;
+ uv.x = (uv.x * 2.0 - 1.0) * vp_he.x;
+ uv.y = -(uv.y * 2.0 - 1.0) * vp_he.y;
uv.z = -zn;
vertices[i * 2 + 1] = p_transform.basis.xform(uv).normalized();
vertices[i * 2 + 1].z = -vertices[i * 2 + 1].z;
@@ -3007,16 +2966,6 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
li->light_index = state.spot_light_count;
copymem(&state.spot_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
state.spot_light_count++;
-
-#if 0
- if (li->light_ptr->shadow_enabled) {
- CameraMatrix bias;
- bias.set_light_bias();
- Transform modelview=Transform(camera_transform_inverse * li->transform).inverse();
- li->shadow_projection[0] = bias * li->projection * modelview;
- lights_use_shadow=true;
- }
-#endif
} break;
}
@@ -4181,11 +4130,15 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
state.ubo_data.shadow_dual_paraboloid_render_zfar = 0;
state.ubo_data.opaque_prepass_threshold = 0.99;
- p_cam_projection.get_viewport_size(state.ubo_data.viewport_size[0], state.ubo_data.viewport_size[1]);
-
if (storage->frame.current_rt) {
- state.ubo_data.screen_pixel_size[0] = 1.0 / storage->frame.current_rt->width;
- state.ubo_data.screen_pixel_size[1] = 1.0 / storage->frame.current_rt->height;
+ int viewport_width_pixels = storage->frame.current_rt->width;
+ int viewport_height_pixels = storage->frame.current_rt->height;
+
+ state.ubo_data.viewport_size[0] = viewport_width_pixels;
+ state.ubo_data.viewport_size[1] = viewport_height_pixels;
+
+ state.ubo_data.screen_pixel_size[0] = 1.0 / viewport_width_pixels;
+ state.ubo_data.screen_pixel_size[1] = 1.0 / viewport_height_pixels;
}
_setup_environment(env, p_cam_projection, p_cam_transform, p_reflection_probe.is_valid());
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 0a528552cc..6baf69dc7b 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1854,6 +1854,9 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sky->irradiance, 0);
+ int irradiance_size = GLOBAL_GET("rendering/quality/reflections/irradiance_max_size");
+ int upscale_size = MIN(int(previous_power_of_2(irradiance_size)), p_radiance_size);
+
GLuint tmp_fb2;
GLuint tmp_tex;
{
@@ -1862,10 +1865,10 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb2);
glGenTextures(1, &tmp_tex);
glBindTexture(GL_TEXTURE_2D, tmp_tex);
- glTexImage2D(GL_TEXTURE_2D, 0, internal_format, p_radiance_size, 2.0 * p_radiance_size, 0, format, type, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, internal_format, upscale_size, 2.0 * upscale_size, 0, format, type, NULL);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_tex, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#ifdef DEBUG_ENABLED
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
@@ -1882,9 +1885,8 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::SOURCE_MIP_LEVEL, MAX(Math::floor(Math::log(float(texture->width)) / Math::log(2.0f)) - 10.0f, 0.0f));
// Compute Irradiance for a large texture, specified by radiance size and then pull out a low mipmap corresponding to 32x32
- int vp_size = p_radiance_size;
for (int i = 0; i < 2; i++) {
- glViewport(0, i * vp_size, vp_size, vp_size);
+ glViewport(0, i * upscale_size, upscale_size, upscale_size);
glBindVertexArray(resources.quadie_array);
shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0);
@@ -1903,7 +1905,7 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
shaders.copy.set_conditional(CopyShaderGLES3::USE_LOD, true);
shaders.copy.bind();
- shaders.copy.set_uniform(CopyShaderGLES3::MIP_LEVEL, MAX(Math::floor(Math::log(float(p_radiance_size)) / Math::log(2.0f)) - 5.0f, 0.0f)); // Mip level that corresponds to a 32x32 texture
+ shaders.copy.set_uniform(CopyShaderGLES3::MIP_LEVEL, MAX(Math::floor(Math::log(float(upscale_size)) / Math::log(2.0f)) - 5.0f, 0.0f)); // Mip level that corresponds to a 32x32 texture
glViewport(0, 0, size, size * 2.0);
glBindVertexArray(resources.quadie_array);
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 121a7f60f4..4e4d896bd7 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -166,7 +166,7 @@ static String _opstr(SL::Operator p_op) {
static String _mkid(const String &p_id) {
- String id = "m_" + p_id;
+ String id = "m_" + p_id.replace("__", "_dus_");
return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl
}
@@ -400,7 +400,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
for (int i = 0; i < max_uniforms; i++) {
r_gen_code.uniforms += uniform_defines[i];
}
-#if 1
+
// add up
int offset = 0;
for (int i = 0; i < uniform_sizes.size(); i++) {
@@ -420,45 +420,6 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
if (r_gen_code.uniform_total_size % 16 != 0) { //UBO sizes must be multiples of 16
r_gen_code.uniform_total_size += r_gen_code.uniform_total_size % 16;
}
-#else
- // add up
- for (int i = 0; i < uniform_sizes.size(); i++) {
-
- if (i > 0) {
-
- int align = uniform_sizes[i - 1] % uniform_alignments[i];
- if (align != 0) {
- uniform_sizes[i - 1] += uniform_alignments[i] - align;
- }
-
- uniform_sizes[i] = uniform_sizes[i] + uniform_sizes[i - 1];
- }
- }
- //offset
- r_gen_code.uniform_offsets.resize(uniform_sizes.size());
- for (int i = 0; i < uniform_sizes.size(); i++) {
-
- if (i > 0)
- r_gen_code.uniform_offsets[i] = uniform_sizes[i - 1];
- else
- r_gen_code.uniform_offsets[i] = 0;
- }
- /*
- for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) {
-
- if (SL::is_sampler_type(E->get().type)) {
- continue;
- }
-
- }
-
-*/
- if (uniform_sizes.size()) {
- r_gen_code.uniform_total_size = uniform_sizes[uniform_sizes.size() - 1];
- } else {
- r_gen_code.uniform_total_size = 0;
- }
-#endif
for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) {
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index a330dbef77..a45ac2eb8a 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1224,35 +1224,6 @@ in highp float dp_clip;
#endif
-#if 0
-// need to save texture depth for this
-vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 pos, float distance) {
-
- float scale = 8.25 * (1.0 - translucency) / subsurface_scatter_width;
- float d = scale * distance;
-
- /**
- * Armed with the thickness, we can now calculate the color by means of the
- * precalculated transmittance profile.
- * (It can be precomputed into a texture, for maximum performance):
- */
- float dd = -d * d;
- vec3 profile =
- vec3(0.233, 0.455, 0.649) * exp(dd / 0.0064) +
- vec3(0.1, 0.336, 0.344) * exp(dd / 0.0484) +
- vec3(0.118, 0.198, 0.0) * exp(dd / 0.187) +
- vec3(0.113, 0.007, 0.007) * exp(dd / 0.567) +
- vec3(0.358, 0.004, 0.0) * exp(dd / 1.99) +
- vec3(0.078, 0.0, 0.0) * exp(dd / 7.41);
-
- /**
- * Using the profile, we finally approximate the transmitted lighting from
- * the back of the object:
- */
- return profile * clamp(0.3 + dot(light_vec, normal),0.0,1.0);
-}
-#endif
-
void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent, vec3 albedo, vec3 transmission, float roughness, float metallic, float specular, float rim, float rim_tint, float clearcoat, float clearcoat_gloss, float anisotropy, float p_blob_intensity, inout vec3 diffuse_light, inout vec3 specular_light, inout float alpha) {
vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz - vertex;
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 68487c7805..524f0363a1 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -229,8 +229,8 @@ Error AudioDriverPulseAudio::init_device() {
samples_out.resize(pa_buffer_size);
// Reset audio input to keep synchronisation.
- capture_position = 0;
- capture_size = 0;
+ input_position = 0;
+ input_size = 0;
return OK;
}
@@ -465,7 +465,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
size_t bytes = pa_stream_readable_size(ad->pa_rec_str);
if (bytes > 0) {
const void *ptr = NULL;
- size_t maxbytes = ad->capture_buffer.size() * sizeof(int16_t);
+ size_t maxbytes = ad->input_buffer.size() * sizeof(int16_t);
bytes = MIN(bytes, maxbytes);
ret = pa_stream_peek(ad->pa_rec_str, &ptr, &bytes);
@@ -475,11 +475,11 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
int16_t *srcptr = (int16_t *)ptr;
for (size_t i = bytes >> 1; i > 0; i--) {
int32_t sample = int32_t(*srcptr++) << 16;
- ad->capture_buffer_write(sample);
+ ad->input_buffer_write(sample);
if (ad->pa_rec_map.channels == 1) {
- // In case capture device is single channel convert it to Stereo
- ad->capture_buffer_write(sample);
+ // In case input device is single channel convert it to Stereo
+ ad->input_buffer_write(sample);
}
}
@@ -666,7 +666,7 @@ Error AudioDriverPulseAudio::capture_init_device() {
break;
default:
- WARN_PRINTS("PulseAudio: Unsupported number of capture channels: " + itos(pa_rec_map.channels));
+ WARN_PRINTS("PulseAudio: Unsupported number of input channels: " + itos(pa_rec_map.channels));
pa_channel_map_init_stereo(&pa_rec_map);
break;
}
@@ -698,10 +698,10 @@ Error AudioDriverPulseAudio::capture_init_device() {
ERR_FAIL_V(ERR_CANT_OPEN);
}
- capture_buffer_init(input_buffer_frames);
+ input_buffer_init(input_buffer_frames);
- print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " capture channels");
- print_verbose("PulseAudio: capture buffer frames: " + itos(input_buffer_frames) + " calculated latency: " + itos(input_buffer_frames * 1000 / mix_rate) + "ms");
+ print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " input channels");
+ print_verbose("PulseAudio: input buffer frames: " + itos(input_buffer_frames) + " calculated latency: " + itos(input_buffer_frames * 1000 / mix_rate) + "ms");
return OK;
}
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 8ce0eca8c6..c381890834 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -85,7 +85,7 @@ public:
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() const;
- virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL);
+ virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL);
virtual Error kill(const ProcessID &p_pid);
virtual int get_process_id() const;
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp
index 8b342fb416..9a05284aea 100644
--- a/drivers/wasapi/audio_driver_wasapi.cpp
+++ b/drivers/wasapi/audio_driver_wasapi.cpp
@@ -342,8 +342,8 @@ Error AudioDriverWASAPI::init_render_device(bool reinit) {
// Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels)
samples_in.resize(buffer_frames * channels);
- capture_position = 0;
- capture_size = 0;
+ input_position = 0;
+ input_size = 0;
print_verbose("WASAPI: detected " + itos(channels) + " channels");
print_verbose("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
@@ -362,7 +362,7 @@ Error AudioDriverWASAPI::init_capture_device(bool reinit) {
HRESULT hr = audio_input.audio_client->GetBufferSize(&max_frames);
ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN);
- capture_buffer_init(max_frames);
+ input_buffer_init(max_frames);
return OK;
}
@@ -715,8 +715,8 @@ void AudioDriverWASAPI::thread_func(void *p_udata) {
}
}
- ad->capture_buffer_write(l);
- ad->capture_buffer_write(r);
+ ad->input_buffer_write(l);
+ ad->input_buffer_write(r);
}
read_frames += num_frames_available;