diff options
author | Marek Olšák <[email protected]> | 2017-01-20 16:02:04 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-02-03 11:08:55 +0000 |
commit | 651861d8624f91c5ba052a2117a0e63b3139bd16 (patch) | |
tree | f0e21ff48cb6d3bdb5145601330bb74e9638d017 /src/gallium | |
parent | d701877fb05251d26a040d1c3809681b56ae160b (diff) |
radeonsi: handle first_non_void correctly in si_create_vertex_elements
This fixes R11G11B10_FLOAT, because it's in the category of "OTHER",
meaning that it doesn't have any channel description.
Cc: 17.0 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
(cherry picked from commit eac7df43ca05abd9992b305e078e88fe7b7f8c91)
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 876cbf6a34b..01edff9cc0c 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3368,7 +3368,7 @@ static void *si_create_vertex_elements(struct pipe_context *ctx, first_non_void = util_format_get_first_non_void_channel(elements[i].src_format); data_format = si_translate_buffer_dataformat(ctx->screen, desc, first_non_void); num_format = si_translate_buffer_numformat(ctx->screen, desc, first_non_void); - channel = &desc->channel[first_non_void]; + channel = first_non_void >= 0 ? &desc->channel[first_non_void] : NULL; v->rsrc_word3[i] = S_008F0C_DST_SEL_X(si_map_swizzle(desc->swizzle[0])) | S_008F0C_DST_SEL_Y(si_map_swizzle(desc->swizzle[1])) | @@ -3390,12 +3390,12 @@ static void *si_create_vertex_elements(struct pipe_context *ctx, /* This isn't actually used in OpenGL. */ v->fix_fetch |= (uint64_t)SI_FIX_FETCH_A2_SINT << (4 * i); } - } else if (channel->type == UTIL_FORMAT_TYPE_FIXED) { + } else if (channel && channel->type == UTIL_FORMAT_TYPE_FIXED) { if (desc->swizzle[3] == PIPE_SWIZZLE_1) v->fix_fetch |= (uint64_t)SI_FIX_FETCH_RGBX_32_FIXED << (4 * i); else v->fix_fetch |= (uint64_t)SI_FIX_FETCH_RGBA_32_FIXED << (4 * i); - } else if (channel->size == 32 && !channel->pure_integer) { + } else if (channel && channel->size == 32 && !channel->pure_integer) { if (channel->type == UTIL_FORMAT_TYPE_SIGNED) { if (channel->normalized) { if (desc->swizzle[3] == PIPE_SWIZZLE_1) |