summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2018-10-23 05:47:28 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2018-10-23 05:47:28 +0000
commitf6666e4c3977a5d74f3da7464672ea48e44dff4b (patch)
tree21df237f03b2aabc094d514d3d8f0d13c4f00f4e /lib/mesa/src/gallium/auxiliary
parent6f93ffbe5713be116f31de00cb562a09606a779c (diff)
Import Mesa 17.3.9
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary')
-rw-r--r--lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.h10
-rw-r--r--lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.h5
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.am7
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.sources3
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/SConscript1
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h35
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c2
-rw-r--r--lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h20
-rw-r--r--lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info.h11
-rw-r--r--lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info_opcodes.h252
-rw-r--r--lib/mesa/src/gallium/auxiliary/tgsi/tgsi_lowering.h4
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_dump_defines.c125
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c133
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h6
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_tests.c19
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_idalloc.c96
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_idalloc.h62
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_log.c235
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_log.h100
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_mm.c5
-rw-r--r--lib/mesa/src/gallium/auxiliary/vl/vl_csc.h3
21 files changed, 930 insertions, 204 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index 9ec051a34..c00997b89 100644
--- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.h
+++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.h
@@ -82,7 +82,8 @@ enum lp_sampler_lod_control {
enum lp_sampler_op_type {
LP_SAMPLER_OP_TEXTURE,
LP_SAMPLER_OP_FETCH,
- LP_SAMPLER_OP_GATHER
+ LP_SAMPLER_OP_GATHER,
+ LP_SAMPLER_OP_LODQ
};
@@ -165,6 +166,7 @@ struct lp_static_sampler_state
unsigned normalized_coords:1;
unsigned min_max_lod_equal:1; /**< min_lod == max_lod ? */
unsigned lod_bias_non_zero:1;
+ unsigned max_lod_pos:1;
unsigned apply_min_lod:1; /**< min_lod > 0 ? */
unsigned apply_max_lod:1; /**< max_lod < last_level ? */
unsigned seamless_cube_map:1;
@@ -321,6 +323,10 @@ struct lp_build_sample_context
/** number of lod values (valid are 1, length/4, length) */
unsigned num_lods;
+ boolean no_quad_lod;
+ boolean no_brilinear;
+ boolean no_rho_approx;
+
/** regular scalar float type */
struct lp_type float_type;
struct lp_build_context float_bld;
@@ -486,6 +492,7 @@ lp_sampler_static_texture_state(struct lp_static_texture_state *state,
void
lp_build_lod_selector(struct lp_build_sample_context *bld,
+ boolean is_lodq,
unsigned texture_index,
unsigned sampler_index,
LLVMValueRef s,
@@ -496,6 +503,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
LLVMValueRef lod_bias, /* optional */
LLVMValueRef explicit_lod, /* optional */
unsigned mip_filter,
+ LLVMValueRef *out_lod,
LLVMValueRef *out_lod_ipart,
LLVMValueRef *out_lod_fpart,
LLVMValueRef *out_lod_positive);
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.h b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.h
index 463d44eb4..c92517fee 100644
--- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.h
+++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.h
@@ -82,6 +82,11 @@ struct lp_build_emit_data {
LLVMValueRef output[4];
/**
+ * Secondary output for instruction that have a second destination register.
+ */
+ LLVMValueRef output1[4];
+
+ /**
* The current instruction that is being 'executed'.
*/
const struct tgsi_full_instruction * inst;
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.am b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.am
index 8039a957b..878159f23 100644
--- a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.am
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.am
@@ -5,6 +5,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
-I$(top_srcdir)/src/loader \
-I$(top_srcdir)/src/gallium/winsys \
+ -I$(top_builddir)/src/util \
$(GALLIUM_PIPE_LOADER_DEFINES) \
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
@@ -40,9 +41,11 @@ libpipe_loader_dynamic_la_SOURCES += \
endif
libpipe_loader_static_la_LIBADD = \
- $(top_builddir)/src/loader/libloader.la
+ $(top_builddir)/src/loader/libloader.la \
+ $(top_builddir)/src/util/libxmlconfig.la
libpipe_loader_dynamic_la_LIBADD = \
- $(top_builddir)/src/loader/libloader.la
+ $(top_builddir)/src/loader/libloader.la \
+ $(top_builddir)/src/util/libxmlconfig.la
EXTRA_DIST = SConscript
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.sources b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.sources
index d6e3c2c06..66dd22ccc 100644
--- a/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.sources
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/Makefile.sources
@@ -2,7 +2,8 @@ COMMON_SOURCES := \
pipe_loader.c \
pipe_loader.h \
pipe_loader_priv.h \
- pipe_loader_sw.c
+ pipe_loader_sw.c \
+ driinfo_gallium.h
DRM_SOURCES := \
pipe_loader_drm.c
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/SConscript b/lib/mesa/src/gallium/auxiliary/pipe-loader/SConscript
index 14e1b350a..0f72195b2 100644
--- a/lib/mesa/src/gallium/auxiliary/pipe-loader/SConscript
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/SConscript
@@ -7,6 +7,7 @@ env.MSVC2013Compat()
env.Append(CPPPATH = [
'#/src/loader',
'#/src/gallium/winsys',
+ xmlpool_options.dir.dir,
])
env.Append(CPPDEFINES = [
diff --git a/lib/mesa/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/lib/mesa/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
new file mode 100644
index 000000000..003a3d708
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
@@ -0,0 +1,35 @@
+// DriConf options supported by all Gallium DRI drivers.
+DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_MESA_GLTHREAD("false")
+ DRI_CONF_MESA_NO_ERROR("false")
+ DRI_CONF_DISABLE_EXT_BUFFER_AGE("false")
+ DRI_CONF_DISABLE_OML_SYNC_CONTROL("false")
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_QUALITY
+ DRI_CONF_PP_CELSHADE(0)
+ DRI_CONF_PP_NORED(0)
+ DRI_CONF_PP_NOGREEN(0)
+ DRI_CONF_PP_NOBLUE(0)
+ DRI_CONF_PP_JIMENEZMLAA(0, 0, 32)
+ DRI_CONF_PP_JIMENEZMLAA_COLOR(0, 0, 32)
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_DEBUG
+ DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
+ DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
+ DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
+ DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
+ DRI_CONF_FORCE_GLSL_VERSION(0)
+ DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
+ DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
+ DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH("false")
+ DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
+ DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
+ DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
+DRI_CONF_SECTION_END
+
+DRI_CONF_SECTION_MISCELLANEOUS
+ DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false")
+ DRI_CONF_GLSL_ZERO_INIT("false")
+DRI_CONF_SECTION_END
diff --git a/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index 250f739c8..d22c24e67 100644
--- a/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -30,7 +30,7 @@
* Buffer cache.
*
* \author Jose Fonseca <jfonseca-at-vmware-dot-com>
- * \author Thomas Hellström <thellstom-at-vmware-dot-com>
+ * \author Thomas Hellström <thellstrom-at-vmware-dot-com>
*/
diff --git a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
index 0b2c363e1..85c14a786 100644
--- a/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
+++ b/lib/mesa/src/gallium/auxiliary/postprocess/pp_mlaa.h
@@ -164,12 +164,12 @@ static const char offsetvs[] = "VERT\n"
"DCL OUT[1], GENERIC[0]\n"
"DCL OUT[2], GENERIC[10]\n"
"DCL OUT[3], GENERIC[11]\n"
- "DCL CONST[0]\n"
+ "DCL CONST[0][0]\n"
"IMM FLT32 { 1.0000, 0.0000, -1.0000, 0.0000}\n"
" 0: MOV OUT[0], IN[0]\n"
" 1: MOV OUT[1], IN[1]\n"
- " 2: MAD OUT[2], CONST[0].xyxy, IMM[0].zyyz, IN[1].xyxy\n"
- " 3: MAD OUT[3], CONST[0].xyxy, IMM[0].xyyx, IN[1].xyxy\n"
+ " 2: MAD OUT[2], CONST[0][0].xyxy, IMM[0].zyyz, IN[1].xyxy\n"
+ " 3: MAD OUT[3], CONST[0][0].xyxy, IMM[0].xyyx, IN[1].xyxy\n"
" 4: END\n";
@@ -183,7 +183,7 @@ static const char blend2fs_1[] = "FRAG\n"
"DCL SVIEW[1], 2D, FLOAT\n"
"DCL SAMP[2]\n"
"DCL SVIEW[2], 2D, FLOAT\n"
- "DCL CONST[0]\n"
+ "DCL CONST[0][0]\n"
"DCL TEMP[0..6]\n"
"IMM FLT32 { 0.0000, -0.2500, 0.00609756, 0.5000}\n"
"IMM FLT32 { -1.5000, -2.0000, 0.9000, 1.5000}\n"
@@ -204,7 +204,7 @@ static const char blend2fs_2[] =
" 11: BRK\n"
" 12: ENDIF\n"
" 13: MOV TEMP[4].y, IMM[0].xxxx\n"
- " 14: MAD TEMP[3].xyz, CONST[0].xyyy, TEMP[4].xyyy, TEMP[1].xyyy\n"
+ " 14: MAD TEMP[3].xyz, CONST[0][0].xyyy, TEMP[4].xyyy, TEMP[1].xyyy\n"
" 15: MOV TEMP[3].w, IMM[0].xxxx\n"
" 16: TXL TEMP[5], TEMP[3], SAMP[2], 2D\n"
" 17: MOV TEMP[3].x, TEMP[5].yyyy\n"
@@ -229,7 +229,7 @@ static const char blend2fs_2[] =
" 36: BRK\n"
" 37: ENDIF\n"
" 38: MOV TEMP[5].y, IMM[0].xxxx\n"
- " 39: MAD TEMP[4].xyz, CONST[0].xyyy, TEMP[5].xyyy, TEMP[3].xyyy\n"
+ " 39: MAD TEMP[4].xyz, CONST[0][0].xyyy, TEMP[5].xyyy, TEMP[3].xyyy\n"
" 40: MOV TEMP[4].w, IMM[0].xxxx\n"
" 41: TXL TEMP[6].xy, TEMP[4], SAMP[2], 2D\n"
" 42: MOV TEMP[4].x, TEMP[6].yyyy\n"
@@ -250,7 +250,7 @@ static const char blend2fs_2[] =
" 57: MOV TEMP[5].x, TEMP[1].xxxx\n"
" 58: ADD TEMP[1].x, TEMP[4].xxxx, IMM[2].yyyy\n"
" 59: MOV TEMP[5].z, TEMP[1].xxxx\n"
- " 60: MAD TEMP[1], TEMP[5], CONST[0].xyxy, IN[0].xyxy\n"
+ " 60: MAD TEMP[1], TEMP[5], CONST[0][0].xyxy, IN[0].xyxy\n"
" 61: MOV TEMP[4], TEMP[1].xyyy\n"
" 62: MOV TEMP[4].w, IMM[0].xxxx\n"
" 63: TXL TEMP[5].x, TEMP[4], SAMP[2], 2D\n"
@@ -278,7 +278,7 @@ static const char blend2fs_2[] =
" 85: BRK\n"
" 86: ENDIF\n"
" 87: MOV TEMP[3].y, IMM[0].xxxx\n"
- " 88: MAD TEMP[5].xyz, CONST[0].xyyy, TEMP[3].yxxx, TEMP[1].xyyy\n"
+ " 88: MAD TEMP[5].xyz, CONST[0][0].xyyy, TEMP[3].yxxx, TEMP[1].xyyy\n"
" 89: MOV TEMP[5].w, IMM[0].xxxx\n"
" 90: TXL TEMP[4], TEMP[5], SAMP[2], 2D\n"
" 91: MOV TEMP[2].x, TEMP[4].xxxx\n"
@@ -303,7 +303,7 @@ static const char blend2fs_2[] =
"110: BRK\n"
"111: ENDIF\n"
"112: MOV TEMP[4].y, IMM[0].xxxx\n"
- "113: MAD TEMP[5].xyz, CONST[0].xyyy, TEMP[4].yxxx, TEMP[2].xyyy\n"
+ "113: MAD TEMP[5].xyz, CONST[0][0].xyyy, TEMP[4].yxxx, TEMP[2].xyyy\n"
"114: MOV TEMP[5].w, IMM[0].xxxx\n"
"115: TXL TEMP[6], TEMP[5], SAMP[2], 2D\n"
"116: MOV TEMP[3].x, TEMP[6].xxxx\n"
@@ -324,7 +324,7 @@ static const char blend2fs_2[] =
"131: MOV TEMP[4].y, TEMP[1].xxxx\n"
"132: ADD TEMP[1].x, TEMP[3].xxxx, IMM[2].yyyy\n"
"133: MOV TEMP[4].w, TEMP[1].xxxx\n"
- "134: MAD TEMP[1], TEMP[4], CONST[0].xyxy, IN[0].xyxy\n"
+ "134: MAD TEMP[1], TEMP[4], CONST[0][0].xyxy, IN[0].xyxy\n"
"135: MOV TEMP[3], TEMP[1].xyyy\n"
"136: MOV TEMP[3].w, IMM[0].xxxx\n"
"137: TXL TEMP[4].y, TEMP[3], SAMP[2], 2D\n"
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info.h b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info.h
index e60888fec..8d32f4774 100644
--- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info.h
+++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info.h
@@ -76,11 +76,10 @@ struct tgsi_opcode_info
unsigned is_tex:1;
unsigned is_store:1;
unsigned is_branch:1;
- int pre_dedent:2;
- int post_indent:2;
+ unsigned pre_dedent:1;
+ unsigned post_indent:1;
enum tgsi_output_mode output_mode:3;
- const char *mnemonic;
- uint opcode;
+ unsigned opcode:8;
};
const struct tgsi_opcode_info *
@@ -112,10 +111,10 @@ static inline bool tgsi_type_is_64bit(enum tgsi_opcode_type type)
}
enum tgsi_opcode_type
-tgsi_opcode_infer_src_type( uint opcode );
+tgsi_opcode_infer_src_type( uint opcode, uint src_idx );
enum tgsi_opcode_type
-tgsi_opcode_infer_dst_type( uint opcode );
+tgsi_opcode_infer_dst_type( uint opcode, uint dst_idx );
#if defined __cplusplus
}
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info_opcodes.h b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info_opcodes.h
new file mode 100644
index 000000000..1b2803cf3
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_info_opcodes.h
@@ -0,0 +1,252 @@
+OPCODE(1, 1, COMP, ARL)
+OPCODE(1, 1, COMP, MOV)
+OPCODE(1, 1, CHAN, LIT)
+OPCODE(1, 1, REPL, RCP)
+OPCODE(1, 1, REPL, RSQ)
+OPCODE(1, 1, CHAN, EXP)
+OPCODE(1, 1, CHAN, LOG)
+OPCODE(1, 2, COMP, MUL)
+OPCODE(1, 2, COMP, ADD)
+OPCODE(1, 2, REPL, DP3)
+OPCODE(1, 2, REPL, DP4)
+OPCODE(1, 2, CHAN, DST)
+OPCODE(1, 2, COMP, MIN)
+OPCODE(1, 2, COMP, MAX)
+OPCODE(1, 2, COMP, SLT)
+OPCODE(1, 2, COMP, SGE)
+OPCODE(1, 3, COMP, MAD)
+OPCODE(1, 2, OTHR, TEX_LZ, .is_tex = 1)
+OPCODE(1, 3, COMP, LRP)
+OPCODE(1, 3, COMP, FMA)
+OPCODE(1, 1, REPL, SQRT)
+OPCODE(1, 2, COMP, LDEXP)
+OPCODE(1, 1, COMP, F2U64)
+OPCODE(1, 1, COMP, F2I64)
+OPCODE(1, 1, COMP, FRC)
+OPCODE(1, 2, OTHR, TXF_LZ, .is_tex = 1)
+OPCODE(1, 1, COMP, FLR)
+OPCODE(1, 1, COMP, ROUND)
+OPCODE(1, 1, REPL, EX2)
+OPCODE(1, 1, REPL, LG2)
+OPCODE(1, 2, REPL, POW)
+OPCODE_GAP(31) /* removed */
+OPCODE(1, 1, COMP, U2I64)
+OPCODE(1, 0, OTHR, CLOCK)
+OPCODE(1, 1, COMP, I2I64)
+OPCODE_GAP(35) /* removed */
+OPCODE(1, 1, REPL, COS)
+OPCODE(1, 1, COMP, DDX)
+OPCODE(1, 1, COMP, DDY)
+OPCODE(0, 0, NONE, KILL)
+OPCODE(1, 1, REPL, PK2H)
+OPCODE(1, 1, REPL, PK2US)
+OPCODE(1, 1, REPL, PK4B)
+OPCODE(1, 1, REPL, PK4UB)
+OPCODE(1, 1, COMP, D2U64)
+OPCODE(1, 2, COMP, SEQ)
+OPCODE(1, 1, COMP, D2I64)
+OPCODE(1, 2, COMP, SGT)
+OPCODE(1, 1, REPL, SIN)
+OPCODE(1, 2, COMP, SLE)
+OPCODE(1, 2, COMP, SNE)
+OPCODE(1, 1, COMP, U642D)
+OPCODE(1, 2, OTHR, TEX, .is_tex = 1)
+OPCODE(1, 4, OTHR, TXD, .is_tex = 1)
+OPCODE(1, 2, OTHR, TXP, .is_tex = 1)
+OPCODE(1, 1, CHAN, UP2H)
+OPCODE(1, 1, CHAN, UP2US)
+OPCODE(1, 1, CHAN, UP4B)
+OPCODE(1, 1, CHAN, UP4UB)
+OPCODE(1, 1, COMP, U642F)
+OPCODE(1, 1, COMP, I642F)
+OPCODE(1, 1, COMP, ARR)
+OPCODE(1, 1, COMP, I642D)
+OPCODE(0, 0, NONE, CAL, .is_branch = 1)
+OPCODE(0, 0, NONE, RET)
+OPCODE(1, 1, COMP, SSG)
+OPCODE(1, 3, COMP, CMP)
+OPCODE_GAP(67) /* removed */
+OPCODE(1, 2, OTHR, TXB, .is_tex = 1)
+OPCODE(1, 1, OTHR, FBFETCH)
+OPCODE(1, 2, COMP, DIV)
+OPCODE(1, 2, REPL, DP2)
+OPCODE(1, 2, OTHR, TXL, .is_tex = 1)
+OPCODE(0, 0, NONE, BRK)
+OPCODE(0, 1, NONE, IF, .is_branch = 1, .post_indent = 1)
+OPCODE(0, 1, NONE, UIF, .is_branch = 1, .post_indent = 1)
+OPCODE(1, 2, COMP, READ_INVOC)
+OPCODE(0, 0, NONE, ELSE, .is_branch = 1, .pre_dedent = 1, .post_indent = 1)
+OPCODE(0, 0, NONE, ENDIF, .pre_dedent = 1)
+OPCODE(1, 1, COMP, DDX_FINE)
+OPCODE(1, 1, COMP, DDY_FINE)
+OPCODE_GAP(81) /* removed */
+OPCODE_GAP(82) /* removed */
+OPCODE(1, 1, COMP, CEIL)
+OPCODE(1, 1, COMP, I2F)
+OPCODE(1, 1, COMP, NOT)
+OPCODE(1, 1, COMP, TRUNC)
+OPCODE(1, 2, COMP, SHL)
+OPCODE(1, 1, OTHR, BALLOT)
+OPCODE(1, 2, COMP, AND)
+OPCODE(1, 2, COMP, OR)
+OPCODE(1, 2, COMP, MOD)
+OPCODE(1, 2, COMP, XOR)
+OPCODE_GAP(93) /* removed */
+OPCODE(1, 2, OTHR, TXF, .is_tex = 1)
+OPCODE(1, 2, OTHR, TXQ, .is_tex = 1)
+OPCODE(0, 0, NONE, CONT)
+OPCODE(0, 1, NONE, EMIT)
+OPCODE(0, 1, NONE, ENDPRIM)
+OPCODE(0, 0, NONE, BGNLOOP, .is_branch = 1, .post_indent = 1)
+OPCODE(0, 0, NONE, BGNSUB, .post_indent = 1)
+OPCODE(0, 0, NONE, ENDLOOP, .is_branch = 1, .pre_dedent = 1)
+OPCODE(0, 0, NONE, ENDSUB, .pre_dedent = 1)
+OPCODE_GAP(103) /* removed */
+OPCODE(1, 1, OTHR, TXQS, .is_tex = 1)
+OPCODE(1, 1, OTHR, RESQ)
+OPCODE(1, 1, COMP, READ_FIRST)
+OPCODE(0, 0, NONE, NOP)
+OPCODE(1, 2, COMP, FSEQ)
+OPCODE(1, 2, COMP, FSGE)
+OPCODE(1, 2, COMP, FSLT)
+OPCODE(1, 2, COMP, FSNE)
+OPCODE(0, 1, OTHR, MEMBAR)
+OPCODE_GAP(113) /* removed */
+OPCODE_GAP(114) /* removed */
+OPCODE_GAP(115) /* removed */
+OPCODE(0, 1, NONE, KILL_IF)
+OPCODE(0, 0, NONE, END)
+OPCODE(1, 3, COMP, DFMA)
+OPCODE(1, 1, COMP, F2I)
+OPCODE(1, 2, COMP, IDIV)
+OPCODE(1, 2, COMP, IMAX)
+OPCODE(1, 2, COMP, IMIN)
+OPCODE(1, 1, COMP, INEG)
+OPCODE(1, 2, COMP, ISGE)
+OPCODE(1, 2, COMP, ISHR)
+OPCODE(1, 2, COMP, ISLT)
+OPCODE(1, 1, COMP, F2U)
+OPCODE(1, 1, COMP, U2F)
+OPCODE(1, 2, COMP, UADD)
+OPCODE(1, 2, COMP, UDIV)
+OPCODE(1, 3, COMP, UMAD)
+OPCODE(1, 2, COMP, UMAX)
+OPCODE(1, 2, COMP, UMIN)
+OPCODE(1, 2, COMP, UMOD)
+OPCODE(1, 2, COMP, UMUL)
+OPCODE(1, 2, COMP, USEQ)
+OPCODE(1, 2, COMP, USGE)
+OPCODE(1, 2, COMP, USHR)
+OPCODE(1, 2, COMP, USLT)
+OPCODE(1, 2, COMP, USNE)
+OPCODE(0, 1, NONE, SWITCH)
+OPCODE(0, 1, NONE, CASE)
+OPCODE(0, 0, NONE, DEFAULT)
+OPCODE(0, 0, NONE, ENDSWITCH)
+
+OPCODE(1, 3, OTHR, SAMPLE)
+OPCODE(1, 2, OTHR, SAMPLE_I)
+OPCODE(1, 3, OTHR, SAMPLE_I_MS)
+OPCODE(1, 4, OTHR, SAMPLE_B)
+OPCODE(1, 4, OTHR, SAMPLE_C)
+OPCODE(1, 4, OTHR, SAMPLE_C_LZ)
+OPCODE(1, 5, OTHR, SAMPLE_D)
+OPCODE(1, 4, OTHR, SAMPLE_L)
+OPCODE(1, 3, OTHR, GATHER4)
+OPCODE(1, 2, OTHR, SVIEWINFO)
+OPCODE(1, 2, OTHR, SAMPLE_POS)
+OPCODE(1, 2, OTHR, SAMPLE_INFO)
+OPCODE(1, 1, COMP, UARL)
+OPCODE(1, 3, COMP, UCMP)
+OPCODE(1, 1, COMP, IABS)
+OPCODE(1, 1, COMP, ISSG)
+OPCODE(1, 2, OTHR, LOAD)
+OPCODE(1, 2, OTHR, STORE, .is_store = 1)
+OPCODE_GAP(163) /* removed */
+OPCODE_GAP(164) /* removed */
+OPCODE_GAP(165) /* removed */
+OPCODE(0, 0, OTHR, BARRIER)
+
+OPCODE(1, 3, OTHR, ATOMUADD, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMXCHG, .is_store = 1)
+OPCODE(1, 4, OTHR, ATOMCAS, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMAND, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMOR, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMXOR, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMUMIN, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMUMAX, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMIMIN, .is_store = 1)
+OPCODE(1, 3, OTHR, ATOMIMAX, .is_store = 1)
+OPCODE(1, 3, OTHR, TEX2, .is_tex = 1)
+OPCODE(1, 3, OTHR, TXB2, .is_tex = 1)
+OPCODE(1, 3, OTHR, TXL2, .is_tex = 1)
+OPCODE(1, 2, COMP, IMUL_HI)
+OPCODE(1, 2, COMP, UMUL_HI)
+OPCODE(1, 3, OTHR, TG4, .is_tex = 1)
+OPCODE(1, 2, OTHR, LODQ, .is_tex = 1)
+OPCODE(1, 3, COMP, IBFE)
+OPCODE(1, 3, COMP, UBFE)
+OPCODE(1, 4, COMP, BFI)
+OPCODE(1, 1, COMP, BREV)
+OPCODE(1, 1, COMP, POPC)
+OPCODE(1, 1, COMP, LSB)
+OPCODE(1, 1, COMP, IMSB)
+OPCODE(1, 1, COMP, UMSB)
+OPCODE(1, 1, OTHR, INTERP_CENTROID)
+OPCODE(1, 2, OTHR, INTERP_SAMPLE)
+OPCODE(1, 2, OTHR, INTERP_OFFSET)
+OPCODE(1, 1, COMP, F2D)
+OPCODE(1, 1, COMP, D2F)
+OPCODE(1, 1, COMP, DABS)
+OPCODE(1, 1, COMP, DNEG)
+OPCODE(1, 2, COMP, DADD)
+OPCODE(1, 2, COMP, DMUL)
+OPCODE(1, 2, COMP, DMAX)
+OPCODE(1, 2, COMP, DMIN)
+OPCODE(1, 2, COMP, DSLT)
+OPCODE(1, 2, COMP, DSGE)
+OPCODE(1, 2, COMP, DSEQ)
+OPCODE(1, 2, COMP, DSNE)
+OPCODE(1, 1, COMP, DRCP)
+OPCODE(1, 1, COMP, DSQRT)
+OPCODE(1, 3, COMP, DMAD)
+OPCODE(1, 1, COMP, DFRAC)
+OPCODE(1, 2, COMP, DLDEXP)
+OPCODE(2, 1, REPL, DFRACEXP)
+OPCODE(1, 1, COMP, D2I)
+OPCODE(1, 1, COMP, I2D)
+OPCODE(1, 1, COMP, D2U)
+OPCODE(1, 1, COMP, U2D)
+OPCODE(1, 1, COMP, DRSQ)
+OPCODE(1, 1, COMP, DTRUNC)
+OPCODE(1, 1, COMP, DCEIL)
+OPCODE(1, 1, COMP, DFLR)
+OPCODE(1, 1, COMP, DROUND)
+OPCODE(1, 1, COMP, DSSG)
+OPCODE(1, 1, COMP, VOTE_ANY)
+OPCODE(1, 1, COMP, VOTE_ALL)
+OPCODE(1, 1, COMP, VOTE_EQ)
+OPCODE(1, 2, COMP, U64SEQ)
+OPCODE(1, 2, COMP, U64SNE)
+OPCODE(1, 2, COMP, I64SLT)
+OPCODE(1, 2, COMP, U64SLT)
+OPCODE(1, 2, COMP, I64SGE)
+OPCODE(1, 2, COMP, U64SGE)
+OPCODE(1, 2, COMP, I64MIN)
+OPCODE(1, 2, COMP, U64MIN)
+OPCODE(1, 2, COMP, I64MAX)
+OPCODE(1, 2, COMP, U64MAX)
+OPCODE(1, 1, COMP, I64ABS)
+OPCODE(1, 1, COMP, I64SSG)
+OPCODE(1, 1, COMP, I64NEG)
+OPCODE(1, 2, COMP, U64ADD)
+OPCODE(1, 2, COMP, U64MUL)
+OPCODE(1, 2, COMP, U64SHL)
+OPCODE(1, 2, COMP, I64SHR)
+OPCODE(1, 2, COMP, U64SHR)
+OPCODE(1, 2, COMP, I64DIV)
+OPCODE(1, 2, COMP, U64DIV)
+OPCODE(1, 2, COMP, I64MOD)
+OPCODE(1, 2, COMP, U64MOD)
+OPCODE(1, 2, COMP, DDIV)
+OPCODE(1, 3, OTHR, LOD)
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_lowering.h b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_lowering.h
index 20e4f843a..fd4c38f01 100644
--- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_lowering.h
+++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_lowering.h
@@ -55,8 +55,6 @@ struct tgsi_lowering_config
* enable lowering of TGSI_OPCODE_<opc>
*/
unsigned lower_DST:1;
- unsigned lower_XPD:1;
- unsigned lower_SCS:1;
unsigned lower_LRP:1;
unsigned lower_FRC:1;
unsigned lower_POW:1;
@@ -65,9 +63,7 @@ struct tgsi_lowering_config
unsigned lower_LOG:1;
unsigned lower_DP4:1;
unsigned lower_DP3:1;
- unsigned lower_DPH:1;
unsigned lower_DP2:1;
- unsigned lower_DP2A:1;
unsigned lower_FLR:1;
unsigned lower_CEIL:1;
unsigned lower_TRUNC:1;
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_dump_defines.c b/lib/mesa/src/gallium/auxiliary/util/u_dump_defines.c
index 9d831efcf..e87e53016 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_dump_defines.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_dump_defines.c
@@ -62,36 +62,36 @@ util_dump_enum_continuous(unsigned value,
}
-#define DEFINE_UTIL_DUMP_CONTINUOUS(_name) \
+#define DEFINE_UTIL_STR_CONTINUOUS(_name) \
const char * \
- util_dump_##_name(unsigned value, boolean shortened) \
+ util_str_##_name(unsigned value, boolean shortened) \
{ \
if(shortened) \
- return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_##_name##_short_names), util_##_name##_short_names); \
else \
- return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_names), util_dump_##_name##_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_##_name##_names), util_##_name##_names); \
}
/**
- * Same as DEFINE_UTIL_DUMP_CONTINUOUS but with static assertions to detect
+ * Same as DEFINE_UTIL_STR_CONTINUOUS but with static assertions to detect
* failures to update lists.
*/
-#define DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(_name, _count) \
+#define DEFINE_UTIL_STR_CONTINUOUS_COUNT(_name, _count) \
const char * \
- util_dump_##_name(unsigned value, boolean shortened) \
+ util_str_##_name(unsigned value, boolean shortened) \
{ \
- STATIC_ASSERT(ARRAY_SIZE(util_dump_##_name##_names) == _count); \
- STATIC_ASSERT(ARRAY_SIZE(util_dump_##_name##_short_names) == _count); \
+ STATIC_ASSERT(ARRAY_SIZE(util_##_name##_names) == _count); \
+ STATIC_ASSERT(ARRAY_SIZE(util_##_name##_short_names) == _count); \
if(shortened) \
- return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_##_name##_short_names), util_##_name##_short_names); \
else \
- return util_dump_enum_continuous(value, ARRAY_SIZE(util_dump_##_name##_names), util_dump_##_name##_names); \
+ return util_dump_enum_continuous(value, ARRAY_SIZE(util_##_name##_names), util_##_name##_names); \
}
static const char *
-util_dump_blend_factor_names[] = {
+util_blend_factor_names[] = {
UTIL_DUMP_INVALID_NAME, /* 0x0 */
"PIPE_BLENDFACTOR_ONE",
"PIPE_BLENDFACTOR_SRC_COLOR",
@@ -122,7 +122,7 @@ util_dump_blend_factor_names[] = {
};
static const char *
-util_dump_blend_factor_short_names[] = {
+util_blend_factor_short_names[] = {
UTIL_DUMP_INVALID_NAME, /* 0x0 */
"one",
"src_color",
@@ -152,11 +152,11 @@ util_dump_blend_factor_short_names[] = {
"inv_src1_alpha"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(blend_factor)
+DEFINE_UTIL_STR_CONTINUOUS(blend_factor)
static const char *
-util_dump_blend_func_names[] = {
+util_blend_func_names[] = {
"PIPE_BLEND_ADD",
"PIPE_BLEND_SUBTRACT",
"PIPE_BLEND_REVERSE_SUBTRACT",
@@ -165,7 +165,7 @@ util_dump_blend_func_names[] = {
};
static const char *
-util_dump_blend_func_short_names[] = {
+util_blend_func_short_names[] = {
"add",
"sub",
"rev_sub",
@@ -173,11 +173,11 @@ util_dump_blend_func_short_names[] = {
"max"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(blend_func)
+DEFINE_UTIL_STR_CONTINUOUS(blend_func)
static const char *
-util_dump_logicop_names[] = {
+util_logicop_names[] = {
"PIPE_LOGICOP_CLEAR",
"PIPE_LOGICOP_NOR",
"PIPE_LOGICOP_AND_INVERTED",
@@ -197,7 +197,7 @@ util_dump_logicop_names[] = {
};
static const char *
-util_dump_logicop_short_names[] = {
+util_logicop_short_names[] = {
"clear",
"nor",
"and_inverted",
@@ -216,11 +216,11 @@ util_dump_logicop_short_names[] = {
"set"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(logicop)
+DEFINE_UTIL_STR_CONTINUOUS(logicop)
static const char *
-util_dump_func_names[] = {
+util_func_names[] = {
"PIPE_FUNC_NEVER",
"PIPE_FUNC_LESS",
"PIPE_FUNC_EQUAL",
@@ -232,7 +232,7 @@ util_dump_func_names[] = {
};
static const char *
-util_dump_func_short_names[] = {
+util_func_short_names[] = {
"never",
"less",
"equal",
@@ -243,11 +243,11 @@ util_dump_func_short_names[] = {
"always"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(func)
+DEFINE_UTIL_STR_CONTINUOUS(func)
static const char *
-util_dump_stencil_op_names[] = {
+util_stencil_op_names[] = {
"PIPE_STENCIL_OP_KEEP",
"PIPE_STENCIL_OP_ZERO",
"PIPE_STENCIL_OP_REPLACE",
@@ -259,7 +259,7 @@ util_dump_stencil_op_names[] = {
};
static const char *
-util_dump_stencil_op_short_names[] = {
+util_stencil_op_short_names[] = {
"keep",
"zero",
"replace",
@@ -270,11 +270,11 @@ util_dump_stencil_op_short_names[] = {
"invert"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(stencil_op)
+DEFINE_UTIL_STR_CONTINUOUS(stencil_op)
static const char *
-util_dump_tex_target_names[] = {
+util_tex_target_names[] = {
"PIPE_BUFFER",
"PIPE_TEXTURE_1D",
"PIPE_TEXTURE_2D",
@@ -287,7 +287,7 @@ util_dump_tex_target_names[] = {
};
static const char *
-util_dump_tex_target_short_names[] = {
+util_tex_target_short_names[] = {
"buffer",
"1d",
"2d",
@@ -299,11 +299,11 @@ util_dump_tex_target_short_names[] = {
"cube_array",
};
-DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(tex_target, PIPE_MAX_TEXTURE_TYPES)
+DEFINE_UTIL_STR_CONTINUOUS_COUNT(tex_target, PIPE_MAX_TEXTURE_TYPES)
static const char *
-util_dump_tex_wrap_names[] = {
+util_tex_wrap_names[] = {
"PIPE_TEX_WRAP_REPEAT",
"PIPE_TEX_WRAP_CLAMP",
"PIPE_TEX_WRAP_CLAMP_TO_EDGE",
@@ -315,7 +315,7 @@ util_dump_tex_wrap_names[] = {
};
static const char *
-util_dump_tex_wrap_short_names[] = {
+util_tex_wrap_short_names[] = {
"repeat",
"clamp",
"clamp_to_edge",
@@ -326,45 +326,46 @@ util_dump_tex_wrap_short_names[] = {
"mirror_clamp_to_border"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(tex_wrap)
+DEFINE_UTIL_STR_CONTINUOUS(tex_wrap)
static const char *
-util_dump_tex_mipfilter_names[] = {
+util_tex_mipfilter_names[] = {
"PIPE_TEX_MIPFILTER_NEAREST",
"PIPE_TEX_MIPFILTER_LINEAR",
"PIPE_TEX_MIPFILTER_NONE"
};
static const char *
-util_dump_tex_mipfilter_short_names[] = {
+util_tex_mipfilter_short_names[] = {
"nearest",
"linear",
"none"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(tex_mipfilter)
+DEFINE_UTIL_STR_CONTINUOUS(tex_mipfilter)
static const char *
-util_dump_tex_filter_names[] = {
+util_tex_filter_names[] = {
"PIPE_TEX_FILTER_NEAREST",
"PIPE_TEX_FILTER_LINEAR"
};
static const char *
-util_dump_tex_filter_short_names[] = {
+util_tex_filter_short_names[] = {
"nearest",
"linear"
};
-DEFINE_UTIL_DUMP_CONTINUOUS(tex_filter)
+DEFINE_UTIL_STR_CONTINUOUS(tex_filter)
static const char *
-util_dump_query_type_names[] = {
+util_query_type_names[] = {
"PIPE_QUERY_OCCLUSION_COUNTER",
"PIPE_QUERY_OCCLUSION_PREDICATE",
+ "PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE",
"PIPE_QUERY_TIMESTAMP",
"PIPE_QUERY_TIMESTAMP_DISJOINT",
"PIPE_QUERY_TIME_ELAPSED",
@@ -372,12 +373,13 @@ util_dump_query_type_names[] = {
"PIPE_QUERY_PRIMITIVES_EMITTED",
"PIPE_QUERY_SO_STATISTICS",
"PIPE_QUERY_SO_OVERFLOW_PREDICATE",
+ "PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE",
"PIPE_QUERY_GPU_FINISHED",
"PIPE_QUERY_PIPELINE_STATISTICS",
};
static const char *
-util_dump_query_type_short_names[] = {
+util_query_type_short_names[] = {
"occlusion_counter",
"occlusion_predicate",
"timestamp",
@@ -391,11 +393,30 @@ util_dump_query_type_short_names[] = {
"pipeline_statistics",
};
-DEFINE_UTIL_DUMP_CONTINUOUS(query_type)
+DEFINE_UTIL_STR_CONTINUOUS(query_type)
static const char *
-util_dump_prim_mode_names[] = {
+util_query_value_type_names[] = {
+ "PIPE_QUERY_TYPE_I32",
+ "PIPE_QUERY_TYPE_U32",
+ "PIPE_QUERY_TYPE_I64",
+ "PIPE_QUERY_TYPE_U64",
+};
+
+static const char *
+util_query_value_type_short_names[] = {
+ "i32",
+ "u32",
+ "i64",
+ "u64",
+};
+
+DEFINE_UTIL_STR_CONTINUOUS(query_value_type)
+
+
+static const char *
+util_prim_mode_names[] = {
"PIPE_PRIM_POINTS",
"PIPE_PRIM_LINES",
"PIPE_PRIM_LINE_LOOP",
@@ -414,7 +435,7 @@ util_dump_prim_mode_names[] = {
};
static const char *
-util_dump_prim_mode_short_names[] = {
+util_prim_mode_short_names[] = {
"points",
"lines",
"line_loop",
@@ -432,4 +453,20 @@ util_dump_prim_mode_short_names[] = {
"patches",
};
-DEFINE_UTIL_DUMP_CONTINUOUS(prim_mode)
+DEFINE_UTIL_STR_CONTINUOUS(prim_mode)
+
+void
+util_dump_query_type(FILE *stream, unsigned value)
+{
+ if (value >= PIPE_QUERY_DRIVER_SPECIFIC)
+ fprintf(stream, "PIPE_QUERY_DRIVER_SPECIFIC + %i",
+ value - PIPE_QUERY_DRIVER_SPECIFIC);
+ else
+ fprintf(stream, "%s", util_str_query_type(value, false));
+}
+
+void
+util_dump_query_value_type(FILE *stream, unsigned value)
+{
+ fprintf(stream, "%s", util_str_query_value_type(value, false));
+}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
index 8c4f2150b..3f755e536 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
@@ -28,136 +28,15 @@
#include "u_format.h"
#include "u_format_s3tc.h"
#include "util/format_srgb.h"
+#include "../../../mesa/main/texcompress_s3tc_tmp.h"
-#if defined(_WIN32) || defined(WIN32)
-#define DXTN_LIBNAME "dxtn.dll"
-#elif defined(__CYGWIN__)
-#define DXTN_LIBNAME "cygtxc_dxtn.dll"
-#elif defined(__APPLE__)
-#define DXTN_LIBNAME "libtxc_dxtn.dylib"
-#else
-#define DXTN_LIBNAME "libtxc_dxtn.so"
-#endif
+util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
+util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
+util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
+util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
-
-static void
-util_format_dxt1_rgb_fetch_stub(int src_stride,
- const uint8_t *src,
- int col, int row,
- uint8_t *dst)
-{
- assert(0);
-}
-
-
-static void
-util_format_dxt1_rgba_fetch_stub(int src_stride,
- const uint8_t *src,
- int col, int row,
- uint8_t *dst )
-{
- assert(0);
-}
-
-
-static void
-util_format_dxt3_rgba_fetch_stub(int src_stride,
- const uint8_t *src,
- int col, int row,
- uint8_t *dst )
-{
- assert(0);
-}
-
-
-static void
-util_format_dxt5_rgba_fetch_stub(int src_stride,
- const uint8_t *src,
- int col, int row,
- uint8_t *dst )
-{
- assert(0);
-}
-
-
-static void
-util_format_dxtn_pack_stub(int src_comps,
- int width, int height,
- const uint8_t *src,
- enum util_format_dxtn dst_format,
- uint8_t *dst,
- int dst_stride)
-{
- assert(0);
-}
-
-
-boolean util_format_s3tc_enabled = FALSE;
-
-util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = util_format_dxt1_rgb_fetch_stub;
-util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = util_format_dxt1_rgba_fetch_stub;
-util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = util_format_dxt3_rgba_fetch_stub;
-util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = util_format_dxt5_rgba_fetch_stub;
-
-util_format_dxtn_pack_t util_format_dxtn_pack = util_format_dxtn_pack_stub;
-
-
-void
-util_format_s3tc_init(void)
-{
- static boolean first_time = TRUE;
- struct util_dl_library *library = NULL;
- util_dl_proc fetch_2d_texel_rgb_dxt1;
- util_dl_proc fetch_2d_texel_rgba_dxt1;
- util_dl_proc fetch_2d_texel_rgba_dxt3;
- util_dl_proc fetch_2d_texel_rgba_dxt5;
- util_dl_proc tx_compress_dxtn;
-
- if (!first_time)
- return;
- first_time = FALSE;
-
- if (util_format_s3tc_enabled)
- return;
-
- library = util_dl_open(DXTN_LIBNAME);
- if (!library) {
- debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
- "compression/decompression unavailable\n");
- return;
- }
-
- fetch_2d_texel_rgb_dxt1 =
- util_dl_get_proc_address(library, "fetch_2d_texel_rgb_dxt1");
- fetch_2d_texel_rgba_dxt1 =
- util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt1");
- fetch_2d_texel_rgba_dxt3 =
- util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt3");
- fetch_2d_texel_rgba_dxt5 =
- util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt5");
- tx_compress_dxtn =
- util_dl_get_proc_address(library, "tx_compress_dxtn");
-
- if (!util_format_dxt1_rgb_fetch ||
- !util_format_dxt1_rgba_fetch ||
- !util_format_dxt3_rgba_fetch ||
- !util_format_dxt5_rgba_fetch ||
- !util_format_dxtn_pack) {
- debug_printf("couldn't reference all symbols in " DXTN_LIBNAME
- ", software DXTn compression/decompression "
- "unavailable\n");
- util_dl_close(library);
- return;
- }
-
- util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
- util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
- util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
- util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
- util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
- util_format_s3tc_enabled = TRUE;
-}
+util_format_dxtn_pack_t util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
/*
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
index ae20010cd..6f188c67f 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
@@ -58,8 +58,6 @@ typedef void
uint8_t *dst,
int dst_stride);
-extern boolean util_format_s3tc_enabled;
-
extern util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch;
extern util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch;
extern util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch;
@@ -69,10 +67,6 @@ extern util_format_dxtn_pack_t util_format_dxtn_pack;
void
-util_format_s3tc_init(void);
-
-
-void
util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
void
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
index 3075ea0ab..9c9a5838d 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
@@ -140,6 +140,12 @@ util_format_test_cases[] =
{PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xc0000000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+ {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x000003ff), UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x000ffc00), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
+ {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x3ff00000), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
+ {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x3fffffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000003ff), UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000ffc00), UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
@@ -164,6 +170,19 @@ util_format_test_cases[] =
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+ {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x003e), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
+ {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x07c0), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
+ {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0xf800), UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0xfffe), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x003e), UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x07c0), UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf800), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0001), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
+ {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x000f), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x00f0), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_idalloc.c b/lib/mesa/src/gallium/auxiliary/util/u_idalloc.c
new file mode 100644
index 000000000..26104552e
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/util/u_idalloc.c
@@ -0,0 +1,96 @@
+/**************************************************************************
+ *
+ * Copyright 2017 Valve Corporation
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/**
+ * @file
+ * A simple allocator that allocates and release "numbers".
+ *
+ * @author Samuel Pitoiset <samuel.pitoiset@gmail.com>
+ */
+
+#include "util/u_idalloc.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
+
+void
+util_idalloc_init(struct util_idalloc *buf)
+{
+ memset(buf, 0, sizeof(*buf));
+}
+
+void
+util_idalloc_fini(struct util_idalloc *buf)
+{
+ if (buf->data)
+ free(buf->data);
+}
+
+void
+util_idalloc_resize(struct util_idalloc *buf, unsigned new_num_elements)
+{
+ new_num_elements = align(new_num_elements, 32);
+
+ if (new_num_elements > buf->num_elements) {
+ unsigned i;
+
+ buf->data = realloc(buf->data,
+ (new_num_elements / 32) * sizeof(*buf->data));
+
+ for (i = buf->num_elements / 32; i < new_num_elements / 32; i++)
+ buf->data[i] = 0;
+ buf->num_elements = new_num_elements;
+ }
+}
+
+unsigned
+util_idalloc_alloc(struct util_idalloc *buf)
+{
+ unsigned num_elements = buf->num_elements;
+
+ for (unsigned i = 0; i < num_elements / 32; i++) {
+ if (buf->data[i] == 0xffffffff)
+ continue;
+
+ unsigned bit = ffs(~buf->data[i]) - 1;
+ buf->data[i] |= 1u << bit;
+ return i * 32 + bit;
+ }
+
+ /* No slots available, resize and return the first free. */
+ util_idalloc_resize(buf, num_elements * 2);
+
+ buf->data[num_elements / 32] |= 1 << (num_elements % 32);
+
+ return num_elements;
+}
+
+void
+util_idalloc_free(struct util_idalloc *buf, unsigned id)
+{
+ assert(id < buf->num_elements);
+ buf->data[id / 32] &= ~(1 << (id % 32));
+}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_idalloc.h b/lib/mesa/src/gallium/auxiliary/util/u_idalloc.h
new file mode 100644
index 000000000..82469e94d
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/util/u_idalloc.h
@@ -0,0 +1,62 @@
+/**************************************************************************
+ *
+ * Copyright 2017 Valve Corporation
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef U_IDALLOC_H
+#define U_IDALLOC_H
+
+#include <inttypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct util_idalloc
+{
+ uint32_t *data;
+ unsigned num_elements;
+};
+
+void
+util_idalloc_init(struct util_idalloc *buf);
+
+void
+util_idalloc_fini(struct util_idalloc *buf);
+
+void
+util_idalloc_resize(struct util_idalloc *buf, unsigned new_num_elements);
+
+unsigned
+util_idalloc_alloc(struct util_idalloc *buf);
+
+void
+util_idalloc_free(struct util_idalloc *buf, unsigned id);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* U_IDALLOC_H */
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_log.c b/lib/mesa/src/gallium/auxiliary/util/u_log.c
new file mode 100644
index 000000000..dacbe0505
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/util/u_log.c
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "u_log.h"
+
+#include "u_memory.h"
+#include "util/u_string.h"
+
+struct page_entry {
+ const struct u_log_chunk_type *type;
+ void *data;
+};
+
+struct u_log_page {
+ struct page_entry *entries;
+ unsigned num_entries;
+ unsigned max_entries;
+};
+
+struct u_log_auto_logger {
+ u_auto_log_fn *callback;
+ void *data;
+};
+
+/**
+ * Initialize the given logging context.
+ */
+void
+u_log_context_init(struct u_log_context *ctx)
+{
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/**
+ * Free all resources associated with the given logging context.
+ *
+ * Pages taken from the context via \ref u_log_new_page must be destroyed
+ * separately.
+ */
+void
+u_log_context_destroy(struct u_log_context *ctx)
+{
+ u_log_page_destroy(ctx->cur);
+ FREE(ctx->auto_loggers);
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/**
+ * Add an auto logger.
+ *
+ * Auto loggers are called each time a chunk is added to the log.
+ */
+void
+u_log_add_auto_logger(struct u_log_context *ctx, u_auto_log_fn *callback,
+ void *data)
+{
+ struct u_log_auto_logger *new_auto_loggers =
+ REALLOC(ctx->auto_loggers,
+ sizeof(*new_auto_loggers) * ctx->num_auto_loggers,
+ sizeof(*new_auto_loggers) * (ctx->num_auto_loggers + 1));
+ if (!new_auto_loggers) {
+ fprintf(stderr, "Gallium u_log: out of memory\n");
+ return;
+ }
+
+ unsigned idx = ctx->num_auto_loggers++;
+ ctx->auto_loggers = new_auto_loggers;
+ ctx->auto_loggers[idx].callback = callback;
+ ctx->auto_loggers[idx].data = data;
+}
+
+/**
+ * Make sure that auto loggers have run.
+ */
+void
+u_log_flush(struct u_log_context *ctx)
+{
+ if (!ctx->num_auto_loggers)
+ return;
+
+ struct u_log_auto_logger *auto_loggers = ctx->auto_loggers;
+ unsigned num_auto_loggers = ctx->num_auto_loggers;
+
+ /* Prevent recursion. */
+ ctx->num_auto_loggers = 0;
+ ctx->auto_loggers = NULL;
+
+ for (unsigned i = 0; i < num_auto_loggers; ++i)
+ auto_loggers[i].callback(auto_loggers[i].data, ctx);
+
+ assert(!ctx->num_auto_loggers);
+ ctx->num_auto_loggers = num_auto_loggers;
+ ctx->auto_loggers = auto_loggers;
+}
+
+static void str_print(void *data, FILE *stream)
+{
+ fputs((char *)data, stream);
+}
+
+static const struct u_log_chunk_type str_chunk_type = {
+ .destroy = free,
+ .print = str_print,
+};
+
+void
+u_log_printf(struct u_log_context *ctx, const char *fmt, ...)
+{
+ va_list va;
+ char *str = NULL;
+
+ va_start(va, fmt);
+ int ret = util_vasprintf(&str, fmt, va);
+ va_end(va);
+
+ if (ret >= 0) {
+ u_log_chunk(ctx, &str_chunk_type, str);
+ } else {
+ fprintf(stderr, "Gallium u_log_printf: out of memory\n");
+ }
+}
+
+/**
+ * Add a custom chunk to the log.
+ *
+ * type->destroy will be called as soon as \p data is no longer needed.
+ */
+void
+u_log_chunk(struct u_log_context *ctx, const struct u_log_chunk_type *type,
+ void *data)
+{
+ struct u_log_page *page = ctx->cur;
+
+ u_log_flush(ctx);
+
+ if (!page) {
+ ctx->cur = CALLOC_STRUCT(u_log_page);
+ page = ctx->cur;
+ if (!page)
+ goto out_of_memory;
+ }
+
+ if (page->num_entries >= page->max_entries) {
+ unsigned new_max_entries = MAX2(16, page->num_entries * 2);
+ struct page_entry *new_entries = REALLOC(page->entries,
+ page->max_entries * sizeof(*page->entries),
+ new_max_entries * sizeof(*page->entries));
+ if (!new_entries)
+ goto out_of_memory;
+
+ page->entries = new_entries;
+ page->max_entries = new_max_entries;
+ }
+
+ page->entries[page->num_entries].type = type;
+ page->entries[page->num_entries].data = data;
+ page->num_entries++;
+ return;
+
+out_of_memory:
+ fprintf(stderr, "Gallium: u_log: out of memory\n");
+}
+
+/**
+ * Convenience helper that starts a new page and prints the previous one.
+ */
+void
+u_log_new_page_print(struct u_log_context *ctx, FILE *stream)
+{
+ if (ctx->cur) {
+ u_log_page_print(ctx->cur, stream);
+ u_log_page_destroy(ctx->cur);
+ ctx->cur = NULL;
+ }
+}
+
+/**
+ * Return the current page from the logging context and start a new one.
+ *
+ * The caller is responsible for destroying the returned page.
+ */
+struct u_log_page *
+u_log_new_page(struct u_log_context *ctx)
+{
+ struct u_log_page *page = ctx->cur;
+ ctx->cur = NULL;
+ return page;
+}
+
+/**
+ * Free all data associated with \p page.
+ */
+void
+u_log_page_destroy(struct u_log_page *page)
+{
+ if (!page)
+ return;
+
+ for (unsigned i = 0; i < page->num_entries; ++i) {
+ if (page->entries[i].type->destroy)
+ page->entries[i].type->destroy(page->entries[i].data);
+ }
+ FREE(page->entries);
+ FREE(page);
+}
+
+/**
+ * Print the given page to \p stream.
+ */
+void
+u_log_page_print(struct u_log_page *page, FILE *stream)
+{
+ for (unsigned i = 0; i < page->num_entries; ++i)
+ page->entries[i].type->print(page->entries[i].data, stream);
+}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_log.h b/lib/mesa/src/gallium/auxiliary/util/u_log.h
new file mode 100644
index 000000000..09c47caee
--- /dev/null
+++ b/lib/mesa/src/gallium/auxiliary/util/u_log.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file u_log.h
+ * @brief Context logging facilities
+ *
+ * Provides a means of logging context events (draw calls, command streams, ...)
+ * into files.
+ *
+ * Log entries start their life cycle as "chunks". Chunks can be plain text
+ * written by \ref u_log_printf or custom internal representations added by
+ * \ref u_log_chunk that are only converted to text on-demand (e.g. for higher
+ * performance pipelined hang-debugging).
+ *
+ * Chunks are accumulated into "pages". The manager of the log can periodically
+ * take out the current page using \ref u_log_new_page and dump it to a file.
+ *
+ * Furthermore, "auto loggers" can be added to a context, which are callbacks
+ * that are given the opportunity to add their own logging each time a chunk is
+ * added. Drivers can use this to lazily log chunks of their command stream.
+ * Lazy loggers don't need to be re-entrant.
+ */
+
+#ifndef U_LOG_H
+#define U_LOG_H
+
+#include <stdio.h>
+
+#include "u_debug.h"
+
+struct u_log_page;
+struct u_log_auto_logger;
+
+struct u_log_chunk_type {
+ void (*destroy)(void *data);
+ void (*print)(void *data, FILE *stream);
+};
+
+struct u_log_context {
+ struct u_log_page *cur;
+ struct u_log_auto_logger *auto_loggers;
+ unsigned num_auto_loggers;
+};
+
+typedef void (u_auto_log_fn)(void *data, struct u_log_context *ctx);
+
+void
+u_log_context_init(struct u_log_context *ctx);
+
+void
+u_log_context_destroy(struct u_log_context *ctx);
+
+void
+u_log_add_auto_logger(struct u_log_context *ctx, u_auto_log_fn *callback,
+ void *data);
+
+void
+u_log_flush(struct u_log_context *ctx);
+
+void
+u_log_printf(struct u_log_context *ctx, const char *fmt, ...) _util_printf_format(2,3);
+
+void
+u_log_chunk(struct u_log_context *ctx, const struct u_log_chunk_type *type,
+ void *data);
+
+void
+u_log_new_page_print(struct u_log_context *ctx, FILE *stream);
+
+struct u_log_page *
+u_log_new_page(struct u_log_context *ctx);
+
+void
+u_log_page_destroy(struct u_log_page *page);
+
+void
+u_log_page_print(struct u_log_page *page, FILE *stream);
+
+#endif /* U_LOG_H */
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_mm.c b/lib/mesa/src/gallium/auxiliary/util/u_mm.c
index bd4c4e1b1..7a45e2919 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_mm.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_mm.c
@@ -183,7 +183,10 @@ u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
assert(size >= 0);
assert(align2 >= 0);
- assert(align2 <= 12); /* sanity check, 2^12 (4KB) enough? */
+ /* Make sure that a byte alignment isn't getting passed for our
+ * power-of-two alignment arg.
+ */
+ assert(align2 < 32);
if (!heap || align2 < 0 || size <= 0)
return NULL;
diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_csc.h b/lib/mesa/src/gallium/auxiliary/vl/vl_csc.h
index 4927470e4..8623e1b3b 100644
--- a/lib/mesa/src/gallium/auxiliary/vl/vl_csc.h
+++ b/lib/mesa/src/gallium/auxiliary/vl/vl_csc.h
@@ -45,7 +45,8 @@ enum VL_CSC_COLOR_STANDARD
VL_CSC_COLOR_STANDARD_IDENTITY,
VL_CSC_COLOR_STANDARD_BT_601,
VL_CSC_COLOR_STANDARD_BT_709,
- VL_CSC_COLOR_STANDARD_SMPTE_240M
+ VL_CSC_COLOR_STANDARD_SMPTE_240M,
+ VL_CSC_COLOR_STANDARD_BT_709_REV
};
extern const struct vl_procamp vl_default_procamp;