]> O.S.I.I.S - jp/vke.net.git/commitdiff
linux dll resolve for netcore
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 13 Jul 2021 10:26:51 +0000 (12:26 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 13 Jul 2021 10:26:51 +0000 (12:26 +0200)
.gitignore
.vscode/launch.json [new file with mode: 0644]
.vscode/tasks.json [new file with mode: 0644]
FUNDING.yml [new file with mode: 0644]
samples/ClearScreen/main.cs
samples/Textured/main.cs
samples/pbr/main.cs
vke/src/base/SubPass.cs

index 727a6000177b8d670c580b5d1fd02a324a5fcffd..8c080572e143af66afac07caaf0f7125bc38f726 100644 (file)
@@ -1,5 +1,4 @@
 .vs
-.vscode
 build/
 packages/
 datas
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644 (file)
index 0000000..8bb526e
--- /dev/null
@@ -0,0 +1,69 @@
+{
+       // Use IntelliSense to learn about possible attributes.
+       // Hover to view descriptions of existing attributes.
+       // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+       "version": "0.2.0",
+       "configurations": [
+               {
+                       "name": ".NET Core Launch (ClearScreen)",
+                       "type": "coreclr",
+                       "request": "launch",
+                       "preLaunchTask": "build ClearScreen",
+                       "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/ClearScreen",
+                       "args": [],
+                       "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
+                       "stopAtEntry": false,
+                       "console": "internalConsole"
+               },
+               {
+                       "name": ".NET Core Launch (Triangle)",
+                       "type": "coreclr",
+                       "request": "launch",
+                       "preLaunchTask": "build Triangle",
+                       "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/Triangle",
+                       "args": [],
+                       "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
+                       "stopAtEntry": false,
+                       "console": "internalConsole"
+               },
+               {
+                       "name": ".NET Core Launch (pbr)",
+                       "type": "coreclr",
+                       "request": "launch",
+                       "preLaunchTask": "build pbr",
+                       "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/pbr",
+                       "args": [],
+                       "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
+                       "stopAtEntry": false,
+                       "console": "internalConsole"
+               },
+               {
+                       "name": ".NET Core Launch (deferred)",
+                       "type": "coreclr",
+                       "request": "launch",
+                       "preLaunchTask": "build deferred",
+                       "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/deferred",
+                       "args": [],
+                       "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
+                       "stopAtEntry": false,
+                       "console": "internalConsole"
+               },
+               {
+                       "name": ".NET Core Launch (console)",
+                       "type": "coreclr",
+                       "request": "launch",
+                       "preLaunchTask": "build",
+                       "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/Triangle",
+                       "args": [],
+                       "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
+                       "console": "internalConsole",
+                       "stopAtEntry": false
+               },
+               {
+                       "name": ".NET Core Attach",
+                       "type": "coreclr",
+                       "request": "attach",
+                       "processId": "${command:pickProcess}"
+               }
+       ]
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644 (file)
index 0000000..1c80658
--- /dev/null
@@ -0,0 +1,90 @@
+{
+       "version": "2.0.0",
+       "tasks": [
+               {
+                       "label": "build Triangle",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "build",
+                               "${workspaceFolder}/samples/Triangle/Triangle.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               },
+               {
+                       "label": "build ClearScreen",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "build",
+                               "${workspaceFolder}/samples/ClearScreen/ClearScreen.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               },
+               {
+                       "label": "build pbr",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "build",
+                               "${workspaceFolder}/samples/pbr/pbr.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               },
+               {
+                       "label": "build deferred",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "build",
+                               "${workspaceFolder}/samples/deferred/deferred.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               },
+               {
+                       "label": "publish",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "publish",
+                               "${workspaceFolder}/samples/Triangle/Triangle.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               },
+               {
+                       "label": "watch",
+                       "command": "dotnet",
+                       "type": "process",
+                       "args": [
+                               "watch",
+                               "run",
+                               "${workspaceFolder}/samples/Triangle/Triangle.csproj",
+                               "/property:GenerateFullPaths=true",
+                               "/property:SolutionDir=${workspaceFolder}/",
+                               "/property:Configuration=Debug",
+                               "/consoleloggerparameters:NoSummary"
+                       ],
+                       "problemMatcher": "$msCompile"
+               }
+       ]
+}
\ No newline at end of file
diff --git a/FUNDING.yml b/FUNDING.yml
new file mode 100644 (file)
index 0000000..253a06e
--- /dev/null
@@ -0,0 +1 @@
+custom: "https://www.paypal.me/GrandTetraSoftware"
index c343e993d943491fec92872222acd3fa1350a645..2792850559cda26361850ecb591b08be14aea608 100644 (file)
@@ -6,7 +6,7 @@ using Vulkan;
 
 //Most simple example of the `VkWindow` class usage to output something on screen.
 namespace ClearScreen {
-       class Program : VkWindow {
+       class Program : SampleBase {
                //excutable entry point
                static void Main (string[] args) {
                        //the base constructor will create the window with GLFW
index b9a86623db2001eef17f30d51b985f3d5488a6e8..31337f40b3fb0a9c1fc1a5247bc5a5f57054ba0f 100644 (file)
@@ -59,7 +59,7 @@ namespace Textured {
                ushort[] indices = { 0, 1, 2, 2, 0, 3 };
                int currentImgIndex = 0;
                string[] imgPathes = {
-                       vke.samples.Utils.GetDataFile ("models/Bricks16_col.jpg"),
+                       vke.samples.Utils.GetDataFile ("textures/texspace256.jpg"),
                        vke.samples.Utils.GetDataFile ("textures/texturearray_rocks_bc3_unorm.ktx"),
                        vke.samples.Utils.GetDataFile ("textures/texture.jpg"),
                        vke.samples.Utils.GetDataFile ("textures/tex256.jpg"),
index 80eb0aa591219b60a77cb55a459ecae4e0e0c0a5..4c31ad307b7daba07250957e389bb2db7da5ba6b 100644 (file)
@@ -46,7 +46,7 @@ namespace pbrSample {
                bool queryUpdatePrefilCube, showDebugImg;
 
                Vector4 lightPos = new Vector4 (1, 0, 0, 0);
-               uint curModelIndex = 13;
+               uint curModelIndex = 0;
 
                protected override void initVulkan () {
                        base.initVulkan ();
index 9a7fbb6e7a1f608540ac2891971ff62f98bd496b..a7b511d926724c9849c2b0e5638b05b972f48e77 100644 (file)
@@ -9,7 +9,7 @@ namespace vke {
                public uint Index { get; internal set; }
                List<VkAttachmentReference> colorRefs = new List<VkAttachmentReference>();
         List<VkAttachmentReference> inputRefs = new List<VkAttachmentReference>();
-        MarshaledObject<VkAttachmentReference> depthRef;
+        public VkAttachmentReference? DepthReference;
         List<VkAttachmentReference> resolveRefs = new List<VkAttachmentReference>();
         List<uint> preservedRefs = new List<uint>();
 
@@ -44,19 +44,12 @@ namespace vke {
                public void AddResolveReference (uint attachment, VkImageLayout layout = VkImageLayout.ColorAttachmentOptimal) {
                        AddResolveReference (new VkAttachmentReference { attachment = attachment, layout = layout });
                }
-               public VkAttachmentReference DepthReference {
-            set {
-                if (depthRef != null)
-                    depthRef.Dispose ();
-                depthRef = new MarshaledObject<VkAttachmentReference> (value);
-            }
-        }
 
                /// <summary>
                /// after having fetched the vkSubpassDescription structure, the lists of attachment are pinned,
                /// so it is mandatory to call the UnpinLists methods after.
                /// </summary>
-               public VkSubpassDescription SubpassDescription {
+               internal VkSubpassDescription SubpassDescription {
             get {
                 VkSubpassDescription subpassDescription = new VkSubpassDescription ();
                 subpassDescription.pipelineBindPoint = VkPipelineBindPoint.Graphics;
@@ -75,14 +68,14 @@ namespace vke {
                                if (resolveRefs.Count > 0)
                                        subpassDescription.pResolveAttachments = resolveRefs.Pin ();
 
-                               if (depthRef != null)
-                    subpassDescription.pDepthStencilAttachment = depthRef.Pointer;
+                               if (DepthReference.HasValue)
+                    subpassDescription.pDepthStencilAttachment = DepthReference.Value.Pin();
 
                 return subpassDescription;
             }        
         }
 
-               public void UnpinLists () {
+               internal void UnpinLists () {
                        if (colorRefs.Count > 0) 
                                colorRefs.Unpin (); 
                        if (inputRefs.Count > 0)                        
@@ -91,6 +84,8 @@ namespace vke {
                                preservedRefs.Unpin ();
                        if (resolveRefs.Count > 0)
                                resolveRefs.Unpin ();
+            if (DepthReference.HasValue)
+                DepthReference.Unpin();
                }
 
                public static implicit operator uint(SubPass sp) => sp.Index;