vrend: Fix shaders with gerneric indices >= 32

Probably for some time now the generics are moved from index 0-31
to 9-40, and this doesn't fit the masks we were using, so use
64 bit masks.

Apparently this only triggered an assert and didn't lead to further
failures when the assertion was not enabled so that the CTS didin't
catch this.

We could also use 32 bit masks and shift the index by 9, but if
this would get us into trouble we ever decide to switch the
PIPE_CAP_TGSI_TEXCOORD in mesa/virgl.

Fixes a number of piglits from the glsl-1.10 set that otherwise trigger
an assertion.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
macos/master
Gert Wollny 3 years ago
parent a758b61afe
commit a30704147c
  1. 16
      src/vrend_shader.c
  2. 8
      src/vrend_shader.h

@ -162,9 +162,9 @@ struct vrend_generic_ios {
struct vrend_io_range input_range;
struct vrend_io_range output_range;
uint32_t outputs_expected_mask;
uint32_t inputs_emitted_mask;
uint32_t outputs_emitted_mask;
uint64_t outputs_expected_mask;
uint64_t inputs_emitted_mask;
uint64_t outputs_emitted_mask;
};
struct vrend_patch_ios {
@ -6246,11 +6246,11 @@ emit_ios_generic(const struct dump_ctx *ctx,
postfix);
if (io->name == TGSI_SEMANTIC_GENERIC) {
assert(io->sid < 32);
assert(io->sid < 64);
if (iot == io_in) {
generic_ios->inputs_emitted_mask |= 1 << io->sid;
generic_ios->inputs_emitted_mask |= 1ull << io->sid;
} else {
generic_ios->outputs_emitted_mask |= 1 << io->sid;
generic_ios->outputs_emitted_mask |= 1ull << io->sid;
}
}
@ -6891,8 +6891,8 @@ static int emit_ios(const struct dump_ctx *ctx,
if (generic_ios->outputs_expected_mask &&
(generic_ios->outputs_expected_mask != generic_ios->outputs_emitted_mask)) {
for (int i = 0; i < 31; ++i) {
uint32_t mask = 1 << i;
for (int i = 0; i < 64; ++i) {
uint64_t mask = 1ull << i;
bool expecting = generic_ios->outputs_expected_mask & mask;
if (expecting & !(generic_ios->outputs_emitted_mask & mask))
emit_hdrf(glsl_strbufs, " out vec4 %s_g%dA0_f%s;\n",

@ -88,10 +88,10 @@ struct vrend_shader_info_out {
};
struct vrend_shader_info_in {
uint64_t generic_emitted_mask : 32;
uint64_t num_indirect_generic : 8;
uint64_t num_indirect_patch : 8;
uint64_t use_pervertex : 1;
uint64_t generic_emitted_mask;
uint32_t num_indirect_generic : 8;
uint32_t num_indirect_patch : 8;
uint32_t use_pervertex : 1;
};

Loading…
Cancel
Save