diff options
author | Neil Roberts <[email protected]> | 2018-03-01 17:51:58 +0100 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2018-06-21 14:25:05 +0200 |
commit | 386f09be9b7984d99d7106b2ec10ba25d5cf2673 (patch) | |
tree | f56055e56985211b8a8b4a0598732948e438e729 /src/intel | |
parent | 23edc5b1ef36226a84a4e0bf325d05d3dbdff350 (diff) |
spirv: Get rid of vtn_variable_mode_image/sampler
vtn_variable_mode_image and _sampler are instead replaced with
vtn_variable_mode_uniform which encompasses both of them. In the few
places where it was neccessary to distinguish between the two, the
GLSL type of the pointer is used instead.
The main reason to do this is that on OpenGL it is permitted to put
images and samplers into structs and declare a uniform with them. That
means that variables can now have a mix of uniform, sampler and image
modes so picking a single one of those modes for a variable no longer
makes sense.
This fixes OpLoad on a sampler within a struct which was previously
using the variable mode to determine whether it was a sampler or not.
The type of the variable is a struct so it was not being considered to
be uniform mode even though the member being loaded should be sampler
mode.
The previous code appeared to be using var->interface_type as a place
to store the type of the variable without the enclosing array for
images and samplers. I guess this worked because opaque types can not
appear in interfaces so the interface_type is sort of unused. This
patch removes the overloading of var->interface_type and any places
that needed the type without the array can now just deduce it from
var->type.
v2: squash in this patch the changes to anv/nir (Timothy)
Signed-off-by: Eduardo Lima <[email protected]>
Signed-off-by: Neil Roberts <[email protected]
Signed-off-by: Alejandro Piñeiro <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c index d5a08f712f1..1147e0c9d96 100644 --- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c +++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c @@ -427,10 +427,12 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline, } nir_foreach_variable(var, &shader->uniforms) { - if (!glsl_type_is_image(var->interface_type)) + const struct glsl_type *glsl_type = glsl_without_array(var->type); + + if (!glsl_type_is_image(glsl_type)) continue; - enum glsl_sampler_dim dim = glsl_get_sampler_dim(var->interface_type); + enum glsl_sampler_dim dim = glsl_get_sampler_dim(glsl_type); const uint32_t set = var->data.descriptor_set; const uint32_t binding = var->data.binding; |