mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 11:58:10 +02:00
draw: fix gs vertex stream counting
this can't be determined from pipe_shader_state::stream_output,
as this only contains xfb info, which is not the same as the vertex
stream info, and may break primitives generated queries
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15506>
(cherry picked from commit 32f117f5f8)
This commit is contained in:
parent
ff2ecc72af
commit
a825e59d40
2 changed files with 11 additions and 8 deletions
|
|
@ -1956,7 +1956,7 @@
|
|||
"description": "draw: fix gs vertex stream counting",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"because_sha": null
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "tgsi/tgsi_parse.h"
|
||||
#include "tgsi/tgsi_exec.h"
|
||||
#include "nir/nir_to_tgsi_info.h"
|
||||
#include "compiler/nir/nir.h"
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "util/u_math.h"
|
||||
|
|
@ -792,8 +793,16 @@ draw_create_geometry_shader(struct draw_context *draw,
|
|||
}
|
||||
|
||||
tgsi_scan_shader(state->tokens, &gs->info);
|
||||
} else
|
||||
gs->num_vertex_streams = 1;
|
||||
for (i = 0; i < gs->state.stream_output.num_outputs; i++) {
|
||||
if (gs->state.stream_output.output[i].stream >= gs->num_vertex_streams)
|
||||
gs->num_vertex_streams = gs->state.stream_output.output[i].stream + 1;
|
||||
}
|
||||
} else {
|
||||
nir_tgsi_scan_shader(state->ir.nir, &gs->info, true);
|
||||
nir_shader *nir = state->ir.nir;
|
||||
gs->num_vertex_streams = util_last_bit(nir->info.gs.active_stream_mask);
|
||||
}
|
||||
|
||||
/* setup the defaults */
|
||||
gs->max_out_prims = 0;
|
||||
|
|
@ -858,12 +867,6 @@ draw_create_geometry_shader(struct draw_context *draw,
|
|||
|
||||
gs->machine = draw->gs.tgsi.machine;
|
||||
|
||||
gs->num_vertex_streams = 1;
|
||||
for (i = 0; i < gs->state.stream_output.num_outputs; i++) {
|
||||
if (gs->state.stream_output.output[i].stream >= gs->num_vertex_streams)
|
||||
gs->num_vertex_streams = gs->state.stream_output.output[i].stream + 1;
|
||||
}
|
||||
|
||||
#ifdef DRAW_LLVM_AVAILABLE
|
||||
if (use_llvm) {
|
||||
int vector_size = gs->vector_length * sizeof(float);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue