Skip to content

Commit

Permalink
wgpu: Fail if a 1d texture with more than one MIP level is requested (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aleino-nv authored Nov 19, 2024
1 parent ed04b02 commit e6329ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wgpu/wgpu-texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Result DeviceImpl::createTexture(const TextureDesc& desc_, const SubresourceData
{
TextureDesc desc = fixupTextureDesc(desc_);

// WebGPU only supports 1 MIP level for 1d textures
// https://www.w3.org/TR/webgpu/#abstract-opdef-maximum-miplevel-count
if ((desc.type == TextureType::Texture1D) && (desc.mipLevelCount > 1))
{
return SLANG_FAIL;
}

RefPtr<TextureImpl> texture = new TextureImpl(this, desc);
WGPUTextureDescriptor textureDesc = {};
textureDesc.size.width = desc.size.width;
Expand Down

0 comments on commit e6329ef

Please sign in to comment.