Skip to content

Commit

Permalink
Merge pull request #24 from arhik/main
Browse files Browse the repository at this point in the history
including tracy and infiltrator
  • Loading branch information
arhik authored Jul 13, 2024
2 parents 0eadcbc + 1eedef8 commit a514114
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
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

0 comments on commit a514114

Please sign in to comment.