freedreno/a4xx: add cube map array support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
@@ -187,9 +187,9 @@ fd4_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
|
||||
A4XX_TEX_CONST_3_LAYERSZ(rsc->layer_size);
|
||||
break;
|
||||
case PIPE_TEXTURE_CUBE:
|
||||
case PIPE_TEXTURE_CUBE_ARRAY: /* ?? not sure about _CUBE_ARRAY */
|
||||
case PIPE_TEXTURE_CUBE_ARRAY:
|
||||
so->texconst3 =
|
||||
A4XX_TEX_CONST_3_DEPTH(1) |
|
||||
A4XX_TEX_CONST_3_DEPTH(prsc->array_size / 6) |
|
||||
A4XX_TEX_CONST_3_LAYERSZ(rsc->layer_size);
|
||||
break;
|
||||
case PIPE_TEXTURE_3D:
|
||||
|
||||
@@ -459,7 +459,6 @@ fd_resource_create(struct pipe_screen *pscreen,
|
||||
if (is_a4xx(fd_screen(pscreen))) {
|
||||
switch (tmpl->target) {
|
||||
case PIPE_TEXTURE_3D:
|
||||
/* TODO 3D_ARRAY? */
|
||||
rsc->layer_first = false;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -163,7 +163,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TEXTURE_MULTISAMPLE:
|
||||
case PIPE_CAP_TEXTURE_BARRIER:
|
||||
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
|
||||
case PIPE_CAP_CUBE_MAP_ARRAY:
|
||||
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
|
||||
case PIPE_CAP_START_INSTANCE:
|
||||
case PIPE_CAP_COMPUTE:
|
||||
@@ -195,6 +194,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return is_a3xx(screen);
|
||||
|
||||
case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
|
||||
case PIPE_CAP_CUBE_MAP_ARRAY:
|
||||
return is_a4xx(screen);
|
||||
|
||||
case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
|
||||
|
||||
@@ -1636,6 +1636,11 @@ emit_tex(struct ir3_compile *ctx, nir_tex_instr *tex)
|
||||
coord[i] = ir3_SHL_B(b, coord[i], 0, lod, 0);
|
||||
}
|
||||
|
||||
/* the array coord for cube arrays needs 0.5 added to it */
|
||||
if (tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE && tex->is_array &&
|
||||
opc != OPC_ISAML)
|
||||
coord[3] = ir3_ADD_F(b, coord[3], 0, create_immed(b, fui(0.5)), 0);
|
||||
|
||||
/*
|
||||
* lay out the first argument in the proper order:
|
||||
* - actual coordinates first
|
||||
@@ -1759,6 +1764,12 @@ emit_tex_txs(struct ir3_compile *ctx, nir_tex_instr *tex)
|
||||
|
||||
tex_info(tex, &flags, &coords);
|
||||
|
||||
/* Actually we want the number of dimensions, not coordinates. This
|
||||
* distinction only matters for cubes.
|
||||
*/
|
||||
if (tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE)
|
||||
coords = 2;
|
||||
|
||||
dst = get_dst(ctx, &tex->dest, 4);
|
||||
|
||||
compile_assert(ctx, tex->num_srcs == 1);
|
||||
|
||||
Reference in New Issue
Block a user