zink: pull xfb info from tess shader when applicable
if it's the last vertex stage then it does the xfb Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>
This commit is contained in:

committed by
Marge Bot

parent
612d8f81c3
commit
2891e0b74e
@@ -331,8 +331,16 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, struct z
|
||||
void *streamout = NULL;
|
||||
nir_shader *nir = zs->nir;
|
||||
/* TODO: use a separate mem ctx here for ralloc */
|
||||
if (zs->streamout.so_info_slots && (zs->nir->info.stage != MESA_SHADER_VERTEX || !zs->has_geometry_shader))
|
||||
if (zs->has_geometry_shader) {
|
||||
if (zs->nir->info.stage == MESA_SHADER_GEOMETRY)
|
||||
streamout = &zs->streamout;
|
||||
} else if (zs->has_tess_shader) {
|
||||
if (zs->nir->info.stage == MESA_SHADER_TESS_EVAL)
|
||||
streamout = &zs->streamout;
|
||||
} else
|
||||
streamout = &zs->streamout;
|
||||
if (!zs->streamout.so_info_slots)
|
||||
streamout = NULL;
|
||||
if (zs->nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
nir = nir_shader_clone(NULL, nir);
|
||||
if (!zink_fs_key(key)->samples &&
|
||||
|
@@ -72,6 +72,7 @@ struct zink_shader {
|
||||
size_t num_bindings;
|
||||
struct set *programs;
|
||||
|
||||
bool has_tess_shader; // vertex shaders need to know if a tesseval shader exists
|
||||
bool has_geometry_shader; // vertex shaders need to know if a geometry shader exists
|
||||
};
|
||||
|
||||
|
@@ -304,6 +304,7 @@ update_shader_modules(struct zink_context *ctx, struct zink_shader *stages[ZINK_
|
||||
if (dirty[i]) {
|
||||
struct zink_shader_module *zm;
|
||||
dirty[i]->has_geometry_shader = dirty[MESA_SHADER_GEOMETRY] || stages[PIPE_SHADER_GEOMETRY];
|
||||
dirty[i]->has_tess_shader = dirty[MESA_SHADER_TESS_EVAL] || stages[PIPE_SHADER_TESS_EVAL];
|
||||
zm = get_shader_module_for_stage(ctx, dirty[i], prog);
|
||||
zink_shader_module_reference(zink_screen(ctx->base.screen), &prog->modules[type], zm);
|
||||
/* we probably need a new pipeline when we switch shader modules */
|
||||
|
Reference in New Issue
Block a user