etnaviv: tell the truth if alpha-test is supported
GPUs with the feature bit PE_NO_ALPHA_TEST set have no fixed-function alpha test unit and we want to let st lower it with a shader variant. For GC7000K this fixes all fbo-alphatest-formats piglits like: spec@ext_framebuffer_object@fbo-alphatest-formats spec@ext_packed_float@fbo-alphatest-formats spec@ext_texture_srgb@fbo-alphatest-formats This only works with the NIR compiler backend. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Tested-by: Lukas F. Hartmann <lukas@mntmn.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9871>
This commit is contained in:
parent
d1f96e0c72
commit
663272c4da
|
@ -58,6 +58,7 @@ enum etna_param_id {
|
|||
ETNA_GPU_FEATURES_5 = 0x8,
|
||||
ETNA_GPU_FEATURES_6 = 0x9,
|
||||
ETNA_GPU_FEATURES_7 = 0xa,
|
||||
ETNA_GPU_FEATURES_8 = 0xb,
|
||||
|
||||
ETNA_GPU_STREAM_COUNT = 0x10,
|
||||
ETNA_GPU_REGISTER_MAX = 0x11,
|
||||
|
|
|
@ -115,6 +115,9 @@ int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param,
|
|||
case ETNA_GPU_FEATURES_7:
|
||||
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_7);
|
||||
return 0;
|
||||
case ETNA_GPU_FEATURES_8:
|
||||
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_8);
|
||||
return 0;
|
||||
case ETNA_GPU_STREAM_COUNT:
|
||||
*value = get_param(dev, core, ETNA_GPU_STREAM_COUNT);
|
||||
return 0;
|
||||
|
|
|
@ -180,6 +180,12 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX:
|
||||
return VIV_FEATURE(screen, chipMinorFeatures1, HALTI0);
|
||||
|
||||
case PIPE_CAP_ALPHA_TEST:
|
||||
if (DBG_ENABLED(ETNA_DBG_NIR))
|
||||
return !VIV_FEATURE(screen, chipMinorFeatures7, PE_NO_ALPHA_TEST);
|
||||
else
|
||||
return 1;
|
||||
|
||||
/* Unsupported features. */
|
||||
case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
|
||||
case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
|
||||
|
@ -1033,6 +1039,12 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
|
|||
}
|
||||
screen->features[7] = val;
|
||||
|
||||
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_8, &val)) {
|
||||
DBG("could not get ETNA_GPU_FEATURES_8");
|
||||
goto fail;
|
||||
}
|
||||
screen->features[8] = val;
|
||||
|
||||
if (!etna_get_specs(screen))
|
||||
goto fail;
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ enum viv_features_word {
|
|||
viv_chipMinorFeatures4 = 5,
|
||||
viv_chipMinorFeatures5 = 6,
|
||||
viv_chipMinorFeatures6 = 7,
|
||||
viv_chipMinorFeatures7 = 8,
|
||||
VIV_FEATURES_WORD_COUNT /* Must be last */
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue