glsl: remove ActiveStreamMask field

There is no need to pass this value around just store it directly
in the shader info.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28709>
This commit is contained in:
Timothy Arceri
2024-04-12 14:52:19 +10:00
committed by Marge Bot
parent 1e13e9be45
commit 1139a703c1
4 changed files with 3 additions and 6 deletions

View File

@@ -227,7 +227,7 @@ validate_geometry_shader_emissions(const struct gl_constants *consts,
"EmitStreamVertex" : "EndStreamPrimitive",
state.invalid_stream_id, state.max_stream_allowed);
}
prog->Geom.ActiveStreamMask = state.used_streams;
sh->Program->nir->info.gs.active_stream_mask = state.used_streams;
prog->Geom.UsesEndPrimitive = state.end_primitive_found;
/* From the ARB_gpu_shader5 spec:
@@ -250,11 +250,11 @@ validate_geometry_shader_emissions(const struct gl_constants *consts,
* Since we can call EmitVertex() and EndPrimitive() when we output
* primitives other than points, calling EmitStreamVertex(0) or
* EmitEndPrimitive(0) should not produce errors. This it also what Nvidia
* does. We can use prog->Geom.ActiveStreamMask to check whether only the
* does. We can use info.gs.active_stream_mask to check whether only the
* first (zero) stream is active.
* stream.
*/
if (prog->Geom.ActiveStreamMask & ~(1 << 0) &&
if (sh->Program->nir->info.gs.active_stream_mask & ~(1 << 0) &&
sh->Program->info.gs.output_primitive != MESA_PRIM_POINTS) {
linker_error(prog, "EmitStreamVertex(n) and EndStreamPrimitive(n) "
"with n>0 requires point output\n");

View File

@@ -428,7 +428,6 @@ struct gl_shader_program
*/
struct {
bool UsesEndPrimitive;
unsigned ActiveStreamMask;
} Geom;
/** Data shared by gl_program and gl_shader_program */

View File

@@ -2661,7 +2661,6 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src,
switch (dst_sh->Stage) {
case MESA_SHADER_GEOMETRY: {
dst->info.gs.uses_end_primitive = src->Geom.UsesEndPrimitive;
dst->info.gs.active_stream_mask = src->Geom.ActiveStreamMask;
break;
}
default:

View File

@@ -299,7 +299,6 @@ init_shader_program(struct gl_shader_program *prog)
prog->FragDataIndexBindings = string_to_uint_map_ctor();
prog->Geom.UsesEndPrimitive = false;
prog->Geom.ActiveStreamMask = 0;
prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS;