File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -434,15 +434,15 @@ TEXTURE_FORMAT GetModelImageDataTextureFormat(const Model::ImageData& Image)
434434 if (Image.TexFormat != TEX_FORMAT_UNKNOWN)
435435 return Image.TexFormat ;
436436
437- VERIFY (Image.ComponentSize == 1 , " Only 8-bit image components are currently supported" );
437+ DEV_CHECK_ERR (Image.ComponentSize == 1 , " Only 8-bit image components are currently supported" );
438438 switch (Image.NumComponents )
439439 {
440440 case 1 : return TEX_FORMAT_R8_UNORM;
441441 case 2 : return TEX_FORMAT_RG8_UNORM;
442442 case 3 :
443443 case 4 : return TEX_FORMAT_RGBA8_UNORM;
444444 default :
445- UNEXPECTED (" Unsupported number of color components in gltf image: " , Image.NumComponents );
445+ DEV_ERROR (" Unsupported number of color components in gltf image: " , Image.NumComponents );
446446 return TEX_FORMAT_UNKNOWN;
447447 }
448448}
@@ -830,9 +830,14 @@ Uint32 Model::AddTexture(IRenderDevice* pDevice,
830830 TexDesc.MiscFlags = MISC_TEXTURE_FLAG_GENERATE_MIPS;
831831
832832 pDevice->CreateTexture (TexDesc, nullptr , &TexInfo.pTexture );
833- TexInfo.pTexture ->GetDefaultView (TEXTURE_VIEW_SHADER_RESOURCE)->SetSampler (pSampler);
834-
835- TexInfo.pTexture ->SetUserData (pTexInitData);
833+ if (TexInfo.pTexture )
834+ {
835+ TexInfo.pTexture ->SetUserData (pTexInitData);
836+ }
837+ else
838+ {
839+ DEV_ERROR (" Failed to create texture from image data" );
840+ }
836841 }
837842 }
838843 else if (Image.FileFormat == IMAGE_FILE_FORMAT_DDS || Image.FileFormat == IMAGE_FILE_FORMAT_KTX)
You can’t perform that action at this time.
0 commit comments