Jump to content

[SOLVED] Инициализация текстуры. Ошибка: D3D11Texture::setImage2D(): new texture format is not the same as the old one.


photo

Recommended Posts

Добрый день.

Инициализирую текстуру и пытаюсь передать ей картинку.

Получаю ошибку 

D3D11Texture::setImage2D(): new texture format is not the same as the old one.

D3D11Texture::update_format(): formats are not compatible.
D3D11Texture::setImage2D(): can't update texture format according to the image.

ptrHeightDataTexture = Texture::create();

ptrHeightDataTexture->create2DArray(dataImage->getWidth(), dataImage->getHeight(), dataImage->getNumLayers(), dataImage->getFormat(), Texture::USAGE_READWRITE | Texture::USAGE_RENDER);

ptrHeightDataTexture->setImage2D(dataImage, 0, 0, -1);

Текстуре присваивается формат R32U. У картинки R32F.

С Уважением Константин.

format.jpg

format2.jpg

Edited by Vasara
Link to comment

Andrey KozlovСегодня, в 16:09 (Discord)
dataImage->getFormat() возвращает значение FORMAT из Image, а Texture::create2DArray принимает значение FORMAT из Texture. Поэтому получается разная интерпретация Image::FORMAT_R32F == Texture::FORMAT_R32U == 12

Link to comment
  • Vasara changed the title to [SOLVED] Инициализация текстуры. Ошибка: D3D11Texture::setImage2D(): new texture format is not the same as the old one.
×
×
  • Create New...