diff options
author | Chia-I Wu <[email protected]> | 2015-06-18 14:26:29 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-06-20 11:14:14 +0800 |
commit | 4555211028394673f8ad68f3de9c12e9a1f93160 (patch) | |
tree | c9d885b73ee4253b91a4fe7e22171e76b63fc90e /src/gallium/drivers/ilo/ilo_state.c | |
parent | e8d297b7a108fcf1cb688fe1db89e83b8f85e091 (diff) |
ilo: add 3DSTATE_VF_INSTANCING to ilo_state_vf
3DSTATE_VF_INSTANCING specifies instancing enable and step rate. They are
specified along with 3DSTATE_VERTEX_BUFFERS instead prior to Gen8. Both
commands are added.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_state.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_state.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c index a01e9da69ec..d6144e4035f 100644 --- a/src/gallium/drivers/ilo/ilo_state.c +++ b/src/gallium/drivers/ilo/ilo_state.c @@ -1329,6 +1329,7 @@ ilo_create_vertex_elements_state(struct pipe_context *pipe, { const struct ilo_dev *dev = ilo_context(pipe)->dev; struct ilo_state_vf_element_info vf_elements[PIPE_MAX_ATTRIBS]; + unsigned instance_divisors[PIPE_MAX_ATTRIBS]; struct ilo_state_vf_info vf_info; struct ilo_ve_state *ve; unsigned i; @@ -1347,7 +1348,7 @@ ilo_create_vertex_elements_state(struct pipe_context *pipe, */ for (hw_idx = 0; hw_idx < ve->vb_count; hw_idx++) { if (ve->vb_mapping[hw_idx] == elem->vertex_buffer_index && - ve->instance_divisors[hw_idx] == elem->instance_divisor) + instance_divisors[hw_idx] == elem->instance_divisor) break; } @@ -1356,7 +1357,7 @@ ilo_create_vertex_elements_state(struct pipe_context *pipe, hw_idx = ve->vb_count++; ve->vb_mapping[hw_idx] = elem->vertex_buffer_index; - ve->instance_divisors[hw_idx] = elem->instance_divisor; + instance_divisors[hw_idx] = elem->instance_divisor; } attr->buffer = hw_idx; @@ -1367,6 +1368,9 @@ ilo_create_vertex_elements_state(struct pipe_context *pipe, attr->is_integer = util_format_is_pure_integer(elem->src_format); attr->is_double = (util_format_is_float(elem->src_format) && attr->format_size == attr->component_count * 8); + + attr->instancing_enable = (elem->instance_divisor != 0); + attr->instancing_step_rate = elem->instance_divisor; } memset(&vf_info, 0, sizeof(vf_info)); |