emulator opengl - encode glShaderSource
glShaderSource strings are concatenated into a single string before sent over the wire protocol. The wire protocol transfer is done using a special api call 'glShaderString' Change-Id: I90c157df66fe82fee17c460a1e7852d370c77088
This commit is contained in:
committed by
David 'Digit' Turner
parent
d10c96517b
commit
0c814b227c
@@ -25,6 +25,7 @@ GL2Encoder::GL2Encoder(IOStream *stream) : gl2_encoder_context_t(stream)
|
||||
m_glGetVertexAttribiv_enc = set_glGetVertexAttribiv(s_glGetVertexAttribiv);
|
||||
m_glGetVertexAttribfv_enc = set_glGetVertexAttribfv(s_glGetVertexAttribfv);
|
||||
m_glGetVertexAttribPointerv = set_glGetVertexAttribPointerv(s_glGetVertexAttribPointerv);
|
||||
set_glShaderSource(s_glShaderSource);
|
||||
}
|
||||
|
||||
GL2Encoder::~GL2Encoder()
|
||||
@@ -322,3 +323,15 @@ GLint * GL2Encoder::getCompressedTextureFormats()
|
||||
}
|
||||
return m_compressedTextureFormats;
|
||||
}
|
||||
|
||||
void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, GLstr *string, GLint *length)
|
||||
{
|
||||
|
||||
int len = glUtilsCalcShaderSourceLen(string, length, count);
|
||||
char *str = new char[len + 1];
|
||||
glUtilsPackStrings(str, string, length, count);
|
||||
|
||||
GL2Encoder *ctx = (GL2Encoder *)self;
|
||||
ctx->glShaderString(ctx, shader, str, len + 1);
|
||||
delete str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user