@@ -70,7 +70,7 @@ function createTexture(
7070
7171 textureDesc = cStruct (
7272 WGPUTextureDescriptor;
73- label = toCString (label),
73+ label = toWGPUString (label),
7474 size = textureExtent |> concrete,
7575 mipLevelCount = mipLevelCount,
7676 sampleCount = sampleCount,
@@ -121,7 +121,7 @@ function createView(gpuTexture::GPUTexture; dimension = nothing)
121121 viewDescriptor =
122122 cStruct (
123123 WGPUTextureViewDescriptor;
124- label = toCString (gpuTexture. label),
124+ label = toWGPUString (gpuTexture. label),
125125 format = gpuTexture. texInfo[" format" ],
126126 dimension = dimension,
127127 aspect = WGPUTextureAspect_All,
@@ -167,7 +167,7 @@ function createSampler(
167167)
168168 desc = cStruct (
169169 WGPUSamplerDescriptor;
170- label = toCString (label),
170+ label = toWGPUString (label),
171171 addressModeU = addressModeU,
172172 addressModeV = addressModeV,
173173 addressModeW = addressModeW,
@@ -365,7 +365,7 @@ function createBindGroupLayout(gpuDevice, label, entries)
365365 if count > 0
366366 bindGroupLayoutDesc = cStruct (
367367 WGPUBindGroupLayoutDescriptor;
368- label = toCString (label),
368+ label = toWGPUString (label),
369369 entries = count == 0 ? C_NULL : entries. cEntries |> pointer, # assuming array of entries
370370 entryCount = count,
371371 )
@@ -421,7 +421,7 @@ function createBindGroup(label, gpuDevice, bindingLayout, entries)
421421 if bindingLayout. internal[] != C_NULL && count > 0
422422 bindGroupDesc = GC. @preserve label cStruct (
423423 WGPUBindGroupDescriptor;
424- label = toCString (label),
424+ label = toWGPUString (label),
425425 layout = bindingLayout. internal[],
426426 entries = count == 0 ? C_NULL : entries. cEntries |> pointer,
427427 entryCount = count,
@@ -479,7 +479,7 @@ function createPipelineLayout(gpuDevice, label, bindingLayouts, bindings)
479479 end
480480 pipelineDescriptor = GC. @preserve bindGroupLayoutArray label cStruct (
481481 WGPUPipelineLayoutDescriptor;
482- label = toCString (label),
482+ label = toWGPUString (label),
483483 bindGroupLayouts = layoutCount == 0 ? C_NULL : bindGroupLayoutArray |> pointer,
484484 bindGroupLayoutCount = layoutCount,
485485 )
@@ -515,15 +515,15 @@ function createComputeStage(shaderModule, entryPoint::String)
515515 computeStage = cStruct (
516516 WGPUProgrammableStageDescriptor;
517517 _module = shaderModule. internal[],
518- entryPoint = toCString (entryPoint),
518+ entryPoint = toWGPUString (entryPoint),
519519 )
520520 return ComputeStage (computeStage, entryPoint)
521521end
522522
523523function createComputePipeline (gpuDevice, label, pipelinelayout, computeStage)
524524 desc = cStruct (
525525 WGPUComputePipelineDescriptor;
526- label = toCString (label),
526+ label = toWGPUString (label),
527527 layout = pipelinelayout. internal[],
528528 compute = computeStage. internal |> concrete,
529529 )
@@ -622,7 +622,7 @@ function createEntry(::Type{GPUVertexState}; args...)
622622 aRef = GC. @preserve entryPointArg bufferDescArrayPtr cStruct (
623623 WGPUVertexState;
624624 _module = shaderInternal[],
625- entryPoint = toCString (entryPointArg),
625+ entryPoint = toWGPUString (entryPointArg),
626626 buffers = length (buffers) == 0 ? C_NULL : bufferDescArrayPtr,
627627 bufferCount = length (buffers),
628628 )
@@ -786,7 +786,7 @@ function createEntry(::Type{GPUFragmentState}; args...)
786786 aref = GC. @preserve entryPointArg ctargets shader cStruct (
787787 WGPUFragmentState;
788788 _module = shader. internal[],
789- entryPoint = toCString (entryPointArg),
789+ entryPoint = toWGPUString (entryPointArg),
790790 targets = ctargets,
791791 targetCount = targetsLen,
792792 )
@@ -841,7 +841,7 @@ function createRenderPipeline(
841841
842842 pipelineDesc = GC. @preserve vertexState primitiveState depthStencilState multiSampleState fragmentState label cStruct (
843843 WGPURenderPipelineDescriptor;
844- label = toCString (label),
844+ label = toWGPUString (label),
845845 layout = pipelinelayout. internal[],
846846 vertex = vertexState[] |> concrete,
847847 primitive = primitiveState[] |> concrete,
@@ -1002,7 +1002,7 @@ end
10021002function createCommandEncoder (gpuDevice, label)
10031003 cmdEncDesc = GC. @preserve label cStruct (
10041004 WGPUCommandEncoderDescriptor;
1005- label = toCString (label),
1005+ label = toWGPUString (label),
10061006 )
10071007 commandEncoder =
10081008 wgpuDeviceCreateCommandEncoder (
@@ -1019,7 +1019,7 @@ function beginComputePass(
10191019)
10201020 desc =
10211021 GC. @preserve label cStruct (
1022- WGPUComputePassDescriptor; label = toCString (label)
1022+ WGPUComputePassDescriptor; label = toWGPUString (label)
10231023 )
10241024 computePass = wgpuCommandEncoderBeginComputePass (cmdEncoder. internal[], desc |> ptr) |> Ref
10251025 GPUComputePassEncoder (label, computePass, cmdEncoder, desc)
@@ -1044,7 +1044,7 @@ function beginRenderPass(
10441044 # Both color and depth attachments requires pointer
10451045 desc = GC. @preserve label cStruct (
10461046 WGPURenderPassDescriptor;
1047- label = toCString (label),
1047+ label = toWGPUString (label),
10481048 colorAttachments = let ca = colorAttachmentsIn
10491049 length (ca. internal[]) > 0 ? ca. internal[] : C_NULL
10501050 end ,
@@ -1098,16 +1098,16 @@ function copyBufferToTexture(
10981098 cOrigin = cStruct (WGPUOrigin3D; origin... )
10991099 cDestination =
11001100 cStruct (
1101- WGPUImageCopyTexture ;
1101+ WGPUTexelCopyTextureInfo ;
11021102 texture = source[:texture ]. internal[],
11031103 mipLevel = get (source, :mipLevel , 0 ),
11041104 origin = cOrigin |> concrete,
11051105 aspect = getEnum (WGPUTextureAspect, " All" ),
11061106 )
1107- texLayout = cStruct (WGPUTextureDataLayout ; destination[:layout ]. .. )
1107+ texLayout = cStruct (WGPUTexelCopyBufferLayout ; destination[:layout ]. .. )
11081108 cSource =
11091109 cStruct (
1110- WGPUImageCopyBuffer ;
1110+ WGPUTexelCopyBufferInfo ;
11111111 buffer = destination[:buffer ]. internal[],
11121112 layout = texLayout |> concrete,
11131113 )
@@ -1136,19 +1136,19 @@ function copyTextureToBuffer(
11361136 cOrigin = cStruct (WGPUOrigin3D; origin... )
11371137 cSource =
11381138 cStruct (
1139- WGPUImageCopyTexture ;
1139+ WGPUTexelCopyTextureInfo ;
11401140 texture = source[:texture ]. internal[],
11411141 mipLevel = get (source, :mipLevel , 0 ),
11421142 origin = cOrigin |> concrete,
11431143 aspect = getEnum (WGPUTextureAspect, " All" ),
11441144 )
11451145 textureLayout = cStruct (
1146- WGPUTextureDataLayout ;
1146+ WGPUTexelCopyBufferLayout ;
11471147 destination[:layout ]. .. , # should document these obscure
11481148 )
11491149 cDestination =
11501150 cStruct (
1151- WGPUImageCopyBuffer ;
1151+ WGPUTexelCopyBufferInfo ;
11521152 buffer = destination[:buffer ]. internal[],
11531153 layout = textureLayout |> concrete,
11541154 )
@@ -1173,7 +1173,7 @@ function copyTextureToTexture(
11731173
11741174 cSource =
11751175 cStruct (
1176- WGPUImageCopyTexture ;
1176+ WGPUTexelCopyTextureInfo ;
11771177 texture = source[:texture ]. internal[],
11781178 mipLevel = get (source, :mipLevel , 0 ),
11791179 origin = cOrigin1 |> concrete,
@@ -1185,7 +1185,7 @@ function copyTextureToTexture(
11851185
11861186 cDestination =
11871187 cStruct (
1188- WGPUImageCopyTexture ;
1188+ WGPUTexelCopyTextureInfo ;
11891189 texture = destination[:texture ]. internal[],
11901190 mipLevel = get (destination, :mipLevel , 0 ),
11911191 origin = cOrigin2 |> concrete,
@@ -1203,7 +1203,7 @@ function copyTextureToTexture(
12031203end
12041204
12051205function finish (cmdEncoder:: GPUCommandEncoder ; label = " CMD ENCODER COMMAND BUFFER " )
1206- desc = cStruct (WGPUCommandBufferDescriptor; label = toCString (label))
1206+ desc = cStruct (WGPUCommandBufferDescriptor; label = toWGPUString (label))
12071207 cmdEncoderFinish = wgpuCommandEncoderFinish (
12081208 cmdEncoder. internal[],
12091209 desc |> ptr,
@@ -1431,7 +1431,7 @@ function writeTexture(queue::GPUQueue; args...)
14311431
14321432 destination =
14331433 cStruct (
1434- WGPUImageCopyTexture ;
1434+ WGPUTexelCopyTextureInfo ;
14351435 texture = texture. internal[],
14361436 mipLevel = mipLevel,
14371437 origin = cOrigin[],
@@ -1443,7 +1443,7 @@ function writeTexture(queue::GPUQueue; args...)
14431443 end
14441444 cDataLayout =
14451445 cStruct (
1446- WGPUTextureDataLayout ;
1446+ WGPUTexelCopyBufferLayout ;
14471447 offset = offset,
14481448 bytesPerRow = bytesPerRow,
14491449 rowsPerImage = rowsPerImage,
0 commit comments