Skip to content

[BUG] all op will fail if the texture is in 3d format #296

Description

@jcyuan

Cocos Creator version

3.8.8

System information

Win11

Issue description

Creating 3D textures in Cocos (3.8.8) works fine, but uploading fails because the gfx layer "wants" to upload them as texture_2d_array. I'm not sure if this is a typo or intentional... possibly for WebGL 1 compatibility? However, WebGL 1 doesn't support texture_2d_array either, and sampler3D cannot be used in shaders, so this is almost certainly a BUG. I'm not sure if the official team has other considerations.

This BUG currently causes all 3D texture related operations to fail. For example, device.copyBuffersToTexture([data], this._texture, [region]);: if this._texture was created with TextureType.TEX3D, this operation will definitely fail (no error is reported, but the data is not submitted to the GPU).

Relevant error log output

No response

Steps to reproduce

const device = deviceManager.gfxDevice;
        this._texture = device.createTexture(new TextureInfo(
            TextureType.TEX3D,
            TextureUsageBit.SAMPLED | TextureUsageBit.TRANSFER_DST,
            Format.R8,
            this._width,
            this._height,
            TextureFlagBit.NONE,
            1,
            1,
            SampleCount.X1,
            this._depth,
        ));
        const region = new BufferTextureCopy(
            0, 0, 0,
            new Offset(0, 0, 0),
            new Extent(this._width, this._height, this._depth),
            new TextureSubresLayers(0, 0, 1),
        );
        device.copyBuffersToTexture([pixels], this._texture, [region]);   // wont work

Minimal reproduction project

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions