2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/render/shaders/program.h>
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/common/dali-vector.h>
27 #include <dali/public-api/common/constants.h>
28 #include <dali/integration-api/debug.h>
29 #include <dali/integration-api/shader-data.h>
30 #include <dali/integration-api/gl-defines.h>
31 #include <dali/internal/render/common/performance-monitor.h>
32 #include <dali/internal/render/shaders/program-cache.h>
33 #include <dali/internal/render/gl-resources/gl-call-debug.h>
37 void LogWithLineNumbers( const char * source )
39 unsigned int lineNumber = 0u;
40 const char *prev = source;
41 const char *ptr = prev;
49 // seek the next end of line or end of text
50 while( *ptr!='\n' && *ptr != '\0' )
55 std::string line( prev, ptr-prev );
56 Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, "%4d %s\n", lineNumber, line.c_str());
79 const char* gStdAttribs[ Program::ATTRIB_TYPE_LAST ] =
81 "aPosition", // ATTRIB_POSITION
82 "aNormal", // ATTRIB_NORMAL
83 "aTexCoord", // ATTRIB_TEXCOORD
84 "aColor", // ATTRIB_COLOR
85 "aBoneWeights", // ATTRIB_BONE_WEIGHTS
86 "aBoneIndices" // ATTRIB_BONE_INDICES
89 const char* gStdUniforms[ Program::UNIFORM_TYPE_LAST ] =
91 "uMvpMatrix", // UNIFORM_MVP_MATRIX
92 "uModelView", // UNIFORM_MODELVIEW_MATRIX
93 "uProjection", // UNIFORM_PROJECTION_MATRIX
94 "uModelMatrix", // UNIFORM_MODEL_MATRIX,
95 "uViewMatrix", // UNIFORM_VIEW_MATRIX,
96 "uNormalMatrix", // UNIFORM_NORMAL_MATRIX
97 "uColor", // UNIFORM_COLOR
98 "uCustomTextureCoords", // UNIFORM_CUSTOM_TEXTURE_COORDS
99 "sTexture", // UNIFORM_SAMPLER
100 "sTextureRect", // UNIFORM_SAMPLER_RECT
101 "sEffect", // UNIFORM_EFFECT_SAMPLER
102 "sEffectRect", // UNIFORM_EFFECT_SAMPLER_RECT
103 "uTimeDelta", // UNIFORM_TIME_DELTA
104 "sOpacityTexture", // UNIFORM_SAMPLER_OPACITY
105 "sNormalMapTexture", // UNIFORM_SAMPLER_NORMAL_MAP
106 "uTextColor", // UNIFORM_TEXT_COLOR
107 "uSmoothing", // UNIFORM_SMOOTHING
108 "uOutline", // UNIFORM_OUTLINE
109 "uOutlineColor", // UNIFORM_OUTLINE_COLOR
110 "uGlow", // UNIFORM_GLOW
111 "uGlowColor", // UNIFORM_GLOW_COLOR
112 "uShadow", // UNIFORM_SHADOW
113 "uShadowColor", // UNIFORM_SHADOW_COLOR
114 "uShadowSmoothing", // UNIFORM_SHADOW_SMOOTHING
115 "uGradientColor", // UNIFORM_GRADIENT_COLOR
116 "uGradientLine", // UNIFORM_GRADIENT_LINE
117 "uInvTextSize" // UNIFORM_INVERSE_TEXT_SIZE
120 } // <unnamed> namespace
124 Program* Program::New( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry )
126 size_t shaderHash = shaderData->GetHashValue();
127 Program* program = cache.GetProgram( shaderHash );
129 if( NULL == program )
131 // program not found so create it
132 program = new Program( cache, shaderData, modifiesGeometry );
134 // we want to lazy load programs so dont do a Load yet, it gets done in Use()
136 cache.AddProgram( shaderHash, program );
151 if ( this != mCache.GetCurrentProgram() )
153 LOG_GL( "UseProgram(%d)\n", mProgramId );
154 CHECK_GL( mGlAbstraction, mGlAbstraction.UseProgram(mProgramId) );
156 mCache.SetCurrentProgram( this );
161 bool Program::IsUsed()
163 return ( this == mCache.GetCurrentProgram() );
166 GLint Program::GetAttribLocation( AttribType type )
168 DALI_ASSERT_DEBUG(type != ATTRIB_UNKNOWN);
170 if( mAttribLocations[ type ] == ATTRIB_UNKNOWN )
172 GLint loc = CHECK_GL( mGlAbstraction, mGlAbstraction.GetAttribLocation( mProgramId, gStdAttribs[type] ) );
173 mAttribLocations[ type ] = loc;
174 LOG_GL( "GetAttribLocation(program=%d,%s) = %d\n", mProgramId, gStdAttribs[type], mAttribLocations[type] );
177 return mAttribLocations[type];
180 unsigned int Program::RegisterUniform( const std::string& name )
182 unsigned int index = 0;
183 // find the value from cache
184 for( ;index < mUniformLocations.size(); ++index )
186 if( mUniformLocations[ index ].first == name )
188 // name found so return index
192 // if we get here, index is one past end so push back the new name
193 mUniformLocations.push_back( std::make_pair( name, UNIFORM_NOT_QUERIED ) );
197 GLint Program::GetUniformLocation( unsigned int uniformIndex )
199 // debug check that index is within name cache
200 DALI_ASSERT_DEBUG( mUniformLocations.size() > uniformIndex );
202 // check if we have already queried the location of the uniform
203 GLint location = mUniformLocations[ uniformIndex ].second;
205 if( location == UNIFORM_NOT_QUERIED )
207 location = CHECK_GL( mGlAbstraction, mGlAbstraction.GetUniformLocation( mProgramId, mUniformLocations[ uniformIndex ].first.c_str() ) );
209 mUniformLocations[ uniformIndex ].second = location;
210 LOG_GL( "GetUniformLocation(program=%d,%s) = %d\n", mProgramId, mUniformLocations[ uniformIndex ].first.c_str(), mUniformLocations[ uniformIndex ].second );
216 void Program::SetUniform1i( GLint location, GLint value0 )
218 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
220 if( UNIFORM_UNKNOWN == location )
222 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
223 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
224 // specified uniform variable will not be changed.following opengl silently do nothing
228 // check if uniform location fits the cache
229 if( location >= MAX_UNIFORM_CACHE_SIZE )
231 // not cached, make the gl call
232 LOG_GL( "Uniform1i(%d,%d)\n", location, value0 );
233 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform1i( location, value0 ) );
237 // check if the value is different from what's already been set
238 if( value0 != mUniformCacheInt[ location ] )
241 LOG_GL( "Uniform1i(%d,%d)\n", location, value0 );
242 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform1i( location, value0 ) );
244 mUniformCacheInt[ location ] = value0;
249 void Program::SetUniform4i( GLint location, GLint value0, GLint value1, GLint value2, GLint value3 )
251 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
253 if( UNIFORM_UNKNOWN == location )
255 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
256 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
257 // specified uniform variable will not be changed.following opengl silently do nothing
261 // Not caching these as based on current analysis this is not called that often by our shaders
262 LOG_GL( "Uniform4i(%d,%d,%d,%d,%d)\n", location, value0, value1, value2, value3 );
263 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform4i( location, value0, value1, value2, value3 ) );
266 void Program::SetUniform1f( GLint location, GLfloat value0 )
268 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
270 if( UNIFORM_UNKNOWN == location )
272 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
273 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
274 // specified uniform variable will not be changed.following opengl silently do nothing
278 // check if uniform location fits the cache
279 if( location >= MAX_UNIFORM_CACHE_SIZE )
281 // not cached, make the gl call
282 LOG_GL( "Uniform1f(%d,%f)\n", location, value0 );
283 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform1f( location, value0 ) );
287 // check if the same value has already been set, reset if it is different
288 if( ( fabsf(value0 - mUniformCacheFloat[ location ]) >= Math::MACHINE_EPSILON_1 ) )
291 LOG_GL( "Uniform1f(%d,%f)\n", location, value0 );
292 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform1f( location, value0 ) );
295 mUniformCacheFloat[ location ] = value0;
300 void Program::SetUniform2f( GLint location, GLfloat value0, GLfloat value1 )
302 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
304 if( UNIFORM_UNKNOWN == location )
306 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
307 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
308 // specified uniform variable will not be changed.following opengl silently do nothing
312 // Not caching these as based on current analysis this is not called that often by our shaders
313 LOG_GL( "Uniform2f(%d,%f,%f)\n", location, value0, value1 );
314 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform2f( location, value0, value1 ) );
317 void Program::SetUniform3f( GLint location, GLfloat value0, GLfloat value1, GLfloat value2 )
319 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
321 if( UNIFORM_UNKNOWN == location )
323 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
324 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
325 // specified uniform variable will not be changed.following opengl silently do nothing
329 // Not caching these as based on current analysis this is not called that often by our shaders
330 LOG_GL( "Uniform3f(%d,%f,%f,%f)\n", location, value0, value1, value2 );
331 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform3f( location, value0, value1, value2 ) );
334 void Program::SetUniform4f( GLint location, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3 )
336 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
338 if( UNIFORM_UNKNOWN == location )
340 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
341 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
342 // specified uniform variable will not be changed.following opengl silently do nothing
346 // check if uniform location fits the cache
347 if( location >= MAX_UNIFORM_CACHE_SIZE )
349 // not cached, make the gl call
350 LOG_GL( "Uniform4f(%d,%f,%f,%f,%f)\n", location, value0, value1, value2, value3 );
351 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform4f( location, value0, value1, value2, value3 ) );
355 // check if the same value has already been set, reset if any component is different
356 // checking index 3 first because we're often animating alpha (rgba)
357 if( ( fabsf(value3 - mUniformCacheFloat4[ location ][ 3 ]) >= Math::MACHINE_EPSILON_1 )||
358 ( fabsf(value0 - mUniformCacheFloat4[ location ][ 0 ]) >= Math::MACHINE_EPSILON_1 )||
359 ( fabsf(value1 - mUniformCacheFloat4[ location ][ 1 ]) >= Math::MACHINE_EPSILON_1 )||
360 ( fabsf(value2 - mUniformCacheFloat4[ location ][ 2 ]) >= Math::MACHINE_EPSILON_1 ) )
363 LOG_GL( "Uniform4f(%d,%f,%f,%f,%f)\n", location, value0, value1, value2, value3 );
364 CHECK_GL( mGlAbstraction, mGlAbstraction.Uniform4f( location, value0, value1, value2, value3 ) );
366 mUniformCacheFloat4[ location ][ 0 ] = value0;
367 mUniformCacheFloat4[ location ][ 1 ] = value1;
368 mUniformCacheFloat4[ location ][ 2 ] = value2;
369 mUniformCacheFloat4[ location ][ 3 ] = value3;
374 void Program::SetUniformMatrix4fv( GLint location, GLsizei count, const GLfloat* value )
376 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
378 if( UNIFORM_UNKNOWN == location )
380 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
381 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
382 // specified uniform variable will not be changed.following opengl silently do nothing
386 // Not caching these calls. Based on current analysis this is called very often
387 // but with different values (we're using this for MVP matrices)
388 // NOTE! we never want driver or GPU to transpose
389 LOG_GL( "UniformMatrix4fv(%d,%d,GL_FALSE,%x)\n", location, count, value );
390 CHECK_GL( mGlAbstraction, mGlAbstraction.UniformMatrix4fv( location, count, GL_FALSE, value ) );
393 void Program::SetUniformMatrix3fv( GLint location, GLsizei count, const GLfloat* value )
395 DALI_ASSERT_DEBUG( IsUsed() ); // should not call this if this program is not used
397 if( UNIFORM_UNKNOWN == location )
399 // From http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml : Notes
400 // If location is equal to UNIFORM_UNKNOWN, the data passed in will be silently ignored and the
401 // specified uniform variable will not be changed.following opengl silently do nothing
406 // Not caching these calls. Based on current analysis this is called very often
407 // but with different values (we're using this for MVP matrices)
408 // NOTE! we never want driver or GPU to transpose
409 LOG_GL( "UniformMatrix3fv(%d,%d,GL_FALSE,%x)\n", location, count, value );
410 CHECK_GL( mGlAbstraction, mGlAbstraction.UniformMatrix3fv( location, count, GL_FALSE, value ) );
413 void Program::GlContextCreated()
417 void Program::GlContextDestroyed()
421 mFragmentShaderId = 0;
424 ResetAttribsUniformCache();
427 bool Program::ModifiesGeometry()
429 return mModifiesGeometry;
432 Program::Program( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry )
434 mGlAbstraction( mCache.GetGlAbstraction() ),
435 mProjectionMatrix( NULL ),
438 mVertexShaderId( 0 ),
439 mFragmentShaderId( 0 ),
441 mProgramData(shaderData),
442 mModifiesGeometry( modifiesGeometry )
444 // reserve space for standard uniforms
445 mUniformLocations.reserve( UNIFORM_TYPE_LAST );
446 // reset built in uniform names in cache
447 for( int i = 0; i < UNIFORM_TYPE_LAST; ++i )
449 RegisterUniform( gStdUniforms[ i ] );
452 ResetAttribsUniformCache();
462 DALI_ASSERT_ALWAYS( NULL != mProgramData.Get() && "Program data is not initialized" );
464 LOG_GL( "CreateProgram()\n" );
465 mProgramId = CHECK_GL( mGlAbstraction, mGlAbstraction.CreateProgram() );
467 GLint linked = GL_FALSE;
469 const bool binariesSupported = mCache.IsBinarySupported();
471 // if shader binaries are supported and ShaderData contains compiled bytecode?
472 if( binariesSupported && mProgramData->HasBinary() )
474 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "Program::Load() - Using Compiled Shader, Size = %d\n", mProgramData->GetBufferSize());
476 CHECK_GL( mGlAbstraction, mGlAbstraction.ProgramBinary(mProgramId, mCache.ProgramBinaryFormat(), mProgramData->GetBufferData(), mProgramData->GetBufferSize()) );
478 CHECK_GL( mGlAbstraction, mGlAbstraction.ValidateProgram(mProgramId) );
481 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_VALIDATE_STATUS, &success ) );
483 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "ValidateProgram Status = %d\n", success);
485 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_LINK_STATUS, &linked ) );
487 if( GL_FALSE == linked )
489 DALI_LOG_ERROR("Failed to load program binary \n");
492 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_INFO_LOG_LENGTH, &nLength) );
495 Dali::Vector< char > szLog;
496 szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
497 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() ) );
498 DALI_LOG_ERROR( "Program Link Error: %s\n", szLog.Begin() );
507 // Fall back to compiling and linking the vertex and fragment sources
508 if( GL_FALSE == linked )
510 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "Program::Load() - Runtime compilation\n");
511 if( CompileShader( GL_VERTEX_SHADER, mVertexShaderId, mProgramData->GetVertexShader() ) )
513 if( CompileShader( GL_FRAGMENT_SHADER, mFragmentShaderId, mProgramData->GetFragmentShader() ) )
517 if( binariesSupported && mLinked )
519 GLint binaryLength = 0;
522 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv(mProgramId, GL_PROGRAM_BINARY_LENGTH_OES, &binaryLength) );
523 DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "Program::Load() - GL_PROGRAM_BINARY_LENGTH_OES: %d\n", binaryLength);
524 if( binaryLength > 0 )
526 // Allocate space for the bytecode in ShaderData
527 mProgramData->AllocateBuffer(binaryLength);
528 // Copy the bytecode to ShaderData
529 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramBinary(mProgramId, binaryLength, NULL, &binaryFormat, mProgramData->GetBufferData()) );
530 mCache.StoreBinary( mProgramData );
541 void Program::Unload()
545 if( this == mCache.GetCurrentProgram() )
547 CHECK_GL( mGlAbstraction, mGlAbstraction.UseProgram(0) );
549 mCache.SetCurrentProgram( NULL );
554 LOG_GL( "DeleteProgram(%d)\n", mProgramId );
555 CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteProgram( mProgramId ) );
563 bool Program::CompileShader( GLenum shaderType, GLuint& shaderId, const char* src )
567 LOG_GL( "CreateShader(%d)\n", shaderType );
568 shaderId = CHECK_GL( mGlAbstraction, mGlAbstraction.CreateShader( shaderType ) );
569 LOG_GL( "AttachShader(%d,%d)\n", mProgramId, shaderId );
570 CHECK_GL( mGlAbstraction, mGlAbstraction.AttachShader( mProgramId, shaderId ) );
573 LOG_GL( "ShaderSource(%d)\n", shaderId );
574 CHECK_GL( mGlAbstraction, mGlAbstraction.ShaderSource(shaderId, 1, &src, NULL ) );
576 LOG_GL( "CompileShader(%d)\n", shaderId );
577 CHECK_GL( mGlAbstraction, mGlAbstraction.CompileShader( shaderId ) );
580 LOG_GL( "GetShaderiv(%d)\n", shaderId );
581 CHECK_GL( mGlAbstraction, mGlAbstraction.GetShaderiv( shaderId, GL_COMPILE_STATUS, &compiled ) );
583 if (compiled == GL_FALSE)
585 DALI_LOG_ERROR("Failed to compile shader\n");
586 LogWithLineNumbers(src);
589 mGlAbstraction.GetShaderiv( shaderId, GL_INFO_LOG_LENGTH, &nLength);
592 Dali::Vector< char > szLog;
593 szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
594 mGlAbstraction.GetShaderInfoLog( shaderId, nLength, &nLength, szLog.Begin() );
595 DALI_LOG_ERROR( "Shader Compiler Error: %s\n", szLog.Begin() );
598 DALI_ASSERT_ALWAYS( 0 && "Shader compilation failure" );
601 return compiled != 0;
606 LOG_GL( "LinkProgram(%d)\n", mProgramId );
607 CHECK_GL( mGlAbstraction, mGlAbstraction.LinkProgram( mProgramId ) );
610 LOG_GL( "GetProgramiv(%d)\n", mProgramId );
611 CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_LINK_STATUS, &linked ) );
613 if (linked == GL_FALSE)
615 DALI_LOG_ERROR("Shader failed to link \n");
618 mGlAbstraction.GetProgramiv( mProgramId, GL_INFO_LOG_LENGTH, &nLength);
621 Dali::Vector< char > szLog;
622 szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
623 mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() );
624 DALI_LOG_ERROR( "Shader Link Error: %s\n", szLog.Begin() );
627 DALI_ASSERT_ALWAYS( 0 && "Shader linking failure" );
630 mLinked = linked != GL_FALSE;
633 void Program::FreeShaders()
637 LOG_GL( "DeleteShader(%d)\n", mVertexShaderId );
638 CHECK_GL( mGlAbstraction, mGlAbstraction.DetachShader( mProgramId, mVertexShaderId ) );
639 CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteShader( mVertexShaderId ) );
643 if (mFragmentShaderId)
645 LOG_GL( "DeleteShader(%d)\n", mFragmentShaderId );
646 CHECK_GL( mGlAbstraction, mGlAbstraction.DetachShader( mProgramId, mFragmentShaderId ) );
647 CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteShader( mFragmentShaderId ) );
648 mFragmentShaderId = 0;
652 void Program::ResetAttribsUniformCache()
654 // reset attribute locations
655 for( unsigned i = 0; i < ATTRIB_TYPE_LAST; ++i )
657 mAttribLocations[ i ] = ATTRIB_UNKNOWN;
660 // reset all gl uniform locations
661 for( unsigned int i = 0; i < mUniformLocations.size(); ++i )
663 // reset gl program locations and names
664 mUniformLocations[ i ].second = UNIFORM_NOT_QUERIED;
667 // reset uniform cache
668 for( int i = 0; i < MAX_UNIFORM_CACHE_SIZE; ++i )
670 // GL initializes uniforms to 0
671 mUniformCacheInt[ i ] = 0;
672 mUniformCacheFloat[ i ] = 0.0f;
673 mUniformCacheFloat4[ i ][ 0 ] = 0.0f;
674 mUniformCacheFloat4[ i ][ 1 ] = 0.0f;
675 mUniformCacheFloat4[ i ][ 2 ] = 0.0f;
676 mUniformCacheFloat4[ i ][ 3 ] = 0.0f;
680 } // namespace Internal