- 時間撮記:
- 2012-10-29 上午11:51:43 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c
r40301 r43764 1623 1623 } 1624 1624 1625 #define CR_BUFFER_HWID(_p) ((_p) ? (_p)->hwid : 0) 1625 1626 1626 1627 void … … 1850 1851 GLint curClientTextureUnit = from->curClientTextureUnit; 1851 1852 int i; 1853 GLint idHwArrayBuffer = CR_BUFFER_HWID(toCtx->bufferobject.arrayBuffer); 1854 const GLint idHwInitialBuffer = idHwArrayBuffer; 1855 1856 #ifdef DEBUG_misha 1857 { 1858 GLint tstHwBuffer = -1; 1859 diff_api.GetIntegerv(GL_ARRAY_BUFFER_BINDING, &tstHwBuffer); 1860 CRASSERT(idHwInitialBuffer == tstHwBuffer); 1861 } 1862 #endif 1852 1863 1853 1864 if (CHECKDIRTY(cb->clientPointer, bitID)) { … … 1858 1869 from->array.v.stride != to->array.v.stride || 1859 1870 from->array.v.buffer != to->array.v.buffer) { 1871 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.v.buffer); 1872 if (idHwArrayBufferUsed != idHwArrayBuffer) 1873 { 1874 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1875 idHwArrayBuffer = idHwArrayBufferUsed; 1876 } 1860 1877 diff_api.VertexPointer(to->array.v.size, to->array.v.type, 1861 1878 to->array.v.stride, to->array.v.p); … … 1871 1888 from->array.n.stride != to->array.n.stride || 1872 1889 from->array.n.buffer != to->array.n.buffer) { 1890 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.n.buffer); 1891 if (idHwArrayBufferUsed != idHwArrayBuffer) 1892 { 1893 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1894 idHwArrayBuffer = idHwArrayBufferUsed; 1895 } 1873 1896 diff_api.NormalPointer(to->array.n.type, 1874 1897 to->array.n.stride, to->array.n.p); … … 1885 1908 from->array.c.stride != to->array.c.stride || 1886 1909 from->array.c.buffer != to->array.c.buffer) { 1910 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.c.buffer); 1911 if (idHwArrayBufferUsed != idHwArrayBuffer) 1912 { 1913 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1914 idHwArrayBuffer = idHwArrayBufferUsed; 1915 } 1887 1916 diff_api.ColorPointer(to->array.c.size, to->array.c.type, 1888 1917 to->array.c.stride, to->array.c.p); … … 1898 1927 from->array.i.stride != to->array.i.stride || 1899 1928 from->array.i.buffer != to->array.i.buffer) { 1929 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.i.buffer); 1930 if (idHwArrayBufferUsed != idHwArrayBuffer) 1931 { 1932 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1933 idHwArrayBuffer = idHwArrayBufferUsed; 1934 } 1900 1935 diff_api.IndexPointer(to->array.i.type, 1901 1936 to->array.i.stride, to->array.i.p); … … 1913 1948 from->array.t[i].stride != to->array.t[i].stride || 1914 1949 from->array.t[i].buffer != to->array.t[i].buffer) { 1950 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.t[i].buffer); 1951 if (idHwArrayBufferUsed != idHwArrayBuffer) 1952 { 1953 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1954 idHwArrayBuffer = idHwArrayBufferUsed; 1955 } 1915 1956 diff_api.ClientActiveTextureARB(GL_TEXTURE0_ARB + i); 1916 1957 curClientTextureUnit = i; … … 1928 1969 if (from->array.e.stride != to->array.e.stride || 1929 1970 from->array.e.buffer != to->array.e.buffer) { 1971 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.e.buffer); 1972 if (idHwArrayBufferUsed != idHwArrayBuffer) 1973 { 1974 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1975 idHwArrayBuffer = idHwArrayBufferUsed; 1976 } 1930 1977 diff_api.EdgeFlagPointer(to->array.e.stride, to->array.e.p); 1931 1978 FILLDIRTY(cb->e); … … 1941 1988 from->array.s.stride != to->array.s.stride || 1942 1989 from->array.s.buffer != to->array.s.buffer) { 1990 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.s.buffer); 1991 if (idHwArrayBufferUsed != idHwArrayBuffer) 1992 { 1993 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 1994 idHwArrayBuffer = idHwArrayBufferUsed; 1995 } 1943 1996 diff_api.SecondaryColorPointerEXT(to->array.s.size, to->array.s.type, 1944 1997 to->array.s.stride, to->array.s.p); … … 1954 2007 from->array.f.stride != to->array.f.stride || 1955 2008 from->array.f.buffer != to->array.f.buffer) { 2009 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.f.buffer); 2010 if (idHwArrayBufferUsed != idHwArrayBuffer) 2011 { 2012 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 2013 idHwArrayBuffer = idHwArrayBufferUsed; 2014 } 1956 2015 diff_api.FogCoordPointerEXT(to->array.f.type, 1957 2016 to->array.f.stride, to->array.f.p); … … 1971 2030 from->array.a[i].normalized != to->array.a[i].normalized || 1972 2031 from->array.a[i].buffer != to->array.a[i].buffer) { 2032 GLint idHwArrayBufferUsed = CR_BUFFER_HWID(to->array.a[i].buffer); 2033 if (idHwArrayBufferUsed != idHwArrayBuffer) 2034 { 2035 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwArrayBufferUsed); 2036 idHwArrayBuffer = idHwArrayBufferUsed; 2037 } 1973 2038 diff_api.VertexAttribPointerARB(i, to->array.a[i].size, 1974 2039 to->array.a[i].type, … … 1986 2051 } 1987 2052 2053 if (idHwArrayBuffer != idHwInitialBuffer) 2054 { 2055 diff_api.BindBufferARB(GL_ARRAY_BUFFER_ARB, idHwInitialBuffer); 2056 } 2057 1988 2058 if (CHECKDIRTY(cb->enableClientState, bitID)) { 1989 2059 /* update vertex array enable/disable flags */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器