diff options
author | Chia-I Wu <[email protected]> | 2013-06-06 11:28:02 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-06-07 11:13:16 +0800 |
commit | 2d82885d3cd9c5ab90e4777da8dfd723da273cd8 (patch) | |
tree | 8994f1566557fdc8a92b914c6b02ee73bcd06bf4 /src/gallium/drivers/ilo/ilo_gpe_gen7.c | |
parent | 39e947569e5c0e159045aa5771e0ee5509eedee4 (diff) |
ilo: add emit_SURFACE_STATE() for sampler views
Introduce ilo_view_cso and initialize it in create_sampler_view(). Add
emit_SURFACE_STATE() to GPE, which can emit SURFACE_STATE from
ilo_view_surface.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_gpe_gen7.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_gpe_gen7.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen7.c b/src/gallium/drivers/ilo/ilo_gpe_gen7.c index 43b76628d66..5dd75bc3171 100644 --- a/src/gallium/drivers/ilo/ilo_gpe_gen7.c +++ b/src/gallium/drivers/ilo/ilo_gpe_gen7.c @@ -1718,39 +1718,6 @@ gen7_emit_surf_SURFACE_STATE(const struct ilo_dev_info *dev, } static uint32_t -gen7_emit_view_SURFACE_STATE(const struct ilo_dev_info *dev, - const struct pipe_sampler_view *view, - struct ilo_cp *cp) -{ - struct ilo_view_surface surf; - - ILO_GPE_VALID_GEN(dev, 7, 7); - - if (view->texture->target == PIPE_BUFFER) { - const unsigned elem_size = util_format_get_blocksize(view->format); - const unsigned first_elem = view->u.buf.first_element; - const unsigned num_elems = view->u.buf.last_element - first_elem + 1; - struct ilo_buffer *buf = ilo_buffer(view->texture); - - ilo_gpe_init_view_surface_for_buffer_gen7(dev, buf, - first_elem * elem_size, num_elems * elem_size, - elem_size, view->format, false, false, &surf); - } - else { - struct ilo_texture *tex = ilo_texture(view->texture); - - ilo_gpe_init_view_surface_for_texture_gen7(dev, tex, view->format, - view->u.tex.first_level, - view->u.tex.last_level - view->u.tex.first_level + 1, - view->u.tex.first_layer, - view->u.tex.last_layer - view->u.tex.first_layer + 1, - false, false, &surf); - } - - return gen7_emit_SURFACE_STATE(dev, &surf, false, cp); -} - -static uint32_t gen7_emit_cbuf_SURFACE_STATE(const struct ilo_dev_info *dev, const struct pipe_constant_buffer *cbuf, struct ilo_cp *cp) @@ -1993,8 +1960,8 @@ gen7_init(struct ilo_gpe_gen7 *gen7) GEN7_USE(gen7, DEPTH_STENCIL_STATE, gen6); GEN7_USE(gen7, SCISSOR_RECT, gen6); GEN7_USE(gen7, BINDING_TABLE_STATE, gen6); + GEN7_USE(gen7, SURFACE_STATE, gen6); GEN7_SET(gen7, surf_SURFACE_STATE); - GEN7_SET(gen7, view_SURFACE_STATE); GEN7_SET(gen7, cbuf_SURFACE_STATE); GEN7_USE(gen7, SAMPLER_STATE, gen6); GEN7_USE(gen7, SAMPLER_BORDER_COLOR_STATE, gen6); |