summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/vc5
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
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')
-rw-r--r--src/gallium/drivers/vc5/vc5_state.c13
-rw-r--r--src/gallium/drivers/vc5/vc5_uniforms.c10
2 files changed, 8 insertions, 15 deletions
diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c
index d022aa84e4..04ce3075a8 100644
--- a/src/gallium/drivers/vc5/vc5_state.c
+++ b/src/gallium/drivers/vc5/vc5_state.c
@@ -588,19 +588,6 @@ vc5_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
pipe_reference(NULL, &prsc->reference);
- v3dx_pack(&so->p1, TEXTURE_UNIFORM_PARAMETER_1_CFG_MODE1, p1) {
- p1.return_word_0_of_texture_data = true;
- if (vc5_get_tex_return_size(cso->format) == 16) {
- p1.return_word_1_of_texture_data = true;
- } else {
- int chans = vc5_get_tex_return_channels(cso->format);
-
- p1.return_word_1_of_texture_data = chans > 1;
- p1.return_word_2_of_texture_data = chans > 2;
- p1.return_word_3_of_texture_data = chans > 3;
- }
- }
-
/* Compute the sampler view's swizzle up front. This will be plugged
* into either the sampler (for 16-bit returns) or the shader's
* texture key (for 32)
diff --git a/src/gallium/drivers/vc5/vc5_uniforms.c b/src/gallium/drivers/vc5/vc5_uniforms.c
index 5e181344e7..676ab1a32c 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