Merge Mesa 9.2.5
This commit is contained in:
parent
47c63d2e5f
commit
ee6e2c0845
2
dist/Mesa/SConstruct
vendored
2
dist/Mesa/SConstruct
vendored
@ -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\\"'),
|
||||
])
|
||||
|
||||
|
2
dist/Mesa/configure.ac
vendored
2
dist/Mesa/configure.ac
vendored
@ -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])
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
*/
|
||||
|
2
dist/Mesa/src/glsl/ast_to_hir.cpp
vendored
2
dist/Mesa/src/glsl/ast_to_hir.cpp
vendored
@ -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");
|
||||
}
|
||||
}
|
||||
|
2
dist/Mesa/src/glx/glxcmds.c
vendored
2
dist/Mesa/src/glx/glxcmds.c
vendored
@ -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;
|
||||
}
|
||||
|
3
dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c
vendored
3
dist/Mesa/src/mesa/drivers/dri/i965/brw_cc.c
vendored
@ -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);
|
||||
|
@ -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();
|
||||
|
1
dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h
vendored
1
dist/Mesa/src/mesa/drivers/dri/i965/brw_fs.h
vendored
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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:
|
||||
|
16
dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c
vendored
16
dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.c
vendored
@ -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;
|
||||
}
|
||||
|
2
dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h
vendored
2
dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h
vendored
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
16
dist/Mesa/src/mesa/main/texparam.c
vendored
16
dist/Mesa/src/mesa/main/texparam.c
vendored
@ -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)
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user