| 70 | } |
| 71 | |
| 72 | void GFXGLTextureArray::bind(U32 textureUnit) const |
| 73 | { |
| 74 | glActiveTexture(GL_TEXTURE0 + textureUnit); |
| 75 | glBindTexture(GL_TEXTURE_2D_ARRAY, mTextureArray); |
| 76 | |
| 77 | dynamic_cast<GFXGLDevice*>(getOwningDevice())->getOpenglCache()->setCacheBindedTex(textureUnit, GL_TEXTURE_2D_ARRAY, mTextureArray); |
| 78 | |
| 79 | GFXGLStateBlockRef sb = dynamic_cast<GFXGLDevice*>(GFX)->getCurrentStateBlock(); |
| 80 | AssertFatal(sb, "GFXGLTextureArray::bind - No active stateblock!"); |
| 81 | if (!sb) |
| 82 | return; |
| 83 | |
| 84 | const GFXSamplerStateDesc& ssd = sb->getDesc().samplers[textureUnit]; |
| 85 | glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, minificationFilter(ssd.minFilter, ssd.mipFilter, 0)); |
| 86 | glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GFXGLTextureFilter[ssd.magFilter]); |
| 87 | glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, mMin(mMipLevels - 1, 1)); |
| 88 | glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GFXGLTextureAddress[ssd.addressModeU]); |
| 89 | glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GFXGLTextureAddress[ssd.addressModeV]); |
| 90 | } |
| 91 | |
| 92 | void GFXGLTextureArray::zombify() |
| 93 | { |
nothing calls this directly
no test coverage detected