summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-09 12:38:58 -0800
committerJason Ekstrand <[email protected]>2016-03-10 10:41:52 -0800
commit1f3d582cba4921fa638c1aa0d8e7861f91059547 (patch)
treeb6cc9fd36133ed6a292795f1dfccce6de7aa128e /src
parent8c819b8c2b4ebe63b431e34946b4ea3a43b6c118 (diff)
isl/surface_state: Set the clear color
Diffstat (limited to 'src')
-rw-r--r--src/intel/isl/isl_surface_state.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index f3390a6c553..6afe45d650e 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -393,9 +393,11 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
}
#endif
-#if 0
- if (GEN_GEN == 8) {
- if (isl_format_is_integer(info->view->format)) {
+ if (GEN_GEN <= 8) {
+ /* Prior to Sky Lake, we only have one bit for the clear color which
+ * gives us 0 or 1 in whatever the surface's format happens to be.
+ */
+ if (isl_format_has_int_channel(info->view->format)) {
for (unsigned i = 0; i < 4; i++) {
assert(info->clear_color.u32[i] == 0 ||
info->clear_color.u32[i] == 1);
@@ -406,17 +408,16 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
info->clear_color.f32[i] == 1.0f);
}
}
- s.RedClearColor = info->clear_color.u32[0] != 0,
- s.GreenClearColor = info->clear_color.u32[1] != 0,
- s.BlueClearColor = info->clear_color.u32[2] != 0,
- s.AlphaClearColor = info->clear_color.u32[3] != 0,
+ s.RedClearColor = info->clear_color.u32[0] != 0;
+ s.GreenClearColor = info->clear_color.u32[1] != 0;
+ s.BlueClearColor = info->clear_color.u32[2] != 0;
+ s.AlphaClearColor = info->clear_color.u32[3] != 0;
} else {
- .RedClearColor = info->clear_color.u32[0],
- .GreenClearColor = info->clear_color.u32[1],
- .BlueClearColor = info->clear_color.u32[2],
- .AlphaClearColor = info->clear_color.u32[3],
+ s.RedClearColor = info->clear_color.u32[0];
+ s.GreenClearColor = info->clear_color.u32[1];
+ s.BlueClearColor = info->clear_color.u32[2];
+ s.AlphaClearColor = info->clear_color.u32[3];
}
-#endif
GENX(RENDER_SURFACE_STATE_pack)(NULL, state, &s);
}