diff --git a/src/Aardvark.Rendering.Vulkan/Core/Platform.fs b/src/Aardvark.Rendering.Vulkan/Core/Platform.fs index 8f9cebfd..e326b3ac 100644 --- a/src/Aardvark.Rendering.Vulkan/Core/Platform.fs +++ b/src/Aardvark.Rendering.Vulkan/Core/Platform.fs @@ -38,6 +38,8 @@ module Instance = let ShaderSubgroupVote = EXTShaderSubgroupVote.Name let ShaderSubgroupBallot = EXTShaderSubgroupBallot.Name + let ConservativeRasterization = EXTConservativeRasterization.Name + let Debug = [ EXTDebugReport.Name EXTDebugUtils.Name diff --git a/src/Aardvark.Rendering.Vulkan/Management/ResourceManager.fs b/src/Aardvark.Rendering.Vulkan/Management/ResourceManager.fs index 83bd8e3e..2373b1e3 100644 --- a/src/Aardvark.Rendering.Vulkan/Management/ResourceManager.fs +++ b/src/Aardvark.Rendering.Vulkan/Management/ResourceManager.fs @@ -966,7 +966,8 @@ module Resources = inherit AbstractPointerResourceWithEquality(owner, key) override x.Free(info : VkPipelineRasterizationStateCreateInfo) = - Marshal.FreeHGlobal info.pNext + if info.pNext <> 0n then + Marshal.FreeHGlobal info.pNext override x.Compute(user, token, renderToken) = let depthClamp = depthClamp.GetValue(user, token, renderToken) @@ -977,18 +978,23 @@ module Resources = let conservativeRaster = conservativeRaster.GetValue(user, token, renderToken) let state = RasterizerState.create conservativeRaster depthClamp bias cull front fill - let conservativeRaster = - VkPipelineRasterizationConservativeStateCreateInfoEXT( - VkPipelineRasterizationConservativeStateCreateFlagsEXT.None, - (if conservativeRaster then VkConservativeRasterizationModeEXT.Overestimate else VkConservativeRasterizationModeEXT.Disabled), - 0.0f - ) + let pConservativeRaster = + if conservativeRaster then + let info = + VkPipelineRasterizationConservativeStateCreateInfoEXT( + VkPipelineRasterizationConservativeStateCreateFlagsEXT.None, + VkConservativeRasterizationModeEXT.Overestimate, + 0.0f + ) - let pConservativeRaster = NativePtr.alloc 1 - conservativeRaster |> NativePtr.write pConservativeRaster + let ptr = NativePtr.alloc 1 + info |> NativePtr.write ptr + NativePtr.toNativeInt ptr + else + 0n VkPipelineRasterizationStateCreateInfo( - NativePtr.toNativeInt pConservativeRaster, + pConservativeRaster, VkPipelineRasterizationStateCreateFlags.None, (if state.depthClampEnable then 1u else 0u), (if state.rasterizerDiscardEnable then 1u else 0u), diff --git a/src/Aardvark.Rendering.Vulkan/Runtime/Headless.fs b/src/Aardvark.Rendering.Vulkan/Runtime/Headless.fs index 14aa5895..31947f3d 100644 --- a/src/Aardvark.Rendering.Vulkan/Runtime/Headless.fs +++ b/src/Aardvark.Rendering.Vulkan/Runtime/Headless.fs @@ -14,6 +14,7 @@ type HeadlessVulkanApplication(debug : IDebugConfig, instanceExtensions : list attr - | None _ -> failf "could not find vertex attribute '%A'" semantic + | None -> failf "could not find vertex attribute '%A'" semantic member x.TryGetFaceAttribute(semantic : Symbol) = faceAttributeBuffers |> Map.tryFind semantic @@ -781,7 +781,7 @@ and ManagedTracePool(runtime : IRuntime, signature : TraceObjectSignature, member x.GetFaceAttribute(semantic : Symbol) = match x.TryGetFaceAttribute semantic with | Some attr -> attr - | None _ -> failf "could not find face attribute '%A'" semantic + | None -> failf "could not find face attribute '%A'" semantic member x.TryGetGeometryAttribute(semantic : Symbol) = geometryAttributeBuffers |> Map.tryFind semantic @@ -790,7 +790,7 @@ and ManagedTracePool(runtime : IRuntime, signature : TraceObjectSignature, member x.GetGeometryAttribute(semantic : Symbol) = match x.TryGetGeometryAttribute semantic with | Some attr -> attr - | None _ -> failf "could not find geometry attribute '%A'" semantic + | None -> failf "could not find geometry attribute '%A'" semantic member x.TryGetInstanceAttribute(semantic : Symbol) = instanceAttributeBuffers |> Map.tryFind semantic @@ -799,7 +799,7 @@ and ManagedTracePool(runtime : IRuntime, signature : TraceObjectSignature, member x.GetInstanceAttribute(semantic : Symbol) = match x.TryGetInstanceAttribute semantic with | Some attr -> attr - | None _ -> failf "could not find instance attribute '%A'" semantic + | None -> failf "could not find instance attribute '%A'" semantic member x.Dispose() = lock x (fun _ -> diff --git a/src/Application/Aardvark.Application.WinForms.Vulkan/Application.fs b/src/Application/Aardvark.Application.WinForms.Vulkan/Application.fs index 09c7aa62..56b1cef8 100644 --- a/src/Application/Aardvark.Application.WinForms.Vulkan/Application.fs +++ b/src/Application/Aardvark.Application.WinForms.Vulkan/Application.fs @@ -102,6 +102,7 @@ type VulkanApplication(debug : IDebugConfig, chooseDevice : list yield Instance.Extensions.ShaderSubgroupVote yield Instance.Extensions.ShaderSubgroupBallot yield Instance.Extensions.GetPhysicalDeviceProperties2 + yield Instance.Extensions.ConservativeRasterization yield! Instance.Extensions.Raytracing yield! Instance.Extensions.Sharing