[Mesa-dev] [PATCH 2/2] st/mesa: don't assign prog->ShadowSamplers
Nicolai Hähnle
nhaehnle at gmail.com
Fri Oct 6 20:39:51 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
It's not used, and the assignment for the TGSI case was incorrect
for sampler arrays.
---
src/mesa/state_tracker/st_glsl_to_nir.cpp | 1 -
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 ----
2 files changed, 5 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 06a8ee8c612..5a439aaf92a 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -428,21 +428,20 @@ st_nir_get_mesa_program(struct gl_context *ctx,
if (ctx->_Shader->Flags & GLSL_DUMP) {
_mesa_log("\n");
_mesa_log("GLSL IR for linked %s program %d:\n",
_mesa_shader_stage_to_string(shader->Stage),
shader_program->Name);
_mesa_print_ir(_mesa_get_log_file(), shader->ir, NULL);
_mesa_log("\n\n");
}
- prog->ShadowSamplers = shader->shadow_samplers;
prog->ExternalSamplersUsed = gl_external_samplers(prog);
_mesa_update_shader_textures_used(shader_program, prog);
/* Avoid reallocation of the program parameter list, because the uniform
* storage is only associated with the original parameter list.
* This should be enough for Bitmap and DrawPixels constants.
*/
_mesa_reserve_parameter_storage(prog->Parameters, 8);
/* This has to be done last. Any operation the can cause
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 4b365c84817..1cfc9d963dc 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4468,24 +4468,20 @@ count_resources(glsl_to_tgsi_visitor *v, gl_program *prog)
if (inst->info->is_tex) {
for (int i = 0; i < inst->sampler_array_size; i++) {
unsigned idx = inst->sampler_base + i;
v->samplers_used |= 1u << idx;
debug_assert(idx < (int)ARRAY_SIZE(v->sampler_types));
v->sampler_types[idx] = inst->tex_type;
v->sampler_targets[idx] =
st_translate_texture_target(inst->tex_target, inst->tex_shadow);
- if (inst->tex_shadow) {
- prog->ShadowSamplers |= 1 << (inst->resource.index + i);
- }
-
if (inst->op == TGSI_OPCODE_TXF || inst->op == TGSI_OPCODE_TXF_LZ) {
prog->TexelFetchSamplers |= 1u << idx;
}
}
}
if (inst->tex_target == TEXTURE_EXTERNAL_INDEX)
prog->ExternalSamplersUsed |= 1 << inst->resource.index;
if (inst->resource.file != PROGRAM_UNDEFINED && (
--
2.11.0
More information about the mesa-dev
mailing list