#define VIRGL_CAP_TEXTURE_VIEW (1 << 1)
#define VIRGL_CAP_SET_MIN_SAMPLES (1 << 2)
#define VIRGL_CAP_COPY_IMAGE (1 << 3)
+#define VIRGL_CAP_TGSI_PRECISE (1 << 4)
#define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
#define VIRGL_BIND_RENDER_TARGET (1 << 1)
struct virgl_transform_context {
struct tgsi_transform_context base;
bool cull_enabled;
+ bool has_precise;
};
static void
virgl_tgsi_transform_instruction(struct tgsi_transform_context *ctx,
struct tgsi_full_instruction *inst)
{
- if (inst->Instruction.Precise)
+ struct virgl_transform_context *vtctx = (struct virgl_transform_context *)ctx;
+ if (!vtctx->has_precise && inst->Instruction.Precise)
inst->Instruction.Precise = 0;
for (unsigned i = 0; i < inst->Instruction.NumSrcRegs; i++) {
transform.base.transform_property = virgl_tgsi_transform_property;
transform.base.transform_instruction = virgl_tgsi_transform_instruction;
transform.cull_enabled = vscreen->caps.caps.v1.bset.has_cull;
+ transform.has_precise = vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TGSI_PRECISE;
tgsi_transform_shader(tokens_in, new_tokens, newLen, &transform.base);
return new_tokens;