Merge commit 'origin/master' into gallium-0.2

Conflicts:

	src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
This commit is contained in:
Alan Hourihane 2008-11-01 22:57:26 +00:00
commit 81c862205e
55 changed files with 3493 additions and 2898 deletions

View File

@ -295,6 +295,8 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \

View File

@ -83,7 +83,7 @@ dnl Compiler macros
DEFINES=""
AC_SUBST([DEFINES])
case "$host_os" in
linux*)
*-gnu)
if test "x$GCC" = xyes; then
DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE"
fi
@ -271,14 +271,14 @@ if test "x$enable_asm" = xyes; then
case "$host_cpu" in
i?86)
case "$host_os" in
linux* | freebsd* | dragonfly*)
linux* | *freebsd* | dragonfly*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
esac
;;
x86_64)
case "$host_os" in
linux* | freebsd* | dragonfly*)
linux* | *freebsd* | dragonfly*)
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
;;
esac
@ -368,7 +368,7 @@ linux*)
i*86|x86_64|powerpc*) default_driver="dri";;
esac
;;
freebsd* | dragonfly*)
*freebsd* | dragonfly*)
case "$host_cpu" in
i*86|x86_64) default_driver="dri";;
esac

View File

@ -38,8 +38,12 @@
#include <GL/gl.h>
#ifndef GLAPIENTRY
#if defined(_MSC_VER) || defined(__MINGW32__)
#define GLAPIENTRY __stdcall
#else
#define GLAPIENTRY
#endif
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *

View File

@ -290,17 +290,25 @@ extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
unsigned long *mask );
/* GLX 1.4 and later */
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
#ifndef GLX_GLXEXT_LEGACY
#include <GL/glxext.h>
#else
/* GLX 1.3 function pointer typedefs */
typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
/*
@ -316,6 +324,17 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
/* GLX 1.4 and later */
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
/* GLX 1.4 function pointer typedefs */
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#ifndef GLX_GLXEXT_LEGACY
#include <GL/glxext.h>
#endif /* GLX_GLXEXT_LEGACY */

View File

@ -57,7 +57,13 @@
#define I830_DESTREG_SR0 7
#define I830_DESTREG_SR1 8
#define I830_DESTREG_SR2 9
#define I830_DEST_SETUP_SIZE 10
#define I830_DESTREG_DRAWRECT0 10
#define I830_DESTREG_DRAWRECT1 11
#define I830_DESTREG_DRAWRECT2 12
#define I830_DESTREG_DRAWRECT3 13
#define I830_DESTREG_DRAWRECT4 14
#define I830_DESTREG_DRAWRECT5 15
#define I830_DEST_SETUP_SIZE 16
#define I830_CTXREG_STATE1 0
#define I830_CTXREG_STATE2 1

View File

@ -513,6 +513,16 @@ i830_emit_state(struct intel_context *intel)
OUT_BATCH(state->Buffer[I830_DESTREG_SR0]);
OUT_BATCH(state->Buffer[I830_DESTREG_SR1]);
OUT_BATCH(state->Buffer[I830_DESTREG_SR2]);
if (intel->constant_cliprect) {
assert(state->Buffer[I830_DESTREG_DRAWRECT0] != MI_NOOP);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT0]);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT1]);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT2]);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT3]);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT4]);
OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT5]);
}
ADVANCE_BATCH();
}
@ -592,6 +602,7 @@ i830_state_draw_region(struct intel_context *intel,
struct intel_region *depth_region)
{
struct i830_context *i830 = i830_context(&intel->ctx);
GLcontext *ctx = &intel->ctx;
GLuint value;
ASSERT(state == &i830->state || state == &i830->meta);
@ -644,6 +655,24 @@ i830_state_draw_region(struct intel_context *intel,
}
state->Buffer[I830_DESTREG_DV1] = value;
if (intel->constant_cliprect) {
state->Buffer[I830_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO;
state->Buffer[I830_DESTREG_DRAWRECT1] = 0;
state->Buffer[I830_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */
state->Buffer[I830_DESTREG_DRAWRECT3] =
(ctx->DrawBuffer->Width & 0xffff) |
(ctx->DrawBuffer->Height << 16);
state->Buffer[I830_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */
state->Buffer[I830_DESTREG_DRAWRECT5] = 0;
} else {
state->Buffer[I830_DESTREG_DRAWRECT0] = MI_NOOP;
state->Buffer[I830_DESTREG_DRAWRECT1] = MI_NOOP;
state->Buffer[I830_DESTREG_DRAWRECT2] = MI_NOOP;
state->Buffer[I830_DESTREG_DRAWRECT3] = MI_NOOP;
state->Buffer[I830_DESTREG_DRAWRECT4] = MI_NOOP;
state->Buffer[I830_DESTREG_DRAWRECT5] = MI_NOOP;
}
I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);

View File

@ -65,7 +65,13 @@
#define I915_DESTREG_SR0 9
#define I915_DESTREG_SR1 10
#define I915_DESTREG_SR2 11
#define I915_DEST_SETUP_SIZE 12
#define I915_DESTREG_DRAWRECT0 12
#define I915_DESTREG_DRAWRECT1 13
#define I915_DESTREG_DRAWRECT2 14
#define I915_DESTREG_DRAWRECT3 15
#define I915_DESTREG_DRAWRECT4 16
#define I915_DESTREG_DRAWRECT5 17
#define I915_DEST_SETUP_SIZE 18
#define I915_CTXREG_STATE4 0
#define I915_CTXREG_LI 1

View File

@ -399,6 +399,17 @@ i915_emit_state(struct intel_context *intel)
OUT_BATCH(state->Buffer[I915_DESTREG_SR0]);
OUT_BATCH(state->Buffer[I915_DESTREG_SR1]);
OUT_BATCH(state->Buffer[I915_DESTREG_SR2]);
if (intel->constant_cliprect) {
assert(state->Buffer[I915_DESTREG_DRAWRECT0] != MI_NOOP);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT0]);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT1]);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT2]);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT3]);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT4]);
OUT_BATCH(state->Buffer[I915_DESTREG_DRAWRECT5]);
}
ADVANCE_BATCH();
}
@ -521,6 +532,7 @@ i915_state_draw_region(struct intel_context *intel,
struct intel_region *depth_region)
{
struct i915_context *i915 = i915_context(&intel->ctx);
GLcontext *ctx = &intel->ctx;
GLuint value;
ASSERT(state == &i915->state || state == &i915->meta);
@ -573,6 +585,24 @@ i915_state_draw_region(struct intel_context *intel,
}
state->Buffer[I915_DESTREG_DV1] = value;
if (intel->constant_cliprect) {
state->Buffer[I915_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO;
state->Buffer[I915_DESTREG_DRAWRECT1] = 0;
state->Buffer[I915_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */
state->Buffer[I915_DESTREG_DRAWRECT3] =
(ctx->DrawBuffer->Width & 0xffff) |
(ctx->DrawBuffer->Height << 16);
state->Buffer[I915_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */
state->Buffer[I915_DESTREG_DRAWRECT5] = 0;
} else {
state->Buffer[I915_DESTREG_DRAWRECT0] = MI_NOOP;
state->Buffer[I915_DESTREG_DRAWRECT1] = MI_NOOP;
state->Buffer[I915_DESTREG_DRAWRECT2] = MI_NOOP;
state->Buffer[I915_DESTREG_DRAWRECT3] = MI_NOOP;
state->Buffer[I915_DESTREG_DRAWRECT4] = MI_NOOP;
state->Buffer[I915_DESTREG_DRAWRECT5] = MI_NOOP;
}
I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
}

View File

@ -39,6 +39,7 @@
#include "brw_context.h"
#include "brw_defines.h"
#include "brw_draw.h"
#include "brw_state.h"
#include "brw_vs.h"
#include "intel_tex.h"
#include "intel_blit.h"

View File

@ -433,7 +433,6 @@ struct brw_context
GLuint primitive;
GLboolean emit_state_always;
GLboolean wrap;
GLboolean tmp_fallback;
GLboolean no_batch_wrap;
@ -445,6 +444,19 @@ struct brw_context
GLuint nr_draw_regions;
struct intel_region *draw_regions[MAX_DRAW_BUFFERS];
struct intel_region *depth_region;
/**
* List of buffers accumulated in brw_validate_state to receive
* dri_bo_check_aperture treatment before exec, so we can know if we
* should flush the batch and try again before emitting primitives.
*
* This can be a fixed number as we only have a limited number of
* objects referenced from the batchbuffer in a primitive emit,
* consisting of the vertex buffers, pipelined state pointers,
* the CURBE, the depth buffer, and a query BO.
*/
dri_bo *validated_bos[VERT_ATTRIB_MAX + 16];
int validated_bo_count;
} state;
struct brw_state_pointers attribs;
@ -679,14 +691,6 @@ void brw_prepare_query_begin(struct brw_context *brw);
void brw_emit_query_begin(struct brw_context *brw);
void brw_emit_query_end(struct brw_context *brw);
/*======================================================================
* brw_state.c
*/
void brw_validate_state( struct brw_context *brw );
void brw_init_state( struct brw_context *brw );
void brw_destroy_state( struct brw_context *brw );
/*======================================================================
* brw_state_dump.c
*/

View File

@ -307,6 +307,7 @@ static void prepare_constant_buffer(struct brw_context *brw)
dri_bo_subdata(brw->curbe.curbe_bo, brw->curbe.curbe_offset, bufsz, buf);
}
brw_add_validated_bo(brw, brw->curbe.curbe_bo);
/* Because this provokes an action (ie copy the constants into the
* URB), it shouldn't be shortcircuited if identical to the
@ -328,15 +329,6 @@ static void emit_constant_buffer(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
GLuint sz = brw->curbe.total_size;
dri_bo *aper_array[] = {
brw->intel.batch->buf,
brw->curbe.curbe_bo,
};
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) {
intel_batchbuffer_flush(intel->batch);
return;
}
BEGIN_BATCH(2, IGNORE_CLIPRECTS);
if (sz == 0) {

View File

@ -256,6 +256,7 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
GLboolean retval = GL_FALSE;
GLboolean warn = GL_FALSE;
GLuint i;
if (ctx->NewState)
@ -282,30 +283,25 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
LOCK_HARDWARE(intel);
if (brw->intel.numClipRects == 0) {
if (!intel->constant_cliprect && intel->driDrawable->numClipRects == 0) {
UNLOCK_HARDWARE(intel);
return GL_TRUE;
}
/* Flush the batch if it's approaching full, so that we don't wrap while
* we've got validated state that needs to be in the same batch as the
* primitives. This fraction is just a guess (minimal full state plus
* a primitive is around 512 bytes), and would be better if we had
* an upper bound of how much we might emit in a single
* brw_try_draw_prims().
*/
intel_batchbuffer_require_space(intel->batch, intel->batch->size / 4,
LOOP_CLIPRECTS);
{
/* Flush the batch if it's approaching full, so that we don't wrap while
* we've got validated state that needs to be in the same batch as the
* primitives. This fraction is just a guess (minimal full state plus
* a primitive is around 512 bytes), and would be better if we had
* an upper bound of how much we might emit in a single
* brw_try_draw_prims().
*/
if (intel->batch->ptr - intel->batch->map > intel->batch->size * 3 / 4
/* brw_emit_prim may change the cliprect_mode to LOOP_CLIPRECTS */
|| intel->batch->cliprect_mode != LOOP_CLIPRECTS)
intel_batchbuffer_flush(intel->batch);
/* Set the first primitive early, ahead of validate_state:
*/
brw_set_prim(brw, prim[0].mode);
/* XXX: Need to separate validate and upload of state.
*/
brw_validate_state( brw );
/* Various fallback checks:
@ -316,6 +312,31 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
if (check_fallbacks( brw, prim, nr_prims ))
goto out;
/* Check that we can fit our state in with our existing batchbuffer, or
* flush otherwise.
*/
if (dri_bufmgr_check_aperture_space(brw->state.validated_bos,
brw->state.validated_bo_count)) {
static GLboolean warned;
intel_batchbuffer_flush(intel->batch);
/* Validate the state after we flushed the batch (which would have
* changed the set of dirty state). If we still fail to
* check_aperture, warn of what's happening, but attempt to continue
* on since it may succeed anyway, and the user would probably rather
* see a failure and a warning than a fallback.
*/
brw_validate_state(brw);
if (!warned &&
dri_bufmgr_check_aperture_space(brw->state.validated_bos,
brw->state.validated_bo_count)) {
warn = GL_TRUE;
warned = GL_TRUE;
}
}
brw_upload_state(brw);
for (i = 0; i < nr_prims; i++) {
brw_emit_prim(brw, &prim[i]);
}
@ -326,6 +347,10 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
out:
UNLOCK_HARDWARE(intel);
if (warn)
fprintf(stderr, "i965: Single primitive emit potentially exceeded "
"available aperture space\n");
if (!retval)
DBG("%s failed\n", __FUNCTION__);

View File

@ -250,10 +250,10 @@ static void get_space( struct brw_context *brw,
wrap_buffers(brw, size);
}
assert(*bo_return == NULL);
dri_bo_reference(brw->vb.upload.bo);
*bo_return = brw->vb.upload.bo;
*offset_return = brw->vb.upload.offset;
brw->vb.upload.offset += size;
}
@ -359,6 +359,14 @@ static void brw_prepare_vertices(struct brw_context *brw)
input->offset = (unsigned long)input->glarray->Ptr;
input->stride = input->glarray->StrideB;
} else {
if (input->bo != NULL) {
/* Already-uploaded vertex data is present from a previous
* prepare_vertices, but we had to re-validate state due to
* check_aperture failing and a new batch being produced.
*/
continue;
}
/* Queue the buffer object up to be uploaded in the next pass,
* when we've decided if we're doing interleaved or not.
*/
@ -417,6 +425,12 @@ static void brw_prepare_vertices(struct brw_context *brw)
}
brw_prepare_query_begin(brw);
for (i = 0; i < nr_enabled; i++) {
struct brw_vertex_element *input = enabled[i];
brw_add_validated_bo(brw, input->bo);
}
}
static void brw_emit_vertices(struct brw_context *brw)
@ -512,7 +526,7 @@ static void brw_prepare_indices(struct brw_context *brw)
struct intel_context *intel = &brw->intel;
const struct _mesa_index_buffer *index_buffer = brw->ib.ib;
GLuint ib_size;
dri_bo *bo;
dri_bo *bo = NULL;
struct gl_buffer_object *bufferobj;
GLuint offset;
@ -561,6 +575,8 @@ static void brw_prepare_indices(struct brw_context *brw)
dri_bo_unreference(brw->ib.bo);
brw->ib.bo = bo;
brw->ib.offset = offset;
brw_add_validated_bo(brw, brw->ib.bo);
}
static void brw_emit_indices(struct brw_context *brw)

