...
 
Commits (6)
......@@ -1277,6 +1277,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
} else if (ctx->stage == MESA_SHADER_VERTEX) {
midgard_instruction ins = m_load_attr_32(reg, offset);
ins.load_store.unknown = 0x1E1E; /* XXX: What is this? */
ins.load_store.mask = (1 << instr->num_components) - 1;
emit_mir_instruction(ctx, ins);
} else {
printf("Unknown load\n");
......
......@@ -1834,7 +1834,6 @@ panfrost_create_vertex_elements_state(
so->hw[i].type = type;
so->nr_components[i] = desc->nr_channels;
so->hw[i].nr_components = MALI_POSITIVE(4); /* XXX: Why is this needed? */
so->hw[i].not_normalised = !chan.normalized;
/* Bit used for both signed/unsigned and full/half designation */
......@@ -1843,7 +1842,10 @@ panfrost_create_vertex_elements_state(
(chan.type == UTIL_FORMAT_TYPE_FLOAT && chan.size != 32) ? 1 :
0;
so->hw[i].unknown1 = 0x2a22;
/* TODO: Attributes besides vec2 and vec4 */
so->hw[i].nr_components = MALI_POSITIVE(desc->nr_channels == 2 ? 2 : 4);
so->hw[i].unknown1 = desc->nr_channels == 2 ? 0x2c22 : 0x2a22;
so->hw[i].unknown2 = 0x1;
/* The field itself should probably be shifted over */
......@@ -2094,10 +2096,25 @@ panfrost_create_sampler_view(
assert(prsrc->bytes_per_pixel >= 1 && prsrc->bytes_per_pixel <= 4);
/* TODO: Detect from format better */
const struct util_format_description *desc = util_format_description(prsrc->base.format);
bool depth = prsrc->base.format == PIPE_FORMAT_Z32_UNORM;
bool has_alpha = true;
bool alpha_only = prsrc->base.format == PIPE_FORMAT_A8_UNORM;
/* Compose the format swizzle with the descriptor swizzle to find the
* actual swizzle to send to the hardware */
unsigned char composed_swizzle[4];
unsigned char desc_swizzle[4] = {
template->swizzle_r,
template->swizzle_g,
template->swizzle_b,
template->swizzle_a
};
util_format_compose_swizzles(desc->swizzle, desc_swizzle, composed_swizzle);
struct mali_texture_descriptor texture_descriptor = {
.width = MALI_POSITIVE(texture->width0),
.height = MALI_POSITIVE(texture->height0),
......@@ -2121,10 +2138,10 @@ panfrost_create_sampler_view(
.usage2 = prsrc->has_afbc ? 0x1c : (prsrc->tiled ? 0x11 : 0x12),
},
.swizzle_r = panfrost_translate_texture_swizzle(template->swizzle_r),
.swizzle_g = panfrost_translate_texture_swizzle(template->swizzle_g),
.swizzle_b = panfrost_translate_texture_swizzle(template->swizzle_b),
.swizzle_a = panfrost_translate_texture_swizzle(template->swizzle_a),
.swizzle_r = panfrost_translate_texture_swizzle(composed_swizzle[0]),
.swizzle_g = panfrost_translate_texture_swizzle(composed_swizzle[1]),
.swizzle_b = panfrost_translate_texture_swizzle(composed_swizzle[2]),
.swizzle_a = panfrost_translate_texture_swizzle(composed_swizzle[3]),
};
/* TODO: Other base levels require adjusting dimensions / level numbers / etc */
......