Commit 62ca9974 authored by Alejandro Piñeiro's avatar Alejandro Piñeiro Committed by Marge Bot

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's avatarEric Anholt <eric@anholt.net>
Part-of: <!6766>
parent 3f00638c
......@@ -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;
};
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment