[virglrenderer-devel] [PATCH 2/2] vrend_shader: use emit_sampler_declaration helper

Gurchetan Singh gurchetansingh at chromium.org
Thu Jul 12 01:17:35 UTC 2018


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
---
 src/vrend_shader.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index ac9b72f3bc..1072875f75 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -3855,16 +3855,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);
-- 
2.18.0.203.gfac676dfb9-goog



More information about the virglrenderer-devel mailing list