mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
don't accept 0x0 textures (#4125)
This commit is contained in:
committed by
Weiliang Wang
parent
30cc94deec
commit
c5a0bc796d
@@ -249,7 +249,9 @@ export class Material extends Asset {
|
||||
pass.bindTextureView(binding, val);
|
||||
} else {
|
||||
const textureView = val.getGFXTextureView();
|
||||
if (!textureView) { console.warn('texture asset incomplete!'); return false; }
|
||||
if (!textureView || !textureView.texture.width || !textureView.texture.height) {
|
||||
console.warn('texture asset incomplete!'); return false;
|
||||
}
|
||||
pass.bindTextureView(binding, textureView);
|
||||
pass.bindSampler(binding, samplerLib.getSampler(cc.game._gfxDevice, val.getGFXSamplerInfo()));
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ export class TextureBase extends EventTargetFactory(Asset) {
|
||||
*/
|
||||
public setMipFilter (mipFilter: Filter) {
|
||||
this._mipFilter = mipFilter; this._samplerInfo[SamplerInfoIndex.mipFilter] = mipFilter;
|
||||
this._samplerInfo[SamplerInfoIndex.maxLOD] = mipFilter === Filter.NONE ? 0 : 1000;
|
||||
this._samplerInfo[SamplerInfoIndex.maxLOD] = mipFilter === Filter.NONE ? 0 : 1000; // WebGL2 on some platform need this
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user