@@ -92,6 +92,26 @@ namespace {
9292 double (nativeVertexData[2 ]), double (nativeVertexData[3 ]), double (nativeVertexData[4 ]), double (nativeVertexData[5 ]),
9393 double (nativeVertexData[6 ]), double (nativeVertexData[7 ]), double (nativeVertexData[8 ]), double (nativeVertexData[9 ]),
9494 double (nativeVertexData[10 ]), double (nativeVertexData[11 ]), unsigned (::glGetError ()));
95+ for (const char *name : { " texture_size0" , " texture_rot0" , " texture_off0" , " pixel_size0" }) {
96+ const GLint location = ::glGetUniformLocation (program, name);
97+ GLfloat values[16 ] {};
98+ if (location >= 0 )
99+ ::glGetUniformfv (program, location, values);
100+ std::fprintf (stderr, " native uniform: name=%s location=%d values=%g,%g,%g,%g\n " , name, location,
101+ double (values[0 ]), double (values[1 ]), double (values[2 ]), double (values[3 ]));
102+ }
103+ const GLint sampler = ::glGetUniformLocation (program, " texture0" );
104+ if (sampler >= 0 ) {
105+ GLint unit = 0 , active = 0 , texture = 0 , width = 0 , height = 0 ;
106+ ::glGetUniformiv (program, sampler, &unit);
107+ ::glGetIntegerv (GL_ACTIVE_TEXTURE , &active);
108+ ::glActiveTexture (GL_TEXTURE0 + unit);
109+ ::glGetIntegerv (GL_TEXTURE_BINDING_2D , &texture);
110+ ::glGetTexLevelParameteriv (GL_TEXTURE_2D , 0 , GL_TEXTURE_WIDTH , &width);
111+ ::glGetTexLevelParameteriv (GL_TEXTURE_2D , 0 , GL_TEXTURE_HEIGHT , &height);
112+ std::fprintf (stderr, " native sampler: unit=%d texture=%d size=%dx%d\n " , unit, texture, width, height);
113+ ::glActiveTexture (active);
114+ }
95115 }
96116 ::glDrawArrays (mode, first, count);
97117 }
0 commit comments