Fixes and missing changes

This commit is contained in:
Wojtek Figat
2026-02-24 17:59:42 +01:00
parent 7ea3fb1500
commit 195d5b1aa2
10 changed files with 37 additions and 26 deletions

View File

@@ -19,6 +19,7 @@ void GPUTextureViewWebGPU::Create(WGPUTexture texture, WGPUTextureViewDescriptor
LOG(Error, "Failed to create a view for texture '{}'", GetParent() ? GetParent()->GetName() : StringView::Empty);
#endif
}
Format = desc ? desc->format : wgpuTextureGetFormat(texture);
}
void GPUTextureViewWebGPU::Release()
@@ -178,18 +179,22 @@ void GPUTextureWebGPU::InitHandles()
// Init per slice views
_handlesPerSlice.Resize(Depth(), false);
viewDesc.dimension = WGPUTextureViewDimension_2D;
//viewDesc.dimension = WGPUTextureViewDimension_2DArray;
if (_desc.HasPerSliceViews() && IsRenderTarget())
{
for (int32 sliceIndex = 0; sliceIndex < Depth(); sliceIndex++)
{
//viewDesc.baseArrayLayer = sliceIndex;
//viewDesc.arrayLayerCount = 1;
auto& view = _handlesPerSlice[sliceIndex];
view.Init(this, format, msaa);
view.Create(Texture, &viewDesc);
view.DepthSlice = sliceIndex;
}
}
viewDesc.dimension = _viewDimension;
//viewDesc.baseArrayLayer = 0;
//viewDesc.arrayLayerCount = MipLevels();
//viewDesc.dimension = _viewDimension;
}
else if (IsArray())
{