* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
#include "main/glheader.h"
#include "main/bufferobj.h"
#include "main/imports.h"
-#include "main/image.h"
+#include "main/glformats.h"
#include "main/macros.h"
#include "main/mtypes.h"
*/
struct copy_context {
- GLcontext *ctx;
+ struct gl_context *ctx;
const struct gl_client_array **array;
const struct _mesa_prim *prim;
GLuint nr_prims;
* Dump the parameters/info for a vbo->draw() call.
*/
static void
-dump_draw_info(GLcontext *ctx,
+dump_draw_info(struct gl_context *ctx,
const struct gl_client_array **arrays,
const struct _mesa_prim *prims,
GLuint nr_prims,
static void
flush( struct copy_context *copy )
{
+ struct gl_context *ctx = copy->ctx;
+ const struct gl_client_array **saved_arrays = ctx->Array._DrawArrays;
GLuint i;
/* Set some counters:
(void) dump_draw_info;
#endif
- copy->draw( copy->ctx,
- copy->dstarray_ptr,
+ ctx->Array._DrawArrays = copy->dstarray_ptr;
+ ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+
+ copy->draw( ctx,
copy->dstprim,
copy->dstprim_nr,
©->dstib,
GL_TRUE,
0,
- copy->dstbuf_nr - 1 );
+ copy->dstbuf_nr - 1,
+ NULL );
+
+ ctx->Array._DrawArrays = saved_arrays;
+ ctx->NewDriverState |= ctx->DriverFlags.NewArray;
/* Reset all pointers:
*/
prim->mode = mode;
prim->begin = begin_flag;
+ prim->num_instances = 1;
}
static void
replay_init( struct copy_context *copy )
{
- GLcontext *ctx = copy->ctx;
+ struct gl_context *ctx = copy->ctx;
GLuint i;
GLuint offset;
const GLvoid *srcptr;
copy->vertex_size += attr_size(copy->array[i]);
if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo))
- ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY, vbo);
+ ctx->Driver.MapBufferRange(ctx, 0, vbo->Size, GL_MAP_READ_BIT, vbo);
copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer,
copy->array[i]->Ptr);
*/
if (_mesa_is_bufferobj(copy->ib->obj) &&
!_mesa_bufferobj_mapped(copy->ib->obj))
- ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY,
- copy->ib->obj);
+ ctx->Driver.MapBufferRange(ctx, 0, copy->ib->obj->Size, GL_MAP_READ_BIT,
+ copy->ib->obj);
srcptr = (const GLubyte *) ADD_POINTERS(copy->ib->obj->Pointer,
copy->ib->ptr);
dst->Ptr = copy->dstbuf + offset;
dst->Enabled = GL_TRUE;
dst->Normalized = src->Normalized;
+ dst->Integer = src->Integer;
dst->BufferObj = ctx->Shared->NullBufferObj;
+ dst->_ElementSize = src->_ElementSize;
dst->_MaxElement = copy->dstbuf_size; /* may be less! */
offset += copy->varying[i].size;
static void
replay_finish( struct copy_context *copy )
{
- GLcontext *ctx = copy->ctx;
+ struct gl_context *ctx = copy->ctx;
GLuint i;
/* Free our vertex and index buffers:
for (i = 0; i < copy->nr_varying; i++) {
struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj;
if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo))
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, vbo);
+ ctx->Driver.UnmapBuffer(ctx, vbo);
}
/* Unmap index buffer:
*/
if (_mesa_is_bufferobj(copy->ib->obj) &&
_mesa_bufferobj_mapped(copy->ib->obj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, copy->ib->obj);
+ ctx->Driver.UnmapBuffer(ctx, copy->ib->obj);
}
}
/**
* Split VBO into smaller pieces, draw the pieces.
*/
-void vbo_split_copy( GLcontext *ctx,
+void vbo_split_copy( struct gl_context *ctx,
const struct gl_client_array *arrays[],
const struct _mesa_prim *prim,
GLuint nr_prims,