Merge commit 'origin/master' into gallium-0.2

This commit is contained in:
Alan Hourihane
2008-11-28 16:19:10 +00:00
13 changed files with 240 additions and 48 deletions

View File

@@ -1033,6 +1033,7 @@ else
fi fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
fi fi
echo " Use XCB: $enable_xcb"
dnl Libraries dnl Libraries
echo "" echo ""

View File

@@ -154,6 +154,7 @@ static GLuint TexObj;
static GLuint MyFB; static GLuint MyFB;
static GLuint DepthRB; static GLuint DepthRB;
static GLboolean WireFrame = GL_FALSE; static GLboolean WireFrame = GL_FALSE;
static GLboolean Anim = GL_TRUE;
static GLint texType = 0; static GLint texType = 0;
static GLint T0 = 0; static GLint T0 = 0;
@@ -163,6 +164,11 @@ static GLint Win = 0;
static GLfloat ViewRotX = 20.0, ViewRotY = 30.0, ViewRotZ = 0.0; static GLfloat ViewRotX = 20.0, ViewRotY = 30.0, ViewRotZ = 0.0;
static GLfloat CubeRot = 0.0; static GLfloat CubeRot = 0.0;
static void
idle(void);
static void static void
CheckError(int line) CheckError(int line)
{ {
@@ -605,7 +611,10 @@ key(unsigned char key, int x, int y)
cleanup(); cleanup();
exit(0); exit(0);
break; break;
case ' ':
Anim = !Anim;
glutIdleFunc(Anim ? idle : NULL);
break;
case 'a': case 'a':
v += 0.0005; v += 0.0005;
break; break;
@@ -1013,7 +1022,7 @@ static void
visible(int vis) visible(int vis)
{ {
if (vis == GLUT_VISIBLE) if (vis == GLUT_VISIBLE)
glutIdleFunc(idle); glutIdleFunc(Anim ? idle : NULL);
else else
glutIdleFunc(NULL); glutIdleFunc(NULL);
} }

View File

@@ -104,14 +104,6 @@ bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int us
int the_ustride; int the_ustride;
int the_vstride; int the_vstride;
bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
assert(ret);
ret->bpatch = NULL;
ret->bpatch_normal = NULL;
ret->bpatch_color = NULL;
ret->bpatch_texcoord = NULL;
if(maptype == GL_MAP2_VERTEX_3) dimension = 3; if(maptype == GL_MAP2_VERTEX_3) dimension = 3;
else if (maptype==GL_MAP2_VERTEX_4) dimension = 4; else if (maptype==GL_MAP2_VERTEX_4) dimension = 4;
else { else {
@@ -119,7 +111,14 @@ bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int us
return NULL; return NULL;
} }
bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
assert(ret);
ret->bpatch_normal = NULL;
ret->bpatch_color = NULL;
ret->bpatch_texcoord = NULL;
ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension); ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension);
/*copy the control points there*/ /*copy the control points there*/
the_ustride = vorder * dimension; the_ustride = vorder * dimension;
the_vstride = dimension; the_vstride = dimension;

View File