View File

@ -65,7 +65,7 @@ struct brw_reg
GLuint abs:1; /* source only */
GLuint vstride:4; /* source only */
GLuint width:3; /* src only, align1 only */
GLuint hstride:2; /* src only, align1 only */
GLuint hstride:2; /* align1 only */
GLuint address_mode:1; /* relative addressing, hopefully! */
GLuint pad0:1;

View File

@ -64,7 +64,9 @@ static void brw_set_dest( struct brw_instruction *insn,
if (insn->header.access_mode == BRW_ALIGN_1) {
insn->bits1.da1.dest_subreg_nr = dest.subnr;
insn->bits1.da1.dest_horiz_stride = BRW_HORIZONTAL_STRIDE_1;
if (dest.hstride == BRW_HORIZONTAL_STRIDE_0)
dest.hstride = BRW_HORIZONTAL_STRIDE_1;
insn->bits1.da1.dest_horiz_stride = dest.hstride;
}
else {
insn->bits1.da16.dest_subreg_nr = dest.subnr / 16;
@ -78,7 +80,9 @@ static void brw_set_dest( struct brw_instruction *insn,
*/
if (insn->header.access_mode == BRW_ALIGN_1) {
insn->bits1.ia1.dest_indirect_offset = dest.dw1.bits.indirect_offset;
insn->bits1.ia1.dest_horiz_stride = BRW_HORIZONTAL_STRIDE_1;
if (dest.hstride == BRW_HORIZONTAL_STRIDE_0)
dest.hstride = BRW_HORIZONTAL_STRIDE_1;
insn->bits1.ia1.dest_horiz_stride = dest.hstride;
}
else {
insn->bits1.ia16.dest_indirect_offset = dest.dw1.bits.indirect_offset;

View File

@ -71,6 +71,38 @@ const struct brw_tracked_state brw_blend_constant_color = {
.emit = upload_blend_constant_color
};
/* Constant single cliprect for framebuffer object or DRI2 drawing */
static void upload_drawing_rect(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
GLcontext *ctx = &intel->ctx;
if (!intel->constant_cliprect)
return;
BEGIN_BATCH(4, NO_LOOP_CLIPRECTS);
OUT_BATCH(_3DSTATE_DRAWRECT_INFO_I965);
OUT_BATCH(0); /* xmin, ymin */
OUT_BATCH(((ctx->DrawBuffer->Width - 1) & 0xffff) |
((ctx->DrawBuffer->Height - 1) << 16));
OUT_BATCH(0);
ADVANCE_BATCH();
}
const struct brw_tracked_state brw_drawing_rect = {
.dirty = {
.mesa = _NEW_BUFFERS,
.brw = 0,
.cache = 0
},
.emit = upload_drawing_rect
};
static void prepare_binding_table_pointers(struct brw_context *brw)
{
brw_add_validated_bo(brw, brw->wm.bind_bo);
}
/**
* Upload the binding table pointers, which point each stage's array of surface
* state pointers.
@ -81,15 +113,6 @@ const struct brw_tracked_state brw_blend_constant_color = {
static void upload_binding_table_pointers(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
dri_bo *aper_array[] = {
intel->batch->buf,
brw->wm.bind_bo,
};
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) {
intel_batchbuffer_flush(intel->batch);
return;
}
BEGIN_BATCH(6, IGNORE_CLIPRECTS);
OUT_BATCH(CMD_BINDING_TABLE_PTRS << 16 | (6 - 2));
@ -109,6 +132,7 @@ const struct brw_tracked_state brw_binding_table_pointers = {
.brw = BRW_NEW_BATCH,
.cache = CACHE_NEW_SURF_BIND,
},
.prepare = prepare_binding_table_pointers,
.emit = upload_binding_table_pointers,
};
@ -142,23 +166,18 @@ static void upload_pipelined_state_pointers(struct brw_context *brw )
brw->state.dirty.brw |= BRW_NEW_PSP;
}
static void prepare_psp_urb_cbs(struct brw_context *brw)
{
brw_add_validated_bo(brw, brw->vs.state_bo);
brw_add_validated_bo(brw, brw->gs.state_bo);
brw_add_validated_bo(brw, brw->clip.state_bo);
brw_add_validated_bo(brw, brw->wm.state_bo);
brw_add_validated_bo(brw, brw->cc.state_bo);
}
static void upload_psp_urb_cbs(struct brw_context *brw )
{
struct intel_context *intel = &brw->intel;
dri_bo *aper_array[] = {
intel->batch->buf,
brw->vs.state_bo,
brw->gs.state_bo,
brw->clip.state_bo,
brw->wm.state_bo,
brw->cc.state_bo,
};
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) {
intel_batchbuffer_flush(intel->batch);
return;
}
upload_pipelined_state_pointers(brw);
brw_upload_urb_fence(brw);
brw_upload_constant_buffer_state(brw);
@ -176,9 +195,18 @@ const struct brw_tracked_state brw_psp_urb_cbs = {
CACHE_NEW_WM_UNIT |
CACHE_NEW_CC_UNIT)
},
.prepare = prepare_psp_urb_cbs,
.emit = upload_psp_urb_cbs,
};
static void prepare_depthbuffer(struct brw_context *brw)
{
struct intel_region *region = brw->state.depth_region;
if (region != NULL)
brw_add_validated_bo(brw, region->buffer);
}
static void emit_depthbuffer(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
@ -200,10 +228,6 @@ static void emit_depthbuffer(struct brw_context *brw)
ADVANCE_BATCH();
} else {
unsigned int format;
dri_bo *aper_array[] = {
intel->batch->buf,
region->buffer
};
switch (region->cpp) {
case 2:
@ -220,11 +244,6 @@ static void emit_depthbuffer(struct brw_context *brw)
return;
}
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) {
intel_batchbuffer_flush(intel->batch);
return;
}
BEGIN_BATCH(len, IGNORE_CLIPRECTS);
OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2));
OUT_BATCH(((region->pitch * region->cpp) - 1) |
@ -253,6 +272,7 @@ const struct brw_tracked_state brw_depthbuffer = {
.brw = BRW_NEW_DEPTH_BUFFER | BRW_NEW_BATCH,
.cache = 0,
},
.prepare = prepare_depthbuffer,
.emit = emit_depthbuffer,
};

View File

@ -42,6 +42,7 @@
#include "main/imports.h"
#include "brw_context.h"
#include "brw_state.h"
#include "intel_batchbuffer.h"
#include "intel_reg.h"
@ -163,10 +164,6 @@ void
brw_prepare_query_begin(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
dri_bo *aper_array[] = {
intel->batch->buf,
brw->query.bo,
};
/* Skip if we're not doing any queries. */
if (is_empty_list(&brw->query.active_head))
@ -182,8 +179,7 @@ brw_prepare_query_begin(struct brw_context *brw)
brw->query.index = 0;
}
if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
intel_batchbuffer_flush(intel->batch);
brw_add_validated_bo(brw, brw->query.bo);
}
/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */

View File

@ -35,6 +35,16 @@
#include "brw_context.h"
static inline void
brw_add_validated_bo(struct brw_context *brw, dri_bo *bo)
{
assert(brw->state.validated_bo_count < ARRAY_SIZE(brw->state.validated_bos));
if (bo != NULL) {
dri_bo_reference(bo);
brw->state.validated_bos[brw->state.validated_bo_count++] = bo;
}
};
const struct brw_tracked_state brw_blend_constant_color;
const struct brw_tracked_state brw_cc_unit;
@ -79,9 +89,18 @@ const struct brw_tracked_state brw_pipe_control;
const struct brw_tracked_state brw_clear_surface_cache;
const struct brw_tracked_state brw_clear_batch_cache;
const struct brw_tracked_state brw_drawing_rect;
const struct brw_tracked_state brw_indices;
const struct brw_tracked_state brw_vertices;
/***********************************************************************
* brw_state.c
*/
void brw_validate_state(struct brw_context *brw);
void brw_upload_state(struct brw_context *brw);
void brw_init_state(struct brw_context *brw);
void brw_destroy_state(struct brw_context *brw);
/***********************************************************************
* brw_state_cache.c
*/

View File

@ -97,8 +97,6 @@ void brw_clear_batch_cache_flush( struct brw_context *brw )
{
clear_batch_cache(brw);
brw->wrap = 0;
/* brw_do_flush(brw, BRW_FLUSH_STATE_CACHE|BRW_FLUSH_READ_CACHE); */
brw->state.dirty.mesa |= ~0;

View File

@ -99,6 +99,7 @@ const struct brw_tracked_state *atoms[] =
&brw_psp_urb_cbs,
#endif
&brw_drawing_rect,
&brw_indices,
&brw_vertices,
@ -168,6 +169,18 @@ static void xor_states( struct brw_state_flags *result,
result->cache = a->cache ^ b->cache;
}
static void
brw_clear_validated_bos(struct brw_context *brw)
{
int i;
/* Clear the last round of validated bos */
for (i = 0; i < brw->state.validated_bo_count; i++) {
dri_bo_unreference(brw->state.validated_bos[i]);
brw->state.validated_bos[i] = NULL;
}
brw->state.validated_bo_count = 0;
}
/***********************************************************************
* Emit all state:
@ -176,14 +189,14 @@ void brw_validate_state( struct brw_context *brw )
{
struct intel_context *intel = &brw->intel;
struct brw_state_flags *state = &brw->state.dirty;
GLuint i, count, pass = 0;
dri_bo *last_batch_bo = NULL;
GLuint i;
brw_clear_validated_bos(brw);
state->mesa |= brw->intel.NewGLState;
brw->intel.NewGLState = 0;
if (brw->wrap)
state->brw |= BRW_NEW_CONTEXT;
brw_add_validated_bo(brw, intel->batch->buf);
if (brw->emit_state_always) {
state->mesa |= ~0;
@ -210,8 +223,6 @@ void brw_validate_state( struct brw_context *brw )
brw->intel.Fallback = 0;
count = 0;
/* do prepare stage for all atoms */
for (i = 0; i < Elements(atoms); i++) {
const struct brw_tracked_state *atom = brw->state.atoms[i];
@ -225,19 +236,15 @@ void brw_validate_state( struct brw_context *brw )
}
}
}
}
if (brw->intel.Fallback)
return;
/* We're about to try to set up a coherent state in the batchbuffer for
* the emission of primitives. If we exceed the aperture size in any of the
* emit() calls, we need to go back to square 1 and try setting up again.
*/
got_flushed:
dri_bo_unreference(last_batch_bo);
last_batch_bo = intel->batch->buf;
dri_bo_reference(last_batch_bo);
assert(pass++ <= 2);
void brw_upload_state(struct brw_context *brw)
{
struct brw_state_flags *state = &brw->state.dirty;
int i;
brw_clear_validated_bos(brw);
if (INTEL_DEBUG) {
/* Debug version which enforces various sanity checks on the
@ -262,8 +269,6 @@ got_flushed:
if (check_state(state, &atom->dirty)) {
if (atom->emit) {
atom->emit( brw );
if (intel->batch->buf != last_batch_bo)
goto got_flushed;
}
}
@ -288,15 +293,11 @@ got_flushed:
if (check_state(state, &atom->dirty)) {
if (atom->emit) {
atom->emit( brw );
if (intel->batch->buf != last_batch_bo)
goto got_flushed;
}
}
}
}
dri_bo_unreference(last_batch_bo);
if (!brw->intel.Fallback)
memset(state, 0, sizeof(*state));
}

View File

@ -62,7 +62,6 @@ dri_bo_release(dri_bo **bo)
*/
static void brw_destroy_context( struct intel_context *intel )
{
GLcontext *ctx = &intel->ctx;
struct brw_context *brw = brw_context(&intel->ctx);
int i;

View File

@ -157,6 +157,7 @@ struct brw_wm_instruction {
#define BRW_WM_MAX_PARAM 256
#define BRW_WM_MAX_CONST 256
#define BRW_WM_MAX_KILLS MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS
#define BRW_WM_MAX_SUBROUTINE 16
@ -246,7 +247,10 @@ struct brw_wm_compile {
struct brw_reg stack;
struct brw_reg emit_mask_reg;
GLuint reg_index;
GLuint tmp_regs[BRW_WM_MAX_GRF];
GLuint tmp_index;
GLuint tmp_max;
GLuint subroutines[BRW_WM_MAX_SUBROUTINE];
};

View File

@ -4,6 +4,10 @@
#include "brw_eu.h"
#include "brw_wm.h"
enum _subroutine {
SUB_NOISE1, SUB_NOISE2, SUB_NOISE3, SUB_NOISE4
};
/* Only guess, need a flag in gl_fragment_program later */
GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp)
{
@ -19,6 +23,10 @@ GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp)
case OPCODE_RET:
case OPCODE_DDX:
case OPCODE_DDY:
case OPCODE_NOISE1:
case OPCODE_NOISE2:
case OPCODE_NOISE3:
case OPCODE_NOISE4:
case OPCODE_BGNLOOP:
return GL_TRUE;
default:
@ -47,13 +55,26 @@ static int get_scalar_dst_index(struct prog_instruction *inst)
static struct brw_reg alloc_tmp(struct brw_wm_compile *c)
{
struct brw_reg reg;
reg = brw_vec8_grf(c->tmp_index--, 0);
if(c->tmp_index == c->tmp_max)
c->tmp_regs[ c->tmp_max++ ] = c->reg_index++;
reg = brw_vec8_grf(c->tmp_regs[ c->tmp_index++ ], 0);
return reg;
}
static void release_tmps(struct brw_wm_compile *c)
static int mark_tmps(struct brw_wm_compile *c)
{
c->tmp_index = 127;
return c->tmp_index;
}
static struct brw_reg lookup_tmp( struct brw_wm_compile *c, int index )
{
return brw_vec8_grf( c->tmp_regs[ index ], 0 );
}
static void release_tmps(struct brw_wm_compile *c, int mark)
{
c->tmp_index = mark;
}
static struct brw_reg
@ -155,6 +176,68 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c,
src->NegateBase, src->Abs);
}
/* Subroutines are minimal support for resusable instruction sequences.
They are implemented as simply as possible to minimise overhead: there
is no explicit support for communication between the caller and callee
other than saving the return address in a temporary register, nor is
there any automatic local storage. This implies that great care is
required before attempting reentrancy or any kind of nested
subroutine invocations. */
static void invoke_subroutine( struct brw_wm_compile *c,
enum _subroutine subroutine,
void (*emit)( struct brw_wm_compile * ) )
{
struct brw_compile *p = &c->func;
assert( subroutine < BRW_WM_MAX_SUBROUTINE );
if( c->subroutines[ subroutine ] ) {
/* subroutine previously emitted: reuse existing instructions */
int mark = mark_tmps( c );
struct brw_reg return_address = retype( alloc_tmp( c ),
BRW_REGISTER_TYPE_UD );
int here = p->nr_insn;
brw_push_insn_state(p);
brw_set_mask_control(p, BRW_MASK_DISABLE);
brw_ADD( p, return_address, brw_ip_reg(), brw_imm_ud( 2 << 4 ) );
brw_ADD( p, brw_ip_reg(), brw_ip_reg(),
brw_imm_d( ( c->subroutines[ subroutine ] -
here - 1 ) << 4 ) );
brw_pop_insn_state(p);
release_tmps( c, mark );
} else {
/* previously unused subroutine: emit, and mark for later reuse */
int mark = mark_tmps( c );
struct brw_reg return_address = retype( alloc_tmp( c ),
BRW_REGISTER_TYPE_UD );
struct brw_instruction *calc;
int base = p->nr_insn;
brw_push_insn_state(p);
brw_set_mask_control(p, BRW_MASK_DISABLE);
calc = brw_ADD( p, return_address, brw_ip_reg(), brw_imm_ud( 0 ) );
brw_pop_insn_state(p);
c->subroutines[ subroutine ] = p->nr_insn;
emit( c );
brw_push_insn_state(p);
brw_set_mask_control(p, BRW_MASK_DISABLE);
brw_MOV( p, brw_ip_reg(), return_address );
brw_pop_insn_state(p);
brw_set_src1( calc, brw_imm_ud( ( p->nr_insn - base ) << 4 ) );
release_tmps( c, mark );
}
}
static void emit_abs( struct brw_wm_compile *c,
struct prog_instruction *inst)
{
@ -778,6 +861,7 @@ static void emit_lrp(struct brw_wm_compile *c,
GLuint mask = inst->DstReg.WriteMask;
struct brw_reg dst, tmp1, tmp2, src0, src1, src2;
int i;
int mark = mark_tmps(c);
for (i = 0; i < 4; i++) {
if (mask & (1<<i)) {
dst = get_dst_reg(c, inst, i, 1);
@ -804,7 +888,7 @@ static void emit_lrp(struct brw_wm_compile *c,
brw_MAC(p, dst, src0, tmp1);
brw_set_saturate(p, 0);
}
release_tmps(c);
release_tmps(c, mark);
}
}
@ -957,6 +1041,316 @@ static void emit_ddy(struct brw_wm_compile *c,
brw_set_saturate(p, 0);
}
static __inline struct brw_reg high_words( struct brw_reg reg )
{
return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ),
0, 8, 2 );
}
static __inline struct brw_reg low_words( struct brw_reg reg )
{
return stride( retype( reg, BRW_REGISTER_TYPE_W ), 0, 8, 2 );
}
/* One- and two-dimensional Perlin noise, similar to the description in
_Improving Noise_, Ken Perlin, Computer Graphics vol. 35 no. 3. */
static void noise1_sub( struct brw_wm_compile *c ) {
struct brw_compile *p = &c->func;
struct brw_reg param,
x0, x1, /* gradients at each end */
t, tmp[ 2 ], /* float temporaries */
itmp[ 5 ]; /* unsigned integer temporaries (aliases of floats above) */
int i;
int mark = mark_tmps( c );
x0 = alloc_tmp( c );
x1 = alloc_tmp( c );
t = alloc_tmp( c );
tmp[ 0 ] = alloc_tmp( c );
tmp[ 1 ] = alloc_tmp( c );
itmp[ 0 ] = retype( tmp[ 0 ], BRW_REGISTER_TYPE_UD );
itmp[ 1 ] = retype( tmp[ 1 ], BRW_REGISTER_TYPE_UD );
itmp[ 2 ] = retype( x0, BRW_REGISTER_TYPE_UD );
itmp[ 3 ] = retype( x1, BRW_REGISTER_TYPE_UD );
itmp[ 4 ] = retype( t, BRW_REGISTER_TYPE_UD );
param = lookup_tmp( c, mark - 2 );
brw_set_access_mode( p, BRW_ALIGN_1 );
brw_MOV( p, itmp[ 2 ], brw_imm_ud( 0xBA97 ) ); /* constant used later */
/* Arrange the two end coordinates into scalars (itmp0/itmp1) to
be hashed. Also compute the remainder (offset within the unit
length), interleaved to reduce register dependency penalties. */
brw_RNDD( p, itmp[ 0 ], param );
brw_FRC( p, param, param );
brw_ADD( p, itmp[ 1 ], itmp[ 0 ], brw_imm_ud( 1 ) );
brw_MOV( p, itmp[ 3 ], brw_imm_ud( 0x79D9 ) ); /* constant used later */
brw_MOV( p, itmp[ 4 ], brw_imm_ud( 0xD5B1 ) ); /* constant used later */
/* We're now ready to perform the hashing. The two hashes are
interleaved for performance. The hash function used is
designed to rapidly achieve avalanche and require only 32x16
bit multiplication, and 16-bit swizzles (which we get for
free). We can't use immediate operands in the multiplies,
because immediates are permitted only in src1 and the 16-bit
factor is permitted only in src0. */
for( i = 0; i < 2; i++ )
brw_MUL( p, itmp[ i ], itmp[ 2 ], itmp[ i ] );
for( i = 0; i < 2; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
for( i = 0; i < 2; i++ )
brw_MUL( p, itmp[ i ], itmp[ 3 ], itmp[ i ] );
for( i = 0; i < 2; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
for( i = 0; i < 2; i++ )
brw_MUL( p, itmp[ i ], itmp[ 4 ], itmp[ i ] );
for( i = 0; i < 2; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
/* Now we want to initialise the two gradients based on the
hashes. Format conversion from signed integer to float leaves
everything scaled too high by a factor of pow( 2, 31 ), but
we correct for that right at the end. */
brw_ADD( p, t, param, brw_imm_f( -1.0 ) );
brw_MOV( p, x0, retype( tmp[ 0 ], BRW_REGISTER_TYPE_D ) );
brw_MOV( p, x1, retype( tmp[ 1 ], BRW_REGISTER_TYPE_D ) );
brw_MUL( p, x0, x0, param );
brw_MUL( p, x1, x1, t );
/* We interpolate between the gradients using the polynomial
6t^5 - 15t^4 + 10t^3 (Perlin). */
brw_MUL( p, tmp[ 0 ], param, brw_imm_f( 6.0 ) );
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], brw_imm_f( -15.0 ) );
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param );
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], brw_imm_f( 10.0 ) );
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param );
brw_ADD( p, x1, x1, negate( x0 ) ); /* unrelated work to fill the
pipeline */
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param );
brw_MUL( p, param, tmp[ 0 ], param );
brw_MUL( p, x1, x1, param );
brw_ADD( p, x0, x0, x1 );
/* scale by pow( 2, -30 ), to compensate for the format conversion
above and an extra factor of 2 so that a single gradient covers
the [-1,1] range */
brw_MUL( p, param, x0, brw_imm_f( 0.000000000931322574615478515625 ) );
release_tmps( c, mark );
}
static void emit_noise1( struct brw_wm_compile *c,
struct prog_instruction *inst )
{
struct brw_compile *p = &c->func;
struct brw_reg src, param, dst;
GLuint mask = inst->DstReg.WriteMask;
int i;
int mark = mark_tmps( c );
assert( mark == 0 );
src = get_src_reg( c, inst->SrcReg, 0, 1 );
param = alloc_tmp( c );
brw_MOV( p, param, src );
invoke_subroutine( c, SUB_NOISE1, noise1_sub );
/* Fill in the result: */
brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE );
for (i = 0 ; i < 4; i++) {
if (mask & (1<<i)) {
dst = get_dst_reg(c, inst, i, 1);
brw_MOV( p, dst, param );
}
}
if( inst->SaturateMode == SATURATE_ZERO_ONE )
brw_set_saturate( p, 0 );
release_tmps( c, mark );
}
static void noise2_sub( struct brw_wm_compile *c ) {
struct brw_compile *p = &c->func;
struct brw_reg param0, param1,
x0y0, x0y1, x1y0, x1y1, /* gradients at each corner */
t, tmp[ 4 ], /* float temporaries */
itmp[ 7 ]; /* unsigned integer temporaries (aliases of floats above) */
int i;
int mark = mark_tmps( c );
x0y0 = alloc_tmp( c );
x0y1 = alloc_tmp( c );
x1y0 = alloc_tmp( c );
x1y1 = alloc_tmp( c );
t = alloc_tmp( c );
for( i = 0; i < 4; i++ ) {
tmp[ i ] = alloc_tmp( c );
itmp[ i ] = retype( tmp[ i ], BRW_REGISTER_TYPE_UD );
}
itmp[ 4 ] = retype( x0y0, BRW_REGISTER_TYPE_UD );
itmp[ 5 ] = retype( x0y1, BRW_REGISTER_TYPE_UD );
itmp[ 6 ] = retype( x1y0, BRW_REGISTER_TYPE_UD );
param0 = lookup_tmp( c, mark - 3 );
param1 = lookup_tmp( c, mark - 2 );
brw_set_access_mode( p, BRW_ALIGN_1 );
/* Arrange the four corner coordinates into scalars (itmp0..itmp3) to
be hashed. Also compute the remainders (offsets within the unit
square), interleaved to reduce register dependency penalties. */
brw_RNDD( p, itmp[ 0 ], param0 );
brw_RNDD( p, itmp[ 1 ], param1 );
brw_FRC( p, param0, param0 );
brw_FRC( p, param1, param1 );
brw_MOV( p, itmp[ 4 ], brw_imm_ud( 0xBA97 ) ); /* constant used later */
brw_ADD( p, high_words( itmp[ 0 ] ), high_words( itmp[ 0 ] ),
low_words( itmp[ 1 ] ) );
brw_MOV( p, itmp[ 5 ], brw_imm_ud( 0x79D9 ) ); /* constant used later */
brw_MOV( p, itmp[ 6 ], brw_imm_ud( 0xD5B1 ) ); /* constant used later */
brw_ADD( p, itmp[ 1 ], itmp[ 0 ], brw_imm_ud( 0x10000 ) );
brw_ADD( p, itmp[ 2 ], itmp[ 0 ], brw_imm_ud( 0x1 ) );
brw_ADD( p, itmp[ 3 ], itmp[ 0 ], brw_imm_ud( 0x10001 ) );
/* We're now ready to perform the hashing. The four hashes are
interleaved for performance. The hash function used is
designed to rapidly achieve avalanche and require only 32x16
bit multiplication, and 16-bit swizzles (which we get for
free). We can't use immediate operands in the multiplies,
because immediates are permitted only in src1 and the 16-bit
factor is permitted only in src0. */
for( i = 0; i < 4; i++ )
brw_MUL( p, itmp[ i ], itmp[ 4 ], itmp[ i ] );
for( i = 0; i < 4; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
for( i = 0; i < 4; i++ )
brw_MUL( p, itmp[ i ], itmp[ 5 ], itmp[ i ] );
for( i = 0; i < 4; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
for( i = 0; i < 4; i++ )
brw_MUL( p, itmp[ i ], itmp[ 6 ], itmp[ i ] );
for( i = 0; i < 4; i++ )
brw_XOR( p, low_words( itmp[ i ] ), low_words( itmp[ i ] ),
high_words( itmp[ i ] ) );
/* Now we want to initialise the four gradients based on the
hashes. Format conversion from signed integer to float leaves
everything scaled too high by a factor of pow( 2, 15 ), but
we correct for that right at the end. */
brw_ADD( p, t, param0, brw_imm_f( -1.0 ) );
brw_MOV( p, x0y0, low_words( tmp[ 0 ] ) );
brw_MOV( p, x0y1, low_words( tmp[ 1 ] ) );
brw_MOV( p, x1y0, low_words( tmp[ 2 ] ) );
brw_MOV( p, x1y1, low_words( tmp[ 3 ] ) );
brw_MOV( p, tmp[ 0 ], high_words( tmp[ 0 ] ) );
brw_MOV( p, tmp[ 1 ], high_words( tmp[ 1 ] ) );
brw_MOV( p, tmp[ 2 ], high_words( tmp[ 2 ] ) );
brw_MOV( p, tmp[ 3 ], high_words( tmp[ 3 ] ) );
brw_MUL( p, x1y0, x1y0, t );
brw_MUL( p, x1y1, x1y1, t );
brw_ADD( p, t, param1, brw_imm_f( -1.0 ) );
brw_MUL( p, x0y0, x0y0, param0 );
brw_MUL( p, x0y1, x0y1, param0 );
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param1 );
brw_MUL( p, tmp[ 2 ], tmp[ 2 ], param1 );
brw_MUL( p, tmp[ 1 ], tmp[ 1 ], t );
brw_MUL( p, tmp[ 3 ], tmp[ 3 ], t );
brw_ADD( p, x0y0, x0y0, tmp[ 0 ] );
brw_ADD( p, x1y0, x1y0, tmp[ 2 ] );
brw_ADD( p, x0y1, x0y1, tmp[ 1 ] );
brw_ADD( p, x1y1, x1y1, tmp[ 3 ] );
/* We interpolate between the gradients using the polynomial
6t^5 - 15t^4 + 10t^3 (Perlin). */
brw_MUL( p, tmp[ 0 ], param0, brw_imm_f( 6.0 ) );
brw_MUL( p, tmp[ 1 ], param1, brw_imm_f( 6.0 ) );
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], brw_imm_f( -15.0 ) );
brw_ADD( p, tmp[ 1 ], tmp[ 1 ], brw_imm_f( -15.0 ) );
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param0 );
brw_MUL( p, tmp[ 1 ], tmp[ 1 ], param1 );
brw_ADD( p, x0y1, x0y1, negate( x0y0 ) ); /* unrelated work to fill the
pipeline */
brw_ADD( p, tmp[ 0 ], tmp[ 0 ], brw_imm_f( 10.0 ) );
brw_ADD( p, tmp[ 1 ], tmp[ 1 ], brw_imm_f( 10.0 ) );
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param0 );
brw_MUL( p, tmp[ 1 ], tmp[ 1 ], param1 );
brw_ADD( p, x1y1, x1y1, negate( x1y0 ) ); /* unrelated work to fill the
pipeline */
brw_MUL( p, tmp[ 0 ], tmp[ 0 ], param0 );
brw_MUL( p, tmp[ 1 ], tmp[ 1 ], param1 );
brw_MUL( p, param0, tmp[ 0 ], param0 );
brw_MUL( p, param1, tmp[ 1 ], param1 );
/* Here we interpolate in the y dimension... */
brw_MUL( p, x0y1, x0y1, param1 );
brw_MUL( p, x1y1, x1y1, param1 );
brw_ADD( p, x0y0, x0y0, x0y1 );
brw_ADD( p, x1y0, x1y0, x1y1 );
/* And now in x. There are horrible register dependencies here,
but we have nothing else to do. */
brw_ADD( p, x1y0, x1y0, negate( x0y0 ) );
brw_MUL( p, x1y0, x1y0, param0 );
brw_ADD( p, x0y0, x0y0, x1y0 );
/* scale by pow( 2, -15 ), as described above */
brw_MUL( p, param0, x0y0, brw_imm_f( 0.000030517578125 ) );
release_tmps( c, mark );
}
static void emit_noise2( struct brw_wm_compile *c,
struct prog_instruction *inst )
{
struct brw_compile *p = &c->func;
struct brw_reg src0, src1, param0, param1, dst;
GLuint mask = inst->DstReg.WriteMask;
int i;
int mark = mark_tmps( c );
assert( mark == 0 );
src0 = get_src_reg( c, inst->SrcReg, 0, 1 );
src1 = get_src_reg( c, inst->SrcReg, 1, 1 );
param0 = alloc_tmp( c );
param1 = alloc_tmp( c );
brw_MOV( p, param0, src0 );
brw_MOV( p, param1, src1 );
invoke_subroutine( c, SUB_NOISE2, noise2_sub );
/* Fill in the result: */
brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE );
for (i = 0 ; i < 4; i++) {
if (mask & (1<<i)) {
dst = get_dst_reg(c, inst, i, 1);
brw_MOV( p, dst, param0 );
}
}
if( inst->SaturateMode == SATURATE_ZERO_ONE )
brw_set_saturate( p, 0 );
release_tmps( c, mark );
}
static void emit_wpos_xy(struct brw_wm_compile *c,
struct prog_instruction *inst)
{
@ -1276,6 +1670,15 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
case OPCODE_MAD:
emit_mad(c, inst);
break;
case OPCODE_NOISE1:
emit_noise1(c, inst);
break;
case OPCODE_NOISE2:
emit_noise2(c, inst);
break;
/* case OPCODE_NOISE3: */
/* case OPCODE_NOISE4: */
/* not yet implemented */
case OPCODE_TEX:
emit_tex(c, inst);
break;
@ -1368,7 +1771,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c)
{
brw_wm_pass_fp(c);
c->tmp_index = 127;
brw_wm_emit_glsl(brw, c);
c->prog_data.total_grf = c->reg_index;
c->prog_data.total_scratch = 0;

View File

@ -30,6 +30,7 @@
#include "intel_decode.h"
#include "intel_reg.h"
#include "intel_bufmgr.h"
#include "intel_buffers.h"
/* Relocations in kernel space:
* - pass dma buffer seperately
@ -133,6 +134,9 @@ do_flush_locked(struct intel_batchbuffer *batch,
{
struct intel_context *intel = batch->intel;
int ret = 0;
unsigned int num_cliprects = 0;
struct drm_clip_rect *cliprects = NULL;
int x_off = 0, y_off = 0;
if (batch->buffer)
dri_bo_subdata (batch->buf, 0, used, batch->buffer);
@ -142,23 +146,21 @@ do_flush_locked(struct intel_batchbuffer *batch,
batch->map = NULL;
batch->ptr = NULL;
/* Throw away non-effective packets. Won't work once we have
* hardware contexts which would preserve statechanges beyond a
* single buffer.
*/
if (!(intel->numClipRects == 0 &&
batch->cliprect_mode == LOOP_CLIPRECTS) || intel->no_hw) {
dri_bo_exec(batch->buf, used,
intel->pClipRects,
batch->cliprect_mode != LOOP_CLIPRECTS ?
0 : intel->numClipRects,
(((GLuint) intel->drawX) & 0xffff) |
(((GLuint) intel->drawY) << 16));
if (batch->cliprect_mode == LOOP_CLIPRECTS) {
intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off);
}
/* Dispatch the batchbuffer, if it has some effect (nonzero cliprects).
* Can't short-circuit like this once we have hardware contexts, but we
* should always be in DRI2 mode by then anyway.
*/
if ((batch->cliprect_mode != LOOP_CLIPRECTS ||
num_cliprects != 0) && !intel->no_hw) {
dri_bo_exec(batch->buf, used, cliprects, num_cliprects,
(x_off & 0xffff) | (y_off << 16));
}
if (intel->numClipRects == 0 &&
batch->cliprect_mode == LOOP_CLIPRECTS) {
if (batch->cliprect_mode == LOOP_CLIPRECTS && num_cliprects == 0) {
if (allow_unlock) {
/* If we are not doing any actual user-visible rendering,
* do a sched_yield to keep the app from pegging the cpu while

View File

@ -19,6 +19,9 @@ enum cliprect_mode {
/**
* Batchbuffer contents require looping over per cliprect at batch submit
* time.
*
* This will be upgraded to NO_LOOP_CLIPRECTS when there's a single
* constant cliprect, as in DRI2 or FBO rendering.
*/
LOOP_CLIPRECTS,
/**
@ -29,8 +32,10 @@ enum cliprect_mode {
/**
* Batchbuffer contents contain drawing that already handles cliprects, such
* as 2D drawing to front/back/depth that doesn't respect DRAWING_RECTANGLE.
*
* Equivalent behavior to NO_LOOP_CLIPRECTS, but may not persist in batch
* outside of LOCK/UNLOCK.
* outside of LOCK/UNLOCK. This is upgraded to just NO_LOOP_CLIPRECTS when
* there's a constant cliprect, as in DRI2 or FBO rendering.
*/
REFERENCES_CLIPRECTS
};
@ -115,6 +120,11 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
if (intel_batchbuffer_space(batch) < sz)
intel_batchbuffer_flush(batch);
if ((cliprect_mode == LOOP_CLIPRECTS ||
cliprect_mode == REFERENCES_CLIPRECTS) &&
batch->intel->constant_cliprect)
cliprect_mode = NO_LOOP_CLIPRECTS;
if (cliprect_mode != IGNORE_CLIPRECTS) {
if (batch->cliprect_mode == IGNORE_CLIPRECTS) {
batch->cliprect_mode = cliprect_mode;

View File

@ -422,6 +422,9 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
struct gl_framebuffer *fb = ctx->DrawBuffer;
GLuint clear_depth;
GLbitfield skipBuffers = 0;
unsigned int num_cliprects;
struct drm_clip_rect *cliprects;
int x_off, y_off;
BATCH_LOCALS;
/*
@ -446,7 +449,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
intelFlush(&intel->ctx);
LOCK_HARDWARE(intel);
if (intel->numClipRects) {
intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off);
if (num_cliprects) {
GLint cx, cy, cw, ch;
drm_clip_rect_t clear;
int i;
@ -461,15 +465,15 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
/* clearing a window */
/* flip top to bottom */
clear.x1 = cx + intel->drawX;
clear.x1 = cx + x_off;
clear.y1 = intel->driDrawable->y + intel->driDrawable->h - cy - ch;
clear.x2 = clear.x1 + cw;
clear.y2 = clear.y1 + ch;
}
else {
/* clearing FBO */
assert(intel->numClipRects == 1);
assert(intel->pClipRects == &intel->fboRect);
assert(num_cliprects == 1);
assert(cliprects == &intel->fboRect);
clear.x1 = cx;
clear.y1 = cy;
clear.x2 = clear.x1 + cw;
@ -477,8 +481,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
/* no change to mask */
}
for (i = 0; i < intel->numClipRects; i++) {
const drm_clip_rect_t *box = &intel->pClipRects[i];
for (i = 0; i < num_cliprects; i++) {
const drm_clip_rect_t *box = &cliprects[i];
drm_clip_rect_t b;
GLuint buf;
GLuint clearMask = mask; /* use copy, since we modify it below */

View File

@ -123,99 +123,40 @@ intel_readbuf_region(struct intel_context *intel)
return NULL;
}
/**
* Update the following fields for rendering to a user-created FBO:
* intel->numClipRects
* intel->pClipRects
* intel->drawX
* intel->drawY
*/
static void
intelSetRenderbufferClipRects(struct intel_context *intel)
{
/* If the batch contents require looping over cliprects, flush them before
* we go changing which cliprects get referenced when that happens.
*/
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
(intel->fboRect.x2 != intel->ctx.DrawBuffer->Width ||
intel->fboRect.x2 != intel->ctx.DrawBuffer->Height))
intel_batchbuffer_flush(intel->batch);
assert(intel->ctx.DrawBuffer->Width > 0);
assert(intel->ctx.DrawBuffer->Height > 0);
intel->fboRect.x1 = 0;
intel->fboRect.y1 = 0;
intel->fboRect.x2 = intel->ctx.DrawBuffer->Width;
intel->fboRect.y2 = intel->ctx.DrawBuffer->Height;
intel->numClipRects = 1;
intel->pClipRects = &intel->fboRect;
intel->drawX = 0;
intel->drawY = 0;
}
/**
* As above, but for rendering to front buffer of a window.
* \sa intelSetRenderbufferClipRects
*/
static void
intelSetFrontClipRects(struct intel_context *intel)
void
intel_get_cliprects(struct intel_context *intel,
struct drm_clip_rect **cliprects,
unsigned int *num_cliprects,
int *x_off, int *y_off)
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
if (!dPriv)
return;
if (intel->constant_cliprect) {
/* FBO or DRI2 rendering, which can just use the fb's size. */
intel->fboRect.x1 = 0;
intel->fboRect.y1 = 0;
intel->fboRect.x2 = intel->ctx.DrawBuffer->Width;
intel->fboRect.y2 = intel->ctx.DrawBuffer->Height;
/* If the batch contents require looping over cliprects, flush them before
* we go changing which cliprects get referenced when that happens.
*/
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
intel->pClipRects != dPriv->pClipRects)
intel_batchbuffer_flush(intel->batch);
intel->numClipRects = dPriv->numClipRects;
intel->pClipRects = dPriv->pClipRects;
intel->drawX = dPriv->x;
intel->drawY = dPriv->y;
}
/**
* As above, but for rendering to back buffer of a window.
*/
static void
intelSetBackClipRects(struct intel_context *intel)
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
struct intel_framebuffer *intel_fb;
if (!dPriv)
return;
intel_fb = dPriv->driverPrivate;
if (intel_fb->pf_active || dPriv->numBackClipRects == 0) {
*cliprects = &intel->fboRect;
*num_cliprects = 1;
*x_off = 0;
*y_off = 0;
} else if (intel->front_cliprects ||
intel_fb->pf_active || dPriv->numBackClipRects == 0) {
/* use the front clip rects */
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
intel->pClipRects != dPriv->pClipRects)
intel_batchbuffer_flush(intel->batch);
intel->numClipRects = dPriv->numClipRects;
intel->pClipRects = dPriv->pClipRects;
intel->drawX = dPriv->x;
intel->drawY = dPriv->y;
*cliprects = dPriv->pClipRects;
*num_cliprects = dPriv->numClipRects;
*x_off = dPriv->x;
*y_off = dPriv->y;
}
else {
/* use the back clip rects */
if (intel->batch->cliprect_mode == LOOP_CLIPRECTS &&
intel->pClipRects != dPriv->pBackClipRects)
intel_batchbuffer_flush(intel->batch);
intel->numClipRects = dPriv->numBackClipRects;
intel->pClipRects = dPriv->pBackClipRects;
intel->drawX = dPriv->backX;
intel->drawY = dPriv->backY;
*num_cliprects = dPriv->numBackClipRects;
*cliprects = dPriv->pBackClipRects;
*x_off = dPriv->backX;
*y_off = dPriv->backY;
}
}
@ -300,29 +241,6 @@ intelWindowMoved(struct intel_context *intel)
__DRIdrawablePrivate *dPriv = intel->driDrawable;
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
if (!intel->ctx.DrawBuffer) {
/* when would this happen? -BP */
intelSetFrontClipRects(intel);
}
else if (intel->ctx.DrawBuffer->Name != 0) {
/* drawing to user-created FBO - do nothing */
/* Cliprects would be set from intelDrawBuffer() */
}
else {
/* drawing to a window */
switch (intel_fb->Base._ColorDrawBufferIndexes[0]) {
case BUFFER_FRONT_LEFT:
intelSetFrontClipRects(intel);
break;
case BUFFER_BACK_LEFT:
intelSetBackClipRects(intel);
break;
default:
intelSetFrontClipRects(intel);
}
}
if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
volatile struct drm_i915_sarea *sarea = intel->sarea;
@ -894,7 +812,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
struct intel_context *intel = intel_context(ctx);
struct intel_region *colorRegions[MAX_DRAW_BUFFERS], *depthRegion = NULL;
struct intel_renderbuffer *irbDepth = NULL, *irbStencil = NULL;
int front = 0; /* drawing to front color buffer? */
if (!fb) {
/* this can happen during the initial context initialization */
@ -927,52 +844,44 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
*/
if (fb->_NumColorDrawBuffers == 0) {
/* writing to 0 */
FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
colorRegions[0] = NULL;
if (fb->Name != 0)
intelSetRenderbufferClipRects(intel);
intel->constant_cliprect = GL_TRUE;
} else if (fb->_NumColorDrawBuffers > 1) {
int i;
struct intel_renderbuffer *irb;
FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE);
if (fb->Name != 0)
intelSetRenderbufferClipRects(intel);
for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
irb = intel_renderbuffer(fb->_ColorDrawBuffers[i]);
colorRegions[i] = (irb && irb->region) ? irb->region : NULL;
colorRegions[i] = irb ? irb->region : NULL;
}
intel->constant_cliprect = GL_TRUE;
}
else {
/* draw to exactly one color buffer */
/*_mesa_debug(ctx, "Hardware rendering\n");*/
FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE);
if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
front = 1;
}
/*
* Get the intel_renderbuffer for the colorbuffer we're drawing into.
* And set up cliprects.
/* Get the intel_renderbuffer for the single colorbuffer we're drawing
* into, and set up cliprects if it's .
*/
if (fb->Name == 0) {
intel->constant_cliprect = intel->driScreen->dri2.enabled;
/* drawing to window system buffer */
if (front) {
intelSetFrontClipRects(intel);
if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
if (!intel->constant_cliprect && !intel->front_cliprects)
intel_batchbuffer_flush(intel->batch);
intel->front_cliprects = GL_TRUE;
colorRegions[0] = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
}
else {
intelSetBackClipRects(intel);
if (!intel->constant_cliprect && intel->front_cliprects)
intel_batchbuffer_flush(intel->batch);
intel->front_cliprects = GL_FALSE;
colorRegions[0]= intel_get_rb_region(fb, BUFFER_BACK_LEFT);
}
}
else {
/* drawing to user-created FBO */
struct intel_renderbuffer *irb;
intelSetRenderbufferClipRects(intel);
irb = intel_renderbuffer(fb->_ColorDrawBuffers[0]);
colorRegions[0] = (irb && irb->region) ? irb->region : NULL;
intel->constant_cliprect = GL_TRUE;
}
}

