Commit bddc4d3f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Reuse the shader buffer between shaders.

parent def8d4f4
...@@ -138,15 +138,20 @@ const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token ...@@ -138,15 +138,20 @@ const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token
} }
} }
void shader_buffer_init(struct SHADER_BUFFER *buffer) void shader_buffer_clear(struct SHADER_BUFFER *buffer)
{ {
buffer->buffer = HeapAlloc(GetProcessHeap(), 0, SHADER_PGMSIZE);
buffer->buffer[0] = '\0'; buffer->buffer[0] = '\0';
buffer->bsize = 0; buffer->bsize = 0;
buffer->lineNo = 0; buffer->lineNo = 0;
buffer->newline = TRUE; buffer->newline = TRUE;
} }
void shader_buffer_init(struct SHADER_BUFFER *buffer)
{
buffer->buffer = HeapAlloc(GetProcessHeap(), 0, SHADER_PGMSIZE);
shader_buffer_clear(buffer);
}
void shader_buffer_free(struct SHADER_BUFFER *buffer) void shader_buffer_free(struct SHADER_BUFFER *buffer)
{ {
HeapFree(GetProcessHeap(), 0, buffer->buffer); HeapFree(GetProcessHeap(), 0, buffer->buffer);
......
...@@ -2601,6 +2601,7 @@ typedef struct IWineD3DBaseShaderImpl { ...@@ -2601,6 +2601,7 @@ typedef struct IWineD3DBaseShaderImpl {
IWineD3DBaseShaderClass baseShader; IWineD3DBaseShaderClass baseShader;
} IWineD3DBaseShaderImpl; } IWineD3DBaseShaderImpl;
void shader_buffer_clear(struct SHADER_BUFFER *buffer);
void shader_buffer_init(struct SHADER_BUFFER *buffer); void shader_buffer_init(struct SHADER_BUFFER *buffer);
void shader_buffer_free(struct SHADER_BUFFER *buffer); void shader_buffer_free(struct SHADER_BUFFER *buffer);
void shader_cleanup(IWineD3DBaseShader *iface); void shader_cleanup(IWineD3DBaseShader *iface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment