From 901b792a693bf2a2d0a31fc926359c400238af16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 13 Jul 2021 12:26:51 +0200 Subject: [PATCH] linux dll resolve for netcore --- .gitignore | 1 - .vscode/launch.json | 69 ++++++++++++++++++++++++++++ .vscode/tasks.json | 90 +++++++++++++++++++++++++++++++++++++ FUNDING.yml | 1 + samples/ClearScreen/main.cs | 2 +- samples/Textured/main.cs | 2 +- samples/pbr/main.cs | 2 +- vke/src/base/SubPass.cs | 19 +++----- 8 files changed, 170 insertions(+), 16 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 FUNDING.yml diff --git a/.gitignore b/.gitignore index 727a600..8c08057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .vs -.vscode build/ packages/ datas diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8bb526e --- /dev/null +++ b/.vscode/launch.json @@ -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 index 0000000..1c80658 --- /dev/null +++ b/.vscode/tasks.json @@ -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 index 0000000..253a06e --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1 @@ +custom: "https://www.paypal.me/GrandTetraSoftware" diff --git a/samples/ClearScreen/main.cs b/samples/ClearScreen/main.cs index c343e99..2792850 100644 --- a/samples/ClearScreen/main.cs +++ b/samples/ClearScreen/main.cs @@ -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 diff --git a/samples/Textured/main.cs b/samples/Textured/main.cs index b9a8662..31337f4 100644 --- a/samples/Textured/main.cs +++ b/samples/Textured/main.cs @@ -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"), diff --git a/samples/pbr/main.cs b/samples/pbr/main.cs index 80eb0aa..4c31ad3 100644 --- a/samples/pbr/main.cs +++ b/samples/pbr/main.cs @@ -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 (); diff --git a/vke/src/base/SubPass.cs b/vke/src/base/SubPass.cs index 9a7fbb6..a7b511d 100644 --- a/vke/src/base/SubPass.cs +++ b/vke/src/base/SubPass.cs @@ -9,7 +9,7 @@ namespace vke { public uint Index { get; internal set; } List colorRefs = new List(); List inputRefs = new List(); - MarshaledObject depthRef; + public VkAttachmentReference? DepthReference; List resolveRefs = new List(); List preservedRefs = new List(); @@ -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 (value); - } - } /// /// after having fetched the vkSubpassDescription structure, the lists of attachment are pinned, /// so it is mandatory to call the UnpinLists methods after. /// - 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; -- 2.47.3