View File

@ -29,6 +29,8 @@
#ifndef INTEL_BUFFERS_H
#define INTEL_BUFFERS_H
#include "dri_util.h"
#include "drm.h"
struct intel_context;
struct intel_framebuffer;
@ -53,4 +55,9 @@ extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb);
extern void intelInitBufferFuncs(struct dd_function_table *functions);
void intel_get_cliprects(struct intel_context *intel,
struct drm_clip_rect **cliprects,
unsigned int *num_cliprects,
int *x_off, int *y_off);
#endif /* INTEL_BUFFERS_H */

View File

@ -588,9 +588,6 @@ intelInitContext(struct intel_context *intel,
intel->driFd = sPriv->fd;
intel->driHwLock = sPriv->lock;
intel->width = intelScreen->width;
intel->height = intelScreen->height;
driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
intel->driScreen->myNum,
IS_965(intelScreen->deviceID) ? "i965" : "i915");
@ -932,38 +929,6 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
sarea->ctxOwner, intel->hHWContext);
}
if (sarea->width != intel->width || sarea->height != intel->height) {
int numClipRects = intel->numClipRects;
/*
* FIXME: Really only need to do this when drawing to a
* common back- or front buffer.
*/
/*
* This will essentially drop the outstanding batchbuffer on
* the floor.
*/
intel->numClipRects = 0;
if (intel->Fallback)
_swrast_flush(&intel->ctx);
if (!IS_965(intel->intelScreen->deviceID))
INTEL_FIREVERTICES(intel);
if (intel->batch->map != intel->batch->ptr)
intel_batchbuffer_flush(intel->batch);
intel->numClipRects = numClipRects;
/* force window update */
intel->lastStamp = 0;
intel->width = sarea->width;
intel->height = sarea->height;
}
/* Drawable changed?
*/
if (dPriv && intel->lastStamp != dPriv->lastStamp) {

View File

@ -235,10 +235,18 @@ struct intel_context
/* These refer to the current drawing buffer:
*/
int drawX, drawY; /**< origin of drawing area within region */
GLuint numClipRects; /**< cliprects for drawing */
drm_clip_rect_t *pClipRects;
struct gl_texture_object *frame_buffer_texobj;
/**
* Set to true if a single constant cliprect should be used in the
* batchbuffer. Otherwise, cliprects must be calculated at batchbuffer
* flush time while the lock is held.
*/
GLboolean constant_cliprect;
/**
* In !constant_cliprect mode, set to true if the front cliprects should be
* used instead of back.
*/
GLboolean front_cliprects;
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
int perf_boxes;
@ -271,10 +279,6 @@ struct intel_context
*/
driOptionCache optionCache;
/* Last seen width/height of the screen */
int width;
int height;
int64_t swap_ust;
int64_t swap_missed_ust;

View File

@ -191,11 +191,7 @@ do_blit_bitmap( GLcontext *ctx,
color8888 = INTEL_PACKCOLOR8888(ubcolor[0], ubcolor[1], ubcolor[2], ubcolor[3]);
color565 = INTEL_PACKCOLOR565(ubcolor[0], ubcolor[1], ubcolor[2]);
/* Does zoom apply to bitmaps?
*/
if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F) ||
ctx->Pixel.ZoomX != 1.0F ||
ctx->Pixel.ZoomY != 1.0F)
if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F))
return GL_FALSE;
LOCK_HARDWARE(intel);

