diff options
Diffstat (limited to 'mesalib/src')
-rw-r--r-- | mesalib/src/gallium/Automake.inc | 27 | ||||
-rw-r--r-- | mesalib/src/glsl/ast_to_hir.cpp | 12 | ||||
-rw-r--r-- | mesalib/src/glsl/ir.h | 9 | ||||
-rw-r--r-- | mesalib/src/glsl/ir_print_visitor.cpp | 4 | ||||
-rw-r--r-- | mesalib/src/glsl/link_uniforms.cpp | 4 | ||||
-rw-r--r-- | mesalib/src/glsl/link_varyings.cpp | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/common/meta.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/common/meta_blit.c | 15 | ||||
-rwxr-xr-x | mesalib/src/mesa/drivers/dri/common/dri_util.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_program.c | 30 | ||||
-rw-r--r-- | mesalib/src/mesa/x86/common_x86.c | 2 |
11 files changed, 73 insertions, 41 deletions
diff --git a/mesalib/src/gallium/Automake.inc b/mesalib/src/gallium/Automake.inc index 70921ecd8..97735abe0 100644 --- a/mesalib/src/gallium/Automake.inc +++ b/mesalib/src/gallium/Automake.inc @@ -56,9 +56,6 @@ GALLIUM_DRI_LINKER_FLAGS = \ -shrext .so \ -module \ -avoid-version \ -if HAVE_LD_VERSION_SCRIPT - -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym \ -endif $(GC_SECTIONS) GALLIUM_VDPAU_LINKER_FLAGS = \ @@ -66,9 +63,6 @@ GALLIUM_VDPAU_LINKER_FLAGS = \ -module \ -no-undefined \ -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \ -if HAVE_LD_VERSION_SCRIPT - -Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym \ -endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) @@ -77,9 +71,6 @@ GALLIUM_XVMC_LINKER_FLAGS = \ -module \ -no-undefined \ -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \ -if HAVE_LD_VERSION_SCRIPT - -Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym \ -endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) @@ -88,12 +79,24 @@ GALLIUM_OMX_LINKER_FLAGS = \ -module \ -no-undefined \ -avoid-version \ -if HAVE_LD_VERSION_SCRIPT - -Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym \ -endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) +if HAVE_LD_VERSION_SCRIPT +GALLIUM_DRI_LINKER_FLAGS += \ + -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym + +GALLIUM_VDPAU_LINKER_FLAGS += \ + -Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym + +GALLIUM_XVMC_LINKER_FLAGS += \ + -Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym + +GALLIUM_OMX_LINKER_FLAGS += \ + -Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym +endif + + GALLIUM_COMMON_LIB_DEPS = \ -lm \ $(CLOCK_LIB) \ diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 0128b3f4e..f230a70a3 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -3078,7 +3078,7 @@ validate_identifier(const char *identifier, YYLTYPE loc, * OpenGL, and may not be declared in a shader as either a * variable or a function." */ - if (strncmp(identifier, "gl_", 3) == 0) { + if (is_gl_identifier(identifier)) { _mesa_glsl_error(&loc, state, "identifier `%s' uses reserved `gl_' prefix", identifier); @@ -3651,11 +3651,15 @@ ast_declarator_list::hir(exec_list *instructions, * instruction stream. */ exec_list initializer_instructions; + + /* Examine var name here since var may get deleted in the next call */ + bool var_is_gl_id = is_gl_identifier(var->name); + ir_variable *earlier = get_variable_being_redeclared(var, decl->get_location(), state, false /* allow_all_redeclarations */); if (earlier != NULL) { - if (strncmp(var->name, "gl_", 3) == 0 && + if (var_is_gl_id && earlier->data.how_declared == ir_var_declared_in_block) { _mesa_glsl_error(&loc, state, "`%s' has already been redeclared using " @@ -5399,7 +5403,7 @@ ast_interface_block::hir(exec_list *instructions, ir_variable *earlier = get_variable_being_redeclared(var, loc, state, true /* allow_all_redeclarations */); - if (strncmp(var->name, "gl_", 3) != 0 || earlier == NULL) { + if (!is_gl_identifier(var->name) || earlier == NULL) { _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex can only " "include built-in variables"); @@ -5634,7 +5638,7 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, gl_FragColor_assigned = true; else if (strcmp(var->name, "gl_FragData") == 0) gl_FragData_assigned = true; - else if (strncmp(var->name, "gl_", 3) != 0) { + else if (!is_gl_identifier(var->name)) { if (state->stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_out) { user_defined_fs_output_assigned = true; diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h index ef4a12d60..80609829e 100644 --- a/mesalib/src/glsl/ir.h +++ b/mesalib/src/glsl/ir.h @@ -2342,6 +2342,15 @@ prototype_string(const glsl_type *return_type, const char *name, const char * mode_string(const ir_variable *var); +/** + * Built-in / reserved GL variables names start with "gl_" + */ +static inline bool +is_gl_identifier(const char *s) +{ + return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_'; +} + extern "C" { #endif /* __cplusplus */ diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp index 0a7695ae1..c4a6f9c9f 100644 --- a/mesalib/src/glsl/ir_print_visitor.cpp +++ b/mesalib/src/glsl/ir_print_visitor.cpp @@ -146,7 +146,7 @@ print_type(FILE *f, const glsl_type *t) print_type(f, t->fields.array); fprintf(f, " %u)", t->length); } else if ((t->base_type == GLSL_TYPE_STRUCT) - && (strncmp("gl_", t->name, 3) != 0)) { + && !is_gl_identifier(t->name)) { fprintf(f, "%s@%p", t->name, (void *) t); } else { fprintf(f, "%s", t->name); @@ -430,7 +430,7 @@ void ir_print_visitor::visit(ir_constant *ir) case GLSL_TYPE_FLOAT: if (ir->value.f[i] == 0.0f) /* 0.0 == -0.0, so print with %f to get the proper sign. */ - fprintf(f, "%.1f", ir->value.f[i]); + fprintf(f, "%f", ir->value.f[i]); else if (fabs(ir->value.f[i]) < 0.000001f) fprintf(f, "%a", ir->value.f[i]); else if (fabs(ir->value.f[i]) > 1000000.0f) diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index 95a0c1ac6..377fed64a 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -848,7 +848,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) /* FINISHME: Update code to process built-in uniforms! */ - if (strncmp("gl_", var->name, 3) == 0) { + if (is_gl_identifier(var->name)) { uniform_size.num_shader_uniform_components += var->type->component_slots(); continue; @@ -900,7 +900,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) /* FINISHME: Update code to process built-in uniforms! */ - if (strncmp("gl_", var->name, 3) == 0) + if (is_gl_identifier(var->name)) continue; parcel.set_and_process(prog, var); diff --git a/mesalib/src/glsl/link_varyings.cpp b/mesalib/src/glsl/link_varyings.cpp index 71998dfa9..686329857 100644 --- a/mesalib/src/glsl/link_varyings.cpp +++ b/mesalib/src/glsl/link_varyings.cpp @@ -77,8 +77,7 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, * correspondence between the vertex language and the * fragment language." */ - if (!output->type->is_array() - || (strncmp("gl_", output->name, 3) != 0)) { + if (!output->type->is_array() || !is_gl_identifier(output->name)) { linker_error(prog, "%s shader output `%s' declared as type `%s', " "but %s shader input declared as type `%s'\n", diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h index 007f1040b..765f8dfe4 100644 --- a/mesalib/src/mesa/drivers/common/meta.h +++ b/mesalib/src/mesa/drivers/common/meta.h @@ -270,7 +270,7 @@ struct blit_state struct fb_tex_blit_state { GLint baseLevelSave, maxLevelSave; - GLuint sampler, samplerSave; + GLuint sampler, samplerSave, stencilSamplingSave; GLuint tempTex; }; @@ -407,7 +407,7 @@ _mesa_meta_fb_tex_blit_begin(const struct gl_context *ctx, struct fb_tex_blit_state *blit); extern void -_mesa_meta_fb_tex_blit_end(const struct gl_context *ctx, GLenum target, +_mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target, struct fb_tex_blit_state *blit); extern GLboolean diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c index 707269dd6..5929619f3 100644 --- a/mesalib/src/mesa/drivers/common/meta_blit.c +++ b/mesalib/src/mesa/drivers/common/meta_blit.c @@ -273,7 +273,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, samples); } else { ralloc_asprintf_append(&sample_resolve, - " out_color = sample_%d_0 / %f;\n", + " gl_FragColor = sample_%d_0 / %f;\n", samples, (float)samples); } } @@ -446,6 +446,7 @@ blitframebuffer_texture(struct gl_context *ctx, fb_tex_blit.baseLevelSave = texObj->BaseLevel; fb_tex_blit.maxLevelSave = texObj->MaxLevel; + fb_tex_blit.stencilSamplingSave = texObj->StencilSampling; if (glsl_version) { setup_glsl_blit_framebuffer(ctx, blit, rb, target); @@ -576,7 +577,7 @@ _mesa_meta_fb_tex_blit_begin(const struct gl_context *ctx, } void -_mesa_meta_fb_tex_blit_end(const struct gl_context *ctx, GLenum target, +_mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target, struct fb_tex_blit_state *blit) { /* Restore texture object state, the texture binding will @@ -585,6 +586,16 @@ _mesa_meta_fb_tex_blit_end(const struct gl_context *ctx, GLenum target, if (target != GL_TEXTURE_RECTANGLE_ARB) { _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, blit->baseLevelSave); _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, blit->maxLevelSave); + + if (ctx->Extensions.ARB_stencil_texturing) { + const struct gl_texture_object *texObj = + _mesa_get_current_tex_object(ctx, target); + + if (texObj->StencilSampling != blit->stencilSamplingSave) + _mesa_TexParameteri(target, GL_DEPTH_STENCIL_TEXTURE_MODE, + blit->stencilSamplingSave ? + GL_STENCIL_INDEX : GL_DEPTH_COMPONENT); + } } _mesa_BindSampler(ctx->Texture.CurrentUnit, blit->samplerSave); diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index bb07a9541..f4fc1b1a8 100755 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -52,7 +52,7 @@ #include "main/errors.h" #include "main/macros.h" -PUBLIC const char __dri2ConfigOptions[] = +const char __dri2ConfigOptions[] = DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1) @@ -736,7 +736,7 @@ driSwapBuffers(__DRIdrawable *pdp) /** Core interface */ const __DRIcoreExtension driCoreExtension = { - /*.base =*/ { __DRI_CORE, __DRI_CORE_VERSION }, + /*.base =*/ { __DRI_CORE, 1 }, /*.createNewScreen =*/ NULL, /*.destroyScreen =*/ driDestroyScreen, diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index f9887a2c4..26eb9786d 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -679,32 +679,36 @@ st_translate_fragment_program(struct st_context *st, outputsWritten &= ~(1 << FRAG_RESULT_STENCIL); } + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)) { + fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_SAMPLEMASK; + fs_output_semantic_index[fs_num_outputs] = 0; + outputMapping[FRAG_RESULT_SAMPLE_MASK] = fs_num_outputs; + fs_num_outputs++; + outputsWritten &= ~(1 << FRAG_RESULT_SAMPLE_MASK); + } + /* handle remaining outputs (color) */ for (attr = 0; attr < FRAG_RESULT_MAX; attr++) { if (outputsWritten & BITFIELD64_BIT(attr)) { - int semantic = TGSI_SEMANTIC_COLOR; switch (attr) { case FRAG_RESULT_DEPTH: case FRAG_RESULT_STENCIL: + case FRAG_RESULT_SAMPLE_MASK: /* handled above */ assert(0); break; case FRAG_RESULT_COLOR: - write_all = GL_TRUE; - break; - case FRAG_RESULT_SAMPLE_MASK: - semantic = TGSI_SEMANTIC_SAMPLEMASK; + write_all = GL_TRUE; /* fallthrough */ + default: + assert(attr == FRAG_RESULT_COLOR || + (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX)); + fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR; + fs_output_semantic_index[fs_num_outputs] = numColors; + outputMapping[attr] = fs_num_outputs; + numColors++; break; } - assert(attr == FRAG_RESULT_COLOR || - attr == FRAG_RESULT_SAMPLE_MASK || - (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX)); - fs_output_semantic_name[fs_num_outputs] = semantic; - fs_output_semantic_index[fs_num_outputs] = numColors; - outputMapping[attr] = fs_num_outputs; - numColors++; - fs_num_outputs++; } } diff --git a/mesalib/src/mesa/x86/common_x86.c b/mesalib/src/mesa/x86/common_x86.c index 261f49170..b401c354a 100644 --- a/mesalib/src/mesa/x86/common_x86.c +++ b/mesalib/src/mesa/x86/common_x86.c @@ -52,6 +52,8 @@ #if !defined(bit_SSE4_1) && defined(bit_SSE41) /* XXX: clang defines bit_SSE41 instead of bit_SSE4_1 */ #define bit_SSE4_1 bit_SSE41 +#elif !defined(bit_SSE4_1) && !defined(bit_SSE41) +#define bit_SSE4_1 0x00080000 #endif #endif |