瀏覽代碼

allow binding float[n] variables to float[n-1] variables in Cg shaders

rdb 14 年之前
父節點
當前提交
72af325f2b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      panda/src/glstuff/glShaderContext_src.cxx

+ 1 - 1
panda/src/glstuff/glShaderContext_src.cxx

@@ -642,7 +642,7 @@ issue_parameters(GSG *gsg, int altered) {
         int input_size = _ptr._dim[0] * _ptr._dim[1] * _ptr._dim[2];
         int input_size = _ptr._dim[0] * _ptr._dim[1] * _ptr._dim[2];
 
 
         // dimension is negative only if the parameter had the (deprecated)k_ prefix.
         // dimension is negative only if the parameter had the (deprecated)k_ prefix.
-        if ((input_size != ptr_data->_size) && (_ptr._dim[0] > 0)) { 
+        if ((input_size > ptr_data->_size) && (_ptr._dim[0] > 0)) { 
           GLCAT.error() << _ptr._id._name << ": incorrect number of elements, expected " 
           GLCAT.error() << _ptr._id._name << ": incorrect number of elements, expected " 
                         <<  input_size <<" got " <<  ptr_data->_size << "\n";
                         <<  input_size <<" got " <<  ptr_data->_size << "\n";
           release_resources(gsg);
           release_resources(gsg);