View File

@ -75,19 +75,21 @@ intel_texture_drawpixels(GLcontext * ctx,
/* We're going to mess with texturing with no regard to existing texture
* state, so if there is some set up we have to bail.
*/
if (ctx->Texture._EnabledUnits != 0)
if (ctx->Texture._EnabledUnits != 0) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels() fallback: texturing enabled\n");
return GL_FALSE;
}
/* Can't do textured DrawPixels with a fragment program, unless we were
* to generate a new program that sampled our texture and put the results
* in the fragment color before the user's program started.
*/
if (ctx->FragmentProgram.Enabled)
return GL_FALSE;
/* Don't even want to think about it */
if (format == GL_COLOR_INDEX)
if (ctx->FragmentProgram.Enabled) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels() fallback: fragment program enabled\n");
return GL_FALSE;
}
/* We don't have a way to generate fragments with stencil values which *
* will set the resulting stencil value.
@ -108,8 +110,12 @@ intel_texture_drawpixels(GLcontext * ctx,
* the color buffer, and sample the texture values into the fragment depth
* in a program.
*/
if (format == GL_DEPTH_COMPONENT)
if (format == GL_DEPTH_COMPONENT) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr,
"glDrawPixels() fallback: format == GL_DEPTH_COMPONENT\n");
return GL_FALSE;
}
_mesa_PushAttrib(GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_TEXTURE_BIT |
GL_CURRENT_BIT);
@ -141,22 +147,27 @@ intel_texture_drawpixels(GLcontext * ctx,
_mesa_PushMatrix();
_mesa_LoadIdentity();
/* Create the vertex buffer based on the current raster pos. The x and y
* we're handed are ctx->Current.RasterPos[0,1] rounded to integers.
* We also apply the depth. However, the W component is already multiplied
* into ctx->Current.RasterPos[0,1,2] and we can ignore it at this point.
*/
vertices[0][0] = x;
vertices[0][1] = y;
vertices[0][2] = ctx->Current.RasterPos[2];
vertices[0][3] = ctx->Current.RasterPos[3];
vertices[0][3] = 1.0;
vertices[1][0] = x + width * ctx->Pixel.ZoomX;
vertices[1][1] = y;
vertices[1][2] = ctx->Current.RasterPos[2];
vertices[1][3] = ctx->Current.RasterPos[3];
vertices[1][3] = 1.0;
vertices[2][0] = x + width * ctx->Pixel.ZoomX;
vertices[2][1] = y + height * ctx->Pixel.ZoomY;
vertices[2][2] = ctx->Current.RasterPos[2];
vertices[2][3] = ctx->Current.RasterPos[3];
vertices[2][3] = 1.0;
vertices[3][0] = x;
vertices[3][1] = y + height * ctx->Pixel.ZoomY;
vertices[3][2] = ctx->Current.RasterPos[2];
vertices[3][3] = ctx->Current.RasterPos[3];
vertices[3][3] = 1.0;
texcoords[0][0] = 0.0;
texcoords[0][1] = 0.0;
@ -212,8 +223,12 @@ intel_stencil_drawpixels(GLcontext * ctx,
return GL_TRUE;
/* Can't do a per-bit writemask while treating stencil as rgba data. */
if ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff)
if ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: "
"stencil mask enabled\n");
return GL_FALSE;
}
/* We use FBOs for our wrapping of the depthbuffer into a color
* destination.
@ -224,21 +239,29 @@ intel_stencil_drawpixels(GLcontext * ctx,
/* We're going to mess with texturing with no regard to existing texture
* state, so if there is some set up we have to bail.
*/
if (ctx->Texture._EnabledUnits != 0)
if (ctx->Texture._EnabledUnits != 0) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: "
"texturing enabled\n");
return GL_FALSE;
}
/* Can't do textured DrawPixels with a fragment program, unless we were
* to generate a new program that sampled our texture and put the results
* in the fragment color before the user's program started.
*/
if (ctx->FragmentProgram.Enabled)
if (ctx->FragmentProgram.Enabled) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: "
"fragment program enabled\n");
return GL_FALSE;
}
/* Check that we can load in a texture this big. */
if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) ||
height > (1 << (ctx->Const.MaxTextureLevels - 1))) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
fprintf(stderr, "glDrawPixels(STENCIL_IDNEX) fallback: "
fprintf(stderr, "glDrawPixels(STENCIL_INDEX) fallback: "
"bitmap too large (%dx%d)\n",
width, height);
return GL_FALSE;

View File

@ -29,6 +29,8 @@
#define CMD_2D (0x2 << 29)
#define CMD_3D (0x3 << 29)
#define MI_NOOP (CMD_MI | 0)
#define MI_BATCH_BUFFER_END (CMD_MI | 0xA << 23)
#define MI_FLUSH (CMD_MI | (4 << 23))
@ -44,6 +46,9 @@
#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 (CMD_3D | (0x1d<<24) | (0x04<<16))
#define I1_LOAD_S(n) (1<<(4+n))
#define _3DSTATE_DRAWRECT_INFO (CMD_3D | (0x1d<<24) | (0x80<<16) | 0x3)
#define _3DSTATE_DRAWRECT_INFO_I965 (CMD_3D | (3 << 27) | (1 << 24) | 0x2)
/** @{
*
* PIPE_CONTROL operation, a combination MI_FLUSH and register write with

View File

@ -79,30 +79,6 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region)
}
}
static int
intel_set_region_tiling_gem(struct intel_context *intel,
struct intel_region *region,
uint32_t bo_handle)
{
struct drm_i915_gem_get_tiling get_tiling;
int ret;
memset(&get_tiling, 0, sizeof(get_tiling));
get_tiling.handle = bo_handle;
ret = ioctl(intel->driFd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling);
if (ret != 0) {
fprintf(stderr, "Failed to get tiling state for region: %s\n",
strerror(errno));
return ret;
}
region->tiling = get_tiling.tiling_mode;
region->bit_6_swizzle = get_tiling.swizzle_mode;
return 0;
}
static struct intel_region *
intel_region_alloc_internal(struct intel_context *intel,
GLuint cpp,
@ -151,6 +127,7 @@ intel_region_alloc_for_handle(struct intel_context *intel,
{
struct intel_region *region;
dri_bo *buffer;
int ret;
buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, handle);
@ -159,7 +136,14 @@ intel_region_alloc_for_handle(struct intel_context *intel,
if (region == NULL)
return region;
intel_set_region_tiling_gem(intel, region, handle);
ret = dri_bo_get_tiling(region->buffer, &region->tiling,
&region->bit_6_swizzle);
if (ret != 0) {
fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n",
handle, name, strerror(-ret));
intel_region_release(&region);
return NULL;
}
return region;
}
@ -489,7 +473,14 @@ intel_recreate_static(struct intel_context *intel,
name,
region_desc->bo_handle);
intel_set_region_tiling_gem(intel, region, region_desc->bo_handle);
ret = dri_bo_get_tiling(region->buffer, &region->tiling,
&region->bit_6_swizzle);
if (ret != 0) {
fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n",
region_desc->bo_handle, name, strerror(-ret));
intel_region_release(&region);
return NULL;
}
} else {
if (region->classic_map != NULL) {
drmUnmap(region->classic_map,

View File

@ -30,6 +30,7 @@
#include "main/mtypes.h"
#include "main/colormac.h"
#include "intel_buffers.h"
#include "intel_fbo.h"
#include "intel_screen.h"
#include "intel_span.h"
@ -131,12 +132,8 @@ pwrite_8(struct intel_renderbuffer *irb, uint32_t offset, uint8_t val)
}
static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb,
struct intel_context *intel,
int x, int y)
{
x += intel->drawX;
y += intel->drawY;
return (y * irb->region->pitch + x) * irb->region->cpp;
}
@ -145,7 +142,6 @@ static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb,
*/
static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
struct intel_context *intel,
int x, int y)
{
int tile_stride;
@ -155,9 +151,6 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
int tile_off, tile_base;
tile_stride = (irb->pfPitch * irb->region->cpp) << 3;
x += intel->drawX;
y += intel->drawY;
xbyte = x * irb->region->cpp;
@ -204,7 +197,6 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
}
static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
struct intel_context *intel,
int x, int y)
{
int tile_stride;
@ -214,9 +206,6 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
int tile_off, tile_base;
tile_stride = (irb->pfPitch * irb->region->cpp) << 5;
x += intel->drawX;
y += intel->drawY;
xbyte = x * irb->region->cpp;
@ -268,8 +257,12 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
const GLint yScale = irb->RenderToTexture ? 1 : -1; \
const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
unsigned int num_cliprects; \
struct drm_clip_rect *cliprects; \
int x_off, y_off; \
GLuint p; \
(void) p;
(void) p; \
intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off);
/* XXX FBO: this is identical to the macro in spantmp2.h except we get
* the cliprect info from the context, not the driDrawable.
@ -277,12 +270,12 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
*/
#define HW_CLIPLOOP() \
do { \
int _nc = intel->numClipRects; \
int _nc = num_cliprects; \
while ( _nc-- ) { \
int minx = intel->pClipRects[_nc].x1 - intel->drawX; \
int miny = intel->pClipRects[_nc].y1 - intel->drawY; \
int maxx = intel->pClipRects[_nc].x2 - intel->drawX; \
int maxy = intel->pClipRects[_nc].y2 - intel->drawY;
int minx = cliprects[_nc].x1 - x_off; \
int miny = cliprects[_nc].y1 - y_off; \
int maxx = cliprects[_nc].x2 - x_off; \
int maxy = cliprects[_nc].y2 - y_off;
#if 0
}}
@ -295,6 +288,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define HW_UNLOCK()
/* Convenience macros to avoid typing the swizzle argument over and over */
#define NO_TILE(_X, _Y) no_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off)
#define X_TILE(_X, _Y) x_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off)
#define Y_TILE(_X, _Y) y_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off)
/* 16 bit, RGB565 color spanline and pixel functions
*/
#define SPANTMP_PIXEL_FMT GL_RGB
@ -302,8 +300,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel##x##_RGB565
#define TAG2(x,y) intel##x##_RGB565##y
#define GET_VALUE(X, Y) pread_16(irb, no_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, no_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_16(irb, NO_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, NO_TILE(X, Y), V)
#include "spantmp2.h"
/* 32 bit, ARGB8888 color spanline and pixel functions
@ -313,8 +311,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel##x##_ARGB8888
#define TAG2(x,y) intel##x##_ARGB8888##y
#define GET_VALUE(X, Y) pread_32(irb, no_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, no_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_32(irb, NO_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, NO_TILE(X, Y), V)
#include "spantmp2.h"
/* 32 bit, xRGB8888 color spanline and pixel functions
@ -324,8 +322,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel##x##_xRGB8888
#define TAG2(x,y) intel##x##_xRGB8888##y
#define GET_VALUE(X, Y) pread_xrgb8888(irb, no_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, no_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_xrgb8888(irb, NO_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, NO_TILE(X, Y), V)
#include "spantmp2.h"
/* 16 bit RGB565 color tile spanline and pixel functions
@ -336,8 +334,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_XTile_##x##_RGB565
#define TAG2(x,y) intel_XTile_##x##_RGB565##y
#define GET_VALUE(X, Y) pread_16(irb, x_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, x_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_16(irb, X_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, X_TILE(X, Y), V)
#include "spantmp2.h"
#define SPANTMP_PIXEL_FMT GL_RGB
@ -345,8 +343,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_YTile_##x##_RGB565
#define TAG2(x,y) intel_YTile_##x##_RGB565##y
#define GET_VALUE(X, Y) pread_16(irb, y_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, y_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_16(irb, Y_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_16(irb, Y_TILE(X, Y), V)
#include "spantmp2.h"
/* 32 bit ARGB888 color tile spanline and pixel functions
@ -357,8 +355,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_XTile_##x##_ARGB8888
#define TAG2(x,y) intel_XTile_##x##_ARGB8888##y
#define GET_VALUE(X, Y) pread_32(irb, x_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, x_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_32(irb, X_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, X_TILE(X, Y), V)
#include "spantmp2.h"
#define SPANTMP_PIXEL_FMT GL_BGRA
@ -366,8 +364,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_YTile_##x##_ARGB8888
#define TAG2(x,y) intel_YTile_##x##_ARGB8888##y
#define GET_VALUE(X, Y) pread_32(irb, y_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, y_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_32(irb, Y_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_32(irb, Y_TILE(X, Y), V)
#include "spantmp2.h"
/* 32 bit xRGB888 color tile spanline and pixel functions
@ -378,8 +376,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_XTile_##x##_xRGB8888
#define TAG2(x,y) intel_XTile_##x##_xRGB8888##y
#define GET_VALUE(X, Y) pread_xrgb8888(irb, x_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, x_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_xrgb8888(irb, X_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, X_TILE(X, Y), V)
#include "spantmp2.h"
#define SPANTMP_PIXEL_FMT GL_BGRA
@ -387,15 +385,19 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define TAG(x) intel_YTile_##x##_xRGB8888
#define TAG2(x,y) intel_YTile_##x##_xRGB8888##y
#define GET_VALUE(X, Y) pread_xrgb8888(irb, y_tile_swizzle(irb, intel, X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, y_tile_swizzle(irb, intel, X, Y), V)
#define GET_VALUE(X, Y) pread_xrgb8888(irb, Y_TILE(X, Y))
#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, Y_TILE(X, Y), V)
#include "spantmp2.h"
#define LOCAL_DEPTH_VARS \
struct intel_context *intel = intel_context(ctx); \
struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
const GLint yScale = irb->RenderToTexture ? 1 : -1; \
const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1;
const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
unsigned int num_cliprects; \
struct drm_clip_rect *cliprects; \
int x_off, y_off; \
intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off);
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
@ -404,10 +406,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
** 16-bit depthbuffer functions.
**/
#define VALUE_TYPE GLushort
#define WRITE_DEPTH(_x, _y, d) \
pwrite_16(irb, no_tile_swizzle(irb, intel, _x, _y), d)
#define READ_DEPTH(d, _x, _y) \
d = pread_16(irb, no_tile_swizzle(irb, intel, _x, _y))
#define WRITE_DEPTH(_x, _y, d) pwrite_16(irb, NO_TILE(_x, _y), d)
#define READ_DEPTH(d, _x, _y) d = pread_16(irb, NO_TILE(_x, _y))
#define TAG(x) intel##x##_z16
#include "depthtmp.h"
@ -416,10 +416,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
** 16-bit x tile depthbuffer functions.
**/
#define VALUE_TYPE GLushort
#define WRITE_DEPTH(_x, _y, d) \
pwrite_16(irb, x_tile_swizzle(irb, intel, _x, _y), d)
#define READ_DEPTH(d, _x, _y) \
d = pread_16(irb, x_tile_swizzle(irb, intel, _x, _y))
#define WRITE_DEPTH(_x, _y, d) pwrite_16(irb, X_TILE(_x, _y), d)
#define READ_DEPTH(d, _x, _y) d = pread_16(irb, X_TILE(_x, _y))
#define TAG(x) intel_XTile_##x##_z16
#include "depthtmp.h"
@ -427,10 +425,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
** 16-bit y tile depthbuffer functions.
**/
#define VALUE_TYPE GLushort
#define WRITE_DEPTH(_x, _y, d) \
pwrite_16(irb, y_tile_swizzle(irb, intel, _x, _y), d)
#define READ_DEPTH(d, _x, _y) \
d = pread_16(irb, y_tile_swizzle(irb, intel, _x, _y))
#define WRITE_DEPTH(_x, _y, d) pwrite_16(irb, Y_TILE(_x, _y), d)
#define READ_DEPTH(d, _x, _y) d = pread_16(irb, Y_TILE(_x, _y))
#define TAG(x) intel_YTile_##x##_z16
#include "depthtmp.h"
@ -445,12 +441,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
/* Change ZZZS -> SZZZ */
#define WRITE_DEPTH(_x, _y, d) \
pwrite_32(irb, no_tile_swizzle(irb, intel, _x, _y), \
((d) >> 8) | ((d) << 24))
pwrite_32(irb, NO_TILE(_x, _y), ((d) >> 8) | ((d) << 24))
/* Change SZZZ -> ZZZS */
#define READ_DEPTH( d, _x, _y ) { \
GLuint tmp = pread_32(irb, no_tile_swizzle(irb, intel, _x, _y)); \
GLuint tmp = pread_32(irb, NO_TILE(_x, _y)); \
d = (tmp << 8) | (tmp >> 24); \
}
@ -468,12 +463,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
/* Change ZZZS -> SZZZ */
#define WRITE_DEPTH(_x, _y, d) \
pwrite_32(irb, x_tile_swizzle(irb, intel, _x, _y), \
((d) >> 8) | ((d) << 24)) \
pwrite_32(irb, X_TILE(_x, _y), ((d) >> 8) | ((d) << 24))
/* Change SZZZ -> ZZZS */
#define READ_DEPTH( d, _x, _y ) { \
GLuint tmp = pread_32(irb, x_tile_swizzle(irb, intel, _x, _y)); \
GLuint tmp = pread_32(irb, X_TILE(_x, _y)); \
d = (tmp << 8) | (tmp >> 24); \
}
@ -490,12 +484,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
/* Change ZZZS -> SZZZ */
#define WRITE_DEPTH(_x, _y, d) \
pwrite_32(irb, y_tile_swizzle(irb, intel, _x, _y), \
((d) >> 8) | ((d) << 24))
pwrite_32(irb, Y_TILE(_x, _y), ((d) >> 8) | ((d) << 24))
/* Change SZZZ -> ZZZS */
#define READ_DEPTH( d, _x, _y ) { \
GLuint tmp = pread_32(irb, y_tile_swizzle(irb, intel, _x, _y)); \
GLuint tmp = pread_32(irb, Y_TILE(_x, _y)); \
d = (tmp << 8) | (tmp >> 24); \
}
@ -506,36 +499,24 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
/**
** 8-bit stencil function (XXX FBO: This is obsolete)
**/
#define WRITE_STENCIL(_x, _y, d) \
pwrite_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) \
d = pread_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3);
#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, NO_TILE(_x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) d = pread_8(irb, NO_TILE(_x, _y) + 3);
#define TAG(x) intel##x##_z24_s8
#include "stenciltmp.h"
/**
** 8-bit x-tile stencil function (XXX FBO: This is obsolete)
**/
#define WRITE_STENCIL(_x, _y, d) \
pwrite_8(irb, x_tile_swizzle(irb, intel, _x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) \
d = pread_8(irb, x_tile_swizzle(irb, intel, _x, _y) + 3);
#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, X_TILE(_x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) d = pread_8(irb, X_TILE(_x, _y) + 3);
#define TAG(x) intel_XTile_##x##_z24_s8
#include "stenciltmp.h"
/**
** 8-bit y-tile stencil function (XXX FBO: This is obsolete)
**/
#define WRITE_STENCIL(_x, _y, d) \
pwrite_8(irb, y_tile_swizzle(irb, intel, _x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) \
d = pread_8(irb, y_tile_swizzle(irb, intel, _x, _y) + 3)
#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, Y_TILE(_x, _y) + 3, d)
#define READ_STENCIL(d, _x, _y) d = pread_8(irb, Y_TILE(_x, _y) + 3)
#define TAG(x) intel_YTile_##x##_z24_s8
#include "stenciltmp.h"
@ -602,14 +583,10 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
if (tex) {
/* render to texture */
ASSERT(att->Renderbuffer);
if (map) {
struct gl_texture_image *texImg;
texImg = tex->Image[att->CubeMapFace][att->TextureLevel];
if (map)
intel_tex_map_images(intel, intel_texture_object(tex));
}
else {
else
intel_tex_unmap_images(intel, intel_texture_object(tex));
}
}
}

View File

@ -226,12 +226,8 @@ PrintShaderInstructions(GLuint shader, FILE *f)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
GLuint i;
for (i = 0; i < sh->NumPrograms; i++) {
struct gl_program *prog = sh->Programs[i];
_mesa_print_program_opt(prog, Options.Mode, Options.LineNumbers);
}
struct gl_program *prog = sh->Program;
_mesa_print_program_opt(prog, Options.Mode, Options.LineNumbers);
}

