|
@@ -826,6 +826,20 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
|
|
|
const bool is_shadow = ir->sampler->type->sampler_shadow;
|
|
const bool is_shadow = ir->sampler->type->sampler_shadow;
|
|
|
const bool is_array = ir->sampler->type->sampler_array;
|
|
const bool is_array = ir->sampler->type->sampler_array;
|
|
|
const bool is_msaa = ir->op == ir_txf_ms;
|
|
const bool is_msaa = ir->op == ir_txf_ms;
|
|
|
|
|
+
|
|
|
|
|
+ if (ir->op == ir_txs)
|
|
|
|
|
+ {
|
|
|
|
|
+ buffer.asprintf_append("textureSize (");
|
|
|
|
|
+ ir->sampler->accept(this);
|
|
|
|
|
+ if (ir_texture::has_lod(ir->sampler->type))
|
|
|
|
|
+ {
|
|
|
|
|
+ buffer.asprintf_append(", ");
|
|
|
|
|
+ ir->lod_info.lod->accept(this);
|
|
|
|
|
+ }
|
|
|
|
|
+ buffer.asprintf_append(")");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const glsl_type* uv_type = ir->coordinate->type;
|
|
const glsl_type* uv_type = ir->coordinate->type;
|
|
|
const int uv_dim = uv_type->vector_elements;
|
|
const int uv_dim = uv_type->vector_elements;
|
|
|
int sampler_uv_dim = tex_sampler_dim_size[sampler_dim];
|
|
int sampler_uv_dim = tex_sampler_dim_size[sampler_dim];
|
|
@@ -835,7 +849,7 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
|
|
|
sampler_uv_dim += 1;
|
|
sampler_uv_dim += 1;
|
|
|
if (is_msaa)
|
|
if (is_msaa)
|
|
|
sampler_uv_dim += 1;
|
|
sampler_uv_dim += 1;
|
|
|
- const bool is_proj = (uv_dim > sampler_uv_dim);
|
|
|
|
|
|
|
+ const bool is_proj = ((ir->op == ir_tex || ir->op == ir_txb || ir->op == ir_txl || ir->op == ir_txd) && uv_dim > sampler_uv_dim);
|
|
|
const bool is_lod = (ir->op == ir_txl);
|
|
const bool is_lod = (ir->op == ir_txl);
|
|
|
|
|
|
|
|
#if 0 // BK - disable LOD workarounds.
|
|
#if 0 // BK - disable LOD workarounds.
|
|
@@ -869,27 +883,23 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
|
|
|
}
|
|
}
|
|
|
#endif // 0
|
|
#endif // 0
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // texture function name
|
|
|
|
|
- //ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130
|
|
|
|
|
- if(state->language_version<130)
|
|
|
|
|
- {
|
|
|
|
|
- buffer.asprintf_append ("%s", is_shadow ? "shadow" : "texture");
|
|
|
|
|
- buffer.asprintf_append ("%s", tex_sampler_dim_name[sampler_dim]);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- if (ir->op == ir_txf
|
|
|
|
|
- || ir->op == ir_txf_ms) {
|
|
|
|
|
- buffer.asprintf_append ("texelFetch");
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- buffer.asprintf_append ("texture");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // texture function name
|
|
|
|
|
+ //ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130
|
|
|
|
|
+ if(state->language_version<130)
|
|
|
|
|
+ {
|
|
|
|
|
+ buffer.asprintf_append ("%s", is_shadow ? "shadow" : "texture");
|
|
|
|
|
+ buffer.asprintf_append ("%s", tex_sampler_dim_name[sampler_dim]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (ir->op == ir_txf || ir->op == ir_txf_ms)
|
|
|
|
|
+ buffer.asprintf_append ("texelFetch");
|
|
|
|
|
+ else
|
|
|
|
|
+ buffer.asprintf_append ("texture");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (is_array && state->EXT_texture_array_enable)
|
|
if (is_array && state->EXT_texture_array_enable)
|
|
|
buffer.asprintf_append ("Array");
|
|
buffer.asprintf_append ("Array");
|
|
|
-
|
|
|
|
|
if (ir->op == ir_tex && is_proj)
|
|
if (ir->op == ir_tex && is_proj)
|
|
|
buffer.asprintf_append ("Proj");
|
|
buffer.asprintf_append ("Proj");
|
|
|
if (ir->op == ir_txl)
|
|
if (ir->op == ir_txl)
|
|
@@ -931,6 +941,13 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
|
|
|
buffer.asprintf_append (", ");
|
|
buffer.asprintf_append (", ");
|
|
|
ir->lod_info.lod->accept(this);
|
|
ir->lod_info.lod->accept(this);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // sample index
|
|
|
|
|
+ if (ir->op == ir_txf_ms)
|
|
|
|
|
+ {
|
|
|
|
|
+ buffer.asprintf_append (", ");
|
|
|
|
|
+ ir->lod_info.sample_index->accept(this);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// grad
|
|
// grad
|
|
|
if (ir->op == ir_txd)
|
|
if (ir->op == ir_txd)
|