Re: [Mesa-dev] [PATCH 2/2] st/mesa: don't assign prog->ShadowSamplers

2017-10-10 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Fri, Oct 6, 2017 at 10:39 PM, Nicolai Hähnle  wrote:
> From: Nicolai Hähnle 
>
> 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
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/mesa: don't assign prog->ShadowSamplers

2017-10-06 Thread Kenneth Graunke
On Friday, October 6, 2017 1:39:51 PM PDT Nicolai Hähnle wrote:
> From: Nicolai Hähnle 
> 
> 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(-)

Hmm, you're right...it looked like r300g used it, but it actually
just creates a similar bitfield in its compiler backend.

Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] st/mesa: don't assign prog->ShadowSamplers

2017-10-06 Thread Nicolai Hähnle
From: Nicolai Hähnle 

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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev