Skip to content

Commit

Permalink
sokol_gfx.h wgpu: fix 3d texture view arrayLayerCount
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Sep 2, 2023
1 parent f697ca3 commit 9d18ccc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sokol_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12680,7 +12680,12 @@ _SOKOL_PRIVATE sg_resource_state _sg_wgpu_create_image(_sg_image_t* img, const s
wgpu_texview_desc.label = desc->label;
wgpu_texview_desc.dimension = _sg_wgpu_texture_view_dimension(img->cmn.type);
wgpu_texview_desc.mipLevelCount = (uint32_t)img->cmn.num_mipmaps;
wgpu_texview_desc.arrayLayerCount = (uint32_t)img->cmn.num_slices;
// FIXME: cubemap??
if (img->cmn.type == SG_IMAGETYPE_ARRAY) {
wgpu_texview_desc.arrayLayerCount = (uint32_t)img->cmn.num_slices;
} else {
wgpu_texview_desc.arrayLayerCount = 1;
}
// FIXME: should aspect be DepthOnly for all depth texture formats?
wgpu_texview_desc.aspect = WGPUTextureAspect_All;
img->wgpu.view = wgpuTextureCreateView(img->wgpu.tex, &wgpu_texview_desc);
Expand Down

0 comments on commit 9d18ccc

Please sign in to comment.