cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
dependencies : [
dep_libdrm, dep_llvm, dep_unwind, dep_dl, dep_m, dep_thread, dep_lmsensors,
- idep_nir_headers,
+ idep_nir, idep_nir_headers, idep_mesautil,
],
- build_by_default : false,
- link_with: [
- libglsl
- ]
+ build_by_default : false
)
libgalliumvl_stub = static_library(
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_control_flow.h"
#include "compiler/nir/nir_builder.h"
-#include "compiler/glsl/gl_nir.h"
-#include "compiler/glsl/list.h"
#include "compiler/shader_enums.h"
#include "tgsi_to_nir.h"
enum glsl_sampler_dim dim,
bool is_shadow,
bool is_array,
- enum glsl_base_type base_type)
+ enum glsl_base_type base_type,
+ nir_texop op)
{
nir_variable *var = c->samplers[binding];
if (!var) {
var->data.binding = binding;
var->data.explicit_binding = true;
c->samplers[binding] = var;
+
+ /* Record textures used */
+ unsigned mask = 1 << binding;
+ c->build.shader->info.textures_used |= mask;
+ if (op == nir_texop_txf ||
+ op == nir_texop_txf_ms ||
+ op == nir_texop_txf_ms_mcs)
+ c->build.shader->info.textures_used_by_txf |= mask;
}
return var;
get_sampler_var(c, sview, instr->sampler_dim,
instr->is_shadow,
instr->is_array,
- base_type_for_alu_type(instr->dest_type));
+ base_type_for_alu_type(instr->dest_type),
+ op);
nir_deref_instr *deref = nir_build_deref_var(b, var);
get_sampler_var(c, tex_index, txs->sampler_dim,
txs->is_shadow,
txs->is_array,
- base_type_for_alu_type(txs->dest_type));
+ base_type_for_alu_type(txs->dest_type),
+ nir_texop_txs);
nir_deref_instr *deref = nir_build_deref_var(b, var);
if (c->cap_packed_uniforms)
NIR_PASS_V(nir, nir_lower_uniforms_to_ubo, 16);
- if (c->cap_samplers_as_deref)
- NIR_PASS_V(nir, gl_nir_lower_samplers_as_deref, NULL);
- else
- NIR_PASS_V(nir, gl_nir_lower_samplers, NULL);
+ if (!c->cap_samplers_as_deref)
+ NIR_PASS_V(nir, nir_lower_samplers);
ttn_optimize_nir(nir, c->cap_scalar);
nir_shader_gather_info(nir, c->build.impl);