input, llvm_chan, "");
}
- fix_fetch = (ctx->shader->key.mono.vs.fix_fetch >> (2 * input_index)) & 3;
+ fix_fetch = (ctx->shader->key.mono.vs.fix_fetch >> (4 * input_index)) & 0xf;
if (fix_fetch) {
/* The hardware returns an unsigned value; convert it to a
* signed one.
fprintf(f, " part.vs.epilog.export_prim_id = %u\n", key->part.vs.epilog.export_prim_id);
fprintf(f, " as_es = %u\n", key->as_es);
fprintf(f, " as_ls = %u\n", key->as_ls);
- fprintf(f, " mono.vs.fix_fetch = 0x%x\n", key->mono.vs.fix_fetch);
+ fprintf(f, " mono.vs.fix_fetch = 0x%"PRIx64"\n", key->mono.vs.fix_fetch);
break;
case PIPE_SHADER_TESS_CTRL:
/* Flags for monolithic compilation only. */
union {
struct {
- /* One pair of bits for every input: SI_FIX_FETCH_* enums. */
- uint32_t fix_fetch;
+ /* One nibble for every input: SI_FIX_FETCH_* enums. */
+ uint64_t fix_fetch;
} vs;
struct {
uint64_t inputs_to_copy; /* for fixed-func TCS */
*/
if (data_format == V_008F0C_BUF_DATA_FORMAT_2_10_10_10) {
if (num_format == V_008F0C_BUF_NUM_FORMAT_SNORM) {
- v->fix_fetch |= SI_FIX_FETCH_A2_SNORM << (2 * i);
+ v->fix_fetch |= (uint64_t)SI_FIX_FETCH_A2_SNORM << (4 * i);
} else if (num_format == V_008F0C_BUF_NUM_FORMAT_SSCALED) {
- v->fix_fetch |= SI_FIX_FETCH_A2_SSCALED << (2 * i);
+ v->fix_fetch |= (uint64_t)SI_FIX_FETCH_A2_SSCALED << (4 * i);
} else if (num_format == V_008F0C_BUF_NUM_FORMAT_SINT) {
/* This isn't actually used in OpenGL. */
- v->fix_fetch |= SI_FIX_FETCH_A2_SINT << (2 * i);
+ v->fix_fetch |= (uint64_t)SI_FIX_FETCH_A2_SINT << (4 * i);
}
}
struct si_vertex_element
{
unsigned count;
- uint32_t fix_fetch;
/* Two bits per attribute indicating the size of each vector component
* in bytes if the size 3-workaround must be applied.
*/
uint32_t fix_size3;
+ uint64_t fix_fetch;
uint32_t rsrc_word3[SI_MAX_ATTRIBS];
uint32_t format_size[SI_MAX_ATTRIBS];
key->mono.vs.fix_fetch =
sctx->vertex_elements->fix_fetch &
- u_bit_consecutive(0, 2 * count);
+ u_bit_consecutive64(0, 4 * count);
}
if (sctx->tes_shader.cso)
key->as_ls = 1;
return ((1u << count) - 1) << start;
}
+static inline uint64_t
+u_bit_consecutive64(unsigned start, unsigned count)
+{
+ assert(start + count <= 64);
+ if (count == 64)
+ return ~(uint64_t)0;
+ return (((uint64_t)1 << count) - 1) << start;
+}
+
#ifdef __cplusplus
}