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 <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 6 years ago
parent 476094e832
commit 8e2be176e5
  1. 1
      src/vrend_renderer.c
  2. 5
      src/vrend_shader.c
  3. 2
      src/vrend_shader.h

@ -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.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_arrays_of_arrays = has_feature(feat_arrays_of_arrays);
grctx->shader_cfg.has_gpu_shader5 = has_feature(feat_gpu_shader5); 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_create_sub_ctx(grctx, 0);
vrend_renderer_set_sub_ctx(grctx, 0); vrend_renderer_set_sub_ctx(grctx, 0);

@ -70,6 +70,7 @@
#define SHADER_REQ_SEPERATE_SHADER_OBJECTS (1 << 25) #define SHADER_REQ_SEPERATE_SHADER_OBJECTS (1 << 25)
#define SHADER_REQ_ARRAYS_OF_ARRAYS (1 << 26) #define SHADER_REQ_ARRAYS_OF_ARRAYS (1 << 26)
#define SHADER_REQ_SHADER_INTEGER_FUNC (1 << 27) #define SHADER_REQ_SHADER_INTEGER_FUNC (1 << 27)
#define SHADER_REQ_SHADER_ATOMIC_FLOAT (1 << 28)
struct vrend_shader_io { struct vrend_shader_io {
unsigned name; unsigned name;
@ -264,6 +265,7 @@ static const struct vrend_shader_table shader_req_table[] = {
{ SHADER_REQ_FBFETCH, "EXT_shader_framebuffer_fetch" }, { SHADER_REQ_FBFETCH, "EXT_shader_framebuffer_fetch" },
{ SHADER_REQ_SHADER_CLOCK, "ARB_shader_clock" }, { SHADER_REQ_SHADER_CLOCK, "ARB_shader_clock" },
{ SHADER_REQ_SHADER_INTEGER_FUNC, "MESA_shader_integer_functions" }, { SHADER_REQ_SHADER_INTEGER_FUNC, "MESA_shader_integer_functions" },
{ SHADER_REQ_SHADER_ATOMIC_FLOAT, "NV_shader_atomic_float"},
}; };
enum vrend_type_qualifier { enum vrend_type_qualifier {
@ -2850,7 +2852,10 @@ translate_atomic(struct dump_ctx *ctx,
stypecast = INT; stypecast = INT;
break; break;
case TGSI_RETURN_TYPE_FLOAT: case TGSI_RETURN_TYPE_FLOAT:
if (ctx->cfg->has_es31_compat)
ctx->shader_req_bits |= SHADER_REQ_ES31_COMPAT; ctx->shader_req_bits |= SHADER_REQ_ES31_COMPAT;
else
ctx->shader_req_bits |= SHADER_REQ_SHADER_ATOMIC_FLOAT;
stypecast = FLOAT; stypecast = FLOAT;
break; break;
} }

@ -127,6 +127,7 @@ struct vrend_shader_cfg {
bool use_explicit_locations; bool use_explicit_locations;
bool has_arrays_of_arrays; bool has_arrays_of_arrays;
bool has_gpu_shader5; bool has_gpu_shader5;
bool has_es31_compat;
}; };
struct vrend_context; struct vrend_context;
@ -135,6 +136,7 @@ struct vrend_context;
#define SHADER_STRING_VER_EXT 0 #define SHADER_STRING_VER_EXT 0
#define SHADER_STRING_HDR 1 #define SHADER_STRING_HDR 1
bool vrend_patch_vertex_shader_interpolants(struct vrend_context *rctx, bool vrend_patch_vertex_shader_interpolants(struct vrend_context *rctx,
struct vrend_shader_cfg *cfg, struct vrend_shader_cfg *cfg,
struct vrend_strarray *shader, struct vrend_strarray *shader,

Loading…
Cancel
Save