[Mesa-dev] mesa: make union in gl_program a struct and add FIXME

Submitted by Timothy Arceri on Dec. 30, 2016, 8:45 p.m.

Details

Message ID 20161230204535.10077-1-timothy.arceri@collabora.com
State Accepted
Commit 9d99dc4bc1fda9906e8dc576d6116fbdb05f67ac
Headers show
Series "mesa: make union in gl_program a struct and add FIXME" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Timothy Arceri Dec. 30, 2016, 8:45 p.m.
i915 is mixing the use of these fields, for now change this to a
struct and add a FIXME.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99229
---
 src/mesa/main/mtypes.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 69d2eee..39ae667 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1945,7 +1945,11 @@  struct gl_program
    /** Map from sampler unit to texture unit (set by glUniform1i()) */
    GLubyte SamplerUnits[MAX_SAMPLERS];
 
-   union {
+   /* FIXME: We should be able to make this struct a union. However some
+    * drivers (i915/fragment_programs, swrast/prog_execute) mix the use of
+    * these fields, we should fix this.
+    */
+   struct {
       /** Fields used by GLSL programs */
       struct {
          struct gl_active_atomic_buffer **AtomicBuffers;

Comments

On Saturday, December 31, 2016 7:45:35 AM PST Timothy Arceri wrote:
> i915 is mixing the use of these fields, for now change this to a
> struct and add a FIXME.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99229
> ---
>  src/mesa/main/mtypes.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 69d2eee..39ae667 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1945,7 +1945,11 @@ struct gl_program
>     /** Map from sampler unit to texture unit (set by glUniform1i()) */
>     GLubyte SamplerUnits[MAX_SAMPLERS];
>  
> -   union {
> +   /* FIXME: We should be able to make this struct a union. However some
> +    * drivers (i915/fragment_programs, swrast/prog_execute) mix the use of
> +    * these fields, we should fix this.
> +    */
> +   struct {
>        /** Fields used by GLSL programs */
>        struct {
>           struct gl_active_atomic_buffer **AtomicBuffers;
> 

Thanks Tim.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>