-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Worked with Faless(Fabio Alessandrelli) to update server platform. #16653
Conversation
I've rebased your changes on top of my commits so It's easier to review, and nicer for the commit log. |
Looking for review and merge. |
I don't understand, what branch should be considered for merging? |
drivers/dummy/rasterizer_dummy.h
Outdated
@@ -0,0 +1,539 @@ | |||
/*************************************************************************/ | |||
/* rasterizer.h */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be rasterizer_dummy.h
(with the ending */
properly aligned after the edit).
drivers/dummy/SCsub
Outdated
|
||
Import('env') | ||
|
||
env.add_source_files(env.drivers_sources,"*.cpp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after ,
to respect PEP8.
drivers/dummy/rasterizer_dummy.h
Outdated
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/*************************************************************************/ | ||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind that's fixed in a later commit.
@@ -5,6 +5,8 @@ Import('env') | |||
|
|||
common_server = [\ | |||
"os_server.cpp",\ | |||
"#platform/x11/crash_handler_x11.cpp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for linuxbsd
platform to cleanup this mess :P
drivers/dummy/audio_driver_dummy.h
Outdated
@@ -0,0 +1,58 @@ | |||
/*************************************************************************/ | |||
/* audio_driver_dummy.h */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ending */
should be aligned with the rest.
Need an answer to @Faless' comment before that:
|
Personal opinion, override (c++11) should be used whenever implementing a virtual function. It uses the compiler to help detect if the method made is the exact method overridden. But consistency in the engine source is a good goal too. |
drivers/dummy/rasterizer_dummy.h
Outdated
@@ -39,584 +39,584 @@ | |||
|
|||
class RasterizerSceneDummy : public RasterizerScene { | |||
public: | |||
/* SHADOW ATLAS API */ | |||
/* SHADOW ATLAS API */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something went wrong here. IDE misconfiguration, or wrong version of clang-format? (We need 5.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once fixed, please squash the fixups into the last commit, as we don't really need a specific commit for those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual studio code wants to reformat everything, while msvc ide has my clang-format settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squashed.
We still have to decide the fate and rules for c++11 in the Engine, I think
we can add it later when those rules are set.
…On Feb 14, 2018 16:29, "K. S. Ernest (iFire) Lee" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In drivers/dummy/rasterizer_dummy.h
<#16653 (comment)>:
> @@ -39,584 +39,584 @@
class RasterizerSceneDummy : public RasterizerScene {
public:
- /* SHADOW ATLAS API */
+ /* SHADOW ATLAS API */
Something went wrong here. IDE misconfiguration, or wrong version of
clang-format? (We need 5.0).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16653 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABnBbquC6SD6hiw7_V_VoFygmeFzxeJsks5tUvxygaJpZM4SDENV>
.
|
For now consistency is more important, we shouldn't start doing such changes in some places based on personal preference. |
drivers/dummy/rasterizer_dummy.h
Outdated
void lightmap_capture_set_energy(RID p_capture, float p_energy) {} | ||
float lightmap_capture_get_energy(RID p_capture) const { return 0.0; } | ||
const PoolVector<RasterizerStorage::LightmapCaptureOctree> *lightmap_capture_get_octree_ptr(RID p_capture) const { | ||
PoolVector<RasterizerStorage::LightmapCaptureOctree> p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there memory leak / memory allocation bug here?
Submitted the whitespace changes, removed override and added a comment on a pointer return that looks suspicious. |
drivers/dummy/rasterizer_dummy.h
Outdated
float lightmap_capture_get_energy(RID p_capture) const { return 0.0; } | ||
const PoolVector<RasterizerStorage::LightmapCaptureOctree> *lightmap_capture_get_octree_ptr(RID p_capture) const { | ||
PoolVector<RasterizerStorage::LightmapCaptureOctree> p; | ||
return &p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there memory leak / memory allocation bug here?
No, but it returns an invalid pointer that might crash the engine or corrupts its memory if used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, probably the safest way is to implement lightmap storage properly, like I did for texture (i.e. implement create, owner, and the like)
@Faless how does this look? |
3cb632f
to
70a6b77
Compare
Tried to export a project on WSL (Windows 10)'s Ubuntu.
|
Aren't implemented. [Actually, don't know. These are inherited from OS_unix.] |
Seems to also be able to do exports of some demos I tried.
https://github.com/godotengine/godot/blob/master/editor/editor_file_system.cpp#L278 Removing these lines allowed the export to finish.
|
This is not correct, but the problem is around here. |
Well your problem is:
Then all files it tries to open will be invalid, and if there aren't null checks (like here), it will crash. But that's likely unrelated to this PR and just related to caveats of running Linux binaries on WSL. |
@@ -31,6 +28,7 @@ def get_opts(): | |||
def get_flags(): | |||
|
|||
return [ | |||
("module_mobile_vr_enabled", False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing this? There is a problem here. The mobile_vr
module registers the class MobileVRInterface
. By only enabling it on some platforms, this breaks API portability. This is specially harmful for GDNative and C#.
The code that registers the class is the following:
godot/modules/mobile_vr/register_types.cpp
Lines 35 to 41 in c432ce4
void register_mobile_vr_types() { | |
ClassDB::register_class<MobileVRInterface>(); | |
Ref<MobileVRInterface> mobile_vr; | |
mobile_vr.instance(); | |
ARVRServer::get_singleton()->add_interface(mobile_vr); | |
} |
I can imagine three different situations and the possible solutions:
Can the MobileVRInterface
class be used directly, or can it only be used through the ARVRInterface
interface?
-
If the
MobileVRInterface
class cannot be used directly from scripts and scripts only use theARVRInterface
interface then this class must not be registered manually.register_class
will expose the class to the scripting API, which must be portable. When you create an instance, the class will be registered automatically without exposing it to the scripting API. -
If
MobileVRInterface
or any of its methods from that are not registered byARVRInterface
can be used directly from scripts, then we have a different problem. One of the possible solution could be to create a dummy class. -
What confuses me the most though is that this class is not actually disabled on the desktop, only on server builds. I think this is because of the gl code in this class, am I right? If that is the case, then perhaps the solution is to surround such parts of the code with
#ifdef
s and maybe to not callARVRServer::get_singleton()->add_interface(mobile_vr)
either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you missed the irc conversation, fales replied.
<fales> neikeq seems like VR module uses GLES header
<fales> which is of course not avail in server platform
<fales> it uses LensDistortedShaderGLES3 which is defined "shaders/lens_distorted.glsl.gen.h" maybe we could guard the functions by defines. Not sure what the best solution is. There's also a comment from Mux213 about that shader and its todo state for GLES2 support. Not sure if anything changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be the third possibility I mentioned.
Can't we ifdef that code or add a dummy class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neikeq yes to both.
I think we should ask @BastiaanOlij about the GLES2 comment.
He mentions some refactoring about the shader there.
godot/modules/mobile_vr/mobile_vr_interface.cpp
Lines 300 to 305 in 4226d56
// build our shader | |
if (lens_shader == NULL) { | |
///@TODO need to switch between GLES2 and GLES3 version, Reduz suggested moving this into our drivers and making this a core shader | |
// create a shader | |
lens_shader = new LensDistortedShaderGLES3(); | |
In the meantime I'll see if we can have a dummy implementation of the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope to finally have time for this on my trip to Europe next week.
That said, for the server platform, why not change the detect.py so the module is not included on the server installation? VR is not really applicable on the server so..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BastiaanOlij we're already doing that right now, and that's the problem. The mobile_vr module exposes the class MobileVRInterface
to the scripting API. By disabling the module the scripting API for server builds becomes different to that of other target platforms. That breaks API portability. This hurts specially GDNative and C#, which rely on generating bindings.
Also doesn't this break GDScript scripts that make use MobileVRInterface
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also doesn't this break GDScript scripts that make use
MobileVRInterface
as well?
Yes, for people who uses the server
platform for exporting the game (e.g. in CI).
Ok, fair enough. I do plan to spend time on this next week, get it going on
Gles2, that may involve moving this into the render drivers after which it
can be just an empty method on the dummy driver.
On Wed, 26 Sep 2018 at 11:29 am, Fabio Alessandrelli < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In platform/server/detect.py
<#16653 (comment)>:
> @@ -31,6 +28,7 @@ def get_opts():
def get_flags():
return [
+ ("module_mobile_vr_enabled", False),
Also doesn't this break GDScript scripts that make use MobileVRInterface
as well?
Yes, for people who uses the server platform for exporting the game (e.g.
in CI).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16653 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2vadxo3DFRZFGOUJDjGtbBbAoCzcUdks5uetiTgaJpZM4SDENV>
.
|
Meanwhile, do you think #22422 can be a good temporary solution? |
For #8361
It's an updated version of the server platform. Uses dummy for the driver name. (Any name changes can be discussed elsewhere.)
Add dummy rasterizer driver.
Disable GLES builders and source from server compilation.
Add dummy texture handling.
Server platform now compiles and run on linux.
Seems to also be able to do exports of some demos I tried.
Fixes to OS_Server and DummyRasterizer to match new signatures.
Add dummy audio driver.
Update to newer api.