{
struct qcompile *c = trans->c;
- qir_VPM_WRITE(c, qir_FMUL(c, trans->outputs[2], rcp_w));
+ struct qreg zscale = add_uniform(trans, QUNIFORM_VIEWPORT_Z_SCALE, 0);
+ struct qreg zoffset = add_uniform(trans, QUNIFORM_VIEWPORT_Z_OFFSET, 0);
+
+ qir_VPM_WRITE(c, qir_FMUL(c, qir_FADD(c, qir_FMUL(c,
+ trans->outputs[2],
+ zscale),
+ zoffset),
+ rcp_w));
}
static void
-16.0f / 2.0f));
break;
+ case QUNIFORM_VIEWPORT_Z_OFFSET:
+ cl_u32(&vc4->uniforms, fui(vc4->viewport.translate[2]));
+ break;
+ case QUNIFORM_VIEWPORT_Z_SCALE:
+ cl_u32(&vc4->uniforms, fui(vc4->viewport.scale[2]));
+ break;
+
case QUNIFORM_TEXTURE_CONFIG_P0:
write_texture_p0(vc4, texstate, uinfo->data[i]);
break;
QUNIFORM_VIEWPORT_Y_SCALE,
/** @} */
+ QUNIFORM_VIEWPORT_Z_OFFSET,
+ QUNIFORM_VIEWPORT_Z_SCALE,
+
/**
* A reference to a texture config parameter 0 uniform.
*