mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 07:10:15 +01:00
ilo: move gen6_so_SURFACE_STATE() out of core
It does not belong to core.
This commit is contained in:
parent
e3372c4bfb
commit
dcb5bad3a3
2 changed files with 53 additions and 52 deletions
|
|
@ -1316,58 +1316,6 @@ gen6_SURFACE_STATE(struct ilo_builder *builder,
|
|||
return state_offset;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
gen6_so_SURFACE_STATE(struct ilo_builder *builder,
|
||||
const struct pipe_stream_output_target *so,
|
||||
const struct pipe_stream_output_info *so_info,
|
||||
int so_index)
|
||||
{
|
||||
struct ilo_buffer *buf = ilo_buffer(so->buffer);
|
||||
struct ilo_state_surface_buffer_info info;
|
||||
struct ilo_state_surface surf;
|
||||
|
||||
ILO_DEV_ASSERT(builder->dev, 6, 6);
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
info.buf = buf;
|
||||
info.access = ILO_STATE_SURFACE_ACCESS_DP_SVB;
|
||||
|
||||
switch (so_info->output[so_index].num_components) {
|
||||
case 1:
|
||||
info.format = GEN6_FORMAT_R32_FLOAT;
|
||||
info.format_size = 4;
|
||||
break;
|
||||
case 2:
|
||||
info.format = GEN6_FORMAT_R32G32_FLOAT;
|
||||
info.format_size = 8;
|
||||
break;
|
||||
case 3:
|
||||
info.format = GEN6_FORMAT_R32G32B32_FLOAT;
|
||||
info.format_size = 12;
|
||||
break;
|
||||
case 4:
|
||||
info.format = GEN6_FORMAT_R32G32B32A32_FLOAT;
|
||||
info.format_size = 16;
|
||||
break;
|
||||
default:
|
||||
assert(!"unexpected SO components length");
|
||||
info.format = GEN6_FORMAT_R32_FLOAT;
|
||||
info.format_size = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
info.struct_size =
|
||||
so_info->stride[so_info->output[so_index].output_buffer] * 4;
|
||||
info.offset = so->buffer_offset + so_info->output[so_index].dst_offset * 4;
|
||||
info.size = so->buffer_size - so_info->output[so_index].dst_offset * 4;
|
||||
|
||||
memset(&surf, 0, sizeof(surf));
|
||||
ilo_state_surface_init_for_buffer(&surf, builder->dev, &info);
|
||||
surf.bo = info.buf->bo;
|
||||
|
||||
return gen6_SURFACE_STATE(builder, &surf);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
gen6_SAMPLER_STATE(struct ilo_builder *builder,
|
||||
const struct ilo_state_sampler *samplers,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,65 @@
|
|||
|
||||
#include "ilo_common.h"
|
||||
#include "ilo_blitter.h"
|
||||
#include "ilo_resource.h"
|
||||
#include "ilo_shader.h"
|
||||
#include "ilo_state.h"
|
||||
#include "ilo_render_gen.h"
|
||||
|
||||
#define DIRTY(state) (session->pipe_dirty & ILO_DIRTY_ ## state)
|
||||
|
||||
static inline uint32_t
|
||||
gen6_so_SURFACE_STATE(struct ilo_builder *builder,
|
||||
const struct pipe_stream_output_target *so,
|
||||
const struct pipe_stream_output_info *so_info,
|
||||
int so_index)
|
||||
{
|
||||
struct ilo_buffer *buf = ilo_buffer(so->buffer);
|
||||
struct ilo_state_surface_buffer_info info;
|
||||
struct ilo_state_surface surf;
|
||||
|
||||
ILO_DEV_ASSERT(builder->dev, 6, 6);
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
info.buf = buf;
|
||||
info.access = ILO_STATE_SURFACE_ACCESS_DP_SVB;
|
||||
|
||||
switch (so_info->output[so_index].num_components) {
|
||||
case 1:
|
||||
info.format = GEN6_FORMAT_R32_FLOAT;
|
||||
info.format_size = 4;
|
||||
break;
|
||||
case 2:
|
||||
info.format = GEN6_FORMAT_R32G32_FLOAT;
|
||||
info.format_size = 8;
|
||||
break;
|
||||
case 3:
|
||||
info.format = GEN6_FORMAT_R32G32B32_FLOAT;
|
||||
info.format_size = 12;
|
||||
break;
|
||||
case 4:
|
||||
info.format = GEN6_FORMAT_R32G32B32A32_FLOAT;
|
||||
info.format_size = 16;
|
||||
break;
|
||||
default:
|
||||
assert(!"unexpected SO components length");
|
||||
info.format = GEN6_FORMAT_R32_FLOAT;
|
||||
info.format_size = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
info.struct_size =
|
||||
so_info->stride[so_info->output[so_index].output_buffer] * 4;
|
||||
info.offset = so->buffer_offset + so_info->output[so_index].dst_offset * 4;
|
||||
info.size = so->buffer_size - so_info->output[so_index].dst_offset * 4;
|
||||
|
||||
memset(&surf, 0, sizeof(surf));
|
||||
ilo_state_surface_init_for_buffer(&surf, builder->dev, &info);
|
||||
surf.bo = info.buf->bo;
|
||||
|
||||
return gen6_SURFACE_STATE(builder, &surf);
|
||||
}
|
||||
|
||||
static void
|
||||
gen6_emit_draw_surface_rt(struct ilo_render *r,
|
||||
const struct ilo_state_vector *vec,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue