i965: Add a comment about null renderbuffer surfaces and why they exist.
authorEric Anholt <eric@anholt.net>
Wed, 21 May 2014 21:09:25 +0000 (14:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 2 Jul 2014 19:45:59 +0000 (12:45 -0700)
I noticed this when trying to find comments about pull constant buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
src/mesa/drivers/dri/i965/gen8_surface_state.c

index d3bc797..c0756ad 100644 (file)
@@ -501,6 +501,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)
 {
index 60849e0..01120af 100644 (file)
@@ -393,6 +393,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)
 {
index 87401b7..40eb2ea 100644 (file)
@@ -266,8 +266,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)