diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-19 03:13:16 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-19 03:13:16 +0000 |
commit | 2e5308c450082888617a7ad886f3aac6e35dcd4f (patch) | |
tree | 6a5398687d530c57102ec0d508a380cbce5349e9 /dist | |
parent | 5c1d5a5524845666b88bc49ba6135aea4ef5862b (diff) |
Merge Mesa 9.2.5
Diffstat (limited to 'dist')
22 files changed, 131 insertions, 34 deletions
diff --git a/dist/Mesa/SConstruct b/dist/Mesa/SConstruct index 054bf00a9..de252b880 100644 --- a/dist/Mesa/SConstruct +++ b/dist/Mesa/SConstruct @@ -70,7 +70,7 @@ if env['gles']: # Environment setup env.Append(CPPDEFINES = [ - ('PACKAGE_VERSION', '\\"9.2.3\\"'), + ('PACKAGE_VERSION', '\\"9.2.5\\"'), ('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'), ]) diff --git a/dist/Mesa/configure.ac b/dist/Mesa/configure.ac index 2733fdcfe..a6f0361ee 100644 --- a/dist/Mesa/configure.ac +++ b/dist/Mesa/configure.ac @@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output m4_divert_once([HELP_END], [ See docs/autoconf.html for more details on the options for Mesa.]) -AC_INIT([Mesa], [9.2.3], +AC_INIT([Mesa], [9.2.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) AC_CONFIG_AUX_DIR([bin]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/dist/Mesa/src/gallium/drivers/nouveau/nouveau_buffer.c b/dist/Mesa/src/gallium/drivers/nouveau/nouveau_buffer.c index 3e0404983..95905a877 100644 --- a/dist/Mesa/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/dist/Mesa/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -205,6 +205,9 @@ nouveau_transfer_write(struct nouveau_context *nv, struct nouveau_transfer *tx, base, size / 4, (const uint32_t *)data); else nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data); + + nouveau_fence_ref(nv->screen->fence.current, &buf->fence); + nouveau_fence_ref(nv->screen->fence.current, &buf->fence_wr); } diff --git a/dist/Mesa/src/gallium/drivers/nouveau/nouveau_fence.c b/dist/Mesa/src/gallium/drivers/nouveau/nouveau_fence.c index dea146ce6..c6867104a 100644 --- a/dist/Mesa/src/gallium/drivers/nouveau/nouveau_fence.c +++ b/dist/Mesa/src/gallium/drivers/nouveau/nouveau_fence.c @@ -189,16 +189,15 @@ nouveau_fence_wait(struct nouveau_fence *fence) /* wtf, someone is waiting on a fence in flush_notify handler? */ assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING); - if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) { + if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) nouveau_fence_emit(fence); - if (fence == screen->fence.current) - nouveau_fence_new(screen, &screen->fence.current, FALSE); - } - if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) { + if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel)) return FALSE; - } + + if (fence == screen->fence.current) + nouveau_fence_next(screen); do { nouveau_fence_update(screen, FALSE); diff --git a/dist/Mesa/src/gallium/drivers/nv50/nv50_screen.c b/dist/Mesa/src/gallium/drivers/nv50/nv50_screen.c index 2951eb415..14af9bc2b 100644 --- a/dist/Mesa/src/gallium/drivers/nv50/nv50_screen.c +++ b/dist/Mesa/src/gallium/drivers/nv50/nv50_screen.c @@ -221,7 +221,7 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, case PIPE_SHADER_CAP_MAX_INPUTS: if (shader == PIPE_SHADER_VERTEX) return 32; - return 0x300 / 16; + return 15; case PIPE_SHADER_CAP_MAX_CONSTS: return 65536 / 16; case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: diff --git a/dist/Mesa/src/gallium/drivers/nv50/nv50_state_validate.c b/dist/Mesa/src/gallium/drivers/nv50/nv50_state_validate.c index f5e7b3680..9a4c5ea0c 100644 --- a/dist/Mesa/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/dist/Mesa/src/gallium/drivers/nv50/nv50_state_validate.c @@ -61,7 +61,7 @@ nv50_validate_fb(struct nv50_context *nv50) if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING) nv50->state.rt_serialize = TRUE; mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING; - mt->base.status &= NOUVEAU_BUFFER_STATUS_GPU_READING; + mt->base.status &= ~NOUVEAU_BUFFER_STATUS_GPU_READING; /* only register for writing, otherwise we'd always serialize here */ BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR); @@ -91,7 +91,7 @@ nv50_validate_fb(struct nv50_context *nv50) if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING) nv50->state.rt_serialize = TRUE; mt->base.status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING; - mt->base.status &= NOUVEAU_BUFFER_STATUS_GPU_READING; + mt->base.status &= ~NOUVEAU_BUFFER_STATUS_GPU_READING; BCTX_REFN(nv50->bufctx_3d, FB, &mt->base, WR); } else { diff --git a/dist/Mesa/src/gallium/drivers/nv50/nv50_tex.c b/dist/Mesa/src/gallium/drivers/nv50/nv50_tex.c index 48b35d703..328a204ac 100644 --- a/dist/Mesa/src/gallium/drivers/nv50/nv50_tex.c +++ b/dist/Mesa/src/gallium/drivers/nv50/nv50_tex.c @@ -271,7 +271,7 @@ nv50_validate_tic(struct nv50_context *nv50, int s) nv50->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32); - res->status &= NOUVEAU_BUFFER_STATUS_GPU_WRITING; + res->status &= ~NOUVEAU_BUFFER_STATUS_GPU_WRITING; res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING; BCTX_REFN(nv50->bufctx_3d, TEXTURES, res, RD); diff --git a/dist/Mesa/src/gallium/drivers/nv50/nv50_vbo.c b/dist/Mesa/src/gallium/drivers/nv50/nv50_vbo.c index ca46f6c26..d3a66e6b1 100644 --- a/dist/Mesa/src/gallium/drivers/nv50/nv50_vbo.c +++ b/dist/Mesa/src/gallium/drivers/nv50/nv50_vbo.c @@ -597,6 +597,15 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten, assert(nouveau_resource_mapped_by_gpu(nv50->idxbuf.buffer)); + /* This shouldn't have to be here. The going theory is that the buffer + * is being filled in by PGRAPH, and it's not done yet by the time it + * gets submitted to PFIFO, which in turn starts immediately prefetching + * the not-yet-written data. Ideally this wait would only happen on + * pushbuf submit, but it's probably not a big performance difference. + */ + if (buf->fence_wr && !nouveau_fence_signalled(buf->fence_wr)) + nouveau_fence_wait(buf->fence_wr); + while (instance_count--) { BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1); PUSH_DATA (push, prim); diff --git a/dist/Mesa/src/gallium/state_trackers/xorg/xorg_driver.c b/dist/Mesa/src/gallium/state_trackers/xorg/xorg_driver.c index 9d7713c8f..4671ba785 100644 --- a/dist/Mesa/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/dist/Mesa/src/gallium/state_trackers/xorg/xorg_driver.c @@ -62,6 +62,10 @@ #include "libkms/libkms.h" #endif +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0) +#define DamageUnregister(d, dd) DamageUnregister(dd) +#endif + /* * Functions and symbols exported to Xorg via pointers. */ diff --git a/dist/Mesa/src/glsl/ast_to_hir.cpp b/dist/Mesa/src/glsl/ast_to_hir.cpp index 0481b1fe2..b06a0816e 100644 --- a/dist/Mesa/src/glsl/ast_to_hir.cpp +++ b/dist/Mesa/src/glsl/ast_to_hir.cpp @@ -2682,7 +2682,7 @@ ast_declarator_list::hir(exec_list *instructions, precision_names[this->type->qualifier.precision], type_name); } - } else { + } else if (this->type->specifier->structure == NULL) { _mesa_glsl_warning(&loc, state, "empty declaration"); } } diff --git a/dist/Mesa/src/glx/glxcmds.c b/dist/Mesa/src/glx/glxcmds.c index 3b250cc6a..ec16e8f36 100644 --- a/dist/Mesa/src/glx/glxcmds.c +++ b/dist/Mesa/src/glx/glxcmds.c @@ -183,7 +183,7 @@ GetGLXPrivScreenConfig(Display * dpy, int scrn, struct glx_display ** ppriv, /* Check to see if the GL is supported on this screen */ *ppsc = (*ppriv)->screens[scrn]; - if ((*ppsc)->configs == NULL) { + if ((*ppsc)->configs == NULL && (*ppsc)->visuals == NULL) { /* No support for GL on this screen regardless of visual */ return GLX_BAD_VISUAL; } diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c b/dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c index 6f85f6355..53466e714 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c @@ -187,7 +187,8 @@ static void upload_cc_unit(struct brw_context *brw) eqA != eqRGB); } - if (ctx->Color.AlphaEnabled) { + /* _NEW_BUFFERS */ + if (ctx->Color.AlphaEnabled && ctx->DrawBuffer->_NumColorDrawBuffers <= 1) { cc->cc3.alpha_test = 1; cc->cc3.alpha_test_func = intel_translate_compare_func(ctx->Color.AlphaFunc); diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.cpp b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.cpp index 62dccc106..50a4684ef 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2920,7 +2920,7 @@ fs_visitor::run() /* We handle discards by keeping track of the still-live pixels in f0.1. * Initialize it with the dispatched pixels. */ - if (fp->UsesKill) { + if (fp->UsesKill || c->key.alpha_test_func) { fs_inst *discard_init = emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS); discard_init->flag_subreg = 1; } @@ -2944,6 +2944,9 @@ fs_visitor::run() emit(FS_OPCODE_PLACEHOLDER_HALT); + if (c->key.alpha_test_func) + emit_alpha_test(); + emit_fb_writes(); split_virtual_grfs(); diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h index 0645fb75a..a4740a771 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h @@ -395,6 +395,7 @@ public: fs_reg dst, fs_reg src0, fs_reg src1, fs_reg one); void emit_color_write(int target, int index, int first_color_mrf); + void emit_alpha_test(); void emit_fb_writes(); void emit_shader_time_begin(); diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_emit.cpp index 422592225..8b02ea92c 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_emit.cpp +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_emit.cpp @@ -107,7 +107,7 @@ fs_generator::generate_fb_write(fs_inst *inst) brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - if (fp->UsesKill) { + if (fp->UsesKill || c->key.alpha_test_func) { struct brw_reg pixel_mask; if (brw->gen >= 6) diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index b52690b92..457e0ee81 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2228,6 +2228,60 @@ fs_visitor::emit_color_write(int target, int index, int first_color_mrf) } } +static int +cond_for_alpha_func(GLenum func) +{ + switch(func) { + case GL_GREATER: + return BRW_CONDITIONAL_G; + case GL_GEQUAL: + return BRW_CONDITIONAL_GE; + case GL_LESS: + return BRW_CONDITIONAL_L; + case GL_LEQUAL: + return BRW_CONDITIONAL_LE; + case GL_EQUAL: + return BRW_CONDITIONAL_EQ; + case GL_NOTEQUAL: + return BRW_CONDITIONAL_NEQ; + default: + assert(!"Not reached"); + return 0; + } +} + +/** + * Alpha test support for when we compile it into the shader instead + * of using the normal fixed-function alpha test. + */ +void +fs_visitor::emit_alpha_test() +{ + this->current_annotation = "Alpha test"; + + fs_inst *cmp; + if (c->key.alpha_test_func == GL_ALWAYS) + return; + + if (c->key.alpha_test_func == GL_NEVER) { + /* f0.1 = 0 */ + fs_reg some_reg = fs_reg(retype(brw_vec8_grf(0, 0), + BRW_REGISTER_TYPE_UW)); + cmp = emit(CMP(reg_null_f, some_reg, some_reg, + BRW_CONDITIONAL_NEQ)); + } else { + /* RT0 alpha */ + fs_reg color = outputs[0]; + color.reg_offset += 3; + + /* f0.1 &= func(color, ref) */ + cmp = emit(CMP(reg_null_f, color, fs_reg(c->key.alpha_test_ref), + cond_for_alpha_func(c->key.alpha_test_func))); + } + cmp->predicate = BRW_PREDICATE_NORMAL; + cmp->flag_subreg = 1; +} + void fs_visitor::emit_fb_writes() { diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_tex_layout.c b/dist/Mesa/src/mesa/drivers/dri/i965/brw_tex_layout.c index 1191c3cfb..971089161 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -94,7 +94,7 @@ intel_horizontal_texture_alignment_unit(struct brw_context *brw, static unsigned int intel_vertical_texture_alignment_unit(struct brw_context *brw, - gl_format format) + gl_format format, bool multisampled) { /** * From the "Alignment Unit Size" section of various specs, namely: @@ -118,8 +118,6 @@ intel_vertical_texture_alignment_unit(struct brw_context *brw, * * On SNB+, non-special cases can be overridden by setting the SURFACE_STATE * "Surface Vertical Alignment" field to VALIGN_2 or VALIGN_4. - * - * We currently don't support multisampling. */ if (_mesa_is_format_compressed(format)) return 4; @@ -127,6 +125,9 @@ intel_vertical_texture_alignment_unit(struct brw_context *brw, if (format == MESA_FORMAT_S8) return brw->gen >= 7 ? 8 : 4; + if (multisampled) + return 4; + GLenum base_format = _mesa_get_format_base_format(format); if (brw->gen >= 6 && @@ -284,8 +285,10 @@ brw_miptree_layout_texture_3d(struct brw_context *brw, void brw_miptree_layout(struct brw_context *brw, struct intel_mipmap_tree *mt) { + bool multisampled = mt->num_samples > 1; mt->align_w = intel_horizontal_texture_alignment_unit(brw, mt->format); - mt->align_h = intel_vertical_texture_alignment_unit(brw, mt->format); + mt->align_h = + intel_vertical_texture_alignment_unit(brw, mt->format, multisampled); switch (mt->target) { case GL_TEXTURE_CUBE_MAP: diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c index 10ca5ff84..1358f2778 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c @@ -287,6 +287,10 @@ brw_wm_debug_recompile(struct brw_context *brw, old_key->drawable_height, key->drawable_height); found |= key_debug(brw, "input slots valid", old_key->input_slots_valid, key->input_slots_valid); + found |= key_debug(brw, "mrt alpha test function", + old_key->alpha_test_func, key->alpha_test_func); + found |= key_debug(brw, "mrt alpha test reference value", + old_key->alpha_test_ref, key->alpha_test_ref); found |= brw_debug_recompile_sampler_key(brw, &old_key->tex, &key->tex); @@ -467,6 +471,18 @@ static void brw_wm_populate_key( struct brw_context *brw, if (brw->gen < 6) key->input_slots_valid = brw->vue_map_geom_out.slots_valid; + + /* _NEW_COLOR | _NEW_BUFFERS */ + /* Pre-gen6, the hardware alpha test always used each render + * target's alpha to do alpha test, as opposed to render target 0's alpha + * like GL requires. Fix that by building the alpha test into the + * shader, and we'll skip enabling the fixed function alpha test. + */ + if (brw->gen < 6 && ctx->DrawBuffer->_NumColorDrawBuffers > 1 && ctx->Color.AlphaEnabled) { + key->alpha_test_func = ctx->Color.AlphaFunc; + key->alpha_test_ref = ctx->Color.AlphaRef; + } + /* The unique fragment program ID */ key->program_string_id = fp->id; } diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h index f7a2c5f23..8ad172ef2 100644 --- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h +++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h @@ -70,6 +70,8 @@ struct brw_wm_prog_key { GLushort drawable_height; GLbitfield64 input_slots_valid; GLuint program_string_id:32; + GLenum alpha_test_func; /* < For Gen4/5 MRT alpha test */ + float alpha_test_ref; struct brw_sampler_prog_key_data tex; }; diff --git a/dist/Mesa/src/mesa/drivers/dri/swrast/swrast.c b/dist/Mesa/src/mesa/drivers/dri/swrast/swrast.c index 332c7b72f..3870673db 100644 --- a/dist/Mesa/src/mesa/drivers/dri/swrast/swrast.c +++ b/dist/Mesa/src/mesa/drivers/dri/swrast/swrast.c @@ -397,12 +397,12 @@ swrast_map_renderbuffer(struct gl_context *ctx, stride = w * cpp; xrb->Base.Buffer = malloc(h * stride); - sPriv->swrast_loader->getImage(dPriv, x, y, w, h, + sPriv->swrast_loader->getImage(dPriv, x, rb->Height - y - h, w, h, (char *) xrb->Base.Buffer, dPriv->loaderPrivate); - *out_map = xrb->Base.Buffer; - *out_stride = stride; + *out_map = xrb->Base.Buffer + (h - 1) * stride; + *out_stride = -stride; return; } diff --git a/dist/Mesa/src/mesa/main/texparam.c b/dist/Mesa/src/mesa/main/texparam.c index 32109951c..b437d88f4 100644 --- a/dist/Mesa/src/mesa/main/texparam.c +++ b/dist/Mesa/src/mesa/main/texparam.c @@ -660,11 +660,8 @@ set_tex_parameterf(struct gl_context *ctx, return GL_FALSE; case GL_TEXTURE_LOD_BIAS: - /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias. - * It was removed in core-profile, and it has never existed in OpenGL - * ES. - */ - if (ctx->API != API_OPENGL_COMPAT) + /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias. */ + if (_mesa_is_gles(ctx)) goto invalid_pname; if (!target_allows_setting_sampler_parameters(texObj->Target)) @@ -1489,7 +1486,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = (GLfloat) obj->DepthMode; break; case GL_TEXTURE_LOD_BIAS: - if (ctx->API != API_OPENGL_COMPAT) + if (_mesa_is_gles(ctx)) goto invalid_pname; *params = obj->Sampler.LodBias; @@ -1677,10 +1674,13 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = (GLint) obj->DepthMode; break; case GL_TEXTURE_LOD_BIAS: - if (ctx->API != API_OPENGL_COMPAT) + if (_mesa_is_gles(ctx)) goto invalid_pname; - *params = (GLint) obj->Sampler.LodBias; + /* GL spec 'Data Conversions' section specifies that floating-point + * value in integer Get function is rounded to nearest integer + */ + *params = (GLint) roundf(obj->Sampler.LodBias); break; case GL_TEXTURE_CROP_RECT_OES: if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture) diff --git a/dist/Mesa/src/mesa/state_tracker/st_cb_feedback.c b/dist/Mesa/src/mesa/state_tracker/st_cb_feedback.c index d2e4346b7..34a16ccf9 100644 --- a/dist/Mesa/src/mesa/state_tracker/st_cb_feedback.c +++ b/dist/Mesa/src/mesa/state_tracker/st_cb_feedback.c @@ -85,9 +85,11 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw, const GLfloat *color, *texcoord; GLuint slot; - /* Recall that Y=0=Top of window for Gallium wincoords */ win[0] = v->data[0][0]; - win[1] = ctx->DrawBuffer->Height - v->data[0][1]; + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) + win[1] = ctx->DrawBuffer->Height - v->data[0][1]; + else + win[1] = v->data[0][1]; win[2] = v->data[0][2]; win[3] = 1.0F / v->data[0][3]; |