v3d/compiler: num_tex_used on v3d_key

We would need on OpenGL to update values for all the textures used. On
OpenGL that value can be always took from the context or the nir
shader, but there are cases on Vulkan that it is not the case, or
would force up to recompute it.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Alejandro Piñeiro
2019-12-16 12:11:37 +01:00
committed by Marge Bot
parent 3f00638cff
commit 62ca997476
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -343,6 +343,7 @@ struct v3d_key {
bool clamp_t:1;
bool clamp_r:1;
} tex[V3D_MAX_TEXTURE_SAMPLERS];
uint8_t num_tex_used;
uint8_t ucp_enables;
bool is_last_geometry_stage;
};
+2
View File
@@ -445,6 +445,7 @@ v3d_setup_shared_key(struct v3d_context *v3d, struct v3d_key *key,
{
const struct v3d_device_info *devinfo = &v3d->screen->devinfo;
key->num_tex_used = texstate->num_textures;
for (int i = 0; i < texstate->num_textures; i++) {
struct pipe_sampler_view *sampler = texstate->textures[i];
struct v3d_sampler_view *v3d_sampler = v3d_sampler_view(sampler);
@@ -504,6 +505,7 @@ v3d_setup_shared_precompile_key(struct v3d_uncompiled_shader *uncompiled,
{
nir_shader *s = uncompiled->base.ir.nir;
key->num_tex_used = s->info.num_textures;
for (int i = 0; i < s->info.num_textures; i++) {
key->tex[i].return_size = 16;
key->tex[i].return_channels = 2;