summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_uniforms.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-01-02 11:26:58 -0800
committerEric Anholt <eric@anholt.net>2018-01-03 14:25:23 -0800
commitba965084b60e702b41beaea75237bfa39335b6cb (patch)
treebfeafcc80363bac6f1930209e506398176b81c4f /src/gallium/drivers/vc5/vc5_uniforms.c
parentac4054ca1766b5ab4ee2059e7e0f8590c219730d (diff)
broadcom/vc5: Move texture return channel setup into the compiler.
The compiler decides how many LDTMUs we're going to emit, and that must match the P1 flags. This brings the return channel counting to a single place (so all that's passed into the compiler is "how many return channels you may request from this texture's format), and was a necessary step for shadow samplers once we stop using OVRTMUOUT=0.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_uniforms.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_uniforms.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_uniforms.c b/src/gallium/drivers/vc5/vc5_uniforms.c
index 5e181344e73..676ab1a32c9 100644
--- a/src/gallium/drivers/vc5/vc5_uniforms.c
+++ b/src/gallium/drivers/vc5/vc5_uniforms.c
@@ -193,8 +193,14 @@ static void
write_texture_p1(struct vc5_job *job,
struct vc5_cl_out **uniforms,
struct vc5_texture_stateobj *texstate,
- uint32_t unit)
+ uint32_t data)
{
+ /* Extract the texture unit from the top bits, and the compiler's
+ * packed p1 from the bottom.
+ */
+ uint32_t unit = data >> 5;
+ uint32_t p1 = data & 0x1f;
+
struct pipe_sampler_view *psview = texstate->textures[unit];
struct vc5_sampler_view *sview = vc5_sampler_view(psview);
@@ -207,7 +213,7 @@ write_texture_p1(struct vc5_job *job,
(uint8_t *)&packed,
&unpacked);
- cl_aligned_u32(uniforms, packed | sview->p1);
+ cl_aligned_u32(uniforms, p1 | packed | sview->p1);
}
struct vc5_cl_reloc