View File

@ -150,36 +150,32 @@ void _mesa_print_info( void )
static void add_debug_flags( const char *debug )
{
#ifdef DEBUG
if (_mesa_strstr(debug, "varray"))
MESA_VERBOSE |= VERBOSE_VARRAY;
struct debug_option {
const char *name;
GLbitfield flag;
};
static const struct debug_option debug_opt[] = {
{ "varray", VERBOSE_VARRAY },
{ "tex", VERBOSE_TEXTURE },
{ "imm", VERBOSE_IMMEDIATE },
{ "pipe", VERBOSE_PIPELINE },
{ "driver", VERBOSE_DRIVER },
{ "state", VERBOSE_STATE },
{ "api", VERBOSE_API },
{ "list", VERBOSE_DISPLAY_LIST },
{ "lighting", VERBOSE_LIGHTING },
{ "disassem", VERBOSE_DISASSEM },
{ "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */
{ "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */
};
GLuint i;
if (_mesa_strstr(debug, "tex"))
MESA_VERBOSE |= VERBOSE_TEXTURE;
MESA_VERBOSE = 0x0;
for (i = 0; i < Elements(debug_opt); i++) {
if (_mesa_strstr(debug, debug_opt[i].name))
MESA_VERBOSE |= debug_opt[i].flag;
}
if (_mesa_strstr(debug, "imm"))
MESA_VERBOSE |= VERBOSE_IMMEDIATE;
if (_mesa_strstr(debug, "pipe"))
MESA_VERBOSE |= VERBOSE_PIPELINE;
if (_mesa_strstr(debug, "driver"))
MESA_VERBOSE |= VERBOSE_DRIVER;
if (_mesa_strstr(debug, "state"))
MESA_VERBOSE |= VERBOSE_STATE;
if (_mesa_strstr(debug, "api"))
MESA_VERBOSE |= VERBOSE_API;
if (_mesa_strstr(debug, "list"))
MESA_VERBOSE |= VERBOSE_DISPLAY_LIST;
if (_mesa_strstr(debug, "lighting"))
MESA_VERBOSE |= VERBOSE_LIGHTING;
if (_mesa_strstr(debug, "disassem"))
MESA_VERBOSE |= VERBOSE_DISASSEM;
/* Debug flag:
*/
if (_mesa_strstr(debug, "flush"))

View File

@ -3135,7 +3135,9 @@ enum _verbose
VERBOSE_LIGHTING = 0x0200,
VERBOSE_PRIMS = 0x0400,
VERBOSE_VERTS = 0x0800,
VERBOSE_DISASSEM = 0x1000
VERBOSE_DISASSEM = 0x1000,
VERBOSE_GLSL = 0x2000,
VERBOSE_GLSL_DUMP = 0x4000
};

View File

@ -200,7 +200,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
}
break;
case GL_POINT_SPRITE_COORD_ORIGIN:
if (ctx->Extensions.ARB_point_sprite) {
if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) {
GLenum value = (GLenum) params[0];
if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) {
_mesa_error(ctx, GL_INVALID_VALUE,

File diff suppressed because it is too large Load Diff

View File

@ -2,103 +2,104 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
/* slang_builtin_120_common.gc */
4,1,0,0,26,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,26,109,0,0,1,0,0,26,110,
0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,
10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,28,0,109,97,116,114,105,120,67,111,109,112,77,
117,108,116,0,1,0,0,28,109,0,0,1,0,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,
57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,27,0,
109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,27,109,0,0,1,0,0,27,110,0,0,0,1,8,58,
109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,
110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,30,0,109,
97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,30,109,0,0,1,0,0,30,110,0,0,0,1,8,58,109,
97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,
0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,29,0,109,97,
116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,29,109,0,0,1,0,0,29,110,0,0,0,1,8,58,109,97,
116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,
16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,
110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,31,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,
0,0,31,109,0,0,1,0,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,
8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,
16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,13,0,111,117,116,
101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,0,18,
99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,
114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,14,0,111,117,116,101,114,
80,114,111,100,117,99,116,0,1,0,0,11,99,0,0,1,0,0,11,114,0,0,0,1,8,58,109,97,116,51,0,18,99,0,59,
120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,
4,1,0,0,26,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,109,0,0,1,0,0,0,26,
110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,
16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,28,0,109,97,116,114,105,120,67,111,109,112,
77,117,108,116,0,1,0,0,0,28,109,0,0,1,0,0,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,
8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,
0,27,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,27,109,0,0,1,0,0,0,27,110,0,
0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,
49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,
30,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,30,109,0,0,1,0,0,0,30,110,0,0,
0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,
0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,29,
0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,29,109,0,0,1,0,0,0,29,110,0,0,0,1,
8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,
57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,
51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,31,0,109,97,116,114,105,120,67,111,109,112,77,117,
108,116,0,1,0,0,0,31,109,0,0,1,0,0,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,
57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,
0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,13,
0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,
109,97,116,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,
99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,14,0,111,
117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,11,114,0,0,0,1,8,58,109,97,
116,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,
59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,
59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,
99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,15,0,111,
117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,99,0,0,1,0,0,0,12,114,0,0,0,1,8,58,109,97,
116,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,
59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,
59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,
99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,
114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,
0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,
18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,26,0,111,117,116,101,
114,80,114,111,100,117,99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,51,
0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,
18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,
48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,27,0,111,117,116,101,114,80,114,111,100,
117,99,116,0,1,0,0,0,10,99,0,0,1,0,0,0,11,114,0,0,0,1,8,58,109,97,116,51,120,50,0,18,99,0,59,120,0,
18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,
48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,
121,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,28,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,
0,0,12,99,0,0,1,0,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,52,0,18,99,0,59,120,0,18,114,0,59,120,
0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,
119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,
121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,
0,0,29,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,99,0,0,1,0,0,0,12,114,0,0,0,1,
8,58,109,97,116,52,120,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,
120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,
59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,
59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,15,0,111,117,116,101,114,80,114,
111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,0,18,99,0,59,120,0,18,
114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,
0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,
18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,
48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,
122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,
119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0,
59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,26,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,
0,0,11,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,
48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,
120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,
121,0,48,0,0,0,0,1,0,0,27,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0,
11,114,0,0,0,1,8,58,109,97,116,51,120,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,
0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,
0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,
28,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,
97,116,50,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,
18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,
18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,
48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,29,0,111,117,116,101,114,80,114,111,100,
117,99,116,0,1,0,0,10,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,50,0,18,99,0,59,120,0,18,
114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,
0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,
18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,
48,0,0,0,0,1,0,0,30,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,11,114,
0,0,0,1,8,58,109,97,116,51,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,
114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,
0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,
18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,
59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,
59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,30,0,111,117,116,101,114,80,114,
111,100,117,99,116,0,1,0,0,0,12,99,0,0,1,0,0,0,11,114,0,0,0,1,8,58,109,97,116,51,120,52,0,18,99,0,
59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,
59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,
99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,
114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,
0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,31,0,
111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,99,0,0,1,0,0,0,12,114,0,0,0,1,8,58,109,
97,116,52,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,
18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,
18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,
48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,
119,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,31,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,
0,11,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,
0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,
18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,
48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,
122,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,
119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,13,0,116,114,97,110,115,112,111,115,
101,0,1,0,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,
0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,0,0,14,
0,116,114,97,110,115,112,111,115,101,0,1,0,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,
0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,
48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,
8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,0,
0,15,0,116,114,97,110,115,112,111,115,101,0,1,0,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,
8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,
16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,
0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,
109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0,
18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,
0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,1,0,0,26,0,116,114,97,110,115,112,111,115,101,0,1,0,0,27,
109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,
120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,
59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,0,0,1,0,0,27,0,116,114,97,110,115,112,111,115,101,0,
1,0,0,26,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,
49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,
8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,0,0,0,1,0,0,28,0,116,114,97,110,115,112,111,
115,101,0,1,0,0,29,109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,
120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59,
119,0,48,0,0,0,0,1,0,0,13,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,109,0,0,0,1,8,58,109,
97,116,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,
57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,0,0,14,0,116,114,97,110,115,112,111,115,
101,0,1,0,0,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,
49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,
10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,
16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,0,0,15,0,116,114,97,110,115,112,
111,115,101,0,1,0,0,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,
0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,
109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,
18,109,0,16,10,51,0,57,59,121,0,0,0,0,0,1,0,0,29,0,116,114,97,110,115,112,111,115,101,0,1,0,0,28,
109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,
120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,
59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,
57,59,119,0,0,0,0,0,1,0,0,30,0,116,114,97,110,115,112,111,115,101,0,1,0,0,31,109,0,0,0,1,8,58,109,
97,116,51,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,
10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,
16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,
109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,
18,109,0,16,10,51,0,57,59,122,0,0,0,0,0,1,0,0,31,0,116,114,97,110,115,112,111,115,101,0,1,0,0,30,
109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,
120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,
59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,
57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,
0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0
18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,
0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,
0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,18,109,0,16,10,51,0,57,59,
119,0,0,0,0,0,1,0,0,26,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,27,109,0,0,0,1,8,58,109,97,
116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,
50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,
10,50,0,57,59,121,0,0,0,0,0,1,0,0,27,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,26,109,0,0,0,1,
8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,
109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,
18,109,0,16,10,49,0,57,59,122,0,0,0,0,0,1,0,0,28,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,29,
109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,
120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,
59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,
57,59,121,0,0,0,0,0,1,0,0,29,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,28,109,0,0,0,1,8,58,
109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,
16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,
0,16,10,49,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,0,0,
0,1,0,0,30,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,31,109,0,0,0,1,8,58,109,97,116,51,120,52,
0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,
0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,
121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,
59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,
57,59,122,0,0,0,0,0,1,0,0,31,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,30,109,0,0,0,1,8,58,
109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,
16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,
0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,
109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,
18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,93 +9,93 @@
0,12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,3,0,12,1,103,108,95,83,101,99,111,110,100,97,114,
121,67,111,108,111,114,0,0,0,2,2,3,0,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,
95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,0,9,1,103,108,95,70,111,
103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,
115,97,109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,
0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,
20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,
98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,
112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,
99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,
18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,
20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,
112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,
80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,
98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,
120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,
111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,
0,12,0,116,101,120,116,117,114,101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,
111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,
111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,
0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,
86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,
101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,
111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,
112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,
59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,
116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,
17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,
2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,
114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,
119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,
120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,
0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,
52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,
59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,
86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,
101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99,
111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,
112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,
114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,
101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,
114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,
1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,
1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,
111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,
95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,
0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97,109,
112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,
111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,
0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,
49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,
108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,
111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,
99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,
0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,
116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,
108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,
111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,
103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,
16,115,97,109,112,108,101,114,0,0,1,1,0,0,9,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,
3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,
100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,
101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,
115,97,109,112,108,101,114,0,0,1,1,0,0,10,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,
2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,
100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,
98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,
18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,
114,101,49,68,80,114,111,106,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,
100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,
111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,
18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,
100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,
100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,115,97,109,112,108,101,114,0,
0,1,1,0,0,10,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,
100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,
18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,
100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,
52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108,
101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,
111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,
18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,
100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,
95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
112,99,111,111,114,100,0,0,0,0,1,0,0,9,0,100,70,100,120,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,
100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,
0,10,0,100,70,100,120,0,1,1,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,
86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,0,11,0,100,70,100,120,0,1,1,0,
11,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,
0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,100,70,100,120,0,1,1,0,12,112,0,0,0,1,4,118,101,
99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,0,9,0,100,70,100,121,
0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,
18,112,0,59,120,120,120,120,0,0,0,0,1,0,0,10,0,100,70,100,121,0,1,1,0,10,112,0,0,0,1,4,118,101,99,
52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,
0,0,0,1,0,0,11,0,100,70,100,121,0,1,1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,
114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,100,70,
100,121,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,
18,112,0,0,0,0,1,0,0,9,0,102,119,105,100,116,104,0,1,1,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,
100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,10,0,
102,119,105,100,116,104,0,1,1,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,
0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,11,0,102,119,105,100,116,104,0,
1,1,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,
70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,12,0,102,119,105,100,116,104,0,1,1,0,12,112,0,0,0,1,8,
52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,115,97,109,112,
108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,
99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,
121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,
115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,
50,68,80,114,111,106,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,
1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,
18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,
100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,
100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,115,97,109,112,108,101,114,0,
0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,
100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,
0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,
120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
114,100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,115,97,
109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,
12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,
100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,
119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,
120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,
111,114,100,0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,
111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,
119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,
86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,
104,97,100,111,119,49,68,0,1,1,0,0,20,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,
0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,
100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,
105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,
115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,
49,68,80,114,111,106,0,1,1,0,0,20,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,
1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,
99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,
59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,
86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,
104,97,100,111,119,50,68,0,1,1,0,0,21,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,
0,0,1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,
100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,
105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,
115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,
50,68,80,114,111,106,0,1,1,0,0,21,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,
1,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,
100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,
18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,
100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,
116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,9,0,
100,70,100,120,0,1,1,0,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,
108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,0,10,0,100,70,100,120,0,1,1,0,0,10,112,0,
0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,
120,121,121,121,0,0,0,0,1,0,0,11,0,100,70,100,120,0,1,1,0,0,11,112,0,0,0,1,4,118,101,99,52,95,100,
100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,
1,0,0,12,0,100,70,100,120,0,1,1,0,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,
101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,0,9,0,100,70,100,121,0,1,1,0,0,9,112,0,0,0,1,4,118,101,99,
52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,
0,1,0,0,10,0,100,70,100,121,0,1,1,0,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,
101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,0,11,0,100,70,100,121,0,
1,1,0,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,
121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,100,70,100,121,0,1,1,0,0,12,112,0,0,0,1,
4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,0,9,0,102,
119,105,100,116,104,0,1,1,0,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,
58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,10,0,102,119,105,100,116,104,0,1,
1,0,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,
70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,11,0,102,119,105,100,116,104,0,1,1,0,0,11,112,0,0,0,1,8,
58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,
0,0,0,46,0,0,0
0,0,0,46,0,0,1,0,0,12,0,102,119,105,100,116,104,0,1,1,0,0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,
70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0

View File

@ -229,6 +229,7 @@
.emtcode OP_FIELD 59
.emtcode OP_POSTINCREMENT 60
.emtcode OP_POSTDECREMENT 61
.emtcode OP_PRECISION 62
/* parameter qualifier */
.emtcode PARAM_QUALIFIER_IN 0
@ -753,9 +754,17 @@ parameter_declarator_2
/*
<parameter_declaration> ::= <type_qualifier> <parameter_qualifier>
<precision> <parameter_declarator>
| <type_qualifier> <parameter_qualifier>
<precision> <parameter_type_specifier>
| <type_qualifier> <parameter_qualifier>
<parameter_declarator>
| <type_qualifier> <parameter_qualifier>
<parameter_type_specifier>
| <parameter_qualifier> <precision>
<parameter_declarator>
| <parameter_qualifier> <precision>
<parameter_type_specifier>
| <parameter_qualifier> <parameter_declarator>
| <parameter_qualifier> <parameter_type_specifier>
*/
@ -768,6 +777,12 @@ parameter_declaration_2
parameter_declaration_3
parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;
parameter_declaration_4
parameter_declaration_optprec .and parameter_declaration_rest;
parameter_declaration_optprec
parameter_declaration_prec .or .true .emit PRECISION_DEFAULT;
parameter_declaration_prec
precision .and space;
parameter_declaration_rest
parameter_declarator .or parameter_type_specifier;
/*
@ -1047,6 +1062,7 @@ simple_statement
.if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or
selection_statement .or
iteration_statement .or
precision_stmt .emit OP_PRECISION .or
jump_statement .or
expression_statement .emit OP_EXPRESSION .or
declaration_statement .emit OP_DECLARE;

View File

@ -131,6 +131,7 @@
".emtcode OP_FIELD 59\n"
".emtcode OP_POSTINCREMENT 60\n"
".emtcode OP_POSTDECREMENT 61\n"
".emtcode OP_PRECISION 62\n"
".emtcode PARAM_QUALIFIER_IN 0\n"
".emtcode PARAM_QUALIFIER_OUT 1\n"
".emtcode PARAM_QUALIFIER_INOUT 2\n"
@ -360,6 +361,12 @@
"parameter_declaration_3\n"
" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n"
"parameter_declaration_4\n"
" parameter_declaration_optprec .and parameter_declaration_rest;\n"
"parameter_declaration_optprec\n"
" parameter_declaration_prec .or .true .emit PRECISION_DEFAULT;\n"
"parameter_declaration_prec\n"
" precision .and space;\n"
"parameter_declaration_rest\n"
" parameter_declarator .or parameter_type_specifier;\n"
"parameter_qualifier\n"
" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n"
@ -505,6 +512,7 @@
" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n"
" selection_statement .or\n"
" iteration_statement .or\n"
" precision_stmt .emit OP_PRECISION .or\n"
" jump_statement .or\n"
" expression_statement .emit OP_EXPRESSION .or\n"
" declaration_statement .emit OP_DECLARE;\n"

View File

@ -28,73 +28,74 @@
105,120,0,16,10,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,
108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,
120,0,16,10,51,0,57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,0,0,
12,0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,
9,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,
99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,
0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,
0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,
117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,
111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,
99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,
20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,
98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,
114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,16,
115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,
12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,
59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,
111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,
115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,
114,101,50,68,76,111,100,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,
1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,
59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,
108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,
18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,
114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,
111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,
12,0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,1,
0,0,9,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,
0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,
59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,
120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,
1,0,0,10,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,
0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,
100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,
52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,
18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,
111,100,0,1,1,0,0,16,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,
108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,
0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,
114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,
101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,
0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,
10,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,
18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,
114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,
114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,
12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,115,97,109,112,108,
101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,
111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,
121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,
100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,
50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,
114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,
111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,
0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,
120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,
111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,
17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,
0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,
18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,
0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,
117,114,101,51,68,76,111,100,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,
0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,
52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,
59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,
97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,
120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,
0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,
9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,
111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,
101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,
114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,67,117,98,101,76,
111,100,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,
100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,
18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,
99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,
114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,
0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,
2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,
114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,
101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,
20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,
0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,
0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,
111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,
101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,
114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,1,
0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,
2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,
114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,
101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,
21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,
0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,
100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,
18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,
4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,
108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0
111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,76,111,100,0,1,1,0,0,18,115,97,
109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,
1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,
0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,
52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,
18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,
111,100,0,1,1,0,0,18,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,
108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,
121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,
112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,
18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,
0,0,1,0,0,12,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,115,97,109,112,
108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,
111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,
0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,99,
117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,115,97,109,112,
108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,
111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,
0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,
100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,
52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,115,97,
109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,3,2,0,0,12,
1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,
120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,
111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,
99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,
0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,
21,115,97,109,112,108,101,114,0,0,1,1,0,0,11,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,0,1,
3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,
111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,
116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,
111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,
0,0,21,115,97,109,112,108,101,114,0,0,1,1,0,0,12,99,111,111,114,100,0,0,1,1,0,0,9,108,111,100,0,0,
0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,
111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,
59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,
100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,
109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0

View File

@ -2309,7 +2309,7 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper)
/* type-check expression */
if (!_slang_is_boolean(A, &oper->children[0])) {
slang_info_log_error(A->log, "boolean expression expected for 'while'");
slang_info_log_error(A->log, "boolean expression expected for 'if'");
return NULL;
}
@ -2439,12 +2439,6 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
/*assert(!var->declared);*/
var->declared = GL_TRUE;
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) {
_slang_attach_storage(n, var);
@ -2453,7 +2447,13 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
assert(n->Store);
assert(n->Store->Index < 0);
n->Store->File = PROGRAM_TEMPORARY;
if (is_sampler_type(&var->type)) {
n->Store->File = PROGRAM_SAMPLER;
}
else {
n->Store->File = PROGRAM_TEMPORARY;
}
n->Store->Size = _slang_sizeof_type_specifier(&n->Var->type.specifier);
if (n->Store->Size <= 0) {

View File

@ -800,6 +800,7 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
#define OP_FIELD 59
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
#define OP_PRECISION 62
/**
@ -971,6 +972,16 @@ parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
return 0;
}
break;
case OP_PRECISION:
{
/* set default precision for a type in this scope */
/* ignored at this time */
int prec_qual = *C->I++;
int datatype = *C->I++;
(void) prec_qual;
(void) datatype;
}
break;
default:
return 0;
}
@ -1295,12 +1306,16 @@ static int
parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
slang_variable * param)
{
int param_qual, precision_qual;
/* parse and validate the parameter's type qualifiers (there can be
* two at most) because not all combinations are valid
*/
if (!parse_type_qualifier(C, &param->type.qualifier))
return 0;
switch (*C->I++) {
param_qual = *C->I++;
switch (param_qual) {
case PARAM_QUALIFIER_IN:
if (param->type.qualifier != SLANG_QUAL_CONST
&& param->type.qualifier != SLANG_QUAL_NONE) {
@ -1328,6 +1343,11 @@ parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
return 0;
}
/* parse precision qualifier (lowp, mediump, highp */
precision_qual = *C->I++;
/* ignored at this time */
(void) precision_qual;
/* parse parameter's type specifier and name */
if (!parse_type_specifier(C, O, &param->type.specifier))
return 0;

View File

@ -80,10 +80,23 @@ slang_replace_scope(slang_operation *oper,
slang_variable_scope *newScope)
{
GLuint i;
if (oper->locals != newScope &&
oper->locals->outer_scope == oldScope) {
/* found. replace old w/ new */
oper->locals->outer_scope = newScope;
}
if (oper->type == SLANG_OPER_VARIABLE_DECL) {
/* search/replace in the initializer */
slang_variable *var;
var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE);
if (var && var->initializer) {
slang_replace_scope(var->initializer, oldScope, newScope);
}
}
/* search/replace in children */
for (i = 0; i < oper->num_children; i++) {
slang_replace_scope(&oper->children[i], oldScope, newScope);
}
@ -148,7 +161,9 @@ slang_operation_copy(slang_operation * x, const slang_operation * y)
/* If this operation declares a new scope, we need to make sure
* all children point to it, not the original operation's scope!
*/
if (x->type == SLANG_OPER_BLOCK_NEW_SCOPE) {
if (x->type == SLANG_OPER_BLOCK_NEW_SCOPE ||
x->type == SLANG_OPER_WHILE ||
x->type == SLANG_OPER_FOR) {
slang_replace_scope(x, y->locals, x->locals);
}

View File

@ -1085,6 +1085,14 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n)
n->Store = n->Children[0]->Store;
if (n->Store->File == PROGRAM_SAMPLER) {
/* no code generated for sampler assignments,
* just copy the sampler index at compile time.
*/
n->Store->Index = n->Children[1]->Store->Index;
return NULL;
}
#if PEEPHOLE_OPTIMIZATIONS
if (inst &&
_slang_is_temp(emitInfo->vt, n->Children[1]->Store) &&

View File

@ -219,6 +219,7 @@ link_uniform_vars(struct gl_shader_program *shProg,
inst->Sampler, map[ inst->Sampler ]);
*/
/* here, texUnit is really samplerUnit */
assert(inst->TexSrcUnit < MAX_SAMPLERS);
inst->TexSrcUnit = samplerMap[inst->TexSrcUnit];
prog->SamplerTargets[inst->TexSrcUnit] = inst->TexSrcTarget;
prog->SamplersUsed |= (1 << inst->TexSrcUnit);
@ -563,32 +564,30 @@ _slang_link(GLcontext *ctx,
/* notify driver that a new fragment program has been compiled/linked */
ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
&shProg->FragmentProgram->Base);
#if 0
printf("************** original fragment program\n");
_mesa_print_program(&fragProg->Base);
_mesa_print_program_parameters(ctx, &fragProg->Base);
#endif
#if 0
printf("************** linked fragment prog\n");
_mesa_print_program(&shProg->FragmentProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base);
#endif
if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
printf("Mesa original fragment program:\n");
_mesa_print_program(&fragProg->Base);
_mesa_print_program_parameters(ctx, &fragProg->Base);
printf("Mesa post-link fragment program:\n");
_mesa_print_program(&shProg->FragmentProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base);
}
}
if (vertProg && shProg->VertexProgram) {
/* notify driver that a new vertex program has been compiled/linked */
ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
&shProg->VertexProgram->Base);
#if 0
printf("************** original vertex program\n");
_mesa_print_program(&vertProg->Base);
_mesa_print_program_parameters(ctx, &vertProg->Base);
#endif
#if 0
printf("************** linked vertex prog\n");
_mesa_print_program(&shProg->VertexProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base);
#endif
if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
printf("Mesa original vertex program:\n");
_mesa_print_program(&vertProg->Base);
_mesa_print_program_parameters(ctx, &vertProg->Base);
printf("Mesa post-link vertex program:\n");
_mesa_print_program(&shProg->VertexProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base);
}
}
shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram);

