aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
commit88236adfe3eb41b8368b4c9ecf3e09a7199dc474 (patch)
tree6acb3f7ad3c60c4605551245df9c321b5fb22c3b /mesalib/src/glsl/ir.cpp
parente4086b3defb6186a2fb8a5845968c97e613fb493 (diff)
parent30eb28e89e513ba7c04e8424be0cba326a01882b (diff)
downloadvcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.gz
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.bz2
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winclipboard/internal.h xorg-server/hw/xwin/winclipboard/thread.c xorg-server/hw/xwin/winclipboard/wndproc.c xorg-server/hw/xwin/winclipboard/xevents.c xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winglobals.c
Diffstat (limited to 'mesalib/src/glsl/ir.cpp')
-rwxr-xr-xmesalib/src/glsl/ir.cpp58
1 files changed, 55 insertions, 3 deletions
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
index 4229a2bf4..5907854f6 100755
--- a/mesalib/src/glsl/ir.cpp
+++ b/mesalib/src/glsl/ir.cpp
@@ -1543,18 +1543,44 @@ ir_swizzle::variable_referenced() const
}
+bool ir_variable::temporaries_allocate_names = false;
+
+const char ir_variable::tmp_name[] = "compiler_temp";
+
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
ir_variable_mode mode)
- : ir_instruction(ir_type_variable), max_ifc_array_access(NULL)
+ : ir_instruction(ir_type_variable)
{
this->type = type;
- this->name = ralloc_strdup(this, name);
+
+ if (mode == ir_var_temporary && !ir_variable::temporaries_allocate_names)
+ name = NULL;
+
+ /* The ir_variable clone method may call this constructor with name set to
+ * tmp_name.
+ */
+ assert(name != NULL
+ || mode == ir_var_temporary
+ || mode == ir_var_function_in
+ || mode == ir_var_function_out
+ || mode == ir_var_function_inout);
+ assert(name != ir_variable::tmp_name
+ || mode == ir_var_temporary);
+ if (mode == ir_var_temporary
+ && (name == NULL || name == ir_variable::tmp_name)) {
+ this->name = ir_variable::tmp_name;
+ } else {
+ this->name = ralloc_strdup(this, name);
+ }
+
+ this->u.max_ifc_array_access = NULL;
+
this->data.explicit_location = false;
this->data.has_initializer = false;
this->data.location = -1;
this->data.location_frac = 0;
this->data.binding = 0;
- this->warn_extension = NULL;
+ this->data.warn_extension_index = 0;
this->constant_value = NULL;
this->constant_initializer = NULL;
this->data.origin_upper_left = false;
@@ -1617,6 +1643,32 @@ ir_variable::determine_interpolation_mode(bool flat_shade)
return INTERP_QUALIFIER_SMOOTH;
}
+const char *const ir_variable::warn_extension_table[] = {
+ "",
+ "GL_ARB_shader_stencil_export",
+ "GL_AMD_shader_stencil_export",
+};
+
+void
+ir_variable::enable_extension_warning(const char *extension)
+{
+ for (unsigned i = 0; i < Elements(warn_extension_table); i++) {
+ if (strcmp(warn_extension_table[i], extension) == 0) {
+ this->data.warn_extension_index = i;
+ return;
+ }
+ }
+
+ assert(!"Should not get here.");
+ this->data.warn_extension_index = 0;
+}
+
+const char *
+ir_variable::get_extension_warning() const
+{
+ return this->data.warn_extension_index == 0
+ ? NULL : warn_extension_table[this->data.warn_extension_index];
+}
ir_function_signature::ir_function_signature(const glsl_type *return_type,
builtin_available_predicate b)