Closed DataJuggler closed 2 years ago
Hi @DataJuggler! UWP is not mandatory, and in fact you can just open the ComputeSharp.NET.slnf
solution filter which will remove all the UWP/WinUI 3 projects from the solution, so you won't have to install any additional workloads either. What kind of operations did you want to do? If you just wanted to use the library for general compute, then WinForms would work the same as any other .NET framework, and you can just look at the existing samples. If you wanted to render some shaders, you can look at the SwapChain sample that's rendering to a swapchain attached to an HWND, though you would need to make some changes to make that work when hosted into a WinForms application. Does that help? 🙂
Thanks for the fast reply. I had never seen a .slnf solution before. Somehow that brings in projects of different types, and I don’t know how to run your sample. What project should be the Start project in your solution?
As to what do I want to do, I just have some pixel operations that take a long time, utilizing a GPU if the user has one is seems it could make it faster, but not really sure how to go about this with your project (or where is the best place in mine).
This Blazor site: https://pixeldatabase.net is powered by Nuget package DataJuggler.PixelDatabase: https://github.com/DataJuggler/PixelDatabase
Currently all my pixel operations are done in this class called DirectBitmap (much faster than a Bitmap). https://github.com/DataJuggler/PixelDatabase/blob/master/DirectBitmap.cs
Not sure how to use your GraphicsDevice class to send the processing to a GPU, but I will look over your code when I wake up a little.
Thanks,
Corby
"I had never seen a .slnf solution before"
That's a solution filter, it's just like the normal .sln
file except this only loads a subset of them. Specifically this will skip loading the UWP and WinUI 3 projects, meaning you won't need those workloads installed either in order to build the full solution in VS.
"I don’t know how to run your sample. What project should be the Start project in your solution?"
There are several samples, so you can just pick the one you prefer from the "Samples" folder in the solution explorer. For instance:
ComputeSharp.SwapChain
is a Win32 console app rendering animated shaders to a window.ComputeSharp.ImageProcessing
applies a gaussian/bokeh blur effect to an image using ComputeSharp.If you specifically want to see how to interop with the GPU to process images, that might also be interesting to you. Also, make sure to read the "working with images" section in the readme 😄
Let me know how it goes!
Thank you for the response. I will let you know my results.
Corby
Closing this for now, as the question seems to have been answered, and as mentioned there are several non-UWP samples available. Feel free to comment or open a separate issue if you still have questions! 🙂
I don't use UWP. If there is ever a Win Forms sample I could figure it out.
My Visual Studio doesn't have all the stuff, and I don't want to change VS to use one project.
Is it possible to use it Win Forms is still my question. Sorry I didn't reply, I just couldn't run your sample with all the F# and other stuff in it.
Thanks, I still need a GPU library, this just isn't for Win Forms it doesn't appear.
I'm a bit confused here. I did already say that:
ComputeSharp.SwapChain
sample and the ComputeSharp.ImageProcessing
samples are just Win32 apps, not UWP ones..slnf
file) instead of the normal solution file, and all UWP and WinUI 3 projects will simply be ignored.I wasn’t complaining, I was just stating I didn’t know to open the right one.
Somethings require a learning curve, and I move on to something else I know how to do. I will look through it again when I get time.
As per not being able to display it, what do you do, render a mp4?
Thanks
From: Sergio Pedri @.> Sent: Sunday, January 9, 2022 5:02 AM To: Sergio0694/ComputeSharp @.> Cc: Corby Nichols @.>; Mention @.> Subject: Re: [Sergio0694/ComputeSharp] Is there a WinForms sample project or tutorial? (Issue #176)
I'm a bit confused here. I did already say that:
— Reply to this email directly, view it on GitHubhttps://github.com/Sergio0694/ComputeSharp/issues/176#issuecomment-1008275570, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGI4P7PZQ7RTYCV7SKNUIODUVFTJHANCNFSM5JTRUNRQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>
"I wasn’t complaining"
No I know that, no worries! 😄 I was just genuinely confused as to whether I hadn't explained things clearly enough, is all.
"As per not being able to display it, what do you do, render a mp4?"
What I mean is just that ComputeSharp only has built-in controls to display shaders for UWP and WinUI 3, and the Win32 sample is not specifically for WinForms. It might still be possible to display things in a WinForms app by adapting code from that sample (not entirely sure, never used WinForms myself), but I'm saying there is no built-in support for that though. That said, this is just about the interactive, real-time rendering of shaders. You would still perfectly be able to eg. do some computations with ComputeSharp, render to a texture, and then display that as an image (eg. saving the texture as an image to disk, then loading that in WinForms, or using some other WinForms API to render a single image from memory). What I'm saying is that all the features from the ComputeSharp library itself have no dependencies on any specific UI framework, so they will work just fine on WinForms as on any other framework. It's just the ComputeSharp.Uwp and ComputeSharp.WinUI libraries (the one that have the built-in swap chain controls) that depend on those UI frameworks in particular 🙂
It was on my end for sure. I am sure you have it all explained. I get kind of overwhelmed when I see something new, and I am not sure where in my library is the best place to do this, even if I figure it out. It’s like putting in a floor in between 1 and 2, after the building has been built.
Thanks for the reply, and yes you can close this issue. I will dive in again soon.
Corby
From: Sergio Pedri @.> Sent: Sunday, January 9, 2022 5:35 AM To: Sergio0694/ComputeSharp @.> Cc: Corby Nichols @.>; Mention @.> Subject: Re: [Sergio0694/ComputeSharp] Is there a WinForms sample project or tutorial? (Issue #176)
"I wasn’t complaining"
No I know that, no worries! 😄 I was just genuinely confused as to whether I hadn't explained things clearly enough, is all.
"As per not being able to display it, what do you do, render a mp4?"
What I mean is just that ComputeSharp only has built-in controls to display shaders for UWP and WinUI 3, and the Win32 sample is not specifically for WinForms. It might still be possible to display things in a WinForms app by adapting code from that sample (not entirely sure, never used WinForms myself), but I'm saying there is no built-in support for that though. That said, this is just about the interactive, real-time rendering of shaders. You would still perfectly be able to eg. do some computations with ComputeSharp, render to a texture, and then display that as an image (eg. saving the texture as an image to disk, then loading that in WinForms, or using some other WinForms API to render a single image from memory). What I'm saying is that all the features from the ComputeSharp library itself have no dependencies on any specific UI framework, so they will work just fine on WinForms as on any other framework. It's just the ComputeSharp.Uwp and ComputeSharp.WinUI libraries (the one that have the built-in swap chain controls) that depend on those UI frameworks in particular 🙂
— Reply to this email directly, view it on GitHubhttps://github.com/Sergio0694/ComputeSharp/issues/176#issuecomment-1008280648, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGI4P7NXEHS4HRTAPGDRXRTUVFXHNANCNFSM5JTRUNRQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>
Are any of these tables multiple records, or are they just a single entity per test?
THanks
I want to learn this for my Nuget package PixelDatabase.Net, but I don't like UWP enough to install any project.
Thanks