/* emit texture state for mem->gmem restore operation.. eventually it would
* be good to get rid of this and use normal CSO/etc state for more of these
* special cases, but for now the compiler is not sufficient..
+ *
+ * Also, for using normal state, not quite sure how to handle the special
+ * case format (fd3_gmem_restore_format()) stuff for restoring depth/stencil.
*/
void
fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring, struct pipe_surface *psurf)
CP_LOAD_STATE_0_NUM_UNIT(1));
OUT_RING(ring, CP_LOAD_STATE_1_STATE_TYPE(ST_CONSTANTS) |
CP_LOAD_STATE_1_EXT_SRC_ADDR(0));
- OUT_RING(ring, A3XX_TEX_CONST_0_FMT(fd3_pipe2tex(psurf->format)) |
+ OUT_RING(ring, A3XX_TEX_CONST_0_FMT(fd3_pipe2tex(format)) |
A3XX_TEX_CONST_0_TYPE(A3XX_TEX_2D) |
fd3_tex_swiz(format, PIPE_SWIZZLE_RED, PIPE_SWIZZLE_GREEN,
PIPE_SWIZZLE_BLUE, PIPE_SWIZZLE_ALPHA));
return TFMT_NORM_UINT_8_8_8_8;
case PIPE_FORMAT_Z24X8_UNORM:
- return TFMT_NORM_UINT_X8Z24;
-
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
- return TFMT_NORM_UINT_8_8_8_8;
+ return TFMT_NORM_UINT_X8Z24;
case PIPE_FORMAT_Z16_UNORM:
- return TFMT_NORM_UINT_8_8;
+ return TFMT_NORM_USHORT_Z16;
case PIPE_FORMAT_R16G16B16A16_FLOAT:
case PIPE_FORMAT_R16G16B16X16_FLOAT:
case PIPE_FORMAT_R8_UNORM:
case PIPE_FORMAT_L8_UNORM:
+ return RB_R8_UNORM;
+
case PIPE_FORMAT_A8_UNORM:
return RB_A8_UNORM;
OUT_RING(ring, ++marker_cnt);
}
+/* helper to get numeric value from environment variable.. mostly
+ * just leaving this here because it is helpful to brute-force figure
+ * out unknown formats, etc, which blob driver does not support:
+ */
+static inline uint32_t env2u(const char *envvar)
+{
+ char *str = getenv(envvar);
+ if (str)
+ return strtol(str, NULL, 0);
+ return 0;
+}
+
#endif /* FREEDRENO_UTIL_H_ */