ilo_shader_get_kernel_param(vs, param);
/* cannot use VS's CSO */
- ilo_gpe_init_gs_cso_gen6(builder->dev, vs, &cso);
+ ilo_gpe_init_gs_cso(builder->dev, vs, &cso);
dw2 = cso.payload[0];
dw4 = cso.payload[1];
dw5 = cso.payload[2];
break;
}
- ilo_gpe_init_view_surface_for_buffer_gen6(builder->dev, buf, bo_offset,
+ ilo_gpe_init_view_surface_for_buffer(builder->dev, buf, bo_offset,
so->buffer_size, struct_size, elem_format, false, true, &surf);
return gen6_SURFACE_STATE(builder, &surf, false);
struct ilo_scissor_state *scissor);
void
-ilo_gpe_init_rasterizer_clip(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_clip *clip);
-
-void
-ilo_gpe_init_rasterizer_sf(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_sf *sf);
-
-void
-ilo_gpe_init_rasterizer_wm_gen6(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_wm *wm);
-
-void
-ilo_gpe_init_rasterizer_wm_gen7(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_wm *wm);
-
-static inline void
ilo_gpe_init_rasterizer(const struct ilo_dev_info *dev,
const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_state *rasterizer)
-{
- ilo_gpe_init_rasterizer_clip(dev, state, &rasterizer->clip);
- ilo_gpe_init_rasterizer_sf(dev, state, &rasterizer->sf);
-
- if (ilo_dev_gen(dev) >= ILO_GEN(7))
- ilo_gpe_init_rasterizer_wm_gen7(dev, state, &rasterizer->wm);
- else
- ilo_gpe_init_rasterizer_wm_gen6(dev, state, &rasterizer->wm);
-}
-
+ struct ilo_rasterizer_state *rasterizer);
void
ilo_gpe_init_dsa(const struct ilo_dev_info *dev,
const struct pipe_depth_stencil_alpha_state *state,
struct ilo_sampler_cso *sampler);
void
-ilo_gpe_init_view_surface_null_gen6(const struct ilo_dev_info *dev,
- unsigned width, unsigned height,
- unsigned depth, unsigned level,
- struct ilo_view_surface *surf);
-
-void
-ilo_gpe_init_view_surface_for_buffer_gen6(const struct ilo_dev_info *dev,
- const struct ilo_buffer *buf,
- unsigned offset, unsigned size,
- unsigned struct_size,
- enum pipe_format elem_format,
- bool is_rt, bool render_cache_rw,
- struct ilo_view_surface *surf);
-
-void
-ilo_gpe_init_view_surface_for_texture_gen6(const struct ilo_dev_info *dev,
- const struct ilo_texture *tex,
- enum pipe_format format,
- unsigned first_level,
- unsigned num_levels,
- unsigned first_layer,
- unsigned num_layers,
- bool is_rt,
- struct ilo_view_surface *surf);
-
-void
-ilo_gpe_init_view_surface_null_gen7(const struct ilo_dev_info *dev,
- unsigned width, unsigned height,
- unsigned depth, unsigned level,
- struct ilo_view_surface *surf);
-
-void
-ilo_gpe_init_view_surface_for_buffer_gen7(const struct ilo_dev_info *dev,
- const struct ilo_buffer *buf,
- unsigned offset, unsigned size,
- unsigned struct_size,
- enum pipe_format elem_format,
- bool is_rt, bool render_cache_rw,
- struct ilo_view_surface *surf);
-
-void
-ilo_gpe_init_view_surface_for_texture_gen7(const struct ilo_dev_info *dev,
- const struct ilo_texture *tex,
- enum pipe_format format,
- unsigned first_level,
- unsigned num_levels,
- unsigned first_layer,
- unsigned num_layers,
- bool is_rt,
- struct ilo_view_surface *surf);
-
-static inline void
ilo_gpe_init_view_surface_null(const struct ilo_dev_info *dev,
unsigned width, unsigned height,
unsigned depth, unsigned level,
- struct ilo_view_surface *surf)
-{
- if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
- ilo_gpe_init_view_surface_null_gen7(dev,
- width, height, depth, level, surf);
- }
- else {
- ilo_gpe_init_view_surface_null_gen6(dev,
- width, height, depth, level, surf);
- }
-}
+ struct ilo_view_surface *surf);
-static inline void
+void
ilo_gpe_init_view_surface_for_buffer(const struct ilo_dev_info *dev,
const struct ilo_buffer *buf,
unsigned offset, unsigned size,
unsigned struct_size,
enum pipe_format elem_format,
bool is_rt, bool render_cache_rw,
- struct ilo_view_surface *surf)
-{
- if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
- ilo_gpe_init_view_surface_for_buffer_gen7(dev, buf, offset, size,
- struct_size, elem_format, is_rt, render_cache_rw, surf);
- }
- else {
- ilo_gpe_init_view_surface_for_buffer_gen6(dev, buf, offset, size,
- struct_size, elem_format, is_rt, render_cache_rw, surf);
- }
-}
+ struct ilo_view_surface *surf);
-static inline void
+void
ilo_gpe_init_view_surface_for_texture(const struct ilo_dev_info *dev,
const struct ilo_texture *tex,
enum pipe_format format,
unsigned first_layer,
unsigned num_layers,
bool is_rt,
- struct ilo_view_surface *surf)
-{
- if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
- ilo_gpe_init_view_surface_for_texture_gen7(dev, tex, format,
- first_level, num_levels, first_layer, num_layers,
- is_rt, surf);
- }
- else {
- ilo_gpe_init_view_surface_for_texture_gen6(dev, tex, format,
- first_level, num_levels, first_layer, num_layers,
- is_rt, surf);
- }
-}
+ struct ilo_view_surface *surf);
void
ilo_gpe_init_zs_surface(const struct ilo_dev_info *dev,
struct ilo_shader_cso *cso);
void
-ilo_gpe_init_gs_cso_gen6(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- struct ilo_shader_cso *cso);
-
-void
-ilo_gpe_init_gs_cso_gen7(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- struct ilo_shader_cso *cso);
-
-static inline void
ilo_gpe_init_gs_cso(const struct ilo_dev_info *dev,
const struct ilo_shader_state *gs,
- struct ilo_shader_cso *cso)
-{
- if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
- ilo_gpe_init_gs_cso_gen7(dev, gs, cso);
- }
- else {
- ilo_gpe_init_gs_cso_gen6(dev, gs, cso);
- }
-}
-
-void
-ilo_gpe_init_fs_cso_gen6(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- struct ilo_shader_cso *cso);
+ struct ilo_shader_cso *cso);
void
-ilo_gpe_init_fs_cso_gen7(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- struct ilo_shader_cso *cso);
-
-static inline void
ilo_gpe_init_fs_cso(const struct ilo_dev_info *dev,
const struct ilo_shader_state *fs,
- struct ilo_shader_cso *cso)
-{
- if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
- ilo_gpe_init_fs_cso_gen7(dev, fs, cso);
- }
- else {
- ilo_gpe_init_fs_cso_gen6(dev, fs, cso);
- }
-}
+ struct ilo_shader_cso *cso);
void
ilo_gpe_set_fb(const struct ilo_dev_info *dev,
#include "ilo_state.h"
#include "ilo_state_3d.h"
-void
-ilo_gpe_init_rasterizer_clip(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_clip *clip)
+static void
+rasterizer_init_clip(const struct ilo_dev_info *dev,
+ const struct pipe_rasterizer_state *state,
+ struct ilo_rasterizer_clip *clip)
{
uint32_t dw1, dw2, dw3;
clip->can_enable_guardband = false;
}
-void
-ilo_gpe_init_rasterizer_sf(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_sf *sf)
+static void
+rasterizer_init_sf(const struct ilo_dev_info *dev,
+ const struct pipe_rasterizer_state *state,
+ struct ilo_rasterizer_sf *sf)
{
float offset_const, offset_scale, offset_clamp;
int line_width, point_width;
}
}
-void
-ilo_gpe_init_rasterizer_wm_gen6(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_wm *wm)
+static void
+rasterizer_init_wm_gen6(const struct ilo_dev_info *dev,
+ const struct pipe_rasterizer_state *state,
+ struct ilo_rasterizer_wm *wm)
{
uint32_t dw5, dw6;
wm->payload[1] = dw6;
}
-void
-ilo_gpe_init_rasterizer_wm_gen7(const struct ilo_dev_info *dev,
- const struct pipe_rasterizer_state *state,
- struct ilo_rasterizer_wm *wm)
+static void
+rasterizer_init_wm_gen7(const struct ilo_dev_info *dev,
+ const struct pipe_rasterizer_state *state,
+ struct ilo_rasterizer_wm *wm)
{
uint32_t dw1, dw2;
}
void
-ilo_gpe_init_fs_cso_gen6(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- struct ilo_shader_cso *cso)
+ilo_gpe_init_rasterizer(const struct ilo_dev_info *dev,
+ const struct pipe_rasterizer_state *state,
+ struct ilo_rasterizer_state *rasterizer)
+{
+ rasterizer_init_clip(dev, state, &rasterizer->clip);
+ rasterizer_init_sf(dev, state, &rasterizer->sf);
+
+ if (ilo_dev_gen(dev) >= ILO_GEN(7))
+ rasterizer_init_wm_gen7(dev, state, &rasterizer->wm);
+ else
+ rasterizer_init_wm_gen6(dev, state, &rasterizer->wm);
+}
+
+static void
+fs_init_cso_gen6(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *fs,
+ struct ilo_shader_cso *cso)
{
int start_grf, input_count, sampler_count, interps, max_threads;
uint32_t dw2, dw4, dw5, dw6;
cso->payload[3] = dw6;
}
-void
-ilo_gpe_init_fs_cso_gen7(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- struct ilo_shader_cso *cso)
+static void
+fs_init_cso_gen7(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *fs,
+ struct ilo_shader_cso *cso)
{
int start_grf, sampler_count, max_threads;
uint32_t dw2, dw4, dw5;
cso->payload[3] = wm_dw1;
}
+void
+ilo_gpe_init_fs_cso(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *fs,
+ struct ilo_shader_cso *cso)
+{
+ if (ilo_dev_gen(dev) >= ILO_GEN(7))
+ fs_init_cso_gen7(dev, fs, cso);
+ else
+ fs_init_cso_gen6(dev, fs, cso);
+}
+
struct ilo_zs_surface_info {
int surface_type;
int format;
cso->payload[2] = dw5;
}
-void
-ilo_gpe_init_gs_cso_gen6(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- struct ilo_shader_cso *cso)
+static void
+gs_init_cso_gen6(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *gs,
+ struct ilo_shader_cso *cso)
{
int start_grf, vue_read_len, max_threads;
uint32_t dw2, dw4, dw5, dw6;
cso->payload[3] = dw6;
}
-void
-ilo_gpe_init_gs_cso_gen7(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- struct ilo_shader_cso *cso)
+static void
+gs_init_cso_gen7(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *gs,
+ struct ilo_shader_cso *cso)
{
int start_grf, vue_read_len, sampler_count, max_threads;
uint32_t dw2, dw4, dw5;
}
void
-ilo_gpe_init_view_surface_null_gen6(const struct ilo_dev_info *dev,
- unsigned width, unsigned height,
- unsigned depth, unsigned level,
- struct ilo_view_surface *surf)
+ilo_gpe_init_gs_cso(const struct ilo_dev_info *dev,
+ const struct ilo_shader_state *gs,
+ struct ilo_shader_cso *cso)
+{
+ if (ilo_dev_gen(dev) >= ILO_GEN(7))
+ gs_init_cso_gen7(dev, gs, cso);
+ else
+ gs_init_cso_gen6(dev, gs, cso);
+}
+
+static void
+view_init_null_gen6(const struct ilo_dev_info *dev,
+ unsigned width, unsigned height,
+ unsigned depth, unsigned level,
+ struct ilo_view_surface *surf)
{
uint32_t *dw;
surf->bo = NULL;
}
-void
-ilo_gpe_init_view_surface_for_buffer_gen6(const struct ilo_dev_info *dev,
- const struct ilo_buffer *buf,
- unsigned offset, unsigned size,
- unsigned struct_size,
- enum pipe_format elem_format,
- bool is_rt, bool render_cache_rw,
- struct ilo_view_surface *surf)
+static void
+view_init_for_buffer_gen6(const struct ilo_dev_info *dev,
+ const struct ilo_buffer *buf,
+ unsigned offset, unsigned size,
+ unsigned struct_size,
+ enum pipe_format elem_format,
+ bool is_rt, bool render_cache_rw,
+ struct ilo_view_surface *surf)
{
const int elem_size = util_format_get_blocksize(elem_format);
int width, height, depth, pitch;
surf->bo = buf->bo;
}
-void
-ilo_gpe_init_view_surface_for_texture_gen6(const struct ilo_dev_info *dev,
- const struct ilo_texture *tex,
- enum pipe_format format,
- unsigned first_level,
- unsigned num_levels,
- unsigned first_layer,
- unsigned num_layers,
- bool is_rt,
- struct ilo_view_surface *surf)
+static void
+view_init_for_texture_gen6(const struct ilo_dev_info *dev,
+ const struct ilo_texture *tex,
+ enum pipe_format format,
+ unsigned first_level,
+ unsigned num_levels,
+ unsigned first_layer,
+ unsigned num_layers,
+ bool is_rt,
+ struct ilo_view_surface *surf)
{
int surface_type, surface_format;
int width, height, depth, pitch, lod;
surf->bo = tex->bo;
}
-void
-ilo_gpe_init_view_surface_null_gen7(const struct ilo_dev_info *dev,
- unsigned width, unsigned height,
- unsigned depth, unsigned level,
- struct ilo_view_surface *surf)
+static void
+view_init_null_gen7(const struct ilo_dev_info *dev,
+ unsigned width, unsigned height,
+ unsigned depth, unsigned level,
+ struct ilo_view_surface *surf)
{
uint32_t *dw;
surf->bo = NULL;
}
-void
-ilo_gpe_init_view_surface_for_buffer_gen7(const struct ilo_dev_info *dev,
- const struct ilo_buffer *buf,
- unsigned offset, unsigned size,
- unsigned struct_size,
- enum pipe_format elem_format,
- bool is_rt, bool render_cache_rw,
- struct ilo_view_surface *surf)
+static void
+view_init_for_buffer_gen7(const struct ilo_dev_info *dev,
+ const struct ilo_buffer *buf,
+ unsigned offset, unsigned size,
+ unsigned struct_size,
+ enum pipe_format elem_format,
+ bool is_rt, bool render_cache_rw,
+ struct ilo_view_surface *surf)
{
const bool typed = (elem_format != PIPE_FORMAT_NONE);
const bool structured = (!typed && struct_size > 1);
surf->bo = buf->bo;
}
-void
-ilo_gpe_init_view_surface_for_texture_gen7(const struct ilo_dev_info *dev,
- const struct ilo_texture *tex,
- enum pipe_format format,
- unsigned first_level,
- unsigned num_levels,
- unsigned first_layer,
- unsigned num_layers,
- bool is_rt,
- struct ilo_view_surface *surf)
+static void
+view_init_for_texture_gen7(const struct ilo_dev_info *dev,
+ const struct ilo_texture *tex,
+ enum pipe_format format,
+ unsigned first_level,
+ unsigned num_levels,
+ unsigned first_layer,
+ unsigned num_layers,
+ bool is_rt,
+ struct ilo_view_surface *surf)
{
int surface_type, surface_format;
int width, height, depth, pitch, lod;
surf->bo = tex->bo;
}
+void
+ilo_gpe_init_view_surface_null(const struct ilo_dev_info *dev,
+ unsigned width, unsigned height,
+ unsigned depth, unsigned level,
+ struct ilo_view_surface *surf)
+{
+ if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
+ view_init_null_gen7(dev,
+ width, height, depth, level, surf);
+ } else {
+ view_init_null_gen6(dev,
+ width, height, depth, level, surf);
+ }
+}
+
+void
+ilo_gpe_init_view_surface_for_buffer(const struct ilo_dev_info *dev,
+ const struct ilo_buffer *buf,
+ unsigned offset, unsigned size,
+ unsigned struct_size,
+ enum pipe_format elem_format,
+ bool is_rt, bool render_cache_rw,
+ struct ilo_view_surface *surf)
+{
+ if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
+ view_init_for_buffer_gen7(dev, buf, offset, size,
+ struct_size, elem_format, is_rt, render_cache_rw, surf);
+ } else {
+ view_init_for_buffer_gen6(dev, buf, offset, size,
+ struct_size, elem_format, is_rt, render_cache_rw, surf);
+ }
+}
+
+void
+ilo_gpe_init_view_surface_for_texture(const struct ilo_dev_info *dev,
+ const struct ilo_texture *tex,
+ enum pipe_format format,
+ unsigned first_level,
+ unsigned num_levels,
+ unsigned first_layer,
+ unsigned num_layers,
+ bool is_rt,
+ struct ilo_view_surface *surf)
+{
+ if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
+ view_init_for_texture_gen7(dev, tex, format,
+ first_level, num_levels, first_layer, num_layers,
+ is_rt, surf);
+ } else {
+ view_init_for_texture_gen6(dev, tex, format,
+ first_level, num_levels, first_layer, num_layers,
+ is_rt, surf);
+ }
+}
+
static void
sampler_init_border_color_gen6(const struct ilo_dev_info *dev,
const union pipe_color_union *color,