@@ -31,6 +31,70 @@
#include "glxclient.h" #include "glxclient.h"
#if defined(USE_XCB)
# include <X11/Xlib-xcb.h>
# include <xcb/xcb.h>
# include <xcb/glx.h>
#endif
#ifdef USE_XCB
/**
* Exchange a protocol request for glXQueryServerString.
*/
char *
__glXQueryServerString(Display* dpy,
int opcode,
CARD32 screen,
CARD32 name)
{
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_query_server_string_reply_t* reply =
xcb_glx_query_server_string_reply(c,
xcb_glx_query_server_string(c,
screen,
name),
NULL);
/* The spec doesn't mention this, but the Xorg server replies with
* a string already terminated with '\0'. */
uint32_t len = xcb_glx_query_server_string_string_length(reply);
char* buf = Xmalloc(len);
memcpy(buf, xcb_glx_query_server_string_string(reply), len);
free(reply);
return buf;
}
/**
* Exchange a protocol request for glGetString.
*/
char *
__glXGetString(Display* dpy,
int opcode,
CARD32 contextTag,
CARD32 name)
{
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_get_string_reply_t* reply =
xcb_glx_get_string_reply(c,
xcb_glx_get_string(c,
contextTag,
name),
NULL);
/* The spec doesn't mention this, but the Xorg server replies with
* a string already terminated with '\0'. */
uint32_t len = xcb_glx_get_string_string_length(reply);
char* buf = Xmalloc(len);
memcpy(buf, xcb_glx_get_string_string(reply), len);
free(reply);
return buf;
}
#else
/** /**
* GLX protocol structure for the ficticious "GXLGenericGetString" request. * GLX protocol structure for the ficticious "GXLGenericGetString" request.
* *
@@ -57,7 +121,7 @@ typedef struct GLXGenericGetString
* Query the Server GLX string. * Query the Server GLX string.
* This routine will allocate the necessay space for the string. * This routine will allocate the necessay space for the string.
*/ */
char * static char *
__glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode, __glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode,
CARD32 for_whom, CARD32 name) CARD32 for_whom, CARD32 name)
{ {
@@ -101,3 +165,27 @@ __glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode,
return buf; return buf;
} }
char *
__glXQueryServerString(Display* dpy,
int opcode,
CARD32 screen,
CARD32 name)
{
return __glXGetStringFromServer(dpy, opcode,
X_GLXQueryServerString,
screen, name);
}
char *
__glXGetString(Display* dpy,
int opcode,
CARD32 contextTag,
CARD32 name)
{
return __glXGetStringFromServer(dpy, opcode, X_GLsop_GetString,
contextTag, name);
}
#endif /* USE_XCB */

View File

@@ -741,8 +741,10 @@ extern void _XSend(Display*, const void*, long);
extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
extern char * __glXGetStringFromServer( Display * dpy, int opcode, extern char * __glXQueryServerString(Display* dpy, int opcode,
CARD32 glxCode, CARD32 for_whom, CARD32 name ); CARD32 screen, CARD32 name);
extern char * __glXGetString(Display* dpy, int opcode,
CARD32 screen, CARD32 name);
extern char *__glXstrdup(const char *str); extern char *__glXstrdup(const char *str);

View File

@@ -44,6 +44,12 @@
#include "xf86dri.h" #include "xf86dri.h"
#endif #endif
#if defined(USE_XCB)
#include <X11/Xlib-xcb.h>
#include <xcb/xcb.h>
#include <xcb/glx.h>
#endif
static const char __glXGLXClientVendorName[] = "SGI"; static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.4"; static const char __glXGLXClientVersion[] = "1.4";
@@ -749,8 +755,10 @@ PUBLIC void glXCopyContext(Display *dpy, GLXContext source,
*/ */
static Bool __glXIsDirect(Display *dpy, GLXContextID contextID) static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
{ {
#if !defined(USE_XCB)
xGLXIsDirectReq *req; xGLXIsDirectReq *req;
xGLXIsDirectReply reply; xGLXIsDirectReply reply;
#endif
CARD8 opcode; CARD8 opcode;
opcode = __glXSetupForCommand(dpy); opcode = __glXSetupForCommand(dpy);
@@ -758,6 +766,18 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
return GL_FALSE; return GL_FALSE;
} }
#ifdef USE_XCB
xcb_connection_t* c = XGetXCBConnection(dpy);
xcb_glx_is_direct_reply_t* reply =
xcb_glx_is_direct_reply(c,
xcb_glx_is_direct(c, contextID),
NULL);
const Bool is_direct = reply->is_direct ? True : False;
free(reply);
return is_direct;
#else
/* Send the glXIsDirect request */ /* Send the glXIsDirect request */
LockDisplay(dpy); LockDisplay(dpy);
GetReq(GLXIsDirect,req); GetReq(GLXIsDirect,req);
@@ -769,6 +789,7 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
SyncHandle(); SyncHandle();
return reply.isDirect; return reply.isDirect;
#endif /* USE_XCB */
} }
/** /**
@@ -840,7 +861,6 @@ PUBLIC void glXDestroyGLXPixmap(Display *dpy, GLXPixmap glxpixmap)
PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable) PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
{ {
xGLXSwapBuffersReq *req;
GLXContext gc; GLXContext gc;
GLXContextTag tag; GLXContextTag tag;
CARD8 opcode; CARD8 opcode;
@@ -871,6 +891,13 @@ PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
tag = 0; tag = 0;
} }
#ifdef USE_XCB
xcb_connection_t* c = XGetXCBConnection(dpy);
xcb_glx_swap_buffers(c, tag, drawable);
xcb_flush(c);
#else
xGLXSwapBuffersReq *req;
/* Send the glXSwapBuffers request */ /* Send the glXSwapBuffers request */
LockDisplay(dpy); LockDisplay(dpy);
GetReq(GLXSwapBuffers,req); GetReq(GLXSwapBuffers,req);
@@ -881,6 +908,7 @@ PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
XFlush(dpy); XFlush(dpy);
#endif /* USE_XCB */
} }
@@ -1314,9 +1342,8 @@ PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
if (!psc->effectiveGLXexts) { if (!psc->effectiveGLXexts) {
if (!psc->serverGLXexts) { if (!psc->serverGLXexts) {
psc->serverGLXexts = __glXGetStringFromServer(dpy, priv->majorOpcode, psc->serverGLXexts =
X_GLXQueryServerString, __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS);
screen, GLX_EXTENSIONS);
} }
__glXCalculateUsableExtensions(psc, __glXCalculateUsableExtensions(psc,
@@ -1371,8 +1398,7 @@ PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name )
} }
if ( *str == NULL ) { if ( *str == NULL ) {
*str = __glXGetStringFromServer(dpy, priv->majorOpcode, *str = __glXQueryServerString(dpy, priv->majorOpcode, screen, name);
X_GLXQueryServerString, screen, name);
} }
return *str; return *str;
@@ -1380,9 +1406,18 @@ PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name )
void __glXClientInfo ( Display *dpy, int opcode ) void __glXClientInfo ( Display *dpy, int opcode )
{ {
xGLXClientInfoReq *req;
int size;
char * ext_str = __glXGetClientGLExtensionString(); char * ext_str = __glXGetClientGLExtensionString();
int size = strlen( ext_str ) + 1;
#ifdef USE_XCB
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_client_info(c,
GLX_MAJOR_VERSION,
GLX_MINOR_VERSION,
size,
(const uint8_t *)ext_str);
#else
xGLXClientInfoReq *req;
/* Send the glXClientInfo request */ /* Send the glXClientInfo request */
LockDisplay(dpy); LockDisplay(dpy);
@@ -1392,13 +1427,13 @@ void __glXClientInfo ( Display *dpy, int opcode )
req->major = GLX_MAJOR_VERSION; req->major = GLX_MAJOR_VERSION;
req->minor = GLX_MINOR_VERSION; req->minor = GLX_MINOR_VERSION;
size = strlen( ext_str ) + 1;
req->length += (size + 3) >> 2; req->length += (size + 3) >> 2;
req->numbytes = size; req->numbytes = size;
Data(dpy, ext_str, size); Data(dpy, ext_str, size);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
#endif /* USE_XCB */
Xfree( ext_str ); Xfree( ext_str );
} }

View File

