aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-11 18:04:20 +0200
committermarha <marha@users.sourceforge.net>2014-07-11 18:04:20 +0200
commit3865d60ef607cbb00c819e905e40d3628b8eca29 (patch)
tree73d8064951a7abbe4897bcc25959463d08544495 /mesalib/src/mesa
parent294a395f15dec9e7aa24b83b08f47ba54b9bd232 (diff)
parente708bebcc029873004ade4241f347ce8c58896af (diff)
downloadvcxsrv-3865d60ef607cbb00c819e905e40d3628b8eca29.tar.gz
vcxsrv-3865d60ef607cbb00c819e905e40d3628b8eca29.tar.bz2
vcxsrv-3865d60ef607cbb00c819e905e40d3628b8eca29.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c2
-rw-r--r--mesalib/src/mesa/drivers/dri/common/SConscript70
-rw-r--r--mesalib/src/mesa/main/context.c3
-rw-r--r--mesalib/src/mesa/main/ff_fragment_shader.cpp30
-rw-r--r--mesalib/src/mesa/main/multisample.c2
-rw-r--r--mesalib/src/mesa/main/shared.c1
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_blend.c9
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_rasterizer.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_shader.c6
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_msaa.c6
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.c1
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.c7
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp5
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h2
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c16
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.h3
16 files changed, 91 insertions, 74 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index f1f57297c..89d7a157c 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -217,6 +217,7 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx,
fs_source);
*program = _mesa_CreateProgram();
+ _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name);
_mesa_AttachShader(*program, fs);
_mesa_DeleteShader(fs);
_mesa_AttachShader(*program, vs);
@@ -224,7 +225,6 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx,
_mesa_BindAttribLocation(*program, 0, "position");
_mesa_BindAttribLocation(*program, 1, "texcoords");
_mesa_meta_link_program_with_debug(ctx, *program);
- _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name);
_mesa_UseProgram(*program);
}
diff --git a/mesalib/src/mesa/drivers/dri/common/SConscript b/mesalib/src/mesa/drivers/dri/common/SConscript
index 41f6356c3..d003139bf 100644
--- a/mesalib/src/mesa/drivers/dri/common/SConscript
+++ b/mesalib/src/mesa/drivers/dri/common/SConscript
@@ -27,58 +27,50 @@ drienv.Replace(CPPPATH = [
'#src/egl/drivers/dri',
])
-driswenv = drienv.Clone()
-driswenv.Append(CPPDEFINES = [
- '__NOT_HAVE_DRM_H',
- 'HAVE_DLADDR',
+drienv.AppendUnique(LIBS = [
+ 'expat',
])
+# if HAVE_DRI2
drienv.PkgUseModules('DRM')
+# else
+#env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H'])
-dri_common_utils = drienv.SharedObject(
- target = 'utils.o',
- source = '#src/mesa/drivers/dri/common/utils.c'
-)
+sources = drienv.ParseSourceList('Makefile.sources', 'DRI_COMMON_FILES')
-dri_common_xmlconfig = drienv.SharedObject(
- target = 'xmlconfig.o',
- source = '#src/mesa/drivers/dri/common/xmlconfig.c'
+dri_common = drienv.ConvenienceLibrary(
+ target = 'dri_common',
+ source = sources,
)
-dri_common_dri_util = drienv.SharedObject(
- target = 'dri_util.o',
- source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-dri_common_drisw_util = driswenv.SharedObject(
- target = 'drisw_util.o',
- source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
+#
+# megadrivers_stub
+#
+env = env.Clone()
+env.Append(CPPPATH = [
+ '#/include',
+ '#/src/',
+ '#/src/mapi',
+ '#/src/mesa',
+])
-COMMON_DRI_SW_OBJECTS = [
- dri_common_utils,
- dri_common_xmlconfig,
- dri_common_drisw_util,
-]
+env.Append(CPPDEFINES = [
+ '__NOT_HAVE_DRM_H',
+ 'HAVE_DLADDR',
+])
-COMMON_DRI_DRM_OBJECTS = [
- dri_common_utils,
- dri_common_xmlconfig,
- dri_common_dri_util,
-]
+sources = env.ParseSourceList('Makefile.sources', 'megadriver_stub_FILES')
-drienv.AppendUnique(LIBS = [
- 'expat',
-])
+megadrivers_stub = env.ConvenienceLibrary(
+ target = 'megadrivers_stub',
+ source = sources,
+)
-driswenv.AppendUnique(LIBS = [
- 'expat',
-])
+env.Alias('megadrivers_stub', megadrivers_stub)
Export([
'drienv',
- 'driswenv',
- 'COMMON_DRI_SW_OBJECTS',
- 'COMMON_DRI_DRM_OBJECTS',
+ 'dri_common',
+ 'megadrivers_stub',
])
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index b08215950..50aae8bf6 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -1215,6 +1215,9 @@ _mesa_free_context_data( struct gl_context *ctx )
_mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
_mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL);
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
+
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp
index 2c4f3d7df..8758b5e9d 100644
--- a/mesalib/src/mesa/main/ff_fragment_shader.cpp
+++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp
@@ -914,54 +914,54 @@ static void load_texture( texenv_fragment_program *p, GLuint unit )
switch (texTarget) {
case TEXTURE_1D_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("sampler1DShadow");
+ sampler_type = glsl_type::sampler1DShadow_type;
else
- sampler_type = p->shader->symbols->get_type("sampler1D");
+ sampler_type = glsl_type::sampler1D_type;
coords = 1;
break;
case TEXTURE_1D_ARRAY_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("sampler1DArrayShadow");
+ sampler_type = glsl_type::sampler1DArrayShadow_type;
else
- sampler_type = p->shader->symbols->get_type("sampler1DArray");
+ sampler_type = glsl_type::sampler1DArray_type;
coords = 2;
break;
case TEXTURE_2D_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("sampler2DShadow");
+ sampler_type = glsl_type::sampler2DShadow_type;
else
- sampler_type = p->shader->symbols->get_type("sampler2D");
+ sampler_type = glsl_type::sampler2D_type;
coords = 2;
break;
case TEXTURE_2D_ARRAY_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("sampler2DArrayShadow");
+ sampler_type = glsl_type::sampler2DArrayShadow_type;
else
- sampler_type = p->shader->symbols->get_type("sampler2DArray");
+ sampler_type = glsl_type::sampler2DArray_type;
coords = 3;
break;
case TEXTURE_RECT_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("sampler2DRectShadow");
+ sampler_type = glsl_type::sampler2DRectShadow_type;
else
- sampler_type = p->shader->symbols->get_type("sampler2DRect");
+ sampler_type = glsl_type::sampler2DRect_type;
coords = 2;
break;
case TEXTURE_3D_INDEX:
assert(!p->state->unit[unit].shadow);
- sampler_type = p->shader->symbols->get_type("sampler3D");
+ sampler_type = glsl_type::sampler3D_type;
coords = 3;
break;
case TEXTURE_CUBE_INDEX:
if (p->state->unit[unit].shadow)
- sampler_type = p->shader->symbols->get_type("samplerCubeShadow");
+ sampler_type = glsl_type::samplerCubeShadow_type;
else
- sampler_type = p->shader->symbols->get_type("samplerCube");
+ sampler_type = glsl_type::samplerCube_type;
coords = 3;
break;
case TEXTURE_EXTERNAL_INDEX:
assert(!p->state->unit[unit].shadow);
- sampler_type = p->shader->symbols->get_type("samplerExternalOES");
+ sampler_type = glsl_type::samplerExternalOES_type;
coords = 2;
break;
}
@@ -1241,7 +1241,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
state->symbols->add_function(main_f);
ir_function_signature *main_sig =
- new(p.mem_ctx) ir_function_signature(p.shader->symbols->get_type("void"));
+ new(p.mem_ctx) ir_function_signature(glsl_type::void_type);
main_sig->is_defined = true;
main_f->add_signature(main_sig);
diff --git a/mesalib/src/mesa/main/multisample.c b/mesalib/src/mesa/main/multisample.c
index 599cdee74..1f3fa0c15 100644
--- a/mesalib/src/mesa/main/multisample.c
+++ b/mesalib/src/mesa/main/multisample.c
@@ -89,7 +89,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
/* winsys FBOs are upside down */
if (_mesa_is_winsys_fbo(ctx->DrawBuffer))
- val[1] = 1 - val[1];
+ val[1] = 1.0f - val[1];
return;
}
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index dc22025c2..5ae7014b1 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -312,6 +312,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
_mesa_DeleteHashTable(shared->Programs);
_mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
+ _mesa_reference_geomprog(ctx, &shared->DefaultGeometryProgram, NULL);
_mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
_mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx);
diff --git a/mesalib/src/mesa/state_tracker/st_atom_blend.c b/mesalib/src/mesa/state_tracker/st_atom_blend.c
index 50d240a7b..064e0c14f 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_blend.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_blend.c
@@ -263,16 +263,13 @@ update_blend( struct st_context *st )
blend->rt[i].colormask |= PIPE_MASK_A;
}
- if (ctx->Color.DitherFlag)
- blend->dither = 1;
+ blend->dither = ctx->Color.DitherFlag;
if (ctx->Multisample.Enabled) {
/* unlike in gallium/d3d10 these operations are only performed
if msaa is enabled */
- if (ctx->Multisample.SampleAlphaToCoverage)
- blend->alpha_to_coverage = 1;
- if (ctx->Multisample.SampleAlphaToOne)
- blend->alpha_to_one = 1;
+ blend->alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage;
+ blend->alpha_to_one = ctx->Multisample.SampleAlphaToOne;
}
cso_set_blend(st->cso_context, blend);
diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
index ee5e9e574..2bad64334 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -245,7 +245,7 @@ static void update_raster_state( struct st_context *st )
}
/* _NEW_TRANSFORM */
- raster->depth_clip = ctx->Transform.DepthClamp == GL_FALSE;
+ raster->depth_clip = !ctx->Transform.DepthClamp;
raster->clip_plane_enable = ctx->Transform.ClipPlanesEnabled;
cso_set_rasterizer(st->cso_context, raster);
diff --git a/mesalib/src/mesa/state_tracker/st_atom_shader.c b/mesalib/src/mesa/state_tracker/st_atom_shader.c
index 67c615713..6515a98a3 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_shader.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_shader.c
@@ -89,6 +89,10 @@ update_fp( struct st_context *st )
key.clamp_color = st->clamp_frag_color_in_shader &&
st->ctx->Color._ClampFragmentColor;
+ /* Ignore sample qualifier while computing this flag. */
+ key.persample_shading =
+ _mesa_get_min_invocations_per_fragment(st->ctx, &stfp->Base, true) > 1;
+
st->fp_variant = st_get_fp_variant(st, stfp, &key);
st_reference_fragprog(st, &st->fp, stfp);
@@ -108,7 +112,7 @@ update_fp( struct st_context *st )
const struct st_tracked_state st_update_fp = {
"st_update_fp", /* name */
{ /* dirty */
- _NEW_BUFFERS, /* mesa */
+ _NEW_BUFFERS | _NEW_MULTISAMPLE, /* mesa */
ST_NEW_FRAGMENT_PROGRAM /* st */
},
update_fp /* update */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_msaa.c b/mesalib/src/mesa/state_tracker/st_cb_msaa.c
index bbf2b2c5c..e9955b62b 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_msaa.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_msaa.c
@@ -40,7 +40,7 @@ static void
st_GetSamplePosition(struct gl_context *ctx,
struct gl_framebuffer *fb,
GLuint index,
- GLfloat *outValue)
+ GLfloat *outPos)
{
struct st_context *st = st_context(ctx);
@@ -48,7 +48,9 @@ st_GetSamplePosition(struct gl_context *ctx,
if (st->pipe->get_sample_position)
st->pipe->get_sample_position(st->pipe, (unsigned) fb->Visual.samples,
- index, outValue);
+ index, outPos);
+ else
+ outPos[0] = outPos[1] = 0.5f;
}
diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c
index c7f3ec6be..c805a094b 100644
--- a/mesalib/src/mesa/state_tracker/st_context.c
+++ b/mesalib/src/mesa/state_tracker/st_context.c
@@ -307,6 +307,7 @@ void st_destroy_context( struct st_context *st )
cso_release_all(st->cso_context);
st_reference_fragprog(st, &st->fp, NULL);
+ st_reference_geomprog(st, &st->gp, NULL);
st_reference_vertprog(st, &st->vp, NULL);
/* release framebuffer surfaces */
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c
index 38d4ccfea..409079bd4 100644
--- a/mesalib/src/mesa/state_tracker/st_format.c
+++ b/mesalib/src/mesa/state_tracker/st_format.c
@@ -83,6 +83,8 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat)
return PIPE_FORMAT_B2G3R3_UNORM;
case MESA_FORMAT_B10G10R10A2_UNORM:
return PIPE_FORMAT_B10G10R10A2_UNORM;
+ case MESA_FORMAT_R10G10B10A2_UNORM:
+ return PIPE_FORMAT_R10G10B10A2_UNORM;
case MESA_FORMAT_L4A4_UNORM:
return PIPE_FORMAT_L4A4_UNORM;
case MESA_FORMAT_L8A8_UNORM:
@@ -439,6 +441,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_B2G3R3_UNORM;
case PIPE_FORMAT_B10G10R10A2_UNORM:
return MESA_FORMAT_B10G10R10A2_UNORM;
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ return MESA_FORMAT_R10G10B10A2_UNORM;
case PIPE_FORMAT_L4A4_UNORM:
return MESA_FORMAT_L4A4_UNORM;
case PIPE_FORMAT_L8A8_UNORM:
@@ -857,7 +861,8 @@ static const struct format_mapping format_map[] = {
},
{
{ GL_RGB10_A2, 0 },
- { PIPE_FORMAT_B10G10R10A2_UNORM, DEFAULT_RGBA_FORMATS }
+ { PIPE_FORMAT_B10G10R10A2_UNORM, PIPE_FORMAT_R10G10B10A2_UNORM,
+ DEFAULT_RGBA_FORMATS }
},
{
{ 4, GL_RGBA, GL_RGBA8, 0 },
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9e1943139..f47cd7d53 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4848,6 +4848,7 @@ emit_edgeflags(struct st_translate *t)
* \param inputSemanticIndex the semantic index (ex: which texcoord) for
* each input
* \param interpMode the TGSI_INTERPOLATE_LINEAR/PERSP mode for each input
+ * \param interpLocation the TGSI_INTERPOLATE_LOC_* location for each input
* \param numOutputs number of output registers used
* \param outputMapping maps Mesa fragment program outputs to TGSI
* generic outputs
@@ -4869,7 +4870,7 @@ st_translate_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
- const GLboolean is_centroid[],
+ const GLuint interpLocation[],
GLuint numOutputs,
const GLuint outputMapping[],
const ubyte outputSemanticName[],
@@ -4915,7 +4916,7 @@ st_translate_program(
inputSemanticName[i],
inputSemanticIndex[i],
interpMode[i], 0,
- is_centroid[i]);
+ interpLocation[i]);
}
if (proginfo->InputsRead & VARYING_BIT_POS) {
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
index a3fe91f7e..2e7cb78d5 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h
@@ -45,7 +45,7 @@ enum pipe_error st_translate_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
- const GLboolean is_centroid[],
+ const GLuint interpLocation[],
GLuint numOutputs,
const GLuint outputMapping[],
const ubyte outputSemanticName[],
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index 3570557fe..9d7b7c475 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -351,7 +351,7 @@ st_translate_vertex_program(struct st_context *st,
NULL, /* input semantic name */
NULL, /* input semantic index */
NULL, /* interp mode */
- NULL, /* is centroid */
+ NULL, /* interp location */
/* outputs */
num_outputs,
stvp->result_to_output,
@@ -481,6 +481,7 @@ st_translate_fragment_program(struct st_context *st,
GLuint outputMapping[FRAG_RESULT_MAX];
GLuint inputMapping[VARYING_SLOT_MAX];
GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */
+ GLuint interpLocation[PIPE_MAX_SHADER_INPUTS];
GLuint attr;
GLbitfield64 inputsRead;
struct ureg_program *ureg;
@@ -489,7 +490,6 @@ st_translate_fragment_program(struct st_context *st,
ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
- GLboolean is_centroid[PIPE_MAX_SHADER_INPUTS];
uint fs_num_inputs = 0;
ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
@@ -541,7 +541,15 @@ st_translate_fragment_program(struct st_context *st,
const GLuint slot = fs_num_inputs++;
inputMapping[attr] = slot;
- is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0;
+ if (stfp->Base.IsCentroid & BITFIELD64_BIT(attr))
+ interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTROID;
+ else if (stfp->Base.IsSample & BITFIELD64_BIT(attr))
+ interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE;
+ else
+ interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTER;
+
+ if (key->persample_shading)
+ interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE;
switch (attr) {
case VARYING_SLOT_POS:
@@ -768,7 +776,7 @@ st_translate_fragment_program(struct st_context *st,
input_semantic_name,
input_semantic_index,
interpMode,
- is_centroid,
+ interpLocation,
/* outputs */
fs_num_outputs,
outputMapping,
diff --git a/mesalib/src/mesa/state_tracker/st_program.h b/mesalib/src/mesa/state_tracker/st_program.h
index ce9174f67..9a5b6a847 100644
--- a/mesalib/src/mesa/state_tracker/st_program.h
+++ b/mesalib/src/mesa/state_tracker/st_program.h
@@ -58,6 +58,9 @@ struct st_fp_variant_key
/** for ARB_color_buffer_float */
GLuint clamp_color:1;
+
+ /** for ARB_sample_shading */
+ GLuint persample_shading:1;
};