From 8e2be176e5e548df845d8bf151ac348fc8174b6f Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 19 Mar 2019 15:16:22 +0100 Subject: [PATCH] vrend: Fall back to NV_shader_atomic_float if ARB_GLES3_1_compatibility is missing Softpipe doesn't support ARB_GLES3_1_compatibility but can support NV_shader_atomic_float and this is needed for some dEQP-GLES31 tests to be run on a softpipe GL host. Signed-off-by: Gert Wollny Reviewed-by: Gurchetan Singh --- src/vrend_renderer.c | 1 + src/vrend_shader.c | 7 ++++++- src/vrend_shader.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index e1c97fe..16763b2 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -5650,6 +5650,7 @@ struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *de grctx->shader_cfg.max_draw_buffers = vrend_state.max_draw_buffers; grctx->shader_cfg.has_arrays_of_arrays = has_feature(feat_arrays_of_arrays); grctx->shader_cfg.has_gpu_shader5 = has_feature(feat_gpu_shader5); + grctx->shader_cfg.has_es31_compat = has_feature(feat_gles31_compatibility); vrend_renderer_create_sub_ctx(grctx, 0); vrend_renderer_set_sub_ctx(grctx, 0); diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 1698172..707e434 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -70,6 +70,7 @@ #define SHADER_REQ_SEPERATE_SHADER_OBJECTS (1 << 25) #define SHADER_REQ_ARRAYS_OF_ARRAYS (1 << 26) #define SHADER_REQ_SHADER_INTEGER_FUNC (1 << 27) +#define SHADER_REQ_SHADER_ATOMIC_FLOAT (1 << 28) struct vrend_shader_io { unsigned name; @@ -264,6 +265,7 @@ static const struct vrend_shader_table shader_req_table[] = { { SHADER_REQ_FBFETCH, "EXT_shader_framebuffer_fetch" }, { SHADER_REQ_SHADER_CLOCK, "ARB_shader_clock" }, { SHADER_REQ_SHADER_INTEGER_FUNC, "MESA_shader_integer_functions" }, + { SHADER_REQ_SHADER_ATOMIC_FLOAT, "NV_shader_atomic_float"}, }; enum vrend_type_qualifier { @@ -2850,7 +2852,10 @@ translate_atomic(struct dump_ctx *ctx, stypecast = INT; break; case TGSI_RETURN_TYPE_FLOAT: - ctx->shader_req_bits |= SHADER_REQ_ES31_COMPAT; + if (ctx->cfg->has_es31_compat) + ctx->shader_req_bits |= SHADER_REQ_ES31_COMPAT; + else + ctx->shader_req_bits |= SHADER_REQ_SHADER_ATOMIC_FLOAT; stypecast = FLOAT; break; } diff --git a/src/vrend_shader.h b/src/vrend_shader.h index 95f320a..f286498 100644 --- a/src/vrend_shader.h +++ b/src/vrend_shader.h @@ -127,6 +127,7 @@ struct vrend_shader_cfg { bool use_explicit_locations; bool has_arrays_of_arrays; bool has_gpu_shader5; + bool has_es31_compat; }; struct vrend_context; @@ -135,6 +136,7 @@ struct vrend_context; #define SHADER_STRING_VER_EXT 0 #define SHADER_STRING_HDR 1 + bool vrend_patch_vertex_shader_interpolants(struct vrend_context *rctx, struct vrend_shader_cfg *cfg, struct vrend_strarray *shader,