|
92 | 92 | COPY_STRIDE_UNDEFINED: 0xFFFFFFFF, |
93 | 93 | LIMIT_U32_UNDEFINED: 0xFFFFFFFF, |
94 | 94 | WHOLE_MAP_SIZE: 0xFFFFFFFF, // use 32-bit uint max |
| 95 | + MIP_LEVEL_COUNT_UNDEFINED: 0xFFFFFFFF, |
| 96 | + ARRAY_LAYER_COUNT_UNDEFINED: 0xFFFFFFFF, |
95 | 97 | AdapterType: { |
96 | 98 | Unknown: 3, |
97 | 99 | }, |
@@ -1975,15 +1977,17 @@ var LibraryWebGPU = { |
1975 | 1977 | var desc; |
1976 | 1978 | if (descriptor) { |
1977 | 1979 | {{{ gpu.makeCheckDescriptor('descriptor') }}} |
| 1980 | + var mipLevelCount = {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.mipLevelCount) }}}; |
| 1981 | + var arrayLayerCount = {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.arrayLayerCount) }}}; |
1978 | 1982 | desc = { |
1979 | 1983 | "format": WebGPU.TextureFormat[ |
1980 | 1984 | {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.format) }}}], |
1981 | 1985 | "dimension": WebGPU.TextureViewDimension[ |
1982 | 1986 | {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.dimension) }}}], |
1983 | 1987 | "baseMipLevel": {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.baseMipLevel) }}}, |
1984 | | - "mipLevelCount": {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.mipLevelCount) }}}, |
| 1988 | + "mipLevelCount": mipLevelCount === {{{ gpu.MIP_LEVEL_COUNT_UNDEFINED }}} ? undefined : mipLevelCount, |
1985 | 1989 | "baseArrayLayer": {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.baseArrayLayer) }}}, |
1986 | | - "arrayLayerCount": {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.arrayLayerCount) }}}, |
| 1990 | + "arrayLayerCount": arrayLayerCount === {{{ gpu.ARRAY_LAYER_COUNT_UNDEFINED }}} ? undefined : arrayLayerCount, |
1987 | 1991 | "aspect": WebGPU.TextureAspect[ |
1988 | 1992 | {{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUTextureViewDescriptor.aspect) }}}], |
1989 | 1993 | }; |
|
0 commit comments