summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/SCsub2
-rw-r--r--drivers/dummy/rasterizer_dummy.h259
-rw-r--r--drivers/unix/dir_access_unix.cpp7
-rw-r--r--drivers/unix/dir_access_unix.h3
-rw-r--r--drivers/unix/os_unix.cpp17
-rw-r--r--drivers/unix/semaphore_posix.cpp87
-rw-r--r--drivers/unix/semaphore_posix.h58
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp89
-rw-r--r--drivers/vulkan/vulkan_context.cpp47
-rw-r--r--drivers/windows/dir_access_windows.cpp8
-rw-r--r--drivers/windows/dir_access_windows.h2
-rw-r--r--drivers/windows/semaphore_windows.cpp98
-rw-r--r--drivers/windows/semaphore_windows.h58
13 files changed, 250 insertions, 485 deletions
diff --git a/drivers/SCsub b/drivers/SCsub
index 932014b540..41c20d81ad 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -23,7 +23,7 @@ SConscript('coremidi/SCsub')
SConscript('winmidi/SCsub')
# Graphics drivers
-if (env["platform"] != "server"):
+if (env["platform"] != "server" and env["platform"] != "javascript"):
# SConscript('gles2/SCsub')
SConscript('vulkan/SCsub')
SConscript('gl_context/SCsub')
diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h
index fb23370863..4df28e3ea4 100644
--- a/drivers/dummy/rasterizer_dummy.h
+++ b/drivers/dummy/rasterizer_dummy.h
@@ -47,9 +47,18 @@ public:
void shadow_atlas_set_quadrant_subdivision(RID p_atlas, int p_quadrant, int p_subdivision) {}
bool shadow_atlas_update_light(RID p_atlas, RID p_light_intance, float p_coverage, uint64_t p_light_version) { return false; }
+ void directional_shadow_atlas_set_size(int p_size) {}
int get_directional_light_shadow_size(RID p_light_intance) { return 0; }
void set_directional_shadow_count(int p_count) {}
+ /* SKY API */
+
+ RID sky_create() { return RID(); }
+ void sky_set_radiance_size(RID p_sky, int p_radiance_size) {}
+ void sky_set_mode(RID p_sky, VS::SkyMode p_samples) {}
+ void sky_set_texture(RID p_sky, RID p_panorama) {}
+ void sky_set_texture(RID p_sky, RID p_cube_map, int p_radiance_size) {}
+
/* ENVIRONMENT API */
RID environment_create() { return RID(); }
@@ -61,17 +70,19 @@ public:
void environment_set_bg_color(RID p_env, const Color &p_color) {}
void environment_set_bg_energy(RID p_env, float p_energy) {}
void environment_set_canvas_max_layer(RID p_env, int p_max_layer) {}
- void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0) {}
- void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id){};
+ void environment_set_ambient_light(RID p_env, const Color &p_color, VS::EnvironmentAmbientSource p_ambient = VS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, VS::EnvironmentReflectionSource p_reflection_source = VS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) {}
+// FIXME: Disabled during Vulkan refactoring, should be ported.
+#if 0
+ void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id) {}
+#endif
- void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality) {}
- void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, VS::EnvironmentDOFBlurQuality p_quality) {}
- void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {}
+ void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale) {}
void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {}
void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) {}
- void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, VS::EnvironmentSSAOQuality p_quality, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {}
+ virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_bias, float p_light_affect, float p_ao_channel_affect, VS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {}
+ virtual void environment_set_ssao_quality(VS::EnvironmentSSAOQuality p_quality, bool p_half_size) {}
void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {}
@@ -81,9 +92,17 @@ public:
void environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_end, float p_depth_curve, bool p_transmit, float p_transmit_curve) {}
void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) {}
- bool is_environment(RID p_env) { return false; }
- VS::EnvironmentBG environment_get_background(RID p_env) { return VS::ENV_BG_KEEP; }
- int environment_get_canvas_max_layer(RID p_env) { return 0; }
+ bool is_environment(RID p_env) const { return false; }
+ VS::EnvironmentBG environment_get_background(RID p_env) const { return VS::ENV_BG_KEEP; }
+ int environment_get_canvas_max_layer(RID p_env) const { return 0; }
+
+ virtual RID camera_effects_create() { return RID(); }
+
+ virtual void camera_effects_set_dof_blur_quality(VS::DOFBlurQuality p_quality, bool p_use_jitter) {}
+ virtual void camera_effects_set_dof_blur_bokeh_shape(VS::DOFBokehShape p_shape) {}
+
+ virtual void camera_effects_set_dof_blur(RID p_camera_effects, bool p_far_enable, float p_far_distance, float p_far_transition, bool p_near_enable, float p_near_distance, float p_near_transition, float p_amount) {}
+ virtual void camera_effects_set_custom_exposure(RID p_camera_effects, bool p_enable, float p_exposure) {}
RID light_instance_create(RID p_light) { return RID(); }
void light_instance_set_transform(RID p_light_instance, const Transform &p_transform) {}
@@ -91,8 +110,7 @@ public:
void light_instance_mark_visible(RID p_light_instance) {}
RID reflection_atlas_create() { return RID(); }
- void reflection_atlas_set_size(RID p_ref_atlas, int p_size) {}
- void reflection_atlas_set_subdivision(RID p_ref_atlas, int p_subdiv) {}
+ virtual void reflection_atlas_set_size(RID p_ref_atlas, int p_reflection_size, int p_reflection_count) {}
RID reflection_probe_instance_create(RID p_probe) { return RID(); }
void reflection_probe_instance_set_transform(RID p_instance, const Transform &p_transform) {}
@@ -102,18 +120,28 @@ public:
bool reflection_probe_instance_begin_render(RID p_instance, RID p_reflection_atlas) { return false; }
bool reflection_probe_instance_postprocess_step(RID p_instance) { return true; }
- RID gi_probe_instance_create() { return RID(); }
+ virtual RID gi_probe_instance_create(RID p_gi_probe) { return RID(); }
void gi_probe_instance_set_light_data(RID p_probe, RID p_base, RID p_data) {}
void gi_probe_instance_set_transform_to_data(RID p_probe, const Transform &p_xform) {}
- void gi_probe_instance_set_bounds(RID p_probe, const Vector3 &p_bounds) {}
+ virtual bool gi_probe_needs_update(RID p_probe) const { return false; }
+ virtual void gi_probe_update(RID p_probe, bool p_update_light_instances, const Vector<RID> &p_light_instances, int p_dynamic_object_count, InstanceBase **p_dynamic_objects) {}
- void render_scene(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID *p_light_cull_result, int p_light_cull_count, RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, RID p_environment, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {}
+ virtual void render_scene(RID p_render_buffers, const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID *p_light_cull_result, int p_light_cull_count, RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, RID *p_gi_probe_cull_result, int p_gi_probe_cull_count, RID p_environment, RID p_camera_effects, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass) {}
void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count) {}
+ virtual void render_material(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID p_framebuffer, const Rect2i &p_region) {}
void set_scene_pass(uint64_t p_pass) {}
+ virtual void set_time(double p_time, double p_step) {}
void set_debug_draw_mode(VS::ViewportDebugDraw p_debug_draw) {}
+ virtual RID render_buffers_create() { return RID(); }
+ virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, VS::ViewportMSAA p_msaa) {}
+
+ virtual void screen_space_roughness_limiter_set_active(bool p_enable, float p_curve) {}
+ virtual bool screen_space_roughness_limiter_is_active() const { return false; }
+
bool free(RID p_rid) { return true; }
+ virtual void update() {}
RasterizerSceneDummy() {}
~RasterizerSceneDummy() {}
@@ -152,6 +180,43 @@ public:
mutable RID_PtrOwner<DummyTexture> texture_owner;
mutable RID_PtrOwner<DummyMesh> mesh_owner;
+ virtual RID texture_2d_create(const Ref<Image> &p_image) { return RID(); }
+ virtual RID texture_2d_layered_create(const Vector<Ref<Image> > &p_layers, VS::TextureLayeredType p_layered_type) { return RID(); }
+ virtual RID texture_3d_create(const Vector<Ref<Image> > &p_slices) { return RID(); }
+ virtual RID texture_proxy_create(RID p_base) { return RID(); }
+
+ virtual void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) {}
+ virtual void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) {}
+ virtual void texture_3d_update(RID p_texture, const Ref<Image> &p_image, int p_depth, int p_mipmap) {}
+ virtual void texture_proxy_update(RID p_proxy, RID p_base) {}
+
+ virtual RID texture_2d_placeholder_create() { return RID(); }
+ virtual RID texture_2d_layered_placeholder_create() { return RID(); }
+ virtual RID texture_3d_placeholder_create() { return RID(); }
+
+ virtual Ref<Image> texture_2d_get(RID p_texture) const { return Ref<Image>(); }
+ virtual Ref<Image> texture_2d_layer_get(RID p_texture, int p_layer) const { return Ref<Image>(); }
+ virtual Ref<Image> texture_3d_slice_get(RID p_texture, int p_depth, int p_mipmap) const { return Ref<Image>(); }
+
+ virtual void texture_replace(RID p_texture, RID p_by_texture) {}
+ virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) {}
+// FIXME: Disabled during Vulkan refactoring, should be ported.
+#if 0
+ virtual void texture_bind(RID p_texture, uint32_t p_texture_no) = 0;
+#endif
+
+ virtual void texture_set_path(RID p_texture, const String &p_path) {}
+ virtual String texture_get_path(RID p_texture) const { return String(); }
+
+ virtual void texture_set_detect_3d_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {}
+ virtual void texture_set_detect_normal_callback(RID p_texture, VS::TextureDetectCallback p_callback, void *p_userdata) {}
+ virtual void texture_set_detect_roughness_callback(RID p_texture, VS::TextureDetectRoughnessCallback p_callback, void *p_userdata) {}
+
+ virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) {}
+ virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) {}
+ virtual Size2 texture_size_with_proxy(RID p_proxy) { return Size2(); }
+
+#if 0
RID texture_create() {
DummyTexture *texture = memnew(DummyTexture);
@@ -246,11 +311,7 @@ public:
void texture_set_proxy(RID p_proxy, RID p_base) {}
virtual Size2 texture_size_with_proxy(RID p_texture) const { return Size2(); }
void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) {}
-
- /* SKY API */
-
- RID sky_create() { return RID(); }
- void sky_set_texture(RID p_sky, RID p_cube_map, int p_radiance_size) {}
+#endif
/* SHADER API */
@@ -262,6 +323,7 @@ public:
void shader_set_default_texture_param(RID p_shader, const StringName &p_name, RID p_texture) {}
RID shader_get_default_texture_param(RID p_shader, const StringName &p_name) const { return RID(); }
+ virtual Variant shader_get_param_default(RID p_material, const StringName &p_param) const { return Variant(); }
/* COMMON MATERIAL API */
@@ -269,21 +331,15 @@ public:
void material_set_render_priority(RID p_material, int priority) {}
void material_set_shader(RID p_shader_material, RID p_shader) {}
- RID material_get_shader(RID p_shader_material) const { return RID(); }
void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) {}
Variant material_get_param(RID p_material, const StringName &p_param) const { return Variant(); }
- Variant material_get_param_default(RID p_material, const StringName &p_param) const { return Variant(); }
-
- void material_set_line_width(RID p_material, float p_width) {}
void material_set_next_pass(RID p_material, RID p_next_material) {}
bool material_is_animated(RID p_material) { return false; }
bool material_casts_shadows(RID p_material) { return false; }
-
- void material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance) {}
- void material_remove_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance) {}
+ void material_update_dependency(RID p_material, RasterizerScene::InstanceBase *p_instance) {}
/* MESH API */
@@ -295,6 +351,9 @@ public:
return mesh_owner.make_rid(mesh);
}
+ void mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_surface) {}
+
+#if 0
void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const Vector<uint8_t> &p_array, int p_vertex_count, const Vector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<Vector<uint8_t> > &p_blend_shapes = Vector<Vector<uint8_t> >(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>()) {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!m);
@@ -317,6 +376,8 @@ public:
ERR_FAIL_COND(!m);
m->blend_shape_count = p_amount;
}
+#endif
+
int mesh_get_blend_shape_count(RID p_mesh) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND_V(!m, 0);
@@ -339,6 +400,7 @@ public:
void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) {}
RID mesh_surface_get_material(RID p_mesh, int p_surface) const { return RID(); }
+#if 0
int mesh_surface_get_array_len(RID p_mesh, int p_surface) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND_V(!m, 0);
@@ -404,6 +466,9 @@ public:
m->surfaces.remove(p_index);
}
+#endif
+
+ VS::SurfaceData mesh_get_surface(RID p_mesh, int p_surface) const { return VS::SurfaceData(); }
int mesh_get_surface_count(RID p_mesh) const {
DummyMesh *m = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND_V(!m, 0);
@@ -413,14 +478,14 @@ public:
void mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb) {}
AABB mesh_get_custom_aabb(RID p_mesh) const { return AABB(); }
- AABB mesh_get_aabb(RID p_mesh, RID p_skeleton) const { return AABB(); }
+ AABB mesh_get_aabb(RID p_mesh, RID p_skeleton = RID()) { return AABB(); }
void mesh_clear(RID p_mesh) {}
/* MULTIMESH API */
virtual RID multimesh_create() { return RID(); }
- void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format, VS::MultimeshCustomDataFormat p_data = VS::MULTIMESH_CUSTOM_DATA_NONE) {}
+ virtual void multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, bool p_use_colors = false, bool p_use_custom_data = false) {}
int multimesh_get_instance_count(RID p_multimesh) const { return 0; }
void multimesh_set_mesh(RID p_multimesh, RID p_mesh) {}
@@ -430,19 +495,18 @@ public:
void multimesh_instance_set_custom_data(RID p_multimesh, int p_index, const Color &p_color) {}
RID multimesh_get_mesh(RID p_multimesh) const { return RID(); }
+ AABB multimesh_get_aabb(RID p_multimesh) const { return AABB(); }
Transform multimesh_instance_get_transform(RID p_multimesh, int p_index) const { return Transform(); }
Transform2D multimesh_instance_get_transform_2d(RID p_multimesh, int p_index) const { return Transform2D(); }
Color multimesh_instance_get_color(RID p_multimesh, int p_index) const { return Color(); }
Color multimesh_instance_get_custom_data(RID p_multimesh, int p_index) const { return Color(); }
-
- void multimesh_set_as_bulk_array(RID p_multimesh, const Vector<float> &p_array) {}
+ virtual void multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_buffer) {}
+ virtual Vector<float> multimesh_get_buffer(RID p_multimesh) const { return Vector<float>(); }
void multimesh_set_visible_instances(RID p_multimesh, int p_visible) {}
int multimesh_get_visible_instances(RID p_multimesh) const { return 0; }
- AABB multimesh_get_aabb(RID p_multimesh) const { return AABB(); }
-
/* IMMEDIATE API */
RID immediate_create() { return RID(); }
@@ -490,7 +554,6 @@ public:
void light_set_use_gi(RID p_light, bool p_enabled) {}
void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {}
- void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail) {}
void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) {}
void light_directional_set_blend_splits(RID p_light, bool p_enable) {}
@@ -536,57 +599,55 @@ public:
float reflection_probe_get_origin_max_distance(RID p_probe) const { return 0.0; }
bool reflection_probe_renders_shadows(RID p_probe) const { return false; }
- void instance_add_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance) {}
- void instance_remove_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance) {}
-
- void instance_add_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance) {}
- void instance_remove_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance) {}
+ virtual void base_update_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance) {}
+ virtual void skeleton_update_dependency(RID p_base, RasterizerScene::InstanceBase *p_instance) {}
/* GI PROBE API */
RID gi_probe_create() { return RID(); }
- void gi_probe_set_bounds(RID p_probe, const AABB &p_bounds) {}
- AABB gi_probe_get_bounds(RID p_probe) const { return AABB(); }
+ virtual void gi_probe_allocate(RID p_gi_probe, const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3i &p_octree_size, const Vector<uint8_t> &p_octree_cells, const Vector<uint8_t> &p_data_cells, const Vector<uint8_t> &p_distance_field, const Vector<int> &p_level_counts) {}
- void gi_probe_set_cell_size(RID p_probe, float p_range) {}
- float gi_probe_get_cell_size(RID p_probe) const { return 0.0; }
+ virtual AABB gi_probe_get_bounds(RID p_gi_probe) const { return AABB(); }
+ virtual Vector3i gi_probe_get_octree_size(RID p_gi_probe) const { return Vector3i(); }
+ virtual Vector<uint8_t> gi_probe_get_octree_cells(RID p_gi_probe) const { return Vector<uint8_t>(); }
+ virtual Vector<uint8_t> gi_probe_get_data_cells(RID p_gi_probe) const { return Vector<uint8_t>(); }
+ virtual Vector<uint8_t> gi_probe_get_distance_field(RID p_gi_probe) const { return Vector<uint8_t>(); }
- void gi_probe_set_to_cell_xform(RID p_probe, const Transform &p_xform) {}
- Transform gi_probe_get_to_cell_xform(RID p_probe) const { return Transform(); }
+ virtual Vector<int> gi_probe_get_level_counts(RID p_gi_probe) const { return Vector<int>(); }
+ virtual Transform gi_probe_get_to_cell_xform(RID p_gi_probe) const { return Transform(); }
- void gi_probe_set_dynamic_data(RID p_probe, const Vector<int> &p_data) {}
- Vector<int> gi_probe_get_dynamic_data(RID p_probe) const {
- Vector<int> p;
- return p;
- }
+ virtual void gi_probe_set_dynamic_range(RID p_gi_probe, float p_range) {}
+ virtual float gi_probe_get_dynamic_range(RID p_gi_probe) const { return 0; }
+
+ virtual void gi_probe_set_propagation(RID p_gi_probe, float p_range) {}
+ virtual float gi_probe_get_propagation(RID p_gi_probe) const { return 0; }
- void gi_probe_set_dynamic_range(RID p_probe, int p_range) {}
- int gi_probe_get_dynamic_range(RID p_probe) const { return 0; }
+ void gi_probe_set_energy(RID p_gi_probe, float p_range) {}
+ float gi_probe_get_energy(RID p_gi_probe) const { return 0.0; }
- void gi_probe_set_energy(RID p_probe, float p_range) {}
- float gi_probe_get_energy(RID p_probe) const { return 0.0; }
+ virtual void gi_probe_set_ao(RID p_gi_probe, float p_ao) {}
+ virtual float gi_probe_get_ao(RID p_gi_probe) const { return 0; }
- void gi_probe_set_bias(RID p_probe, float p_range) {}
- float gi_probe_get_bias(RID p_probe) const { return 0.0; }
+ virtual void gi_probe_set_ao_size(RID p_gi_probe, float p_strength) {}
+ virtual float gi_probe_get_ao_size(RID p_gi_probe) const { return 0; }
- void gi_probe_set_normal_bias(RID p_probe, float p_range) {}
- float gi_probe_get_normal_bias(RID p_probe) const { return 0.0; }
+ void gi_probe_set_bias(RID p_gi_probe, float p_range) {}
+ float gi_probe_get_bias(RID p_gi_probe) const { return 0.0; }
- void gi_probe_set_propagation(RID p_probe, float p_range) {}
- float gi_probe_get_propagation(RID p_probe) const { return 0.0; }
+ void gi_probe_set_normal_bias(RID p_gi_probe, float p_range) {}
+ float gi_probe_get_normal_bias(RID p_gi_probe) const { return 0.0; }
- void gi_probe_set_interior(RID p_probe, bool p_enable) {}
- bool gi_probe_is_interior(RID p_probe) const { return false; }
+ void gi_probe_set_interior(RID p_gi_probe, bool p_enable) {}
+ bool gi_probe_is_interior(RID p_gi_probe) const { return false; }
- void gi_probe_set_compress(RID p_probe, bool p_enable) {}
- bool gi_probe_is_compressed(RID p_probe) const { return false; }
+ virtual void gi_probe_set_use_two_bounces(RID p_gi_probe, bool p_enable) {}
+ virtual bool gi_probe_is_using_two_bounces(RID p_gi_probe) const { return false; }
- uint32_t gi_probe_get_version(RID p_probe) { return 0; }
+ virtual void gi_probe_set_anisotropy_strength(RID p_gi_probe, float p_strength) {}
+ virtual float gi_probe_get_anisotropy_strength(RID p_gi_probe) const { return 0; }
- GIProbeCompression gi_probe_get_dynamic_data_get_preferred_compression() const { return GI_PROBE_UNCOMPRESSED; }
- RID gi_probe_dynamic_data_create(int p_width, int p_height, int p_depth, GIProbeCompression p_compression) { return RID(); }
- void gi_probe_dynamic_data_update(RID p_gi_probe_data, int p_depth_slice, int p_slice_count, int p_mipmap, const void *p_data) {}
+ uint32_t gi_probe_get_version(RID p_gi_probe) { return 0; }
/* LIGHTMAP CAPTURE */
struct Instantiable {
@@ -598,7 +659,7 @@ public:
SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first();
while (instances) {
- instances->self()->base_changed(p_aabb, p_materials);
+ //instances->self()->base_changed(p_aabb, p_materials);
instances = instances->next();
}
}
@@ -608,7 +669,7 @@ public:
while (instances) {
SelfList<RasterizerScene::InstanceBase> *next = instances->next();
- instances->self()->base_removed();
+ //instances->self()->base_removed();
instances = next;
}
}
@@ -697,21 +758,17 @@ public:
RID render_target_create() { return RID(); }
void render_target_set_position(RID p_render_target, int p_x, int p_y) {}
void render_target_set_size(RID p_render_target, int p_width, int p_height) {}
- RID render_target_get_texture(RID p_render_target) const { return RID(); }
+ RID render_target_get_texture(RID p_render_target) { return RID(); }
void render_target_set_external_texture(RID p_render_target, unsigned int p_texture_id) {}
void render_target_set_flag(RID p_render_target, RenderTargetFlags p_flag, bool p_value) {}
bool render_target_was_used(RID p_render_target) { return false; }
void render_target_set_as_unused(RID p_render_target) {}
- void render_target_set_msaa(RID p_render_target, VS::ViewportMSAA p_msaa) {}
-
- /* CANVAS SHADOW */
-
- RID canvas_light_shadow_buffer_create(int p_width) { return RID(); }
- /* LIGHT SHADOW MAPPING */
-
- RID canvas_light_occluder_create() { return RID(); }
- void canvas_light_occluder_set_polylines(RID p_occluder, const Vector<Vector2> &p_lines) {}
+ virtual void render_target_request_clear(RID p_render_target, const Color &p_clear_color) {}
+ virtual bool render_target_is_clear_requested(RID p_render_target) { return false; }
+ virtual Color render_target_get_clear_request_color(RID p_render_target) { return Color(); }
+ virtual void render_target_disable_clear_request(RID p_render_target) {}
+ virtual void render_target_do_clear_request(RID p_render_target) {}
VS::InstanceType get_base_type(RID p_rid) const {
if (mesh_owner.owns(p_rid)) {
@@ -748,28 +805,43 @@ public:
static RasterizerStorage *base_singleton;
- RasterizerStorageDummy(){};
+ virtual void capture_timestamps_begin() {}
+ virtual void capture_timestamp(const String &p_name) {}
+ virtual uint32_t get_captured_timestamps_count() const { return 0; }
+ virtual uint64_t get_captured_timestamps_frame() const { return 0; }
+ virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const { return 0; }
+ virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const { return 0; }
+ virtual String get_captured_timestamp_name(uint32_t p_index) const { return String(); }
+
+ RasterizerStorageDummy() {}
~RasterizerStorageDummy() {}
};
class RasterizerCanvasDummy : public RasterizerCanvas {
public:
- RID light_internal_create() { return RID(); }
- void light_internal_update(RID p_rid, Light *p_light) {}
- void light_internal_free(RID p_rid) {}
+ virtual TextureBindingID request_texture_binding(RID p_texture, RID p_normalmap, RID p_specular, VS::CanvasItemTextureFilter p_filter, VS::CanvasItemTextureRepeat p_repeat, RID p_multimesh) { return 0; }
+ virtual void free_texture_binding(TextureBindingID p_binding) {}
- void canvas_begin(){};
- void canvas_end(){};
+ virtual PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) { return 0; }
+ virtual void free_polygon(PolygonID p_polygon) {}
- void canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light, const Transform2D &p_transform){};
- void canvas_debug_viewport_shadows(Light *p_lights_with_shadow){};
+ virtual void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, const Transform2D &p_canvas_transform) {}
+ virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) {}
- void canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, CameraMatrix *p_xform_cache) {}
+ virtual RID light_create() { return RID(); }
+ virtual void light_set_texture(RID p_rid, RID p_texture) {}
+ virtual void light_set_use_shadow(RID p_rid, bool p_enable, int p_resolution) {}
+ virtual void light_update_shadow(RID p_rid, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) {}
- void reset_canvas() {}
+ virtual RID occluder_polygon_create() { return RID(); }
+ virtual void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines) {}
+ virtual void occluder_polygon_set_cull_mode(RID p_occluder, VS::CanvasOccluderPolygonCullMode p_mode) {}
void draw_window_margins(int *p_margins, RID *p_margin_textures) {}
+ virtual bool free(RID p_rid) { return true; }
+ virtual void update() {}
+
RasterizerCanvasDummy() {}
~RasterizerCanvasDummy() {}
};
@@ -789,11 +861,10 @@ public:
void initialize() {}
void begin_frame(double frame_step) {}
- void set_current_render_target(RID p_render_target) {}
- void restore_render_target(bool p_3d_was_drawn) {}
- void clear_render_target(const Color &p_color) {}
- void blit_render_target_to_screen(RID p_render_target, const Rect2 &p_screen_rect, int p_screen = 0) {}
- void 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) {}
+
+ virtual void prepare_for_blitting_render_targets() {}
+ virtual void blit_render_targets_to_screen(int p_screen, const BlitToScreen *p_render_targets, int p_amount) {}
+
void end_frame(bool p_swap_buffers) { OS::get_singleton()->swap_buffers(); }
void finalize() {}
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index 02cb4fa956..715bc56003 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -269,6 +269,11 @@ String DirAccessUnix::get_drive(int p_drive) {
return list[p_drive];
}
+bool DirAccessUnix::drives_are_shortcuts() {
+
+ return true;
+}
+
Error DirAccessUnix::make_dir(String p_dir) {
GLOBAL_LOCK_FUNCTION
@@ -337,7 +342,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
return OK;
}
-String DirAccessUnix::get_current_dir() {
+String DirAccessUnix::get_current_dir(bool p_include_drive) {
String base = _get_root_path();
if (base != "") {
diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h
index 32ddc76638..b403d8e356 100644
--- a/drivers/unix/dir_access_unix.h
+++ b/drivers/unix/dir_access_unix.h
@@ -63,9 +63,10 @@ public:
virtual int get_drive_count();
virtual String get_drive(int p_drive);
+ virtual bool drives_are_shortcuts();
virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success
- virtual String get_current_dir(); ///< return current dir location
+ virtual String get_current_dir(bool p_include_drive = true); ///< return current dir location
virtual Error make_dir(String p_dir);
virtual bool file_exists(String p_file);
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 1d94b9618d..458488f3e9 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -32,13 +32,14 @@
#ifdef UNIX_ENABLED
+#include "core/debugger/engine_debugger.h"
+#include "core/debugger/script_debugger.h"
#include "core/os/thread_dummy.h"
#include "core/project_settings.h"
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "drivers/unix/net_socket_posix.h"
#include "drivers/unix/rw_lock_posix.h"
-#include "drivers/unix/semaphore_posix.h"
#include "drivers/unix/thread_posix.h"
#include "servers/visual_server.h"
@@ -95,16 +96,16 @@ void OS_Unix::debug_break() {
};
static void handle_interrupt(int sig) {
- if (ScriptDebugger::get_singleton() == NULL)
+ if (!EngineDebugger::is_active())
return;
- ScriptDebugger::get_singleton()->set_depth(-1);
- ScriptDebugger::get_singleton()->set_lines_left(1);
+ EngineDebugger::get_script_debugger()->set_depth(-1);
+ EngineDebugger::get_script_debugger()->set_lines_left(1);
}
void OS_Unix::initialize_debugging() {
- if (ScriptDebugger::get_singleton() != NULL) {
+ if (EngineDebugger::is_active()) {
struct sigaction action;
memset(&action, 0, sizeof(action));
action.sa_handler = handle_interrupt;
@@ -121,13 +122,9 @@ void OS_Unix::initialize_core() {
#ifdef NO_THREADS
ThreadDummy::make_default();
- SemaphoreDummy::make_default();
RWLockDummy::make_default();
#else
ThreadPosix::make_default();
-#if !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED)
- SemaphorePosix::make_default();
-#endif
RWLockPosix::make_default();
#endif
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES);
@@ -307,7 +304,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
if (p_pipe_mutex) {
p_pipe_mutex->lock();
}
- (*r_pipe) += buf;
+ (*r_pipe) += String::utf8(buf);
if (p_pipe_mutex) {
p_pipe_mutex->unlock();
}
diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp
deleted file mode 100644
index b532b09cd6..0000000000
--- a/drivers/unix/semaphore_posix.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************/
-/* semaphore_posix.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "semaphore_posix.h"
-
-#if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED)
-
-#include "core/os/memory.h"
-#include <errno.h>
-#include <stdio.h>
-
-Error SemaphorePosix::wait() {
-
- while (sem_wait(&sem)) {
- if (errno == EINTR) {
- errno = 0;
- continue;
- } else {
- perror("sem waiting");
- return ERR_BUSY;
- }
- }
- return OK;
-}
-
-Error SemaphorePosix::post() {
-
- return (sem_post(&sem) == 0) ? OK : ERR_BUSY;
-}
-int SemaphorePosix::get() const {
-
- int val;
- sem_getvalue(&sem, &val);
-
- return val;
-}
-
-SemaphoreOld *SemaphorePosix::create_semaphore_posix() {
-
- return memnew(SemaphorePosix);
-}
-
-void SemaphorePosix::make_default() {
-
- create_func = create_semaphore_posix;
-}
-
-SemaphorePosix::SemaphorePosix() {
-
- int r = sem_init(&sem, 0, 0);
- if (r != 0)
- perror("sem creating");
-}
-
-SemaphorePosix::~SemaphorePosix() {
-
- sem_destroy(&sem);
-}
-
-#endif
diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h
deleted file mode 100644
index 2bffe6933d..0000000000
--- a/drivers/unix/semaphore_posix.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************/
-/* semaphore_posix.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#ifndef SEMAPHORE_POSIX_H
-#define SEMAPHORE_POSIX_H
-
-#include "core/os/semaphore.h"
-
-#if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED)
-
-#include <semaphore.h>
-
-class SemaphorePosix : public SemaphoreOld {
-
- mutable sem_t sem;
-
- static SemaphoreOld *create_semaphore_posix();
-
-public:
- virtual Error wait();
- virtual Error post();
- virtual int get() const;
-
- static void make_default();
- SemaphorePosix();
-
- ~SemaphorePosix();
-};
-
-#endif
-#endif
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index 2bf8a16091..361982b28d 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -1252,7 +1252,7 @@ Error RenderingDeviceVulkan::_buffer_allocate(Buffer *p_buffer, uint32_t p_size,
allocInfo.pUserData = NULL;
VkResult err = vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &p_buffer->buffer, &p_buffer->allocation, NULL);
- ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Can't create buffer of size: " + itos(p_size));
+ ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Can't create buffer of size: " + itos(p_size) + ", error " + itos(err) + ".");
p_buffer->size = p_size;
p_buffer->buffer_info.buffer = p_buffer->buffer;
p_buffer->buffer_info.offset = 0;
@@ -1296,7 +1296,7 @@ Error RenderingDeviceVulkan::_insert_staging_block() {
StagingBufferBlock block;
VkResult err = vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &block.buffer, &block.allocation, NULL);
- ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
+ ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "vmaCreateBuffer failed with error " + itos(err) + ".");
block.frame_used = 0;
block.fill_amount = 0;
@@ -1462,9 +1462,7 @@ Error RenderingDeviceVulkan::_buffer_update(Buffer *p_buffer, size_t p_offset, c
void *data_ptr = NULL;
{
VkResult vkerr = vmaMapMemory(allocator, staging_buffer_blocks[staging_buffer_current].allocation, &data_ptr);
- if (vkerr) {
- ERR_FAIL_V(ERR_CANT_CREATE);
- }
+ ERR_FAIL_COND_V_MSG(vkerr, ERR_CANT_CREATE, "vmaMapMemory failed with error " + itos(vkerr) + ".");
}
//copy to staging buffer
@@ -1752,7 +1750,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
Texture texture;
VkResult err = vmaCreateImage(allocator, &image_create_info, &allocInfo, &texture.image, &texture.allocation, &texture.allocation_info);
- ERR_FAIL_COND_V(err, RID());
+ ERR_FAIL_COND_V_MSG(err, RID(), "vmaCreateImage failed with error " + itos(err) + ".");
texture.type = p_format.type;
texture.format = p_format.format;
@@ -1858,7 +1856,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
if (err) {
vmaDestroyImage(allocator, texture.image, texture.allocation);
- ERR_FAIL_V(RID());
+ ERR_FAIL_V_MSG(RID(), "vkCreateImageView failed with error " + itos(err) + ".");
}
//barrier to set layout
@@ -1964,10 +1962,7 @@ RID RenderingDeviceVulkan::texture_create_shared(const TextureView &p_view, RID
}
VkResult err = vkCreateImageView(device, &image_view_create_info, NULL, &texture.view);
-
- if (err) {
- ERR_FAIL_V(RID());
- }
+ ERR_FAIL_COND_V_MSG(err, RID(), "vkCreateImageView failed with error " + itos(err) + ".");
texture.owner = p_with_texture;
RID id = texture_owner.make_rid(texture);
@@ -2065,10 +2060,7 @@ RID RenderingDeviceVulkan::texture_create_shared_from_slice(const TextureView &p
}
VkResult err = vkCreateImageView(device, &image_view_create_info, NULL, &texture.view);
-
- if (err) {
- ERR_FAIL_V(RID());
- }
+ ERR_FAIL_COND_V_MSG(err, RID(), "vkCreateImageView failed with error " + itos(err) + ".");
texture.owner = p_with_texture;
RID id = texture_owner.make_rid(texture);
@@ -2179,9 +2171,7 @@ Error RenderingDeviceVulkan::texture_update(RID p_texture, uint32_t p_layer, con
{ //map
void *data_ptr = NULL;
VkResult vkerr = vmaMapMemory(allocator, staging_buffer_blocks[staging_buffer_current].allocation, &data_ptr);
- if (vkerr) {
- ERR_FAIL_V(ERR_CANT_CREATE);
- }
+ ERR_FAIL_COND_V_MSG(vkerr, ERR_CANT_CREATE, "vmaMapMemory failed with error " + itos(vkerr) + ".");
write_ptr = (uint8_t *)data_ptr;
write_ptr += alloc_offset;
}
@@ -2468,9 +2458,7 @@ Vector<uint8_t> RenderingDeviceVulkan::texture_get_data(RID p_texture, uint32_t
void *buffer_mem;
VkResult vkerr = vmaMapMemory(allocator, tmp_buffer.allocation, &buffer_mem);
- if (vkerr) {
- ERR_FAIL_V(Vector<uint8_t>());
- }
+ ERR_FAIL_COND_V_MSG(vkerr, Vector<uint8_t>(), "vmaMapMemory failed with error " + itos(vkerr) + ".");
Vector<uint8_t> buffer_data;
{
@@ -2977,7 +2965,7 @@ VkRenderPass RenderingDeviceVulkan::_render_pass_create(const Vector<AttachmentF
VkRenderPass render_pass;
VkResult res = vkCreateRenderPass(device, &render_pass_create_info, NULL, &render_pass);
- ERR_FAIL_COND_V(res, VK_NULL_HANDLE);
+ ERR_FAIL_COND_V_MSG(res, VK_NULL_HANDLE, "vkCreateRenderPass failed with error " + itos(res) + ".");
if (r_color_attachment_count) {
*r_color_attachment_count = color_references.size();
@@ -3126,7 +3114,7 @@ RID RenderingDeviceVulkan::sampler_create(const SamplerState &p_state) {
VkSampler sampler;
VkResult res = vkCreateSampler(device, &sampler_create_info, NULL, &sampler);
- ERR_FAIL_COND_V(res, RID());
+ ERR_FAIL_COND_V_MSG(res, RID(), "vkCreateSampler failed with error " + itos(res) + ".");
return sampler_owner.make_rid(sampler);
}
@@ -3880,7 +3868,7 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages
VkResult res = vkCreateShaderModule(device, &shader_module_create_info, NULL, &module);
if (res) {
success = false;
- error_text = "Error creating shader module for stage: " + String(shader_stage_names[p_stages[i].shader_stage]);
+ error_text = "Error (" + itos(res) + ") creating shader module for stage: " + String(shader_stage_names[p_stages[i].shader_stage]);
break;
}
@@ -3920,7 +3908,7 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages
VkDescriptorSetLayout layout;
VkResult res = vkCreateDescriptorSetLayout(device, &layout_create_info, NULL, &layout);
if (res) {
- error_text = "Error creating descriptor set layout for set " + itos(i);
+ error_text = "Error (" + itos(res) + ") creating descriptor set layout for set " + itos(i);
success = false;
break;
}
@@ -3983,7 +3971,7 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages
VkResult err = vkCreatePipelineLayout(device, &pipeline_layout_create_info, NULL, &shader.pipeline_layout);
if (err) {
- error_text = "Error creating pipeline layout.";
+ error_text = "Error (" + itos(err) + ") creating pipeline layout.";
success = false;
}
}
@@ -4088,7 +4076,7 @@ RID RenderingDeviceVulkan::texture_buffer_create(uint32_t p_size_elements, DataF
VkResult res = vkCreateBufferView(device, &view_create_info, NULL, &texture_buffer.view);
if (res) {
_buffer_free(&texture_buffer.buffer);
- ERR_FAIL_V_MSG(RID(), "Unable to create buffer view");
+ ERR_FAIL_V_MSG(RID(), "Unable to create buffer view, error " + itos(res) + ".");
}
//allocate the view
@@ -4182,7 +4170,10 @@ RenderingDeviceVulkan::DescriptorPool *RenderingDeviceVulkan::_descriptor_pool_a
descriptor_pool_create_info.poolSizeCount = sizes.size();
descriptor_pool_create_info.pPoolSizes = sizes.ptr();
VkResult res = vkCreateDescriptorPool(device, &descriptor_pool_create_info, NULL, &pool->pool);
- ERR_FAIL_COND_V(res, NULL);
+ if (res) {
+ memdelete(pool);
+ ERR_FAIL_COND_V_MSG(res, NULL, "vkCreateDescriptorPool failed with error " + itos(res) + ".");
+ }
descriptor_pools[p_key].insert(pool);
}
@@ -4597,7 +4588,7 @@ RID RenderingDeviceVulkan::uniform_set_create(const Vector<Uniform> &p_uniforms,
VkResult res = vkAllocateDescriptorSets(device, &descriptor_set_allocate_info, &descriptor_set);
if (res) {
_descriptor_pool_free(pool_key, pool); // meh
- ERR_FAIL_V_MSG(RID(), "Cannot allocate descriptor sets.");
+ ERR_FAIL_V_MSG(RID(), "Cannot allocate descriptor sets, error " + itos(res) + ".");
}
UniformSet uniform_set;
@@ -4719,9 +4710,7 @@ Vector<uint8_t> RenderingDeviceVulkan::buffer_get_data(RID p_buffer) {
void *buffer_mem;
VkResult vkerr = vmaMapMemory(allocator, tmp_buffer.allocation, &buffer_mem);
- if (vkerr) {
- ERR_FAIL_V(Vector<uint8_t>());
- }
+ ERR_FAIL_COND_V_MSG(vkerr, Vector<uint8_t>(), "vmaMapMemory failed with error " + itos(vkerr) + ".");
Vector<uint8_t> buffer_data;
{
@@ -5064,7 +5053,7 @@ RID RenderingDeviceVulkan::render_pipeline_create(RID p_shader, FramebufferForma
RenderPipeline pipeline;
VkResult err = vkCreateGraphicsPipelines(device, NULL, 1, &graphics_pipeline_create_info, NULL, &pipeline.pipeline);
- ERR_FAIL_COND_V(err, RID());
+ ERR_FAIL_COND_V_MSG(err, RID(), "vkCreateGraphicsPipelines failed with error " + itos(err) + ".");
pipeline.set_formats = shader->set_formats;
pipeline.push_constant_stages = shader->push_constant.push_constants_vk_stage;
@@ -5137,7 +5126,7 @@ RID RenderingDeviceVulkan::compute_pipeline_create(RID p_shader) {
ComputePipeline pipeline;
VkResult err = vkCreateComputePipelines(device, NULL, 1, &compute_pipeline_create_info, NULL, &pipeline.pipeline);
- ERR_FAIL_COND_V(err, RID());
+ ERR_FAIL_COND_V_MSG(err, RID(), "vkCreateComputePipelines failed with error " + itos(err) + ".");
pipeline.set_formats = shader->set_formats;
pipeline.push_constant_stages = shader->push_constant.push_constants_vk_stage;
@@ -5297,7 +5286,7 @@ Error RenderingDeviceVulkan::_draw_list_setup_framebuffer(Framebuffer *p_framebu
framebuffer_create_info.layers = 1;
VkResult err = vkCreateFramebuffer(device, &framebuffer_create_info, NULL, &version.framebuffer);
- ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
+ ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "vkCreateFramebuffer failed with error " + itos(err) + ".");
p_framebuffer->framebuffers.insert(vk, version);
}
@@ -5558,7 +5547,7 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p
cmd_pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
VkResult res = vkCreateCommandPool(device, &cmd_pool_info, NULL, &split_draw_list_allocators.write[i].command_pool);
- ERR_FAIL_COND_V(res, ERR_CANT_CREATE);
+ ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "vkCreateCommandPool failed with error " + itos(res) + ".");
for (int j = 0; j < frame_count; j++) {
@@ -5573,7 +5562,7 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p
cmdbuf.commandBufferCount = 1;
VkResult err = vkAllocateCommandBuffers(device, &cmdbuf, &command_buffer);
- ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
+ ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "vkAllocateCommandBuffers failed with error " + itos(err) + ".");
split_draw_list_allocators.write[i].command_buffers.push_back(command_buffer);
}
@@ -5622,14 +5611,14 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p
if (res) {
memdelete_arr(draw_list);
draw_list = NULL;
- ERR_FAIL_V(ERR_CANT_CREATE);
+ ERR_FAIL_V_MSG(ERR_CANT_CREATE, "vkResetCommandBuffer failed with error " + itos(res) + ".");
}
res = vkBeginCommandBuffer(command_buffer, &cmdbuf_begin);
if (res) {
memdelete_arr(draw_list);
draw_list = NULL;
- ERR_FAIL_V(ERR_CANT_CREATE);
+ ERR_FAIL_V_MSG(ERR_CANT_CREATE, "vkBeginCommandBuffer failed with error " + itos(res) + ".");
}
draw_list[i].command_buffer = command_buffer;
@@ -6563,13 +6552,13 @@ void RenderingDeviceVulkan::swap_buffers() {
cmdbuf_begin.pInheritanceInfo = NULL;
VkResult err = vkResetCommandBuffer(frames[frame].setup_command_buffer, 0);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkResetCommandBuffer failed with error " + itos(err) + ".");
err = vkBeginCommandBuffer(frames[frame].setup_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->set_setup_buffer(frames[frame].setup_command_buffer); //append now so it's added before everything else
err = vkBeginCommandBuffer(frames[frame].draw_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->append_command_buffer(frames[frame].draw_command_buffer);
}
@@ -6724,7 +6713,7 @@ void RenderingDeviceVulkan::_flush(bool p_current_frame) {
cmdbuf_begin.pInheritanceInfo = NULL;
VkResult err = vkBeginCommandBuffer(frames[frame].setup_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->set_setup_buffer(frames[frame].setup_command_buffer); //append now so it's added before everything else
}
@@ -6736,7 +6725,7 @@ void RenderingDeviceVulkan::_flush(bool p_current_frame) {
cmdbuf_begin.pInheritanceInfo = NULL;
VkResult err = vkBeginCommandBuffer(frames[frame].draw_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->append_command_buffer(frames[frame].draw_command_buffer);
}
}
@@ -6773,7 +6762,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) {
cmd_pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
VkResult res = vkCreateCommandPool(device, &cmd_pool_info, NULL, &frames[i].command_pool);
- ERR_FAIL_COND(res);
+ ERR_FAIL_COND_MSG(res, "vkCreateCommandPool failed with error " + itos(res) + ".");
}
{ //create command buffers
@@ -6787,10 +6776,10 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) {
cmdbuf.commandBufferCount = 1;
VkResult err = vkAllocateCommandBuffers(device, &cmdbuf, &frames[i].setup_command_buffer);
- ERR_CONTINUE(err);
+ ERR_CONTINUE_MSG(err, "vkAllocateCommandBuffers failed with error " + itos(err) + ".");
err = vkAllocateCommandBuffers(device, &cmdbuf, &frames[i].draw_command_buffer);
- ERR_CONTINUE(err);
+ ERR_CONTINUE_MSG(err, "vkAllocateCommandBuffers failed with error " + itos(err) + ".");
}
{
@@ -6825,11 +6814,11 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) {
cmdbuf_begin.pInheritanceInfo = NULL;
VkResult err = vkBeginCommandBuffer(frames[0].setup_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->set_setup_buffer(frames[0].setup_command_buffer); //append now so it's added before everything else
err = vkBeginCommandBuffer(frames[0].draw_command_buffer, &cmdbuf_begin);
- ERR_FAIL_COND(err);
+ ERR_FAIL_COND_MSG(err, "vkBeginCommandBuffer failed with error " + itos(err) + ".");
context->append_command_buffer(frames[0].draw_command_buffer);
}
@@ -6862,7 +6851,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) {
max_descriptors_per_pool = GLOBAL_DEF("rendering/vulkan/descriptor_pools/max_descriptors_per_pool", 64);
//check to make sure DescriptorPoolKey is good
- ERR_FAIL_COND(sizeof(uint64_t) * 3 < UNIFORM_TYPE_MAX * sizeof(uint16_t));
+ static_assert(sizeof(uint64_t) * 3 >= UNIFORM_TYPE_MAX * sizeof(uint16_t));
draw_list = NULL;
draw_list_count = 0;
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index 7068f707e6..c8ff342713 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -44,7 +44,8 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define APP_SHORT_NAME "GodotEngine"
-VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(
+ VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageType,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData,
void *pUserData) {
@@ -67,24 +68,6 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(VkDebugU
return VK_FALSE;
}
- String severity_string;
- switch (messageSeverity) {
- case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
- severity_string = "VERBOSE : ";
- break;
- case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
- severity_string = "INFO : ";
- break;
- case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
- severity_string = "WARNING : ";
- break;
- case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
- severity_string = "ERROR : ";
- break;
- case VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_MAX_ENUM_EXT:
- break;
- }
-
String type_string;
switch (messageType) {
case (VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT):
@@ -133,16 +116,31 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(VkDebugU
}
}
- String error_message(severity_string + type_string +
+ String error_message(type_string +
" - Message Id Number: " + String::num_int64(pCallbackData->messageIdNumber) +
" | Message Id Name: " + pCallbackData->pMessageIdName +
"\n\t" + pCallbackData->pMessage +
objects_string + labels_string);
- ERR_PRINT(error_message);
-
- CRASH_COND_MSG(Engine::get_singleton()->is_abort_on_gpu_errors_enabled(),
- "Crashing, because abort on GPU errors is enabled.");
+ // Convert VK severity to our own log macros.
+ switch (messageSeverity) {
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
+ print_verbose(error_message);
+ break;
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
+ print_line(error_message);
+ break;
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
+ WARN_PRINT(error_message);
+ break;
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
+ ERR_PRINT(error_message);
+ CRASH_COND_MSG(Engine::get_singleton()->is_abort_on_gpu_errors_enabled(),
+ "Crashing, because abort on GPU errors is enabled.");
+ break;
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_MAX_ENUM_EXT:
+ break; // Shouldn't happen, only handling to make compilers happy.
+ }
return VK_FALSE;
}
@@ -1485,6 +1483,7 @@ VkPhysicalDeviceLimits VulkanContext::get_device_limits() const {
}
VulkanContext::VulkanContext() {
+ queue_props = NULL;
command_buffer_count = 0;
instance_validation_layers = NULL;
use_validation_layers = true;
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index 8e0eac6986..cf09f79832 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -189,7 +189,7 @@ Error DirAccessWindows::make_dir(String p_dir) {
return ERR_CANT_CREATE;
}
-String DirAccessWindows::get_current_dir() {
+String DirAccessWindows::get_current_dir(bool p_include_drive) {
String base = _get_root_path();
if (base != "") {
@@ -203,7 +203,11 @@ String DirAccessWindows::get_current_dir() {
} else {
}
- return current_dir;
+ if (p_include_drive) {
+ return current_dir;
+ } else {
+ return current_dir.right(current_dir.find(":") + 1);
+ }
}
bool DirAccessWindows::file_exists(String p_file) {
diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h
index 43951c0be9..f59e4d7030 100644
--- a/drivers/windows/dir_access_windows.h
+++ b/drivers/windows/dir_access_windows.h
@@ -69,7 +69,7 @@ public:
virtual String get_drive(int p_drive);
virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success
- virtual String get_current_dir(); ///< return current dir location
+ virtual String get_current_dir(bool p_include_drive = true); ///< return current dir location
virtual bool file_exists(String p_file);
virtual bool dir_exists(String p_dir);
diff --git a/drivers/windows/semaphore_windows.cpp b/drivers/windows/semaphore_windows.cpp
deleted file mode 100644
index 1b53e311ff..0000000000
--- a/drivers/windows/semaphore_windows.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************/
-/* semaphore_windows.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "semaphore_windows.h"
-
-#if defined(WINDOWS_ENABLED)
-
-#include "core/os/memory.h"
-
-Error SemaphoreWindows::wait() {
-
- WaitForSingleObjectEx(semaphore, INFINITE, false);
- return OK;
-}
-Error SemaphoreWindows::post() {
-
- ReleaseSemaphore(semaphore, 1, NULL);
- return OK;
-}
-int SemaphoreWindows::get() const {
- long previous;
- switch (WaitForSingleObjectEx(semaphore, 0, false)) {
- case WAIT_OBJECT_0: {
- ERR_FAIL_COND_V(!ReleaseSemaphore(semaphore, 1, &previous), -1);
- return previous + 1;
- } break;
- case WAIT_TIMEOUT: {
- return 0;
- } break;
- default: {
- }
- }
-
- ERR_FAIL_V(-1);
-}
-
-SemaphoreOld *SemaphoreWindows::create_semaphore_windows() {
-
- return memnew(SemaphoreWindows);
-}
-
-void SemaphoreWindows::make_default() {
-
- create_func = create_semaphore_windows;
-}
-
-SemaphoreWindows::SemaphoreWindows() {
-
-#ifdef UWP_ENABLED
- semaphore = CreateSemaphoreEx(
- NULL,
- 0,
- 0xFFFFFFF, //wathever
- NULL,
- 0,
- SEMAPHORE_ALL_ACCESS);
-#else
- semaphore = CreateSemaphore(
- NULL,
- 0,
- 0xFFFFFFF, //wathever
- NULL);
-#endif
-}
-
-SemaphoreWindows::~SemaphoreWindows() {
-
- CloseHandle(semaphore);
-}
-
-#endif
diff --git a/drivers/windows/semaphore_windows.h b/drivers/windows/semaphore_windows.h
deleted file mode 100644
index 159e8b3b96..0000000000
--- a/drivers/windows/semaphore_windows.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************/
-/* semaphore_windows.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#ifndef SEMAPHORE_WINDOWS_H
-#define SEMAPHORE_WINDOWS_H
-
-#include "core/os/semaphore.h"
-
-#ifdef WINDOWS_ENABLED
-
-#include <windows.h>
-
-class SemaphoreWindows : public SemaphoreOld {
-
- mutable HANDLE semaphore;
-
- static SemaphoreOld *create_semaphore_windows();
-
-public:
- virtual Error wait();
- virtual Error post();
- virtual int get() const;
-
- static void make_default();
- SemaphoreWindows();
-
- ~SemaphoreWindows();
-};
-
-#endif
-#endif