-----------------------------------------------------------------------
| 261 | } |
| 262 | //----------------------------------------------------------------------- |
| 263 | void RenderSystem::_setTextureUnitSettings( size_t texUnit, TextureUnitState &tl ) |
| 264 | { |
| 265 | // This method is only ever called to set a texture unit to valid details |
| 266 | // The method _disableTextureUnit is called to turn a unit off |
| 267 | |
| 268 | TextureGpu *tex = tl._getTexturePtr(); |
| 269 | bool isValidBinding = false; |
| 270 | |
| 271 | if( mCurrentCapabilities->hasCapability( RSC_COMPLETE_TEXTURE_BINDING ) ) |
| 272 | _setBindingType( tl.getBindingType() ); |
| 273 | |
| 274 | // Vertex texture binding? |
| 275 | if( mCurrentCapabilities->hasCapability( RSC_VERTEX_TEXTURE_FETCH ) && |
| 276 | !mCurrentCapabilities->getVertexTextureUnitsShared() ) |
| 277 | { |
| 278 | isValidBinding = true; |
| 279 | if( tl.getBindingType() == TextureUnitState::BT_VERTEX ) |
| 280 | { |
| 281 | // Bind vertex texture |
| 282 | _setVertexTexture( texUnit, tex ); |
| 283 | // bind nothing to fragment unit (hardware isn't shared but fragment |
| 284 | // unit can't be using the same index |
| 285 | _setTexture( texUnit, 0, false ); |
| 286 | } |
| 287 | else |
| 288 | { |
| 289 | // vice versa |
| 290 | _setVertexTexture( texUnit, 0 ); |
| 291 | _setTexture( texUnit, tex, |
| 292 | mCurrentRenderPassDescriptor->mDepth.texture && |
| 293 | mCurrentRenderPassDescriptor->mDepth.texture == tex ); |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | if( mCurrentCapabilities->hasCapability( RSC_GEOMETRY_PROGRAM ) ) |
| 298 | { |
| 299 | isValidBinding = true; |
| 300 | if( tl.getBindingType() == TextureUnitState::BT_GEOMETRY ) |
| 301 | { |
| 302 | // Bind vertex texture |
| 303 | _setGeometryTexture( texUnit, tex ); |
| 304 | // bind nothing to fragment unit (hardware isn't shared but fragment |
| 305 | // unit can't be using the same index |
| 306 | _setTexture( texUnit, 0, false ); |
| 307 | } |
| 308 | else |
| 309 | { |
| 310 | // vice versa |
| 311 | _setGeometryTexture( texUnit, 0 ); |
| 312 | _setTexture( texUnit, tex, |
| 313 | mCurrentRenderPassDescriptor->mDepth.texture && |
| 314 | mCurrentRenderPassDescriptor->mDepth.texture == tex ); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | if( mCurrentCapabilities->hasCapability( RSC_TESSELLATION_DOMAIN_PROGRAM ) ) |
| 319 | { |
| 320 | isValidBinding = true; |
no test coverage detected