Commit 219676b9 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Lookup pipe_format components on the fly

parent eccff7f6
......@@ -763,6 +763,10 @@ panfrost_bind_rasterizer_state(
ctx->dirty |= PAN_DIRTY_RASTERIZER;
}
#ifdef HAVE_DRI3
#include "util/u_format.h"
#endif
static void*
panfrost_create_vertex_elements_state(
struct pipe_context *pctx,
......@@ -780,9 +784,17 @@ panfrost_create_vertex_elements_state(
* utility function or two. */
for (int i = 0; i < num_elements; ++i) {
#ifdef HAVE_DRI3
enum pipe_format fmt = elements[i].src_format;
int nr_components = util_format_get_nr_components(fmt);
#else
int nr_components = 4; /* XXX */
#endif
so->hw[i].index = i;
so->hw[i].type = 7;
so->hw[i].nr_components = MALI_POSITIVE(4);
so->hw[i].nr_components = MALI_POSITIVE(nr_components);
so->hw[i].not_normalised = 1;
so->hw[i].is_int_signed = 0;
so->hw[i].unknown1 = 0x2a22;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment