Skip to content

Direct3D12 bgfx::blit to a cubemap face and mip produces black. #3441

@unravel-dev

Description

@unravel-dev

Direct3D12 blit texture to a cubemap face and mip produces black.

using bgfx::blit to fill a cuemap's face and mip does't really work properly. It works great on all other backends
dx11,opengl,vulkan. I suspect this to be a problem in the dx12 renderer implementation but i am not an expert and couldn't find anything obvious.

Here is an example code:

//bgfx::TextureInfo of the output cubemap
 const auto& ti = params.output_cube->info;

        for(uint8_t face = 0; face < 6; ++face)
        {
            // input_faces is just an array of Frame Buffers for each face already filled and has mips.
            auto src = params.input_faces[face]->native_handle();
            for(uint8_t mip = 0; mip < max_mips; ++mip)
            {
                uint16_t dim = ti.width >> mip;
                bgfx::blit(pass.id, output_cube->native_handle(), mip, 0, 0, face, src, mip, 0, 0, 0, dim, dim, 1);
            }
        }

Here is the result on Mip 0
Image

Mip 1 and beyond is just black.
Image

And here is the output on DX11/Vulkan/OpenGL
Mip 0
Image

Mip 1 and beyond

Image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions