Re: [Mesa-dev] [PATCH] glsl: allow glsl_type::sampler_index() with images

2017-03-30 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Thu, Mar 30, 2017 at 12:33 AM, Samuel Pitoiset
 wrote:
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/compiler/glsl_types.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
> index 405aa3679a..cf0fe71d1a 100644
> --- a/src/compiler/glsl_types.cpp
> +++ b/src/compiler/glsl_types.cpp
> @@ -315,7 +315,7 @@ glsl_type::sampler_index() const
>  {
> const glsl_type *const t = (this->is_array()) ? this->fields.array : this;
>
> -   assert(t->is_sampler());
> +   assert(t->is_sampler() || t->is_image());
>
> switch (t->sampler_dimensionality) {
> case GLSL_SAMPLER_DIM_1D:
> --
> 2.12.1
>
> ___
> 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] glsl: allow glsl_type::sampler_index() with images

2017-03-30 Thread Nicolai Hähnle

On 30.03.2017 13:09, Samuel Pitoiset wrote:



On 03/30/2017 09:49 AM, Nicolai Hähnle wrote:

On 30.03.2017 00:33, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 


Maybe some of those names should be changed to reflect the dual use?
Anyway, this patch is


sampler_index() looks fine to me. What do you have in mind?


I admit that I have no good alternative. sampler_or_image_index would suck.

Cheers,
Nicolai



Reviewed-by: Nicolai Hähnle 


---
 src/compiler/glsl_types.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 405aa3679a..cf0fe71d1a 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -315,7 +315,7 @@ glsl_type::sampler_index() const
 {
const glsl_type *const t = (this->is_array()) ? this->fields.array
: this;

-   assert(t->is_sampler());
+   assert(t->is_sampler() || t->is_image());

switch (t->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D:







--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: allow glsl_type::sampler_index() with images

2017-03-30 Thread Samuel Pitoiset



On 03/30/2017 09:49 AM, Nicolai Hähnle wrote:

On 30.03.2017 00:33, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 


Maybe some of those names should be changed to reflect the dual use?
Anyway, this patch is


sampler_index() looks fine to me. What do you have in mind?



Reviewed-by: Nicolai Hähnle 


---
 src/compiler/glsl_types.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 405aa3679a..cf0fe71d1a 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -315,7 +315,7 @@ glsl_type::sampler_index() const
 {
const glsl_type *const t = (this->is_array()) ? this->fields.array
: this;

-   assert(t->is_sampler());
+   assert(t->is_sampler() || t->is_image());

switch (t->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D:





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


Re: [Mesa-dev] [PATCH] glsl: allow glsl_type::sampler_index() with images

2017-03-30 Thread Nicolai Hähnle

On 30.03.2017 00:33, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 


Maybe some of those names should be changed to reflect the dual use? 
Anyway, this patch is


Reviewed-by: Nicolai Hähnle 


---
 src/compiler/glsl_types.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 405aa3679a..cf0fe71d1a 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -315,7 +315,7 @@ glsl_type::sampler_index() const
 {
const glsl_type *const t = (this->is_array()) ? this->fields.array : this;

-   assert(t->is_sampler());
+   assert(t->is_sampler() || t->is_image());

switch (t->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D:




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl: allow glsl_type::sampler_index() with images

2017-03-29 Thread Timothy Arceri

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


[Mesa-dev] [PATCH] glsl: allow glsl_type::sampler_index() with images

2017-03-29 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 src/compiler/glsl_types.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 405aa3679a..cf0fe71d1a 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -315,7 +315,7 @@ glsl_type::sampler_index() const
 {
const glsl_type *const t = (this->is_array()) ? this->fields.array : this;
 
-   assert(t->is_sampler());
+   assert(t->is_sampler() || t->is_image());
 
switch (t->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D:
-- 
2.12.1

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