[Mesa-dev] [PATCH 10/11] i965: Add a comment about null renderbuffer surfaces and why they exist.
Eric Anholt
eric at anholt.net
Wed May 21 15:04:31 PDT 2014
I noticed this when trying to find comments about pull constant buffers.
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 8 ++++++++
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 8 ++++++++
src/mesa/drivers/dri/i965/gen8_surface_state.c | 8 ++++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 2995d39..8177cb1 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -504,6 +504,14 @@ const struct brw_tracked_state brw_wm_pull_constants = {
.emit = brw_upload_wm_pull_constants,
};
+/**
+ * Creates a null renderbuffer surface.
+ *
+ * This is used when the shader doesn't write to any color output. An FB
+ * write to target 0 will still be emitted, because that's how the thread is
+ * terminated (and computed depth is returned), so we need to have the
+ * hardware discard the target 0 color output..
+ */
static void
brw_update_null_renderbuffer_surface(struct brw_context *brw, unsigned int unit)
{
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index b31f491..7f4acef 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -392,6 +392,14 @@ gen7_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
true /* rw */);
}
+/**
+ * Creates a null renderbuffer surface.
+ *
+ * This is used when the shader doesn't write to any color output. An FB
+ * write to target 0 will still be emitted, because that's how the thread is
+ * terminated (and computed depth is returned), so we need to have the
+ * hardware discard the target 0 color output..
+ */
static void
gen7_update_null_renderbuffer_surface(struct brw_context *brw, unsigned unit)
{
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index 406f68e..94a55b3 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -246,8 +246,12 @@ gen8_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
}
/**
- * Create the constant buffer surface. Vertex/fragment shader constants will be
- * read from this buffer with Data Port Read instructions/messages.
+ * Creates a null renderbuffer surface.
+ *
+ * This is used when the shader doesn't write to any color output. An FB
+ * write to target 0 will still be emitted, because that's how the thread is
+ * terminated (and computed depth is returned), so we need to have the
+ * hardware discard the target 0 color output..
*/
static void
gen8_update_null_renderbuffer_surface(struct brw_context *brw, unsigned unit)
--
2.0.0.rc2
More information about the mesa-dev
mailing list