void
nv50_resource_resolve(struct pipe_context *, const struct pipe_resolve_info *);
-#define NV50_BLIT_MODE_PASS 0 /* pass through TEX $t0/$s0 output */
-#define NV50_BLIT_MODE_Z24S8 1 /* encode ZS values for RGBA unorm8 */
-#define NV50_BLIT_MODE_S8Z24 2
-#define NV50_BLIT_MODE_X24S8 3
-#define NV50_BLIT_MODE_S8X24 4
-#define NV50_BLIT_MODE_Z24X8 5
-#define NV50_BLIT_MODE_X8Z24 6
-#define NV50_BLIT_MODE_ZS 7 /* put $t0/$s0 into R, $t1/$s1 into G */
-#define NV50_BLIT_MODE_XS 8 /* put $t1/$s1 into G */
-#define NV50_BLIT_MODES 9
+#define NV50_BLIT_MODE_PASS 0 /* pass through TEX $t0/$s0 output */
+#define NV50_BLIT_MODE_Z24S8 1 /* encode ZS values for RGBA unorm8 */
+#define NV50_BLIT_MODE_S8Z24 2
+#define NV50_BLIT_MODE_X24S8 3
+#define NV50_BLIT_MODE_S8X24 4
+#define NV50_BLIT_MODE_Z24X8 5
+#define NV50_BLIT_MODE_X8Z24 6
+#define NV50_BLIT_MODE_ZS 7 /* put $t0/$s0 into R, $t1/$s1 into G */
+#define NV50_BLIT_MODE_XS 8 /* put $t1/$s1 into G */
+#define NV50_BLIT_MODE_INT_CLAMP 9 /* unsigned to signed integer conversion */
+#define NV50_BLIT_MODES 10
/* CUBE and RECT textures are reinterpreted as 2D(_ARRAY) */
#define NV50_BLIT_TEXTURE_BUFFER 0
bool tex_s = false;
bool cvt_un8 = false;
+ bool int_clamp = mode == NV50_BLIT_MODE_INT_CLAMP;
+ if (int_clamp)
+ mode = NV50_BLIT_MODE_PASS;
+
if (mode != NV50_BLIT_MODE_PASS &&
mode != NV50_BLIT_MODE_Z24X8 &&
mode != NV50_BLIT_MODE_X8Z24)
target, tc, ureg_DECL_sampler(ureg, 0));
}
+ /* handle signed to unsigned integer conversions */
+ if (int_clamp)
+ ureg_UMIN(ureg, data, ureg_src(data), ureg_imm1u(ureg, 0x7fffffff));
+
if (cvt_un8) {
struct ureg_src mask;
struct ureg_src scale;
return NV50_BLIT_MODE_XS;
}
default:
+ if (util_format_is_pure_uint(info->src.format) &&
+ util_format_is_pure_sint(info->dst.format))
+ return NV50_BLIT_MODE_INT_CLAMP;
return NV50_BLIT_MODE_PASS;
}
}