pos = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0,
TGSI_INTERPOLATE_LINEAR);
}
- if (st->pbo_upload.upload_layers) {
+ if (st->pbo.layers) {
layer = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_LAYER, 0,
TGSI_INTERPOLATE_CONSTANT);
}
ureg_scalar(ureg_src(temp0), TGSI_SWIZZLE_Y),
ureg_scalar(ureg_src(temp0), TGSI_SWIZZLE_X));
- if (st->pbo_upload.upload_layers) {
+ if (st->pbo.layers) {
/* temp0.x = const0.w * layer + temp0.x */
ureg_UMAD(ureg, ureg_writemask(temp0, TGSI_WRITEMASK_X),
ureg_scalar(const0, TGSI_SWIZZLE_W),
}
/* Create the shaders */
- if (!st->pbo_upload.vs) {
- st->pbo_upload.vs = st_pbo_create_vs(st);
- if (!st->pbo_upload.vs)
+ if (!st->pbo.vs) {
+ st->pbo.vs = st_pbo_create_vs(st);
+ if (!st->pbo.vs)
return false;
}
- if (depth != 1 && st->pbo_upload.use_gs && !st->pbo_upload.gs) {
- st->pbo_upload.gs = st_pbo_create_gs(st);
- if (!st->pbo_upload.gs)
+ if (depth != 1 && st->pbo.use_gs && !st->pbo.gs) {
+ st->pbo.gs = st_pbo_create_gs(st);
+ if (!st->pbo.gs)
return false;
}
- if (!st->pbo_upload.fs) {
- st->pbo_upload.fs = create_pbo_upload_fs(st);
- if (!st->pbo_upload.fs)
+ if (!st->pbo.upload_fs) {
+ st->pbo.upload_fs = create_pbo_upload_fs(st);
+ if (!st->pbo.upload_fs)
return false;
}
cso_set_viewport_dims(cso, surface->width, surface->height, FALSE);
/* Blend state */
- cso_set_blend(cso, &st->pbo_upload.blend);
+ cso_set_blend(cso, &st->pbo.upload_blend);
/* Depth/stencil/alpha state */
{
}
/* Rasterizer state */
- cso_set_rasterizer(cso, &st->pbo_upload.raster);
+ cso_set_rasterizer(cso, &st->pbo.raster);
/* Set up the shaders */
- cso_set_vertex_shader_handle(cso, st->pbo_upload.vs);
+ cso_set_vertex_shader_handle(cso, st->pbo.vs);
- cso_set_geometry_shader_handle(cso, depth != 1 ? st->pbo_upload.gs : NULL);
+ cso_set_geometry_shader_handle(cso, depth != 1 ? st->pbo.gs : NULL);
cso_set_tessctrl_shader_handle(cso, NULL);
cso_set_tesseval_shader_handle(cso, NULL);
- cso_set_fragment_shader_handle(cso, st->pbo_upload.fs);
+ cso_set_fragment_shader_handle(cso, st->pbo.upload_fs);
/* Disable stream output */
cso_set_stream_outputs(cso, 0, NULL, 0);
unsigned stride, image_height;
bool success;
- if (!st->pbo_upload.enabled)
+ if (!st->pbo.upload_enabled)
return false;
/* From now on, we need the gallium representation of dimensions. */
image_height = unpack->ImageHeight > 0 ? unpack->ImageHeight : height;
}
- if (depth != 1 && !st->pbo_upload.upload_layers)
+ if (depth != 1 && !st->pbo.layers)
return false;
/* Choose the source format. Initially, we do so without checking driver
if (desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB)
return false;
- if (st->pbo_upload.rgba_only) {
+ if (st->pbo.rgba_only) {
enum pipe_format orig_dst_format = dst_format;
if (!reinterpret_formats(&src_format, &dst_format)) {
goto fallback;
}
- if (!st->pbo_upload.enabled ||
+ if (!st->pbo.upload_enabled ||
!screen->get_param(screen, PIPE_CAP_SURFACE_REINTERPRET_BLOCKS)) {
goto fallback;
}
out_pos = ureg_DECL_output(ureg, TGSI_SEMANTIC_POSITION, 0);
- if (st->pbo_upload.upload_layers) {
+ if (st->pbo.layers) {
in_instanceid = ureg_DECL_system_value(ureg, TGSI_SEMANTIC_INSTANCEID, 0);
- if (!st->pbo_upload.use_gs)
+ if (!st->pbo.use_gs)
out_layer = ureg_DECL_output(ureg, TGSI_SEMANTIC_LAYER, 0);
}
/* out_pos = in_pos */
ureg_MOV(ureg, out_pos, in_pos);
- if (st->pbo_upload.upload_layers) {
- if (st->pbo_upload.use_gs) {
+ if (st->pbo.layers) {
+ if (st->pbo.use_gs) {
/* out_pos.z = i2f(gl_InstanceID) */
ureg_I2F(ureg, ureg_writemask(out_pos, TGSI_WRITEMASK_Z),
ureg_scalar(in_instanceid, TGSI_SWIZZLE_X));
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
- st->pbo_upload.enabled =
+ st->pbo.upload_enabled =
screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS) &&
screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT) >= 1 &&
screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_INTEGERS);
- if (!st->pbo_upload.enabled)
+ if (!st->pbo.upload_enabled)
return;
- st->pbo_upload.rgba_only =
+ st->pbo.rgba_only =
screen->get_param(screen, PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY);
if (screen->get_param(screen, PIPE_CAP_TGSI_INSTANCEID)) {
if (screen->get_param(screen, PIPE_CAP_TGSI_VS_LAYER_VIEWPORT)) {
- st->pbo_upload.upload_layers = true;
+ st->pbo.layers = true;
} else if (screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES) >= 3) {
- st->pbo_upload.upload_layers = true;
- st->pbo_upload.use_gs = true;
+ st->pbo.layers = true;
+ st->pbo.use_gs = true;
}
}
/* Blend state */
- memset(&st->pbo_upload.blend, 0, sizeof(struct pipe_blend_state));
- st->pbo_upload.blend.rt[0].colormask = PIPE_MASK_RGBA;
+ memset(&st->pbo.upload_blend, 0, sizeof(struct pipe_blend_state));
+ st->pbo.upload_blend.rt[0].colormask = PIPE_MASK_RGBA;
/* Rasterizer state */
- memset(&st->pbo_upload.raster, 0, sizeof(struct pipe_rasterizer_state));
- st->pbo_upload.raster.half_pixel_center = 1;
+ memset(&st->pbo.raster, 0, sizeof(struct pipe_rasterizer_state));
+ st->pbo.raster.half_pixel_center = 1;
}
void
st_destroy_pbo_helpers(struct st_context *st)
{
- if (st->pbo_upload.fs) {
- cso_delete_fragment_shader(st->cso_context, st->pbo_upload.fs);
- st->pbo_upload.fs = NULL;
+ if (st->pbo.upload_fs) {
+ cso_delete_fragment_shader(st->cso_context, st->pbo.upload_fs);
+ st->pbo.upload_fs = NULL;
}
- if (st->pbo_upload.gs) {
- cso_delete_geometry_shader(st->cso_context, st->pbo_upload.gs);
- st->pbo_upload.gs = NULL;
+ if (st->pbo.gs) {
+ cso_delete_geometry_shader(st->cso_context, st->pbo.gs);
+ st->pbo.gs = NULL;
}
- if (st->pbo_upload.vs) {
- cso_delete_vertex_shader(st->cso_context, st->pbo_upload.vs);
- st->pbo_upload.vs = NULL;
+ if (st->pbo.vs) {
+ cso_delete_vertex_shader(st->cso_context, st->pbo.vs);
+ st->pbo.vs = NULL;
}
}