has_layer_face_index_in_z(enum pipe_texture_target target)
{
if (target == PIPE_TEXTURE_CUBE ||
+ target == PIPE_TEXTURE_1D_ARRAY ||
target == PIPE_TEXTURE_2D_ARRAY ||
- target == PIPE_TEXTURE_1D_ARRAY)
+ target == PIPE_TEXTURE_CUBE_ARRAY)
return true;
else
return false;
int z_in, unsigned *layer_out, unsigned *z_out)
{
if (target == PIPE_TEXTURE_CUBE ||
+ target == PIPE_TEXTURE_1D_ARRAY ||
target == PIPE_TEXTURE_2D_ARRAY ||
- target == PIPE_TEXTURE_1D_ARRAY) {
+ target == PIPE_TEXTURE_CUBE_ARRAY) {
*layer_out = z_in;
*z_out = 0;
}
was_tex_rendered_to(struct pipe_resource *resource,
const struct pipe_transfer *transfer)
{
- unsigned face;
+ unsigned layer_face;
- if (resource->target == PIPE_TEXTURE_CUBE) {
+ switch (resource->target) {
+ case PIPE_TEXTURE_CUBE:
assert(transfer->box.depth == 1);
- face = transfer->box.z;
- }
- else {
- face = 0;
+ case PIPE_TEXTURE_1D_ARRAY:
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
+ layer_face = transfer->box.z;
+ break;
+ default:
+ layer_face = 0;
}
return svga_was_texture_rendered_to(svga_texture(resource),
- face, transfer->level);
+ layer_face, transfer->level);
}
baseLevelSize.depth = tex->b.b.depth0;
if ((tex->b.b.target == PIPE_TEXTURE_1D_ARRAY) ||
- (tex->b.b.target == PIPE_TEXTURE_2D_ARRAY)) {
+ (tex->b.b.target == PIPE_TEXTURE_2D_ARRAY) ||
+ (tex->b.b.target == PIPE_TEXTURE_CUBE_ARRAY)) {
st->base.layer_stride =
svga3dsurface_get_image_offset(tex->key.format, baseLevelSize,
tex->b.b.last_level + 1, 1, 0);
st->base.box.x,
st->base.box.y,
st->base.box.z);
+
return (void *) (map + offset);
}
}
st->slice = st->base.box.z;
st->base.box.z = 0; /* so we don't apply double offsets below */
break;
- case PIPE_TEXTURE_2D_ARRAY:
case PIPE_TEXTURE_1D_ARRAY:
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
st->slice = st->base.box.z;
st->base.box.z = 0; /* so we don't apply double offsets below */
unsigned subResource;
subResource = slice * numMipLevels + level;
+
ret = SVGA3D_vgpu10_UpdateSubResource(svga->swc, surf, box, subResource);
if (ret != PIPE_OK) {
svga_context_flush(svga, NULL);
box.z = 0;
break;
case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
nlayers = box.d;
box.z = 0;
box.d = 1;
if (svga_have_vgpu10(svga)) {
unsigned i;
+
for (i = 0; i < nlayers; i++) {
ret = update_image_vgpu10(svga, surf, &box,
st->slice + i, transfer->level,
tex->key.flags |= (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_ARRAY);
tex->key.numFaces = 6;
break;
+ case PIPE_TEXTURE_CUBE_ARRAY:
+ assert(svgascreen->sws->have_sm4_1);
+ tex->key.flags |= (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_ARRAY);
+ tex->key.numFaces = 1; // arraySize already includes the 6 faces
+ tex->key.arraySize = template->array_size;
+ break;
default:
break;
}
st->upload.box.z = 0;
break;
case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
st->upload.nlayers = st->base.box.depth;
st->upload.box.z = 0;
st->upload.box.d = 1;
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
return 1;
+ case PIPE_CAP_CUBE_MAP_ARRAY:
+ return sws->have_sm4_1;
+
/* Unsupported features */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
case PIPE_CAP_COMPUTE:
case PIPE_CAP_START_INSTANCE:
- case PIPE_CAP_CUBE_MAP_ARRAY:
case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT: