From: Rob Clark Date: Fri, 26 Sep 2014 14:33:35 +0000 (-0400) Subject: freedreno/a3xx: add 32bit integer vtx formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c61133046ec079ead9a4f05a5eb06b0bbe10e838;p=mesa.git freedreno/a3xx: add 32bit integer vtx formats Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c index 624155b0ade..c48381c9507 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c @@ -343,6 +343,7 @@ fd3_emit_vertex_bufs(struct fd_ringbuffer *ring, enum pipe_format pfmt = vbufs[i].format; enum a3xx_vtx_fmt fmt = fd3_pipe2vtx(pfmt); bool switchnext = (i != last); + bool isint = util_format_is_pure_integer(pfmt); uint32_t fs = util_format_get_blocksize(pfmt); debug_assert(fmt != ~0); @@ -363,6 +364,7 @@ fd3_emit_vertex_bufs(struct fd_ringbuffer *ring, A3XX_VFD_DECODE_INSTR_REGID(vp->inputs[i].regid) | A3XX_VFD_DECODE_INSTR_SHIFTCNT(fs) | A3XX_VFD_DECODE_INSTR_LASTCOMPVALID | + COND(isint, A3XX_VFD_DECODE_INSTR_INT) | COND(switchnext, A3XX_VFD_DECODE_INSTR_SWITCHNEXT)); total_in += vp->inputs[i].ncomp; diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_util.c b/src/gallium/drivers/freedreno/a3xx/fd3_util.c index c921bc2da9e..c83f65ae421 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_util.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_util.c @@ -134,6 +134,14 @@ fd3_pipe2vtx(enum pipe_format format) case PIPE_FORMAT_R16G16_SNORM: return VFMT_NORM_SHORT_16_16; + case PIPE_FORMAT_R32_UINT: + case PIPE_FORMAT_R32_USCALED: + return VFMT_UINT_32; + + case PIPE_FORMAT_R32_SINT: + case PIPE_FORMAT_R32_SSCALED: + return VFMT_INT_32; + case PIPE_FORMAT_R10G10B10A2_UNORM: return VFMT_NORM_UINT_10_10_10_2; @@ -196,6 +204,14 @@ fd3_pipe2vtx(enum pipe_format format) case PIPE_FORMAT_R16G16B16A16_FLOAT: return VFMT_FLOAT_16_16_16_16; + case PIPE_FORMAT_R32G32_UINT: + case PIPE_FORMAT_R32G32_USCALED: + return VFMT_UINT_32_32; + + case PIPE_FORMAT_R32G32_SINT: + case PIPE_FORMAT_R32G32_SSCALED: + return VFMT_INT_32_32; + /* 96-bit buffers. */ case PIPE_FORMAT_R32G32B32_FLOAT: return VFMT_FLOAT_32_32_32; @@ -203,6 +219,14 @@ fd3_pipe2vtx(enum pipe_format format) case PIPE_FORMAT_R32G32B32_FIXED: return VFMT_FIXED_32_32_32; + case PIPE_FORMAT_R32G32B32_UINT: + case PIPE_FORMAT_R32G32B32_USCALED: + return VFMT_UINT_32_32_32; + + case PIPE_FORMAT_R32G32B32_SINT: + case PIPE_FORMAT_R32G32B32_SSCALED: + return VFMT_INT_32_32_32; + /* 128-bit buffers. */ case PIPE_FORMAT_R32G32B32A32_FLOAT: return VFMT_FLOAT_32_32_32_32; @@ -210,26 +234,20 @@ fd3_pipe2vtx(enum pipe_format format) case PIPE_FORMAT_R32G32B32A32_FIXED: return VFMT_FIXED_32_32_32_32; -/* TODO probably need gles3 blob drivers to find the 32bit int formats: - case PIPE_FORMAT_R32G32B32A32_SNORM: - case PIPE_FORMAT_R32G32B32A32_UNORM: - case PIPE_FORMAT_R32G32B32A32_SINT: case PIPE_FORMAT_R32G32B32A32_UINT: + case PIPE_FORMAT_R32G32B32A32_USCALED: + return VFMT_UINT_32_32_32_32; - case PIPE_FORMAT_R32_UINT: - case PIPE_FORMAT_R32_SINT: - case PIPE_FORMAT_A32_UINT: - case PIPE_FORMAT_A32_SINT: - case PIPE_FORMAT_L32_UINT: - case PIPE_FORMAT_L32_SINT: - case PIPE_FORMAT_I32_UINT: - case PIPE_FORMAT_I32_SINT: + case PIPE_FORMAT_R32G32B32A32_SINT: + case PIPE_FORMAT_R32G32B32A32_SSCALED: + return VFMT_INT_32_32_32_32; - case PIPE_FORMAT_R32G32_SINT: - case PIPE_FORMAT_R32G32_UINT: - case PIPE_FORMAT_L32A32_UINT: - case PIPE_FORMAT_L32A32_SINT: -*/ +/* TODO normalized 32bit int formats do not appear to be supported + * natively.. will require either shader variant or VFD_DECODE + * gymnastics like the blob driver does.. + case PIPE_FORMAT_R32G32B32A32_SNORM: + case PIPE_FORMAT_R32G32B32A32_UNORM: + */ default: return ~0;