summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/evergreen_state.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2011-05-05 18:54:03 -0400
committerAlex Deucher <[email protected]>2011-05-05 18:54:03 -0400
commit5939bc03bc15b9b1131463ffad04a7b2d987074d (patch)
tree36bebb81a4c618f65ee589b72cabb08744c9d292 /src/gallium/drivers/r600/evergreen_state.c
parentbf7a3ddca6fcc73eebdd9afdc45a485b38477bd9 (diff)
r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization. Leaving SOURCE_FORMAT at 0 will work in all cases, but is less efficient. The conditions for the setting the EXPORT_NORM optimization are as follows: R600/RV6xx: BLEND_CLAMP is enabled BLEND_FLOAT32 is disabled 11-bit or smaller UNORM/SNORM/SRGB R7xx/evergreen: 11-bit or smaller UNORM/SNORM/SRGB 16-bit or smaller FLOAT Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index d60c153b482..9757811e8b6 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -710,14 +710,20 @@ static void evergreen_cb(struct r600_pipe_context *rctx, struct r600_pipe_state
S_028C70_ENDIAN(endian);
- /* we can only set the export size if any thing is snorm/unorm component is > 11 bits,
- if we aren't a float, sint or uint */
+ /* EXPORT_NORM is an optimzation that can be enabled for better
+ * performance in certain cases.
+ * EXPORT_NORM can be enabled if:
+ * - 11-bit or smaller UNORM/SNORM/SRGB
+ * - 16-bit or smaller FLOAT
+ */
/* FIXME: This should probably be the same for all CBs if we want
* useful alpha tests. */
if (desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS &&
- desc->channel[i].size < 12 && desc->channel[i].type != UTIL_FORMAT_TYPE_FLOAT &&
- ntype != V_028C70_NUMBER_UINT && ntype != V_028C70_NUMBER_SINT) {
- color_info |= S_028C70_SOURCE_FORMAT(V_028C70_EXPORT_4C_16BPC);
+ ((desc->channel[i].size < 12 &&
+ desc->channel[i].type != UTIL_FORMAT_TYPE_FLOAT &&
+ ntype != V_028C70_NUMBER_UINT && ntype != V_028C70_NUMBER_SINT) ||
+ (desc->channel[i].size < 17 &&
+ desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT))) {
rctx->export_16bpc = true;
} else {
rctx->export_16bpc = false;