Changeset 1289
- Timestamp:
- Apr 24, 2012, 8:17:43 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gpu/shader.cpp
r1265 r1289 295 295 glUniform1i(uni.frag, i); 296 296 #else 297 /* FIXME: does this exist at all? */ 298 //cgGLSetParameter1i((CGparameter)uni.frag, i); 297 /* FIXME: does this exist at all? cgGLSetParameter1i doesn't. */ 299 298 #endif 300 299 } … … 355 354 SetUniform(uni, vec4(v, 0, 0)); 356 355 #elif !defined __CELLOS_LV2__ 357 glUniform2f (uni.frag, v.x, v.y);356 glUniform2fv(uni.frag, 1, &v[0]); 358 357 #else 359 358 if (uni.frag) 360 cgGLSetParameter2f ((CGparameter)uni.frag, v.x, v.y);359 cgGLSetParameter2fv((CGparameter)uni.frag, &v[0]); 361 360 if (uni.vert) 362 cgGLSetParameter2f ((CGparameter)uni.vert, v.x, v.y);361 cgGLSetParameter2fv((CGparameter)uni.vert, &v[0]); 363 362 #endif 364 363 } … … 369 368 SetUniform(uni, vec4(v, 0)); 370 369 #elif !defined __CELLOS_LV2__ 371 glUniform3f (uni.frag, v.x, v.y, v.z);370 glUniform3fv(uni.frag, 1, &v[0]); 372 371 #else 373 372 if (uni.frag) 374 cgGLSetParameter3f ((CGparameter)uni.frag, v.x, v.y, v.z);373 cgGLSetParameter3fv((CGparameter)uni.frag, &v[0]); 375 374 if (uni.vert) 376 cgGLSetParameter3f ((CGparameter)uni.vert, v.x, v.y, v.z);375 cgGLSetParameter3fv((CGparameter)uni.vert, &v[0]); 377 376 #endif 378 377 } … … 386 385 g_d3ddevice->SetVertexShaderConstantF((UINT)uni.vert, &v[0], 1); 387 386 #elif !defined __CELLOS_LV2__ 388 glUniform4f(uni.frag, v.x, v.y, v.z, v.w); 389 #else 390 /* FIXME: use the array versions of these functions */ 387 glUniform4fv(uni.frag, 1, &v[0]); 388 #else 391 389 if (uni.frag) 392 cgGLSetParameter4f ((CGparameter)uni.frag, v.x, v.y, v.z, v.w);390 cgGLSetParameter4fv((CGparameter)uni.frag, &v[0]); 393 391 if (uni.vert) 394 cgGLSetParameter4f ((CGparameter)uni.vert, v.x, v.y, v.z, v.w);392 cgGLSetParameter4fv((CGparameter)uni.vert, &v[0]); 395 393 #endif 396 394 } … … 407 405 glUniformMatrix2fv(uni.frag, 1, GL_FALSE, &m[0][0]); 408 406 #else 409 /* FIXME: not implemented */ 410 Abort(); 407 mat4 tmp(m, 1.0f, 1.0f); 408 if (uni.frag) 409 cgGLSetMatrixParameterfc((CGparameter)uni.frag, &m[0][0]); 410 if (uni.vert) 411 cgGLSetMatrixParameterfc((CGparameter)uni.vert, &m[0][0]); 411 412 #endif 412 413 } … … 425 426 glUniformMatrix3fv(uni.frag, 1, GL_FALSE, &m[0][0]); 426 427 #else 427 /* FIXME: not implemented */ 428 Abort(); 428 /* FIXME: check it's the proper way to do this */ 429 mat4 tmp(m, 1.0f); 430 if (uni.frag) 431 cgGLSetMatrixParameterfc((CGparameter)uni.frag, &m[0][0]); 432 if (uni.vert) 433 cgGLSetMatrixParameterfc((CGparameter)uni.vert, &m[0][0]); 429 434 #endif 430 435 }
Note: See TracChangeset
for help on using the changeset viewer.