summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2014-08-01 10:35:20 +0200
committerIago Toral Quiroga <itoral@igalia.com>2014-09-19 15:01:16 +0200
commitc66165ab2b15047792808433b788632a4b9df287 (patch)
treeb3e957415b97e2a37e871ea37ee8726197d0098b /src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
parent2614cde9981ee3609b8e22d84596603a1bd42212 (diff)
downloadexternal_mesa3d-c66165ab2b15047792808433b788632a4b9df287.zip
external_mesa3d-c66165ab2b15047792808433b788632a4b9df287.tar.gz
external_mesa3d-c66165ab2b15047792808433b788632a4b9df287.tar.bz2
i965/gen6/gs: Fix binding table clash between TF surfaces and textures.
For gen6 geometry shaders we use the first BRW_MAX_SOL_BINDINGS entries of the binding table for transform feedback surfaces. However, vec4_visitor will setup the binding table so that textures use the same space in the binding table. This is done when calling assign_common_binding_table_offsets(0) as part if its run() method. To fix this clash we add a virtual method to the vec4_visitor hierarchy to assign the binding table offsets, so that we can change this behavior specifically for gen6 geometry shaders by mapping textures right after the first BRW_MAX_SOL_BINDINGS entries. Also, when there is no user-provided geometry shader, we only need to upload the binding table if we have transform feedback, however, in the case of a user-provided geometry shader, we can't only look into transform feedback to make that decision. This fixes multiple piglit tests for textureSize() and texelFetch() when these functions are called from a geometry shader in gen6, like these: bin/textureSize gs sampler2D -fbo -auto bin/texelFetch gs usampler2D -fbo -auto Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
index 704a02f..d16cc6e 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
@@ -36,6 +36,15 @@ const unsigned MAX_GS_INPUT_VERTICES = 6;
namespace brw {
void
+gen6_gs_visitor::assign_binding_table_offsets()
+{
+ /* In gen6 we reserve the first BRW_MAX_SOL_BINDINGS entries for transform
+ * feedback surfaces.
+ */
+ assign_common_binding_table_offsets(BRW_MAX_SOL_BINDINGS);
+}
+
+void
gen6_gs_visitor::emit_prolog()
{
vec4_gs_visitor::emit_prolog();