}
-static const char * const tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txf_ms", "txs", "lod", "tg4", "query_levels", "texture_samples" };
+static const char * const tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txf_ms", "txs", "lod", "tg4", "query_levels", "texture_samples", "samples_identical" };
const char *ir_texture::opcode_string()
{
} else if (this->op == ir_lod) {
assert(type->vector_elements == 2);
assert(type->base_type == GLSL_TYPE_FLOAT);
+ } else if (this->op == ir_samples_identical) {
+ assert(type == glsl_type::bool_type);
+ assert(sampler->type->base_type == GLSL_TYPE_SAMPLER);
+ assert(sampler->type->sampler_dimensionality == GLSL_SAMPLER_DIM_MS);
} else {
assert(sampler->type->sampler_type == (int) type->base_type);
if (sampler->type->sampler_shadow)
ir_tg4, /**< Texture gather */
ir_query_levels, /**< Texture levels query */
ir_texture_samples, /**< Texture samples query */
+ ir_samples_identical, /**< Query whether all samples are definitely identical. */
};
* (lod <type> <sampler> <coordinate>)
* (tg4 <type> <sampler> <coordinate> <offset> <component>)
* (query_levels <type> <sampler>)
+ * (samples_identical <sampler> <coordinate>)
*/
class ir_texture : public ir_rvalue {
public:
case ir_lod:
case ir_query_levels:
case ir_texture_samples:
+ case ir_samples_identical:
break;
case ir_txb:
new_tex->lod_info.bias = this->lod_info.bias->clone(mem_ctx, ht);
case ir_lod:
case ir_query_levels:
case ir_texture_samples:
+ case ir_samples_identical:
break;
case ir_txb:
if (!lod_info.bias->equals(other->lod_info.bias, ignore))
case ir_lod:
case ir_query_levels:
case ir_texture_samples:
+ case ir_samples_identical:
break;
case ir_txb:
s = this->lod_info.bias->accept(v);
{
fprintf(f, "(%s ", ir->opcode_string());
+ if (ir->op == ir_samples_identical) {
+ ir->sampler->accept(this);
+ fprintf(f, " ");
+ ir->coordinate->accept(this);
+ fprintf(f, ")");
+ return;
+ }
+
print_type(f, ir->type);
fprintf(f, " ");
case ir_tg4:
ir->lod_info.component->accept(this);
break;
+ case ir_samples_identical:
+ unreachable(!"ir_samples_identical was already handled");
};
fprintf(f, ")");
}
case ir_lod:
case ir_query_levels:
case ir_texture_samples:
+ case ir_samples_identical:
break;
case ir_txb:
handle_rvalue(&ir->lod_info.bias);
case ir_lod:
case ir_query_levels:
case ir_texture_samples:
+ case ir_samples_identical:
break;
case ir_txb:
if (do_graft(&ir->lod_info.bias))
case ir_query_levels:
assert(!"Unexpected ir_query_levels opcode");
break;
+ case ir_samples_identical:
+ unreachable("Unexpected ir_samples_identical opcode");
case ir_texture_samples:
unreachable("Unexpected ir_texture_samples opcode");
}
case ir_texture_samples:
opcode = TGSI_OPCODE_TXQS;
break;
+ case ir_samples_identical:
+ unreachable("Unexpected ir_samples_identical opcode");
}
if (ir->projector) {