mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 01:00:10 +01:00
Merge commit 'origin/master' into HEAD
Conflicts: src/mesa/vbo/vbo.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_exec_draw.c
This commit is contained in:
commit
fb8db63a89
10 changed files with 53 additions and 33 deletions
|
|
@ -1024,6 +1024,9 @@ void brw_vs_emit(struct brw_vs_compile *c )
|
|||
case OPCODE_ADD:
|
||||
brw_ADD(p, dst, args[0], args[1]);
|
||||
break;
|
||||
case OPCODE_COS:
|
||||
emit_math1(c, BRW_MATH_FUNCTION_COS, dst, args[0], BRW_MATH_PRECISION_FULL);
|
||||
break;
|
||||
case OPCODE_DP3:
|
||||
brw_DP3(p, dst, args[0], args[1]);
|
||||
break;
|
||||
|
|
@ -1089,6 +1092,9 @@ void brw_vs_emit(struct brw_vs_compile *c )
|
|||
case OPCODE_SEQ:
|
||||
emit_seq(p, dst, args[0], args[1]);
|
||||
break;
|
||||
case OPCODE_SIN:
|
||||
emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, args[0], BRW_MATH_PRECISION_FULL);
|
||||
break;
|
||||
case OPCODE_SNE:
|
||||
emit_sne(p, dst, args[0], args[1]);
|
||||
break;
|
||||
|
|
@ -1155,7 +1161,10 @@ void brw_vs_emit(struct brw_vs_compile *c )
|
|||
case OPCODE_ENDSUB:
|
||||
break;
|
||||
default:
|
||||
_mesa_printf("Unsupport opcode %d in vertex shader\n", inst->Opcode);
|
||||
_mesa_printf("Unsupported opcode %i (%s) in vertex shader\n",
|
||||
inst->Opcode, inst->Opcode < MAX_OPCODE ?
|
||||
_mesa_opcode_string(inst->Opcode) :
|
||||
"unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1302,8 +1302,10 @@ void brw_wm_emit( struct brw_wm_compile *c )
|
|||
break;
|
||||
|
||||
default:
|
||||
_mesa_printf("unsupport opcode %d in fragment program\n",
|
||||
inst->opcode);
|
||||
_mesa_printf("Unsupported opcode %i (%s) in fragment shader\n",
|
||||
inst->opcode, inst->opcode < MAX_OPCODE ?
|
||||
_mesa_opcode_string(inst->opcode) :
|
||||
"unknown");
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
|
|||
irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
|
||||
irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
|
||||
DBG("Render to DEPTH16 texture OK\n");
|
||||
} else if (texImage->TexFormat == &_mesa_texformat_z24_s8) {
|
||||
} else if (texImage->TexFormat == &_mesa_texformat_s8_z24) {
|
||||
irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT;
|
||||
irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
|
||||
DBG("Render to DEPTH_STENCIL texture OK\n");
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
#include "eval.h"
|
||||
#endif
|
||||
#include "get.h"
|
||||
#if FEATURE_feadback
|
||||
#if FEATURE_feedback
|
||||
#include "feedback.h"
|
||||
#endif
|
||||
#include "fog.h"
|
||||
|
|
@ -222,7 +222,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
|
|||
SET_CopyPixels(exec, _mesa_CopyPixels);
|
||||
SET_DrawPixels(exec, _mesa_DrawPixels);
|
||||
#endif
|
||||
#if FEATURE_feadback
|
||||
#if FEATURE_feedback
|
||||
SET_InitNames(exec, _mesa_InitNames);
|
||||
SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer);
|
||||
SET_LoadName(exec, _mesa_LoadName);
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
|||
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
|
||||
ASSERT(n <= 100);
|
||||
for (i = 0; i < n; i++)
|
||||
params[i] = ENUM_TO_INT(formats[i]);
|
||||
params[i] = ENUM_TO_BOOLEAN(formats[i]);
|
||||
}
|
||||
break;
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
|
|
@ -2137,7 +2137,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
|||
params[0] = (GLfloat)(ctx->DrawBuffer->Visual.depthBits);
|
||||
break;
|
||||
case GL_DEPTH_CLEAR_VALUE:
|
||||
params[0] = (GLfloat)ctx->Depth.Clear;
|
||||
params[0] = ctx->Depth.Clear;
|
||||
break;
|
||||
case GL_DEPTH_FUNC:
|
||||
params[0] = ENUM_TO_FLOAT(ctx->Depth.Func);
|
||||
|
|
@ -2940,7 +2940,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
|||
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
|
||||
ASSERT(n <= 100);
|
||||
for (i = 0; i < n; i++)
|
||||
params[i] = (GLfloat)(ENUM_TO_INT(formats[i]));
|
||||
params[i] = ENUM_TO_FLOAT(formats[i]);
|
||||
}
|
||||
break;
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
|
|
@ -3985,7 +3985,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
|
|||
params[0] = ctx->DrawBuffer->Visual.depthBits;
|
||||
break;
|
||||
case GL_DEPTH_CLEAR_VALUE:
|
||||
params[0] = IROUND(ctx->Depth.Clear);
|
||||
params[0] = FLOAT_TO_INT(ctx->Depth.Clear);
|
||||
break;
|
||||
case GL_DEPTH_FUNC:
|
||||
params[0] = ENUM_TO_INT(ctx->Depth.Func);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ TypeStrings = {
|
|||
# - the GL state name, such as GL_CURRENT_COLOR
|
||||
# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum
|
||||
# - list of code fragments to get the state, such as ["ctx->Foo.Bar"]
|
||||
# - optional extra code or empty string
|
||||
# - optional extra code or empty string. If present, "CONVERSION" will be
|
||||
# replaced by ENUM_TO_FLOAT, INT_TO_FLOAT, etc.
|
||||
# - optional extensions to check, or None
|
||||
#
|
||||
StateVars = [
|
||||
|
|
@ -179,7 +180,7 @@ StateVars = [
|
|||
( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ),
|
||||
( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"],
|
||||
"", None ),
|
||||
( "GL_DEPTH_CLEAR_VALUE", GLfloat, ["ctx->Depth.Clear"], "", None ),
|
||||
( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["ctx->Depth.Clear"], "", None ),
|
||||
( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ),
|
||||
( "GL_DEPTH_RANGE", GLfloatN,
|
||||
[ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ),
|
||||
|
|
@ -532,7 +533,7 @@ StateVars = [
|
|||
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
|
||||
ASSERT(n <= 100);
|
||||
for (i = 0; i < n; i++)
|
||||
params[i] = ENUM_TO_INT(formats[i]);""",
|
||||
params[i] = CONVERSION(formats[i]);""",
|
||||
["ARB_texture_compression"] ),
|
||||
|
||||
# GL_EXT_compiled_vertex_array
|
||||
|
|
@ -1083,10 +1084,11 @@ def EmitGetFunction(stateVars, returnType):
|
|||
assert len(extensions) == 4
|
||||
print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' %
|
||||
(extensions[0], extensions[1], extensions[2], extensions[3], function))
|
||||
conversion = ConversionFunc(varType, returnType)
|
||||
if optionalCode:
|
||||
optionalCode = string.replace(optionalCode, "CONVERSION", conversion);
|
||||
print " {"
|
||||
print " " + optionalCode
|
||||
conversion = ConversionFunc(varType, returnType)
|
||||
n = len(state)
|
||||
for i in range(n):
|
||||
if conversion:
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@ void grammar_alloc_free (void *ptr)
|
|||
free (ptr);
|
||||
}
|
||||
|
||||
void *grammar_alloc_malloc (unsigned int size)
|
||||
void *grammar_alloc_malloc (size_t size)
|
||||
{
|
||||
return malloc (size);
|
||||
}
|
||||
|
||||
void *grammar_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
|
||||
void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size)
|
||||
{
|
||||
return realloc (ptr, size);
|
||||
}
|
||||
|
||||
void *grammar_memory_copy (void *dst, const void * src, unsigned int size)
|
||||
void *grammar_memory_copy (void *dst, const void * src, size_t size)
|
||||
{
|
||||
return memcpy (dst, src, size);
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ int grammar_string_compare (const byte *str1, const byte *str2)
|
|||
return strcmp ((const char *) str1, (const char *) str2);
|
||||
}
|
||||
|
||||
int grammar_string_compare_n (const byte *str1, const byte *str2, unsigned int n)
|
||||
int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n)
|
||||
{
|
||||
return strncmp ((const char *) str1, (const char *) str2, n);
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ byte *grammar_string_copy (byte *dst, const byte *src)
|
|||
return (byte *) strcpy ((char *) dst, (const char *) src);
|
||||
}
|
||||
|
||||
byte *grammar_string_copy_n (byte *dst, const byte *src, unsigned int n)
|
||||
byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n)
|
||||
{
|
||||
return (byte *) strncpy ((char *) dst, (const char *) src, n);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2439,7 +2439,11 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
|
|||
/*assert(!var->declared);*/
|
||||
var->declared = GL_TRUE;
|
||||
|
||||
assert(!is_sampler_type(&var->type));
|
||||
if(is_sampler_type(&var->type)) {
|
||||
slang_info_log_error(A->log, "redeclaration of sampler '%s'",
|
||||
(char*) var->a_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
n = new_node0(IR_VAR_DECL);
|
||||
if (n) {
|
||||
|
|
|
|||
|
|
@ -700,8 +700,8 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
|
|||
&exec->vtx.bufferobj,
|
||||
ctx->Array.NullBufferObj);
|
||||
|
||||
ASSERT(!exec->vtx.buffer_map);
|
||||
exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64);
|
||||
|
||||
vbo_exec_vtxfmt_init( exec );
|
||||
|
||||
/* Hook our functions into the dispatch table.
|
||||
|
|
@ -726,13 +726,13 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
|
|||
|
||||
void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
|
||||
{
|
||||
GLcontext *ctx = exec->ctx;
|
||||
if (exec->vtx.bufferobj->Name) {
|
||||
ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, exec->vtx.bufferobj);
|
||||
ctx->Driver.DeleteBuffer(ctx, exec->vtx.bufferobj);
|
||||
exec->vtx.bufferobj = NULL;
|
||||
/* using a real VBO for vertex data */
|
||||
GLcontext *ctx = exec->ctx;
|
||||
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
|
||||
}
|
||||
else {
|
||||
/* just using malloc'd space for vertex data */
|
||||
if (exec->vtx.buffer_map) {
|
||||
ALIGN_FREE(exec->vtx.buffer_map);
|
||||
exec->vtx.buffer_map = NULL;
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
|
|||
/* Ptr into ordinary app memory */
|
||||
arrays[attr].Ptr = (void *) data;
|
||||
}
|
||||
|
||||
arrays[attr].Size = exec->vtx.attrsz[src];
|
||||
arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
|
||||
arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);
|
||||
|
|
@ -243,8 +242,11 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec )
|
|||
*/
|
||||
vbo_exec_bind_arrays( ctx );
|
||||
|
||||
ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_map = NULL;
|
||||
/* if using a real VBO, unmap it before drawing */
|
||||
if (exec->vtx.bufferobj->Name) {
|
||||
ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_map = NULL;
|
||||
}
|
||||
|
||||
vbo_context(ctx)->draw_prims( ctx,
|
||||
exec->vtx.inputs,
|
||||
|
|
@ -254,11 +256,12 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec )
|
|||
0,
|
||||
exec->vtx.vert_count - 1);
|
||||
|
||||
/* Get new data:
|
||||
*/
|
||||
ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_map
|
||||
= ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj);
|
||||
/* If using a real VBO, get new storage */
|
||||
if (exec->vtx.bufferobj->Name) {
|
||||
ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj);
|
||||
exec->vtx.buffer_map =
|
||||
ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue