diff options
author | Gert Wollny <[email protected]> | 2019-01-15 10:32:17 +0100 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2019-04-10 11:09:40 +0200 |
commit | 04e672257c770412dd04011929662ee969e24106 (patch) | |
tree | f5cbba8a9dd50df82c594584adb8787af939e243 /src/gallium/drivers/virgl | |
parent | 872519c663ca813b87c8e2cd1c2ee90eb086e17c (diff) |
virgl: Enable passing arrays as input to fragment shaders
This is needed to properly handle interpolateAt* when the input to be
interpolated is passed as array in the original GLSL.
Currently, the the GLSL compiler would lower selecting the correct input so
that the interpolant parameter to interpolateAt* is a temporary, and this
can not be used to create a valid shader on the host side, because here the
parameter must a shader input.
By allowing the passing the created TGSI allows to create proper GLSL.
This is related to the virglrenderer bug
https://gitlab.freedesktop.org/virgl/virglrenderer/issues/74
v2: Squash the two patches handling these flags into another
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_hw.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/virgl/virgl_screen.c | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h index 8a56e1d53a8..949a1f545e7 100644 --- a/src/gallium/drivers/virgl/virgl_hw.h +++ b/src/gallium/drivers/virgl/virgl_hw.h @@ -241,6 +241,8 @@ enum virgl_formats { #define VIRGL_CAP_MULTI_DRAW_INDIRECT (1 << 21) #define VIRGL_CAP_INDIRECT_PARAMS (1 << 22) #define VIRGL_CAP_TRANSFORM_FEEDBACK3 (1 << 23) +#define VIRGL_CAP_INDIRECT_INPUT_ADDR (1 << 25) + /* virgl bind flags - these are compatible with mesa 10.5 gallium. * but are fixed, no other should be passed to virgl either. diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 2e2af36f587..66fadddc262 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -357,6 +357,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param) return vscreen->vws->supports_fences; case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL: return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_SRGB_WRITE_CONTROL; + case PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS: + return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_INDIRECT_INPUT_ADDR; default: return u_pipe_screen_get_param_defaults(screen, param); } @@ -395,6 +397,9 @@ virgl_get_shader_param(struct pipe_screen *screen, case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR: case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR: return 1; + case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: + case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR: + return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_INDIRECT_INPUT_ADDR; case PIPE_SHADER_CAP_MAX_INPUTS: if (vscreen->caps.caps.v1.glsl_level < 150) return vscreen->caps.caps.v2.max_vertex_attribs; |