broadcom/compiler: separate texture/sampler info from v3d_key

So far the v3d compiler has them combined, as for OpenGL both are the
same. This change is intended to fit the v3d compiler better with
Vulkan, where they are separate concepts.

Note that NIR has them separate for a long time, both on nir_variable
and on some NIR lowerings.

v2: (from Iago feedback)
    * Use key->num_tex/sampler_used to iterate through the array
    * Fill up num_samplers_used on v3d, assert that is the same that
      num_tex_used if possible.

v3: (Iago)
    * Assert num_tex/samplers_used is smaller that tex/sampler array size.

v4: Update assert mentioned on v3 to use <= instead of < (detected by CI)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>

squash! broadcom/compiler: separate texture/sampler info from v3d_key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
This commit is contained in:
Alejandro Piñeiro
2020-11-10 22:05:10 +01:00
committed by Marge Bot
parent 1fe52af61a
commit 429c336412
5 changed files with 40 additions and 22 deletions

View File

@@ -344,13 +344,17 @@ struct v3d_key {
void *shader_state;
struct {
uint8_t swizzle[4];
uint8_t return_size;
uint8_t return_channels;
bool clamp_s:1;
bool clamp_t:1;
bool clamp_r:1;
} tex[V3D_MAX_TEXTURE_SAMPLERS];
struct {
uint8_t return_size;
uint8_t return_channels;
} sampler[V3D_MAX_TEXTURE_SAMPLERS];
uint8_t num_tex_used;
uint8_t num_samplers_used;
uint8_t ucp_enables;
bool is_last_geometry_stage;
bool robust_buffer_access;