diff options
author | Kenneth Graunke <[email protected]> | 2018-07-18 16:27:07 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:07 -0800 |
commit | 3e9e3121e581060bdda6aec2bddd53188f82433e (patch) | |
tree | a4d9885efe158242ba72403b8bbafb8baacb30d2 /src | |
parent | 5520a54bc500fd96a21fa087404eed683d2b89b8 (diff) |
iris: fix SGVS when there are no valid vertex elements
tessellation nop.shader_test now passes
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index f62c0f377df..638a5e24e08 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1581,7 +1581,7 @@ iris_create_vertex_elements(struct pipe_context *ctx, struct iris_vertex_element_state *cso = malloc(sizeof(struct iris_vertex_element_state)); - cso->count = MAX2(count, 1); + cso->count = count; /* TODO: * - create edge flag one @@ -1589,7 +1589,8 @@ iris_create_vertex_elements(struct pipe_context *ctx, * - if those are necessary, use count + 1/2/3... OR in the length */ iris_pack_command(GENX(3DSTATE_VERTEX_ELEMENTS), cso->vertex_elements, ve) { - ve.DWordLength = 1 + GENX(VERTEX_ELEMENT_STATE_length) * cso->count - 2; + ve.DWordLength = + 1 + GENX(VERTEX_ELEMENT_STATE_length) * MAX2(count, 1) - 2; } uint32_t *ve_pack_dest = &cso->vertex_elements[1]; @@ -3148,10 +3149,11 @@ iris_upload_render_state(struct iris_context *ice, if (dirty & IRIS_DIRTY_VERTEX_ELEMENTS) { struct iris_vertex_element_state *cso = ice->state.cso_vertex_elements; + const unsigned entries = MAX2(cso->count, 1); iris_batch_emit(batch, cso->vertex_elements, sizeof(uint32_t) * - (1 + cso->count * GENX(VERTEX_ELEMENT_STATE_length))); + (1 + entries * GENX(VERTEX_ELEMENT_STATE_length))); iris_batch_emit(batch, cso->vf_instancing, sizeof(uint32_t) * - cso->count * GENX(3DSTATE_VF_INSTANCING_length)); + entries * GENX(3DSTATE_VF_INSTANCING_length)); } if (dirty & IRIS_DIRTY_VF_SGVS) { |