vrend_shader: use emit_sampler_declaration helper

Fixes a bunch of non-compute related dEQP-GLES31.functional.shaders.opaque_type_indexing.*
tests.

Example test cases:
   dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.vertex.sampler2dshadow
   dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.tessellation_control.samplercubearrayshadow
   dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.tessellation_evaluation.samplercubearrayshadow
   dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.sampler2dshadow

Reviewed-by: Dave Airlie <airlied@redhat.com>
macos/master
Gurchetan Singh 6 years ago committed by Dave Airlie
parent 327207986e
commit 0fb73b11e4
  1. 15
      src/vrend_shader.c

@ -3856,16 +3856,11 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
if (ctx->info.indirect_files & (1 << TGSI_FILE_SAMPLER)) {
for (i = 0; i < ctx->num_sampler_arrays; i++) {
int is_shad = 0;
const char *stc;
stc = vrend_shader_samplertypeconv(ctx->sampler_arrays[i].sview_type, &is_shad);
if (!stc)
continue;
snprintf(buf, 255, "uniform %csampler%s %ssamp%d[%d];\n",
get_return_type_prefix(ctx->sampler_arrays[i].sview_rtype),
stc, sname, ctx->sampler_arrays[i].idx,
ctx->sampler_arrays[i].last - ctx->sampler_arrays[i].first);
STRCAT_WITH_RET(glsl_hdr, buf);
uint32_t range = ctx->sampler_arrays[i].last - ctx->sampler_arrays[i].first;
glsl_hdr = emit_sampler_decl(ctx, glsl_hdr, i, range, ctx->sampler_arrays[i].sview_rtype,
ctx->sampler_arrays[i].sview_type);
if (!glsl_hdr)
return NULL;
}
} else {
nsamp = util_last_bit(ctx->samplers_used);

Loading…
Cancel
Save