@@ -139,7 +139,8 @@ XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo,
** Free the per screen configs data as well as the array of ** Free the per screen configs data as well as the array of
** __glXScreenConfigs. ** __glXScreenConfigs.
*/ */
static void FreeScreenConfigs(__GLXdisplayPrivate * priv) static void
FreeScreenConfigs(__GLXdisplayPrivate * priv)
{ {
__GLXscreenConfigs *psc; __GLXscreenConfigs *psc;
GLint i, screens; GLint i, screens;
@@ -221,6 +222,25 @@ __glXFreeDisplayPrivate(XExtData * extension)
static Bool static Bool
QueryVersion(Display * dpy, int opcode, int *major, int *minor) QueryVersion(Display * dpy, int opcode, int *major, int *minor)
{ {
#ifdef USE_XCB
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_query_version_reply_t* reply =
xcb_glx_query_version_reply(c,
xcb_glx_query_version(c,
GLX_MAJOR_VERSION,
GLX_MINOR_VERSION),
NULL);
if(reply->major_version != GLX_MAJOR_VERSION)
{
free(reply);
return GL_FALSE;
}
*major = reply->major_version;
*minor = min(reply->minor_version, GLX_MINOR_VERSION);
free(reply);
return GL_TRUE;
#else
xGLXQueryVersionReq *req; xGLXQueryVersionReq *req;
xGLXQueryVersionReply reply; xGLXQueryVersionReply reply;
@@ -245,6 +265,7 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
*major = reply.majorVersion; *major = reply.majorVersion;
*minor = min(reply.minorVersion, GLX_MINOR_VERSION); *minor = min(reply.minorVersion, GLX_MINOR_VERSION);
return GL_TRUE; return GL_TRUE;
#endif /* USE_XCB */
} }
@@ -529,9 +550,7 @@ getFBConfigs(Display * dpy, __GLXdisplayPrivate * priv, int screen)
__GLXscreenConfigs *psc; __GLXscreenConfigs *psc;
psc = priv->screenConfigs + screen; psc = priv->screenConfigs + screen;
psc->serverGLXexts = __glXGetStringFromServer(dpy, priv->majorOpcode, psc->serverGLXexts = __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS);
X_GLXQueryServerString,
screen, GLX_EXTENSIONS);
LockDisplay(dpy); LockDisplay(dpy);
@@ -589,9 +608,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
memset(psc, 0, screens * sizeof(__GLXscreenConfigs)); memset(psc, 0, screens * sizeof(__GLXscreenConfigs));
priv->screenConfigs = psc; priv->screenConfigs = psc;
priv->serverGLXversion = __glXGetStringFromServer(dpy, priv->majorOpcode, priv->serverGLXversion = __glXQueryServerString(dpy, priv->majorOpcode, 0, GLX_VERSION);
X_GLXQueryServerString,
0, GLX_VERSION);
if (priv->serverGLXversion == NULL) { if (priv->serverGLXversion == NULL) {
FreeScreenConfigs(priv); FreeScreenConfigs(priv);
return GL_FALSE; return GL_FALSE;

View File

@@ -679,9 +679,7 @@ __indirect_glGetString(GLenum name)
*/ */
(void) __glXFlushRenderBuffer(gc, gc->pc); (void) __glXFlushRenderBuffer(gc, gc->pc);
s = (GLubyte *) __glXGetStringFromServer(dpy, gc->majorOpcode, s = (GLubyte *) __glXGetString(dpy, gc->majorOpcode, gc->currentContextTag, name);
X_GLsop_GetString,
gc->currentContextTag, name);
if (!s) { if (!s) {
/* Throw data on the floor */ /* Throw data on the floor */
__glXSetError(gc, GL_OUT_OF_MEMORY); __glXSetError(gc, GL_OUT_OF_MEMORY);

View File

@@ -56,11 +56,13 @@ wmesa_free_framebuffer(HDC hdc)
prev = pwfb; prev = pwfb;
} }
if (pwfb) { if (pwfb) {
struct gl_framebuffer *fb;
if (pwfb == FirstFramebuffer) if (pwfb == FirstFramebuffer)
FirstFramebuffer = pwfb->next; FirstFramebuffer = pwfb->next;
else else
prev->next = pwfb->next; prev->next = pwfb->next;
_mesa_unreference_framebuffer(&pwfb->Base); fb = &pwfb->Base;
_mesa_unreference_framebuffer(&fb);
} }
} }
@@ -1503,6 +1505,9 @@ WMesaContext WMesaCreateContext(HDC hDC,
ctx = &c->gl_ctx; ctx = &c->gl_ctx;
_mesa_initialize_context(ctx, visual, NULL, &functions, (void *)c); _mesa_initialize_context(ctx, visual, NULL, &functions, (void *)c);
/* visual no longer needed - it was copied by _mesa_initialize_context() */
_mesa_destroy_visual(visual);
_mesa_enable_sw_extensions(ctx); _mesa_enable_sw_extensions(ctx);
_mesa_enable_1_3_extensions(ctx); _mesa_enable_1_3_extensions(ctx);
_mesa_enable_1_4_extensions(ctx); _mesa_enable_1_4_extensions(ctx);

View File

@@ -631,6 +631,9 @@ append(char *dst, const char *src)
} }
/**
* Convert token 'k' to a string, append it only 'dst' string.
*/
static void static void
append_token(char *dst, gl_state_index k) append_token(char *dst, gl_state_index k)
{ {
@@ -763,11 +766,30 @@ append_token(char *dst, gl_state_index k)
case STATE_LOCAL: case STATE_LOCAL:
append(dst, "local"); append(dst, "local");
break; break;
/* BEGIN internal state vars */
case STATE_INTERNAL:
append(dst, "(internal)");
break;
case STATE_NORMAL_SCALE: case STATE_NORMAL_SCALE:
append(dst, "normalScale"); append(dst, "normalScale");
break; break;
case STATE_INTERNAL: case STATE_TEXRECT_SCALE:
append(dst, "(internal)"); append(dst, "texrectScale");
break;
case STATE_FOG_PARAMS_OPTIMIZED:
append(dst, "fogParamsOptimized");
break;
case STATE_LIGHT_SPOT_DIR_NORMALIZED:
append(dst, "lightSpotDirNormalized");
break;
case STATE_LIGHT_POSITION:
append(dst, "lightPosition");
break;
case STATE_LIGHT_POSITION_NORMALIZED:
append(dst, "light.position.normalized");
break;
case STATE_LIGHT_HALF_VECTOR:
append(dst, "lightHalfVector");
break; break;
case STATE_PT_SCALE: case STATE_PT_SCALE:
append(dst, "PTscale"); append(dst, "PTscale");
@@ -818,16 +840,16 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
char tmp[30]; char tmp[30];
append(str, "state."); append(str, "state.");
append_token(str, (gl_state_index) state[0]); append_token(str, state[0]);
switch (state[0]) { switch (state[0]) {
case STATE_MATERIAL: case STATE_MATERIAL:
append_face(str, state[1]); append_face(str, state[1]);
append_token(str, (gl_state_index) state[2]); append_token(str, state[2]);
break; break;
case STATE_LIGHT: case STATE_LIGHT:
append_index(str, state[1]); /* light number [i]. */ append_index(str, state[1]); /* light number [i]. */
append_token(str, (gl_state_index) state[2]); /* coefficients */ append_token(str, state[2]); /* coefficients */
break; break;
case STATE_LIGHTMODEL_AMBIENT: case STATE_LIGHTMODEL_AMBIENT:
append(str, "lightmodel.ambient"); append(str, "lightmodel.ambient");
@@ -843,11 +865,11 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
case STATE_LIGHTPROD: case STATE_LIGHTPROD:
append_index(str, state[1]); /* light number [i]. */ append_index(str, state[1]); /* light number [i]. */
append_face(str, state[2]); append_face(str, state[2]);
append_token(str, (gl_state_index) state[3]); append_token(str, state[3]);
break; break;
case STATE_TEXGEN: case STATE_TEXGEN:
append_index(str, state[1]); /* tex unit [i] */ append_index(str, state[1]); /* tex unit [i] */
append_token(str, (gl_state_index) state[2]); /* plane coef */ append_token(str, state[2]); /* plane coef */
break; break;
case STATE_TEXENV_COLOR: case STATE_TEXENV_COLOR:
append_index(str, state[1]); /* tex unit [i] */ append_index(str, state[1]); /* tex unit [i] */
@@ -869,11 +891,11 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
/* state[2] = first row to fetch */ /* state[2] = first row to fetch */
/* state[3] = last row to fetch */ /* state[3] = last row to fetch */
/* state[4] = transpose, inverse or invtrans */ /* state[4] = transpose, inverse or invtrans */
const gl_state_index mat = (gl_state_index) state[0]; const gl_state_index mat = state[0];
const GLuint index = (GLuint) state[1]; const GLuint index = (GLuint) state[1];
const GLuint firstRow = (GLuint) state[2]; const GLuint firstRow = (GLuint) state[2];
const GLuint lastRow = (GLuint) state[3]; const GLuint lastRow = (GLuint) state[3];
const gl_state_index modifier = (gl_state_index) state[4]; const gl_state_index modifier = state[4];
if (index || if (index ||
mat == STATE_TEXTURE_MATRIX || mat == STATE_TEXTURE_MATRIX ||
mat == STATE_PROGRAM_MATRIX) mat == STATE_PROGRAM_MATRIX)
@@ -901,10 +923,11 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
case STATE_VERTEX_PROGRAM: case STATE_VERTEX_PROGRAM:
/* state[1] = {STATE_ENV, STATE_LOCAL} */ /* state[1] = {STATE_ENV, STATE_LOCAL} */
/* state[2] = parameter index */ /* state[2] = parameter index */
append_token(str, (gl_state_index) state[1]); append_token(str, state[1]);
append_index(str, state[2]); append_index(str, state[2]);
break; break;
case STATE_INTERNAL: case STATE_INTERNAL:
append_token(str, state[1]);
break; break;
default: default:
_mesa_problem(NULL, "Invalid state in _mesa_program_state_string"); _mesa_problem(NULL, "Invalid state in _mesa_program_state_string");

View File

@@ -2028,6 +2028,21 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name,
return NULL; return NULL;
} }
/* type checking to be sure function's return type matches 'dest' type */
if (dest) {
slang_typeinfo t0;
slang_typeinfo_construct(&t0);
_slang_typeof_operation(A, dest, &t0);
if (!slang_type_specifier_equal(&t0.spec, &fun->header.type.specifier)) {
slang_info_log_error(A->log,
"Incompatible type returned by call to '%s'",
name);
return NULL;
}
}
n = _slang_gen_function_call(A, fun, oper, dest); n = _slang_gen_function_call(A, fun, oper, dest);
if (n && !n->Store && !dest if (n && !n->Store && !dest

View File

@@ -1391,7 +1391,6 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
RETURN0; RETURN0;
break; break;
case OP_METHOD: case OP_METHOD:
printf("******* begin OP_METHOD\n");
op->type = SLANG_OPER_METHOD; op->type = SLANG_OPER_METHOD;
op->a_obj = parse_identifier(C); op->a_obj = parse_identifier(C);
if (op->a_obj == SLANG_ATOM_NULL) if (op->a_obj == SLANG_ATOM_NULL)

View File

@@ -1324,7 +1324,8 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n)
_slang_is_temp(emitInfo->vt, n->Children[1]->Store) && _slang_is_temp(emitInfo->vt, n->Children[1]->Store) &&
(inst->DstReg.File == n->Children[1]->Store->File) && (inst->DstReg.File == n->Children[1]->Store->File) &&
(inst->DstReg.Index == n->Children[1]->Store->Index) && (inst->DstReg.Index == n->Children[1]->Store->Index) &&
!n->Children[0]->Store->IsIndirect) { !n->Children[0]->Store->IsIndirect &&
n->Children[0]->Store->Size <= 4) {
/* Peephole optimization: /* Peephole optimization:
* The Right-Hand-Side has its results in a temporary place. * The Right-Hand-Side has its results in a temporary place.
* Modify the RHS (and the prev instruction) to store its results * Modify the RHS (and the prev instruction) to store its results