1. 13 Sep, 2019 4 commits
    • Iago Toral's avatar
      v3d: fix TF primitive counts for resume without draw · 2eace10c
      Iago Toral authored
      The V3D documentation states that primitive counters are reset when
      we emit Tile Binning Mode Configuration items, which we do at the start
      of each draw call, however, in the actual hardware this doesn't seem to
      take effect when transform feedback is not active (this doesn't happen in
      the simulator). This causes a problem in the following scenario:
      
      glBeginTransformFeedback()
         glDrawArrays()
         glPauseTransformFeedback()
         glDrawArrays()
         glResumeTransformFeedback()
      glEndTransformFeedback()
      
      The TF pause will trigger a flush of the primitive counters, which results
      in a correct number of primitives up to that point. In theory, the counter
      should then be reset when we execute the draw after pausing TF, but that
      doesn't happen, and since TF is enabled again by the resume command before
      we end recording, by the time we end the transform feedback recording we
      again check the counters, but instead of reading 0, we read again the same
      value we read at the time we paused, incorrectly accumulating that value
      again.
      
      In theory, we should be able to avoid this by using the other method to
      reset the primitive counters: using operation 1 instead of 0 when we
      flush the counts to the buffer at the time we pause, but again, this
      doesn't seem to be work and we still see obsolete counts by the time we
      end transform feedback.
      
      This patch fixes the problem by not accumulating TF primitive counts
      unless we know we have actually queued draw calls during transform
      feedback, since that seems to effectively reset the counters. This should
      also be more performant, since it saves unnecessary stalls for the
      primitive counters to be updated when we know there haven't been any
      new primitives drawn.
      
      Fixes CTS tests:
      dEQP-GLES3.functional.transform_feedback.*
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      2eace10c
    • Iago Toral's avatar
      v3d: remove redundant update of queued draw calls · ded6ea92
      Iago Toral authored
      This was updating the counter for the indexed draw path only, but we are
      already updating the counter for all paths a bit later, so this is only
      duplicating counts for indexed paths.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      ded6ea92
    • Iago Toral's avatar
      v3d: make sure we have enough space in the CL for the primitive counts packet · b9a07eed
      Iago Toral authored
      Fixes: 0f2d1dfe ("v3d: use the GPU to record primitives written to transform feedback")
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      b9a07eed
    • Iago Toral's avatar
      b69f51a5
  2. 12 Sep, 2019 2 commits
  3. 30 Aug, 2019 1 commit
  4. 13 Aug, 2019 3 commits
    • Iago Toral's avatar
      v3d: do not automatically flush current job for SSBOs and shader images · b594796f
      Iago Toral authored
      If the current job has a sequence of draw calls involving SSBOs and/or
      shader images, we would flush the job in between each draw call.
      With this change, we won't flush the current job and we rely on the
      application inserting correct barriers by issuing glMemoryBarrier()
      when needed.
      
      v2 (Eric):
       - When mapping a buffer for writing, we always need to flush.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      b594796f
    • Iago Toral's avatar
      v3d: only process glMemoryBarrier() for SSBOs and images · f1cf1153
      Iago Toral authored
      PIPE_BARRIER_UPDATE is defined as:
      PIPE_BARRIER_UPDATE_BUFFER | PIPE_BARRIER_UPDATE_TEXTURE
      
      Which means we were flushing for any flags other than these two, but
      this was intended to only flush for ssbos and images.
      
      Actually, the driver automatically flushes jobs as we need, including
      writes/reads involving SSBOs and images, so we don't really need to
      flush anything when the program emits a barrier. However, this may
      lead to excessive flushing in some cases, so we will soon change this
      to avoid atutomatic flushing of the current job for SSBOs and images,
      meaning that we will rely on the application to emit correct memory
      barriers for these that we should make sure to process here.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      f1cf1153
    • Iago Toral's avatar
      v3d: fix flushing of SSBOs and shader images · f1559ca9
      Iago Toral authored
      If the current draw call includes SSBOs, then we must flush any jobs
      that are writing to the same SSBOs (so that our SSBOs reads are correct),
      as well as jobs reading from the same SSBO (so that our SSBO writes don't
      stomp previous SSBO reads).
      
      The exact same logic applies to shader images. In this case we were already
      flushing previous writes, but we should also flush previous reads.
      
      Note that We don't need to call v3d_flush_jobs_reading_resource() and
      v3d_flush_jobs_writing_resource() separately though, since flushing
      jobs that read a resource also flushes those writing to it.
      Suggested-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      f1559ca9
  5. 08 Aug, 2019 4 commits
    • Iago Toral's avatar
    • Iago Toral's avatar
      v3d: use the GPU to record primitives written to transform feedback · 0f2d1dfe
      Iago Toral authored
      We can use the PRIMITIVE_COUNTS_FEEDBACK packet to write various primitive
      counts to a buffer, including the number of primives written to transform
      feedback buffers, which will handle buffer overflow correctly.
      
      There are a couple of caveats with this:
      
      Primitive counters are reset when we emit a 'Tile Binning Mode Configuration'
      packet, which can happen in the middle of a primitives query, so we need to
      read the buffer when we submit a job and accumulate the counts in the context
      so we don't lose them.
      
      We also need to do the same when we switch primitive type during transform
      feedback so we can compute the correct number of recorded vertices from
      the number of primitives. This is necessary so we can provide an accurate
      vertex count for draw from transform feedback.
      
      v2:
       - When computing the number of vertices for a primitive, pass in the base
         primitive, since that is what the hardware will count.
       - No need to update primitive counts when switching primitive types if
         the base primitives are the same.
       - Log perf warning when mapping the primitive counts BO for readback (Eric).
       - Only emit the primitive counts packet once at job end (Eric).
       - Use u_upload mechanism for the primitive counts buffer (Eric).
       - Use the XML to generate indices into the primitive counters buffer (Eric).
      
      Fixes piglit tests:
      spec/ext_transform_feedback/overflow-edge-cases
      spec/ext_transform_feedback/query-primitives_written-bufferrange
      spec/ext_transform_feedback/query-primitives_written-bufferrange-discard
      spec/ext_transform_feedback/change-size base-shrink
      spec/ext_transform_feedback/change-size base-grow
      spec/ext_transform_feedback/change-size offset-shrink
      spec/ext_transform_feedback/change-size offset-grow
      spec/ext_transform_feedback/change-size range-shrink
      spec/ext_transform_feedback/change-size range-grow
      spec/ext_transform_feedback/intervening-read prims-written
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      0f2d1dfe
    • Iago Toral's avatar
      9eb8699e
    • Iago Toral's avatar
      v3d: generate packet unpack functions · 9b316ab5
      Iago Toral authored
      These were not being compiled because of the lack of __gen_unpack_address.
      
      v2:
       - Shift raw address correctly (Eric).
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      9b316ab5
  6. 01 Aug, 2019 1 commit
  7. 31 Jul, 2019 2 commits
  8. 30 Jul, 2019 1 commit
    • Alejandro Piñeiro's avatar
      v3d: take into account separate_stencil when checking if stencil should be cleared · cda4c628
      Alejandro Piñeiro authored
      In most cases this is not needed because the usual is that when a
      separate stencil is written, the parent resource is also written.
      
      This is needed if we have a separate stencil, no depth buffer, and the
      source and destination is the same, as in that case the stencil can be
      updated, but not the parent source (like if you are blitting only the
      stencil buffer). On that situation, the following access to the
      stencil buffer would clear the stencil buffer (so overwritting the
      previous blitting) cleared because the parent source has
      v3d_resource.writes to 0.
      
      As far as I see, that situation only happens with the
      GL_DEPTH32F_STENCIL8 format.
      
      Note that one alternative would consider that if the separate_stencil
      has been written, the parent should also be considered written (and
      update its "writes" field accordingly). But I found this patch more
      natural.
      
      Fixes the following piglit tests:
         spec/arb_depth_buffer_float/fbo-stencil-gl_depth32f_stencil8-blit
         spec/arb_depth_buffer_float/fbo-stencil-gl_depth32f_stencil8-copypixels
      
      the latter regressed when internally glCopyPixels implementation
      started to use blitting. So:
      
      Fixes: 131d40cf ("st/mesa: accelerate glCopyPixels(STENCIL)")
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      cda4c628
  9. 26 Jul, 2019 3 commits
  10. 23 Jul, 2019 2 commits
  11. 22 Jul, 2019 1 commit
    • Iago Toral's avatar
      v3d: fill logicop_func in the fragment shader key when precompiling shaders · dacaf7ec
      Iago Toral authored
      Since logicop_func 0 is PIPE_LOGIOP_CLEAR, we were trigger lowerinng
      of logic ops on precompiled shaders, which we don't want to do. Also, this
      had the side effect of making shader-db crash, as during this lowering we
      would try to read the color format swizzle information from the fragment shader
      key that we don't populate in precompiled shaders because right now we only
      need it when logic operations are enabled.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      dacaf7ec
  12. 17 Jul, 2019 1 commit
  13. 16 Jul, 2019 1 commit
    • Iago Toral's avatar
      v3d: flag dirty state when binding new sampler states · 556c2994
      Iago Toral authored
      We emit code to saturate texture coordinates when using clamp wrapping
      mode so if we don't flag the dirty state here we don't get to recompile
      the shaders when the wrapping mode changes.
      
      v2:
        - Do the same when setting sampler views (Eric)
        - Use a switch statement instead of an if ladder.
        - Swap the shader stage assertion with an unreachable.
      
      Fixes:
      spec/!opengl 1.1/texwrap 1d bordercolor/gl_rgba8, border color only
      spec/!opengl 1.1/texwrap 1d proj bordercolor/gl_rgba8, projected, border color only
      spec/!opengl 1.1/texwrap 2d bordercolor/gl_rgba8, border color only
      spec/!opengl 1.1/texwrap 2d proj bordercolor/gl_rgba8, projected, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_alpha12, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_alpha16, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_alpha4, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_alpha8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_intensity8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_luminance4_alpha4, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_luminance6_alpha2, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_luminance8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_luminance8_alpha8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_r3_g3_b2, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb10, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb10_a2, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb4, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb5, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb5_a1, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgb8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgba4, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor-swizzled/gl_rgba8, swizzled, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_alpha12, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_alpha16, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_alpha4, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_alpha8, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_intensity8, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_luminance4_alpha4, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_luminance6_alpha2, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_luminance8, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_luminance8_alpha8, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_r3_g3_b2, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb10, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb10_a2, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb4, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb5, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb5_a1, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgb8, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgba4, border color only
      spec/!opengl 1.1/texwrap formats bordercolor/gl_rgba8, border color only
      spec/!opengl 1.2/texwrap 3d bordercolor/gl_rgba8, border color only
      spec/!opengl 1.2/texwrap 3d proj bordercolor/gl_rgba8, projected, border color only
      spec/arb_es2_compatibility/texwrap formats bordercolor-swizzled/gl_rgb565, swizzled, border color only
      spec/arb_es2_compatibility/texwrap formats bordercolor/gl_rgb565, border color only
      spec/arb_texture_compression/texwrap formats bordercolor-swizzled/gl_compressed_alpha, swizzled, border color only
      spec/arb_texture_compression/texwrap formats bordercolor-swizzled/gl_compressed_luminance_alpha, swizzled, border color only
      spec/arb_texture_compression/texwrap formats bordercolor-swizzled/gl_compressed_rgb, swizzled, border color only
      spec/arb_texture_compression/texwrap formats bordercolor/gl_compressed_alpha, border color only
      spec/arb_texture_compression/texwrap formats bordercolor/gl_compressed_luminance_alpha, border color only
      spec/arb_texture_compression/texwrap formats bordercolor/gl_compressed_rgb, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_alpha16f_arb, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_intensity16f_arb, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_luminance16f_arb, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_luminance_alpha16f_arb, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_rgb16f, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor-swizzled/gl_rgba16f, swizzled, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_alpha16f_arb, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_intensity16f_arb, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_luminance16f_arb, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_luminance_alpha16f_arb, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_rgb16f, border color only
      spec/arb_texture_float/texwrap formats bordercolor/gl_rgba16f, border color only
      spec/arb_texture_rectangle/texwrap rect bordercolor/gl_rgba8, border color only
      spec/arb_texture_rectangle/texwrap rect proj bordercolor/gl_rgba8, projected, border color only
      spec/arb_texture_rg/texwrap formats bordercolor-swizzled/gl_r8, swizzled, border color only
      spec/arb_texture_rg/texwrap formats bordercolor-swizzled/gl_rg8, swizzled, border color only
      spec/arb_texture_rg/texwrap formats bordercolor/gl_r8, border color only
      spec/arb_texture_rg/texwrap formats bordercolor/gl_rg8, border color only
      spec/arb_texture_rg/texwrap formats-float bordercolor-swizzled/gl_r16f, swizzled, border color only
      spec/arb_texture_rg/texwrap formats-float bordercolor-swizzled/gl_rg16f, swizzled, border color only
      spec/arb_texture_rg/texwrap formats-float bordercolor/gl_r16f, border color only
      spec/arb_texture_rg/texwrap formats-float bordercolor/gl_rg16f, border color only
      spec/ext_packed_float/texwrap formats bordercolor-swizzled/gl_r11f_g11f_b10f, swizzled, border color only
      spec/ext_packed_float/texwrap formats bordercolor/gl_r11f_g11f_b10f, border color only
      spec/ext_texture_shared_exponent/texwrap formats bordercolor-swizzled/gl_rgb9_e5, swizzled, border color only
      spec/ext_texture_shared_exponent/texwrap formats bordercolor/gl_rgb9_e5, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_alpha8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_intensity8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_luminance8_alpha8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_luminance8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_r8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_rg8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_rgb8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor-swizzled/gl_rgba8_snorm, swizzled, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_alpha8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_intensity8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_luminance8_alpha8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_luminance8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_r8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_rg8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_rgb8_snorm, border color only
      spec/ext_texture_snorm/texwrap formats bordercolor/gl_rgba8_snorm, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor-swizzled/gl_sluminance8, swizzled, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor-swizzled/gl_sluminance8_alpha8, swizzled, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor-swizzled/gl_srgb8, swizzled, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor-swizzled/gl_srgb8_alpha8, swizzled, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor/gl_sluminance8, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor/gl_sluminance8_alpha8, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor/gl_srgb8, border color only
      spec/ext_texture_srgb/texwrap formats bordercolor/gl_srgb8_alpha8, border color only
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      556c2994
  14. 12 Jul, 2019 2 commits
    • Iago Toral's avatar
      v3d: acquire scoreboard lock before first tlb read · 7c1d7089
      Iago Toral authored
      Until now we have always been emitting our scoreboard locks on the last thread
      switch to improve parallelism. We did this by emitting our last thread switch
      right before our tlb writes at the very end of the program, where we know that
      we are outside control flow.
      
      Unfortunately, this strategy is not valid when we have tlb color reads too, as
      these will happen before this point in the program and can happen inside
      control flow.
      
      To fix this we always emit a thread switch before the first tlb load and if we
      see additional thread switches after that point, we change the strategy to lock
      on the first thread switch.
      
      v2: change the solution so it is expected to work in more scenarios (Eric).
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      7c1d7089
    • Iago Toral's avatar
      v3d: add color formats and swizzles to the fragment shader key · 0279ac6e
      Iago Toral authored
      We are going to need these very soon to emit correct reads from the tlb
      to implement logic operations.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      0279ac6e
  15. 10 Jul, 2019 1 commit
    • Erik Faye-Lund 's avatar
      gallium: get rid of PIPE_CAP_SM3 · 39e7fbf2
      Erik Faye-Lund authored
      PIPE_CAP_SM3 has always been an odd one out of all our caps. While most
      other caps are fine-grained and single-purpose, this cap encode several
      features in one. And since OpenGL cares more about single features, it'd
      be nice to get rid of this one.
      
      As it turns, this is now relatively simple. We only really care about
      three features using this cap, and those already got their own caps. So
      we can remove it, and make sure all current drivers just give the same
      response to all of them.
      
      The only place we *really* care about SM3 is in nine, and there we can
      instead just re-construct the information based on the finer-grained
      caps. This avoids DX9 semantics from needlessly leaking into all of the
      drivers, most of who doesn't care a whole lot about DX9 specifically.
      Signed-off-by: Erik Faye-Lund 's avatarErik Faye-Lund <erik.faye-lund@collabora.com>
      Reviewed-by: 's avatarMarek Olšák <marek.olsak@amd.com>
      Acked-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
      39e7fbf2
  16. 09 Jul, 2019 1 commit
    • Alejandro Piñeiro's avatar
      v3d: Early return with handle 0 when getting a bo on the simulator · 71446bf8
      Alejandro Piñeiro authored
      Until now we were just asking entries on the bo hash table, and don't
      worry if the handle was NULL, as we were just expecting to get a NULL
      in return. It seems that now the hash table assert with some reserverd
      pointers, included NULL. This commit just early returns with handle 0.
      
      This change fixes several crashes on vk-gl-cts GLES tests when using
      the v3d simulator, like:
      KHR-GLES3.core.internalformat.copy_tex_image.*
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      71446bf8
  17. 02 Jul, 2019 3 commits
    • Iago Toral's avatar
      v3d: do not flush jobs that are synced with 'Wait for transform feedback' · 042aeffd
      Iago Toral authored
      Generally, we achieve this by skipping the flush on calls to
      v3d_flush_jobs_writing_resource() when we detect that the resource is written
      in the current job from a transform feedback write.
      
      The exception to this is the case where the caller is about to map the
      resource, in which case we need to flush immediately since we can only emit
      'Wait for transform feedback' commands on rendering jobs. We add a parameter
      to the function so the caller can identify that scenario.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      042aeffd
    • Iago Toral's avatar
      v3d: emit 'Wait for transform feedback' commands when needed · 88cbc4f7
      Iago Toral authored
      The hardware can flush transform feedback writes before reads in the same
      job by inserting this command.
      
      This patch detects when the rendering state for the current draw call reads
      resources that had been previously written by transform feedback in the
      same job and inserts the 'Wait for transform feedback' command before
      emitting the new draw.
      
      v2 (Eric):
        - this was intended to look at job->tf_write_prscs for TF jobs.
        - clear job->tf_write_prscs after we emit the TF flush.
        - can skip flushes for fragment shader reads from TF.
      
      v3 (Eric):
        - all resources in job->tf_write_prscs are resources written by TF so
         we don't need to check if they are bound to PIPE_BIND_STREAM_OUTPUT.
        - documented optimization opportunity for geometry stages.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      88cbc4f7
    • Iago Toral's avatar
      v3d: keep track of resources written by transform feedback · c7dff0e6
      Iago Toral authored
      The hardware provides a feature to sync reads from previous transform feedback
      writes in the same job so if we use this mechanism we no longer have to flush
      the job.
      
      In order to identify this scenario we need a mechanism to identify resources
      that are written by transform feedback.
      
      v2: use _mesa_pointer_set_create (Eric)
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      c7dff0e6
  18. 21 Jun, 2019 3 commits
  19. 18 Jun, 2019 2 commits
  20. 07 Jun, 2019 1 commit
  21. 13 May, 2019 1 commit