View File

@ -23,6 +23,7 @@
*/
#include "main/imports.h"
#include "main/context.h"
#include "slang_log.h"
#include "slang_utility.h"
@ -86,9 +87,11 @@ slang_info_log_message(slang_info_log * log, const char *prefix,
}
slang_string_concat(log->text, msg);
slang_string_concat(log->text, "\n");
#if 0 /* debug */
_mesa_printf("Mesa GLSL error/warning: %s\n", log->text);
#endif
if (MESA_VERBOSE & VERBOSE_GLSL) {
_mesa_printf("Mesa: GLSL %s\n", log->text);
}
return 1;
}

View File

@ -379,28 +379,43 @@ slang_print_tree(const slang_operation *op, int indent)
case SLANG_OPER_WHILE:
assert(op->num_children == 2);
spaces(indent);
printf("WHILE LOOP: locals = %p\n", (void *) op->locals);
indent += 3;
spaces(indent);
printf("WHILE cond:\n");
slang_print_tree(&op->children[0], indent + 3);
spaces(indent);
printf("WHILE body:\n");
slang_print_tree(&op->children[1], indent + 3);
indent -= 3;
spaces(indent);
printf("END WHILE LOOP\n");
break;
case SLANG_OPER_DO:
spaces(indent);
printf("DO LOOP: locals = %p\n", (void *) op->locals);
indent += 3;
spaces(indent);
printf("DO body:\n");
slang_print_tree(&op->children[0], indent + 3);
spaces(indent);
printf("DO cond:\n");
slang_print_tree(&op->children[1], indent + 3);
indent -= 3;
spaces(indent);
printf("END DO LOOP\n");
break;
case SLANG_OPER_FOR:
spaces(indent);
printf("FOR LOOP: locals = %p\n", (void *) op->locals);
indent += 3;
spaces(indent);
printf("FOR init:\n");
slang_print_tree(&op->children[0], indent + 3);
spaces(indent);
printf("FOR while:\n");
printf("FOR condition:\n");
slang_print_tree(&op->children[1], indent + 3);
spaces(indent);
printf("FOR step:\n");
@ -408,6 +423,7 @@ slang_print_tree(const slang_operation *op, int indent)
spaces(indent);
printf("FOR body:\n");
slang_print_tree(&op->children[3], indent + 3);
indent -= 3;
spaces(indent);
printf("ENDFOR\n");
/*

View File

@ -115,6 +115,11 @@ _slang_pop_var_table(slang_var_table *vt)
store->Index,
_mesa_swizzle_string(store->Swizzle, 0, 0));
if (store->File == PROGRAM_SAMPLER) {
/* samplers have no storage */
continue;
}
if (store->Size == 1)
comp = GET_SWZ(store->Swizzle, 0);
else
@ -241,7 +246,15 @@ GLboolean
_slang_alloc_var(slang_var_table *vt, slang_ir_storage *store)
{
struct table *t = vt->Top;
const int i = alloc_reg(vt, store->Size, GL_FALSE);
int i;
if (store->File == PROGRAM_SAMPLER) {
/* don't really allocate storage */
store->Index = 0;
return GL_TRUE;
}
i = alloc_reg(vt, store->Size, GL_FALSE);
if (i < 0)
return GL_FALSE;