diff options
author | Eric Anholt <[email protected]> | 2018-02-05 12:58:06 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-02-05 13:56:02 +0000 |
commit | aa2f609f7009199999f824970f9c13f016994364 (patch) | |
tree | a4fcf946f1448fde854ff8dea7f8ad39a3ef6c02 /src/gallium/drivers/vc5/vc5_program.c | |
parent | 63a8a0f3c017d018220966422deffcb46bf2e373 (diff) |
broadcom/vc5: Ignore samplers for finding uniform offsets.
Fixes:
KHR-GLES3.shaders.struct.uniform.sampler_array_fragment
KHR-GLES3.shaders.struct.uniform.sampler_array_vertex
KHR-GLES3.shaders.struct.uniform.sampler_nested_fragment
KHR-GLES3.shaders.struct.uniform.sampler_nested_vertex
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_program.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_program.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c index 881bd4501d8..eb5b6105455 100644 --- a/src/gallium/drivers/vc5/vc5_program.c +++ b/src/gallium/drivers/vc5/vc5_program.c @@ -35,6 +35,7 @@ #include "compiler/v3d_compiler.h" #include "vc5_context.h" #include "broadcom/cle/v3d_packet_v33_pack.h" +#include "mesa/state_tracker/st_glsl_types.h" static gl_varying_slot vc5_get_slot_for_driver_location(nir_shader *s, uint32_t driver_location) @@ -128,6 +129,12 @@ type_size(const struct glsl_type *type) return glsl_count_attribute_slots(type, false); } +static int +uniforms_type_size(const struct glsl_type *type) +{ + return st_glsl_storage_type_size(type, false); +} + static void * vc5_shader_state_create(struct pipe_context *pctx, const struct pipe_shader_state *cso) @@ -147,7 +154,11 @@ vc5_shader_state_create(struct pipe_context *pctx, */ s = cso->ir.nir; - NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, + NIR_PASS_V(s, nir_lower_io, nir_var_all & ~nir_var_uniform, + type_size, + (nir_lower_io_options)0); + NIR_PASS_V(s, nir_lower_io, nir_var_uniform, + uniforms_type_size, (nir_lower_io_options)0); } else { assert(cso->type == PIPE_SHADER_IR_TGSI); |