summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-04-11 10:04:50 -0400
committerRob Clark <[email protected]>2015-04-11 11:41:03 -0400
commitb98c0262d1183d24a37272558c51678cd6a0e9ec (patch)
treee9d7c8154756ad6d0bd5192e305153432ae2945e /src/gallium/drivers/freedreno/ir3
parent1b936bb9f8da72baaef5c7454e8bebb63bbe067a (diff)
freedreno/ir3/nir: couple little fixes
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 34598dbab1c..f7ea8799c2f 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -303,6 +303,11 @@ declare_var(struct ir3_compile *ctx, nir_variable *var)
(length * sizeof(arr->arr[0])));
arr->length = length;
arr->aid = ++ctx->num_arrays;
+ /* Some shaders end up reading array elements without first writing..
+ * so initialize things to prevent null instr ptrs later:
+ */
+ for (unsigned i = 0; i < length; i++)
+ arr->arr[i] = create_immed(ctx->block, 0);
_mesa_hash_table_insert(ctx->var_ht, var, arr);
}
@@ -733,6 +738,8 @@ emit_alu(struct ir3_compile *ctx, nir_alu_instr *alu)
compile_assert(ctx, !asrc->negate);
src[i] = get_src(ctx, &asrc->src)[asrc->swizzle[chan]];
+
+ compile_assert(ctx, src[i]);
}
switch (alu->op) {
@@ -1613,8 +1620,9 @@ setup_input(struct ir3_compile *ctx, nir_variable *in)
/* with NIR, we need to infer TGSI_INTERPOLATE_COLOR
* from the semantic name:
*/
- if ((semantic_name == TGSI_SEMANTIC_COLOR) ||
- (semantic_name == TGSI_SEMANTIC_BCOLOR))
+ if ((in->data.interpolation == INTERP_QUALIFIER_NONE) &&
+ ((semantic_name == TGSI_SEMANTIC_COLOR) ||
+ (semantic_name == TGSI_SEMANTIC_BCOLOR)))
so->inputs[n].interpolate = TGSI_INTERPOLATE_COLOR;
if (ctx->flat_bypass) {