-
Notifications
You must be signed in to change notification settings - Fork 38
Updated to .NET 4.5.2 and to work with SharpDX 3.0.0 #4
base: master
Are you sure you want to change the base?
Conversation
OK, I fixed that issue with fonts. It was my mistake. Everything is running for me now as it did before in version 2.6.x. No changes required in end-project (except for new Toolkit assemblies obviously). Update: There's a link to download binaries on my fork Wiki (only one page). You can try it out. |
Someone as already started a similar work #3, Ideally I would prefer If you could join the effort with @tomba I guess that you share basically the same goals?!
|
Hi, thank you for your response. #3 was exactly the reason I started to make modifications, because 1) it's not a pull request by its own admission, 2) it uses Pin instead of Fixed, 3) it didn't solve the main problem ("solved" with calling internal methods) Toolkit had.
To allow processing of new Native class (copy of now internal Interop). So I agree it (Fixed) requires almost no change.
New Toolkit will probably lack many of new features (DirectX12), but those can be access directly via SharpDX if one must. I'm using parts of Toolkit, because it contains many classes I would be forced to write anyway without it (I'm talking about hundred of them). I believe many people using Toolkit will be in a similar predicament. So it's cheaper for me to maintain whole Toolkit than split it to separate library with a possible rewrite to better suit my needs. Just to illustrate my motivations a bit. |
Huge commits combined with re-indenting the files make these quite impossible to review. Anyway, one of the motivations with my changes was that Toolkit should be just another library using SharpDX. If Toolkit can't be implemented without pulling in internal SharpDX code, using reflection, etc., how can we expect other users to use SharpDX efficiently... |
I don't understand the csproj diffs either. It's caused by just opening (or saving) it in VS2015 I think. But when I look at the indentation it seems to be the same (might be tab indentation though). I don't see that much difference to warrant for a all red/green diff. There were not that much changes and they're usually quite distinct. All the csproj should be basically the same. About the internal methods. The problem is that Toolkit is built with certain logic in mind and it is based on pointers and methods using pointers in SharpDX. People can use SharpDX quite well (better even) if they know from the beginning that they'll be using classes (not pointers). For Toolkit this would mean to rewrite it or at least a very large refactoring. |
tomba, xoofx already said he would be fine with making those internal methods public. So I don't see why that should be any kind of issue. I will happily submit a PR to SharpDX itself to make those methods public. I pulled this and now I see the situation. It looks like the only change to SharpDX itself is the Mapping.xml changes. The internal methods called via reflection are:
xoofx, would you accept a PR for SharpDX itself, to make those methods public and bring over the Mapping.xml change from this PR? SmartK8, would you accept a PR for your repository that drops the SharpDX project references and replaces them with assembly references? I am going to try that locally to see if I can get your toolkit repo building against the local SharpDX 3.0.2 assemblies I just built. I have pulled your PR and I went ahead and dropped the source project references, replacing them with binary references to my SharpDX build. I then went and added public methods for the internal methods above. I thought I could just make them public directly, but it turns out the base internal methods are generated. So instead I created new public methods by appending "IntPtr" -- e.g. CommonShaderStage.SetConstantBuffersIntPtr and so on. Now I am down to only these compile errors in SmartK8/Toolkit:
The INotifyPropertyChanged error is really the weirdest one in the list. There is no such type anywhere in SharpDX or the Toolkit, and it seems to be a standard type in System.ComponentModel, so I have no idea why the toolkit is complaining about it when trying to call the base GameSystem constructor. Native.cs is indeed missing from the repository. And I am not sure what is up with all the app.config complaints. SmartK8, are you still out there? Here's hoping :-) |
Hi, first of all.. I'm still here ;)
regards, |
Sorry for delay in replying! I am juggling work on an FNA port of my app with work on the SharpDX toolkit. My first attempt at FNA ran smack into a threading issue, so now I want to put some more time in on SharpDX :-) It is great you are still here, thanks very much for your helpful reply.
I am making more progress, but I have encountered another issue you may be able to help with. At line 307 of Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs the current code is:
I modified this to add a new SetUnorderedAccessViewsIntPtr method, called as such:
However, this does not compile, because the underlying method actually takes four arguments. From sharpdx\source\sharpdx.direct3d11\devicecontext.commonshaderstage.cs near the end of the CommonShaderStage class:
The internal method was the one previously being called by reflection, though -- it appears -- with one argument too few. So my question is: what would happen if a reflective call had one argument too few? Would .NET reflection fill in a null for the final IntPtr argument? For now I am simply passing pLinks->UavInitialCount as the final argument; we will see how far that gets me :-) Similarly, these lines:
I can find no method on OutputMergerStage named "SetUnorderedAccessViews" with the signature (int, int, IntPtr, IntPtr). The closest method I can find is:
Is that the correct method? For now I am commenting out these calls to mergerStage.SetUnorderedAccessViews. And finally it looks like there is just one more gosh darn missing app.config file:
But this is the only failure; the actual Toolkit DLLs all build now with only binary dependencies on SharpDX! So this is real progress! I need to time out for tonight, but I will work on pushing these changes as pull requests to both the SharpDX and SmartK8 repositories, once I validate that the SharpDX.Toolkit works at all. I will also try running the tests once I get that final missing app.config file from you. Thanks again! |
I've actually pushed my SharpDX changes to https://github.com/RobJellinghaus/SharpDX and my fork of your repository to https://github.com/RobJellinghaus/SharpDX.Toolkit -- feel free to have a look if you are curious :-) |
I am having an issue with bringing up my app with the above branch of the toolkit and SharpDX. I get an exception thrown during static initialization of SharpDX.Toolkit.Graphics.dll. Specifically, this one:
The call stack is:
So this is the static constructor for PrimitiveQuad defined in SharpDX.Toolkit.Graphics/StockEffects/HLSL/PrimitiveQuad.fx:
The problem is really the final line shown below of the beginning of the EffectData.Shader.Serialize method:
CompilerFlags is of type EffectCompilerFlags defined in SharpDX.Toolkit/Graphics/EffectCompilerFlags.cs. So the problem is there is no instantiation of The comment to the SharpDX.Toolkit/Native.cs Native class is:
So it looks like the post-build InteropBuilder step described there is not working properly. Or else there is something else wrong :-) However, the build output looks like it thinks it is successful at running InteropBuilder on SharpDX.Toolkit:
Yet the resulting SharpDX.Toolkit.dll definitely has no implementations of Will keep debugging on this, but if anyone knows the likely issue offhand, by all means please reply! Thanks. |
The Native.cs is indeed not implemented and is filled using AfterBuild target with SharpCLI.exe. You might need to modify the SharpCLI in tools and change the lines (also check whether targets file contains SharpCLI.exe Exec.. it should): 563 if (method.DeclaringType.Name == "Interop" || method.DeclaringType.Name == "Native") It's kinda tough, because I've said I have whole SharpDX build environment set up. AFAIK the Tools folder is not part of this branch. regards, |
Thank you so much for that tip. It was exactly what I needed. I was able to patch SharpCLI as you suggested in my fork of SharpDX, and then copy it into my fork of the Toolkit. This got around all issues with Native.Fixed. I was then able to fix a bug in my interop code (simply calling the wrong method), and then in very short order I had everything working -- my app lives again on Windows 10! And as a bonus, I have a Toolkit fork that successfully builds and runs with only binary dependencies on the SharpDX DLLs. I think this is ready to make a pull request for. However, @xoofx has not chimed in here in a while. Alexandre, are you interested in an update to this PR, in the form of a working Toolkit project that has only binary SharpDX dependencies (not integrated in the same source tree)? There may still be more cleanup you would like, but I could put some time into this. Or, if the toolkit is no longer interesting to you, anyone curious can pull from my forks at http://github.com/RobJellinghaus and get what I am currently running in my app. Thanks again really very much for your invaluable assistance, SmartK8. My users and I are very grateful! |
Hi there, sorry, I'm following this not very closely. Personally (and professionally), I'm no longer using the Toolkit (nor even SharpDX), but I will merge PR for sure, once they are clean and ready. Quick glance, no need to rename Interop to Native as it implies to patch SharpCli which is unnecessary, just keep Interop name in the Toolkit and this should work just fine. |
@RobJellinghaus: I'm glad you made it work. @xoofx: Agreed. I originally did it to make sure, I was using the right class - to avoid being mixed up with the original Interop. But at this point it can be renamed back, I guess. I've made it primarily for myself and Rob has his own fork for himself. At this point it's getting scattered. Everyone is making their own version/build. It would be great to have at least an illusion of "official" version. I don't know what Rob fixed. But if he built on top of my fork + some fixes + he renames Native => Interop, it would be better to use his fork (his eventual PR). Or I can incorporate his changes in this PR. I'm fine with either way. Just let me know. I would then build "official" binaries for SharpDX Toolkit 3.0.0.0 for people who just want to use it and not mess with source code. If there even are any people using it left beside us :D regards, |
I'm looking at getting a VB.net fork up here soon, there are some parts of the toolkit just like in mainline sharpDX that need fixing too. I'm not sure how to best go about it..... Just remove any of the none byref functions or do we need the none byref functions? how should I handle this? Right now I'm just removing the none byref stuff, seems to work ok but I'm not sure what you C# guys want to do. |
If xoofx is moving on, it may be useful to have one of you guys take more of a leadership role in maintaining this project. It'd be nice to merge any of these changes that makes the project compatible with SharpDX 3, release a beta nuget package, and then make and release incremental updates as code is improved and issues are fixed. @RobJellinghaus seems to have the most recent fork. Would we be good merging that and moving from there? Rob, could you make a pull request? |
Hi, nobody was raising to a challenge so I did my humble fork. These are some changes I did:
Still remains: Fonts were not visible in my game, I still need to determine whether it's caused by SharpDX or something trivial.
This is my first fork, first pull request, first time with GIT. I hope I didn't messed up something. It just I really need SharpDX Toolkit to be up-to-date. It works with my quite complex project (2D isometric game in early stages). I didn't noticed any slow downs or problems, but I don't use all of the things from Toolkit so let me know.