Merge branch 'mesa_7_5_branch'
Conflicts: src/mesa/vbo/vbo_exec_draw.c
This commit is contained in:
commit
b40dc7e7fc
|
@ -9,6 +9,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#include "extfuncs.h"
|
||||
#include "shaderutil.h"
|
||||
|
@ -78,8 +79,12 @@ CompileShaderFile(GLenum shaderType, const char *filename)
|
|||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
GLuint shader;
|
||||
FILE *f;
|
||||
|
||||
FILE *f = fopen(filename, "r");
|
||||
Init();
|
||||
|
||||
|
||||
f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "Unable to open shader file %s\n", filename);
|
||||
return 0;
|
||||
|
|
|
@ -83,7 +83,9 @@ my_buffer_write(struct pipe_screen *screen,
|
|||
assert(dirty_size >= size);
|
||||
assert(size);
|
||||
|
||||
map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_WRITE);
|
||||
map = pipe_buffer_map_range(screen, buf, offset, size,
|
||||
PIPE_BUFFER_USAGE_CPU_WRITE |
|
||||
PIPE_BUFFER_USAGE_FLUSH_EXPLICIT);
|
||||
if (map == NULL)
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
|
|
@ -210,6 +210,7 @@ enum pipe_transfer_usage {
|
|||
#define PIPE_BUFFER_USAGE_CONSTANT (1 << 7)
|
||||
#define PIPE_BUFFER_USAGE_DISCARD (1 << 8)
|
||||
#define PIPE_BUFFER_USAGE_DONTBLOCK (1 << 9)
|
||||
#define PIPE_BUFFER_USAGE_FLUSH_EXPLICIT (1 << 10) /**< See pipe_screen::buffer_flush_mapped_range */
|
||||
/** Pipe driver custom usage flags should be greater or equal to this value */
|
||||
#define PIPE_BUFFER_USAGE_CUSTOM (1 << 16)
|
||||
|
||||
|
|
|
@ -117,7 +117,9 @@ pipe_buffer_write(struct pipe_screen *screen,
|
|||
assert(offset + size <= buf->size);
|
||||
assert(size);
|
||||
|
||||
map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_WRITE);
|
||||
map = pipe_buffer_map_range(screen, buf, offset, size,
|
||||
PIPE_BUFFER_USAGE_CPU_WRITE |
|
||||
PIPE_BUFFER_USAGE_FLUSH_EXPLICIT);
|
||||
assert(map);
|
||||
if(map) {
|
||||
memcpy(map + offset, data, size);
|
||||
|
|
|
@ -221,23 +221,31 @@ struct pipe_screen {
|
|||
/**
|
||||
* Notify a range that was actually written into.
|
||||
*
|
||||
* Can only be used if the buffer was mapped with the
|
||||
* PIPE_BUFFER_USAGE_CPU_WRITE and PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flags
|
||||
* set.
|
||||
*
|
||||
* The range is relative to the buffer start, regardless of the range
|
||||
* specified to buffer_map_range. This is different from the
|
||||
* ARB_map_buffer_range semantics because we don't forbid multiple mappings
|
||||
* of the same buffer (yet).
|
||||
*
|
||||
* If the buffer was mapped for writing and no buffer_flush_mapped_range
|
||||
* call was done until the buffer_unmap is called then the pipe driver will
|
||||
* assumed that the whole buffer was written. This is for backward
|
||||
* compatibility purposes and may affect performance -- the state tracker
|
||||
* should always specify exactly what got written while the buffer was
|
||||
* mapped.
|
||||
*/
|
||||
void (*buffer_flush_mapped_range)( struct pipe_screen *screen,
|
||||
struct pipe_buffer *buf,
|
||||
unsigned offset,
|
||||
unsigned length);
|
||||
|
||||
/**
|
||||
* Unmap buffer.
|
||||
*
|
||||
* If the buffer was mapped with PIPE_BUFFER_USAGE_CPU_WRITE flag but not
|
||||
* PIPE_BUFFER_USAGE_FLUSH_EXPLICIT then the pipe driver will
|
||||
* assume that the whole buffer was written. This is mostly for backward
|
||||
* compatibility purposes and may affect performance -- the state tracker
|
||||
* should always specify exactly what got written while the buffer was
|
||||
* mapped.
|
||||
*/
|
||||
void (*buffer_unmap)( struct pipe_screen *screen,
|
||||
struct pipe_buffer *buf );
|
||||
|
||||
|
|
|
@ -401,6 +401,8 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
|
|||
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
|
||||
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
|
||||
|
||||
free(driver_configs);
|
||||
|
||||
psp->destroyScreen = driDestroyScreen;
|
||||
psp->createContext = driCreateContext;
|
||||
psp->createDrawable = driCreateDrawable;
|
||||
|
|
|
@ -164,7 +164,7 @@ GetGLXScreenConfigs(Display *dpy, int scrn)
|
|||
{
|
||||
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
|
||||
|
||||
return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL;
|
||||
return (priv && priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -236,6 +236,9 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
|
|||
if (access & GL_MAP_READ_BIT)
|
||||
flags |= PIPE_BUFFER_USAGE_CPU_READ;
|
||||
|
||||
if (access & GL_MAP_FLUSH_EXPLICIT_BIT)
|
||||
flags |= PIPE_BUFFER_USAGE_FLUSH_EXPLICIT;
|
||||
|
||||
/* ... other flags ...
|
||||
*/
|
||||
|
||||
|
|
|
@ -282,9 +282,14 @@ void
|
|||
vbo_exec_vtx_map( struct vbo_exec_context *exec )
|
||||
{
|
||||
GLcontext *ctx = exec->ctx;
|
||||
GLenum target = GL_ARRAY_BUFFER_ARB;
|
||||
GLenum access = GL_READ_WRITE_ARB;
|
||||
GLenum usage = GL_STREAM_DRAW_ARB;
|
||||
const GLenum target = GL_ARRAY_BUFFER_ARB;
|
||||
const GLenum access = GL_READ_WRITE_ARB; /* for MapBuffer */
|
||||
const GLenum accessRange = GL_MAP_WRITE_BIT | /* for MapBufferRange */
|
||||
GL_MAP_INVALIDATE_RANGE_BIT |
|
||||
GL_MAP_UNSYNCHRONIZED_BIT |
|
||||
GL_MAP_FLUSH_EXPLICIT_BIT |
|
||||
MESA_MAP_NOWAIT_BIT;
|
||||
const GLenum usage = GL_STREAM_DRAW_ARB;
|
||||
|
||||
if (exec->vtx.bufferobj->Name == 0)
|
||||
return;
|
||||
|
@ -303,10 +308,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
|
|||
exec->vtx.buffer_used,
|
||||
(VBO_VERT_BUFFER_SIZE -
|
||||
exec->vtx.buffer_used),
|
||||
(GL_MAP_WRITE_BIT |
|
||||
GL_MAP_INVALIDATE_RANGE_BIT |
|
||||
GL_MAP_UNSYNCHRONIZED_BIT |
|
||||
MESA_MAP_NOWAIT_BIT),
|
||||
accessRange,
|
||||
exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
|
||||
}
|
||||
|
@ -318,8 +320,16 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
|
|||
VBO_VERT_BUFFER_SIZE,
|
||||
NULL, usage, exec->vtx.bufferobj);
|
||||
|
||||
exec->vtx.buffer_map = (GLfloat *)
|
||||
ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj);
|
||||
|
||||
if (ctx->Driver.MapBufferRange)
|
||||
exec->vtx.buffer_map =
|
||||
(GLfloat *)ctx->Driver.MapBufferRange(ctx, target,
|
||||
0, VBO_VERT_BUFFER_SIZE,
|
||||
accessRange,
|
||||
exec->vtx.bufferobj);
|
||||
else
|
||||
exec->vtx.buffer_map =
|
||||
(GLfloat *)ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ GLNAME(_mesa_sse_transform_points2_3d_no_rot):
|
|||
MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
|
||||
ADD_L( EDI, ECX ) /* count += dest ptr */
|
||||
|
||||
PXOR( XMM0, XMM0 )
|
||||
|
||||
ALIGNTEXT32
|
||||
MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
|
||||
|
|
|
@ -198,6 +198,7 @@ GLNAME(_mesa_sse_transform_points3_3d_no_rot):
|
|||
MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
|
||||
ADD_L( EDI, ECX ) /* count += dest ptr */
|
||||
|
||||
PXOR( XMM0, XMM0 )
|
||||
|
||||
ALIGNTEXT32
|
||||
MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
|
||||
|
|
Loading…
Reference in New Issue