Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

including tracy and infiltrator #24

Merged
merged 3 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/deps/cocoa.dylib
/deps/*.tar.gz
.DS_Store
*.wgsl
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ version = "0.1.5"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Tracy = "e689c965-62c8-4b79-b2c5-8359227902fd"
WGPUNative = "c14bfd16-04f9-4c2f-a915-b355584b5509"

[compat]
Expand Down
2 changes: 2 additions & 0 deletions src/WGPUCore.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module WGPUCore

using CEnum
using Infiltrator
using Tracy

include("utils.jl")
include("log.jl")
Expand Down
10 changes: 5 additions & 5 deletions src/buffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function mapWrite(gpuBuffer::GPUBuffer, data)
@cfunction(bufferCallback, Cvoid, (WGPUBufferMapAsyncStatus, Ptr{Cvoid}))

wgpuBufferMapAsync(
gpuBuffer.internal,
gpuBuffer.internal[],
WGPUMapMode_Write,
0,
bufferSize,
Expand All @@ -81,18 +81,18 @@ end

function createBuffer(label, gpuDevice, bufSize, usage, mappedAtCreation)
labelPtr = toCString(label)
desc = cStruct(
@tracepoint "bufferDesc" desc = cStruct(
WGPUBufferDescriptor;
label = labelPtr,
size = bufSize,
usage = getEnum(WGPUBufferUsage, usage),
mappedAtCreation = mappedAtCreation,
)
buffer = GC.@preserve labelPtr wgpuDeviceCreateBuffer(
@tracepoint "CreateBuffer" buffer = wgpuDeviceCreateBuffer(
gpuDevice.internal[],
desc |> ptr,
) |> Ref
GPUBuffer(label, buffer, gpuDevice, bufSize, usage, desc)
)
GPUBuffer(label, buffer |> Ref, gpuDevice, bufSize, usage, desc)
end

function createBufferWithData(gpuDevice, label, data, usage)
Expand Down
Loading