d3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
This commit is contained in:
Jesse Natalie 2021-04-19 10:07:40 -07:00 committed by Marge Bot
parent 09440ce3fb
commit 1a0fbca1bd

View file

@ -323,7 +323,7 @@ d3d12_emit_points(struct d3d12_context *ctx, struct d3d12_gs_variant_key *key)
* EmitVertex();
*/
for (unsigned i = 0; i < emit_ctx.num_vars; ++i) {
nir_ssa_def *index = (key->flat_varyings & (1 << emit_ctx.in[i]->data.location)) ?
nir_ssa_def *index = (key->flat_varyings & (1ull << emit_ctx.in[i]->data.location)) ?
nir_imm_int(b, (key->flatshade_first ? 0 : 2)) : emit_ctx.loop_index;
nir_deref_instr *in_value = nir_build_deref_array(b, nir_build_deref_var(b, emit_ctx.in[i]), index);
if (emit_ctx.in[i]->data.location == VARYING_SLOT_POS && emit_ctx.edgeflag_cmp) {
@ -356,7 +356,7 @@ d3d12_emit_lines(struct d3d12_context *ctx, struct d3d12_gs_variant_key *key)
/* First vertex */
for (unsigned i = 0; i < emit_ctx.num_vars; ++i) {
nir_ssa_def *index = (key->flat_varyings & (1 << emit_ctx.in[i]->data.location)) ?
nir_ssa_def *index = (key->flat_varyings & (1ull << emit_ctx.in[i]->data.location)) ?
nir_imm_int(b, (key->flatshade_first ? 0 : 2)) : emit_ctx.loop_index;
nir_deref_instr *in_value = nir_build_deref_array(b, nir_build_deref_var(b, emit_ctx.in[i]), index);
nir_copy_deref(b, nir_build_deref_var(b, emit_ctx.out[i]), in_value);
@ -370,7 +370,7 @@ d3d12_emit_lines(struct d3d12_context *ctx, struct d3d12_gs_variant_key *key)
nir_ssa_def *index = next_index;
if (emit_ctx.in[i]->data.location == VARYING_SLOT_POS)
index = nir_bcsel(b, emit_ctx.edgeflag_cmp, next_index, emit_ctx.loop_index);
else if (key->flat_varyings & (1 << emit_ctx.in[i]->data.location))
else if (key->flat_varyings & (1ull << emit_ctx.in[i]->data.location))
index = nir_imm_int(b, 2);
nir_copy_deref(b, nir_build_deref_var(b, emit_ctx.out[i]),
nir_build_deref_array(b, nir_build_deref_var(b, emit_ctx.in[i]), index));