summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/shader
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-10-07 01:21:08 +0800
committerChia-I Wu <[email protected]>2013-09-08 01:22:52 +0800
commite67f99bd292e2d3b083207fb806dc9a42105ce72 (patch)
tree669b572b4adbb1ba54feab0a274577ce1b2b06d7 /src/gallium/drivers/ilo/shader
parent18805b16c8a86ad9de4b5bb9afdce576f528f745 (diff)
ilo: preliminary GEN 7.5 support
This is based on grepping for brw->is_haswell in i965 to see how GEN 7.5 differs from GEN 7. Slightly tested with Xonotic and some Mesa demos.
Diffstat (limited to 'src/gallium/drivers/ilo/shader')
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_fs.c15
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_vs.c15
2 files changed, 24 insertions, 6 deletions
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
index 48d5721631c..0a65498b536 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
@@ -790,10 +790,19 @@ fs_prepare_tgsi_sampling(struct toy_compiler *tc, const struct toy_inst *inst,
}
break;
case TOY_OPCODE_TGSI_TXD:
- if (ref_pos >= 0)
- tc_fail(tc, "TXD with shadow sampler not supported");
+ if (ref_pos >= 0) {
+ assert(ref_pos < 4);
+
+ msg_type = HSW_SAMPLER_MESSAGE_SAMPLE_DERIV_COMPARE;
+ ref_or_si = coords[ref_pos];
+
+ if (tc->dev->gen < ILO_GEN(7.5))
+ tc_fail(tc, "TXD with shadow sampler not supported");
+ }
+ else {
+ msg_type = GEN5_SAMPLER_MESSAGE_SAMPLE_DERIVS;
+ }
- msg_type = GEN5_SAMPLER_MESSAGE_SAMPLE_DERIVS;
tsrc_transpose(inst->src[1], ddx);
tsrc_transpose(inst->src[2], ddy);
num_derivs = num_coords;
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
index b5b44b57796..c20ecc6f6a2 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
@@ -411,10 +411,19 @@ vs_prepare_tgsi_sampling(struct toy_compiler *tc, const struct toy_inst *inst,
/* extract the parameters */
switch (inst->opcode) {
case TOY_OPCODE_TGSI_TXD:
- if (ref_pos >= 0)
- tc_fail(tc, "TXD with shadow sampler not supported");
+ if (ref_pos >= 0) {
+ assert(ref_pos < 4);
+
+ msg_type = HSW_SAMPLER_MESSAGE_SAMPLE_DERIV_COMPARE;
+ ref_or_si = tsrc_swizzle1(coords, ref_pos);
+
+ if (tc->dev->gen < ILO_GEN(7.5))
+ tc_fail(tc, "TXD with shadow sampler not supported");
+ }
+ else {
+ msg_type = GEN5_SAMPLER_MESSAGE_SAMPLE_DERIVS;
+ }
- msg_type = GEN5_SAMPLER_MESSAGE_SAMPLE_DERIVS;
ddx = inst->src[1];
ddy = inst->src[2];
num_derivs = num_coords;