Re: [Mesa-dev] [PATCH] mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINT

2019-09-12 Thread Ilia Mirkin
Yep, it does work out ... you get lucky :) It does seem like it'd be
really easy to just switch to GLubyte like all the other functions do,
but whatever.

On Thu, Sep 12, 2019 at 10:22 PM Marek Olšák  wrote:
>
> Ilia, the patch is OK if GL_STENCIL_INDEX is not allowed, right?
>
> Marek
>
> On Tue, Aug 27, 2019 at 9:24 PM Ilia Mirkin  wrote:
>>
>> By the way, I took the liberty of composing a test which fails with
>> current mesa, and I'm pretty sure it continues to fail with this
>> patch. It does pass if I just make it a GLubyte like all the other
>> instances of the code already do.
>>
>> Piglit test: https://patchwork.freedesktop.org/patch/327460/
>>
>> On Tue, Aug 27, 2019 at 7:37 PM Ilia Mirkin  wrote:
>> >
>> > I don't think the original author was included -- CC was probably
>> > stripped by the ML. Adding here.
>> >
>> > On Tue, Aug 27, 2019 at 6:49 PM Marek Olšák  wrote:
>> > >
>> > > Yes, but if the original author doesn't reply, I'd like to push this.
>> > >
>> > > Marek
>> > >
>> > > On Thu, Aug 15, 2019 at 8:01 PM Ilia Mirkin  wrote:
>> > >>
>> > >> Subtle. The source format *can* be 64-bit, by the way, but if it's
>> > >> GL_DEPTH_COMPONENT it may well be 32-bit.
>> > >>
>> > >> But what if it's GL_STENCIL_INDEX -- could it not be 1-byte? IOW,
>> > >> should this just be a char *, and use byte addressing and be done with
>> > >> it?
>> > >>
>> > >> On Thu, Aug 15, 2019 at 7:56 PM Marek Olšák  wrote:
>> > >> >
>> > >> > From: Jiadong Zhu 
>> > >> >
>> > >> > _mesa_texstore_z32f_x24s8 calculates source rowStride at a
>> > >> > pace of 64-bit, this will make inaccuracy offset if the width
>> > >> > of src image is an odd number. Modify src pointer to int_32* as
>> > >> > source image format is gl_float which is 32-bit per pixel.
>> > >> >
>> > >> > Signed-off-by: Jiadong Zhu 
>> > >> > Signed-off-by: Marek Olšák 
>> > >> > ---
>> > >> >  src/mesa/main/texstore.c | 6 +++---
>> > >> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> > >> >  mode change 100644 => 100755 src/mesa/main/texstore.c
>> > >> >
>> > >> > diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
>> > >> > old mode 100644
>> > >> > new mode 100755
>> > >> > index 2913d4bc067..207695041a7
>> > >> > --- a/src/mesa/main/texstore.c
>> > >> > +++ b/src/mesa/main/texstore.c
>> > >> > @@ -531,35 +531,35 @@ _mesa_texstore_s8(TEXSTORE_PARAMS)
>> > >> > return GL_TRUE;
>> > >> >  }
>> > >> >
>> > >> >
>> > >> >  static GLboolean
>> > >> >  _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
>> > >> >  {
>> > >> > GLint img, row;
>> > >> > const GLint srcRowStride
>> > >> >= _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, 
>> > >> > srcType)
>> > >> > -  / sizeof(uint64_t);
>> > >> > + / sizeof(int32_t);
>> > >> >
>> > >> > assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
>> > >> > assert(srcFormat == GL_DEPTH_STENCIL ||
>> > >> >srcFormat == GL_DEPTH_COMPONENT ||
>> > >> >srcFormat == GL_STENCIL_INDEX);
>> > >> > assert(srcFormat != GL_DEPTH_STENCIL ||
>> > >> >srcType == GL_UNSIGNED_INT_24_8 ||
>> > >> >srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
>> > >> >
>> > >> > /* In case we only upload depth we need to preserve the stencil */
>> > >> > for (img = 0; img < srcDepth; img++) {
>> > >> >uint64_t *dstRow = (uint64_t *) dstSlices[img];
>> > >> > -  const uint64_t *src
>> > >> > - = (const uint64_t *) _mesa_image_address(dims, srcPacking, 
>> > >> > srcAddr,
>> > >> > +  const int32_t *src
>> > >> > + = (const int32_t *) _mesa_image_address(dims, srcPacking, 
>> > >> > srcAddr,
>> > >> > srcWidth, srcHeight,
>> > >> > srcFormat, srcType,
>> > >> > img, 0, 0);
>> > >> >for (row = 0; row < srcHeight; row++) {
>> > >> >   /* The unpack functions with:
>> > >> >*dstType = GL_FLOAT_32_UNSIGNED_INT_24_8_REV
>> > >> >* only write their own dword, so the other dword (stencil
>> > >> >* or depth) is preserved. */
>> > >> >   if (srcFormat != GL_STENCIL_INDEX)
>> > >> >  _mesa_unpack_depth_span(ctx, srcWidth,
>> > >> > --
>> > >> > 2.17.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] mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINT

2019-09-12 Thread Marek Olšák
Ilia, the patch is OK if GL_STENCIL_INDEX is not allowed, right?

Marek

On Tue, Aug 27, 2019 at 9:24 PM Ilia Mirkin  wrote:

> By the way, I took the liberty of composing a test which fails with
> current mesa, and I'm pretty sure it continues to fail with this
> patch. It does pass if I just make it a GLubyte like all the other
> instances of the code already do.
>
> Piglit test: https://patchwork.freedesktop.org/patch/327460/
>
> On Tue, Aug 27, 2019 at 7:37 PM Ilia Mirkin  wrote:
> >
> > I don't think the original author was included -- CC was probably
> > stripped by the ML. Adding here.
> >
> > On Tue, Aug 27, 2019 at 6:49 PM Marek Olšák  wrote:
> > >
> > > Yes, but if the original author doesn't reply, I'd like to push this.
> > >
> > > Marek
> > >
> > > On Thu, Aug 15, 2019 at 8:01 PM Ilia Mirkin 
> wrote:
> > >>
> > >> Subtle. The source format *can* be 64-bit, by the way, but if it's
> > >> GL_DEPTH_COMPONENT it may well be 32-bit.
> > >>
> > >> But what if it's GL_STENCIL_INDEX -- could it not be 1-byte? IOW,
> > >> should this just be a char *, and use byte addressing and be done with
> > >> it?
> > >>
> > >> On Thu, Aug 15, 2019 at 7:56 PM Marek Olšák  wrote:
> > >> >
> > >> > From: Jiadong Zhu 
> > >> >
> > >> > _mesa_texstore_z32f_x24s8 calculates source rowStride at a
> > >> > pace of 64-bit, this will make inaccuracy offset if the width
> > >> > of src image is an odd number. Modify src pointer to int_32* as
> > >> > source image format is gl_float which is 32-bit per pixel.
> > >> >
> > >> > Signed-off-by: Jiadong Zhu 
> > >> > Signed-off-by: Marek Olšák 
> > >> > ---
> > >> >  src/mesa/main/texstore.c | 6 +++---
> > >> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >> >  mode change 100644 => 100755 src/mesa/main/texstore.c
> > >> >
> > >> > diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> > >> > old mode 100644
> > >> > new mode 100755
> > >> > index 2913d4bc067..207695041a7
> > >> > --- a/src/mesa/main/texstore.c
> > >> > +++ b/src/mesa/main/texstore.c
> > >> > @@ -531,35 +531,35 @@ _mesa_texstore_s8(TEXSTORE_PARAMS)
> > >> > return GL_TRUE;
> > >> >  }
> > >> >
> > >> >
> > >> >  static GLboolean
> > >> >  _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
> > >> >  {
> > >> > GLint img, row;
> > >> > const GLint srcRowStride
> > >> >= _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
> srcType)
> > >> > -  / sizeof(uint64_t);
> > >> > + / sizeof(int32_t);
> > >> >
> > >> > assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
> > >> > assert(srcFormat == GL_DEPTH_STENCIL ||
> > >> >srcFormat == GL_DEPTH_COMPONENT ||
> > >> >srcFormat == GL_STENCIL_INDEX);
> > >> > assert(srcFormat != GL_DEPTH_STENCIL ||
> > >> >srcType == GL_UNSIGNED_INT_24_8 ||
> > >> >srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
> > >> >
> > >> > /* In case we only upload depth we need to preserve the stencil
> */
> > >> > for (img = 0; img < srcDepth; img++) {
> > >> >uint64_t *dstRow = (uint64_t *) dstSlices[img];
> > >> > -  const uint64_t *src
> > >> > - = (const uint64_t *) _mesa_image_address(dims,
> srcPacking, srcAddr,
> > >> > +  const int32_t *src
> > >> > + = (const int32_t *) _mesa_image_address(dims, srcPacking,
> srcAddr,
> > >> > srcWidth, srcHeight,
> > >> > srcFormat, srcType,
> > >> > img, 0, 0);
> > >> >for (row = 0; row < srcHeight; row++) {
> > >> >   /* The unpack functions with:
> > >> >*dstType = GL_FLOAT_32_UNSIGNED_INT_24_8_REV
> > >> >* only write their own dword, so the other dword (stencil
> > >> >* or depth) is preserved. */
> > >> >   if (srcFormat != GL_STENCIL_INDEX)
> > >> >  _mesa_unpack_depth_span(ctx, srcWidth,
> > >> > --
> > >> > 2.17.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

[Mesa-dev] freedreno CI day 1

2019-09-12 Thread Eric Anholt
I pushed the branch enabling freedreno CI today.  Now all the MRs will
get pre-merge testing with GLES3.1 on A630, and GLES2 on A307.

See .gitlab-ci/README.md for more info on how it works.  Also, as a
reminder, if you want to get something tested before generating your MR,
you can either edit .gitlab-ci.yml to change .ci-run-policy, or push the
branch to your repo with a name starting with "ci-".  Secondary note: If
you make an MR from a branch starting with "ci-", it will have two
pipelines run every time you update it :(

Today's surprises:

- layout_binding.ssbo.fragment_binding_array is unstable

I did one test to see if a patch I had on hand would fix it, and it
didn't, so I pushed through a patch disabling that test from CI so you
all wouldn't see those failures.

- EXT4 FS corruption

A few unfortunate events came together for this one: I had the kernel
boot args mounting / rw out of habit from back in my NFS-root days, and
there's no initrd to fsck /, and also I have harshly power-cycled them
all in the process of setting things up.  This adds up to "there's minor
corruption on / that may impact test runs."  Watch out for mysterious
docker errors.  If this occurs at a bothersome rate, feel free to push a
disable of freedreno CI until I can fix it, though it doesn't look too
bad yet.  I'll be fixing those boot args and making sure that we've got
clean filesystems on all boards tomorrow.


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

[Mesa-dev] [Bug 111679] Mesa build breaks when only building radeonsi due to missing llvm coroutines symbols

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111679

Shmerl  changed:

   What|Removed |Added

Summary|Mesa build breaks when only |Mesa build breaks when only
   |building radv and radeonsi  |building radeonsi due to
   |due to missing llvm |missing llvm coroutines
   |coroutines symbols  |symbols

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111679] Mesa build breaks when only building radv and radeonsi due to missing llvm coroutines symbols

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111679

--- Comment #3 from Shmerl  ---
(In reply to tele42k3 from comment #2)
> Hello Shmerl, this issue should have been fixed with
> https://gitlab.freedesktop.org/mesa/mesa/commit/
> 8d286776b6ca177a5e55a9c706081a40ebbcf091 , did you encounter this with git
> master after that commit?

Yes, I encountered it already after that commit. See attached patch. In
particular, it happens when building for example only radeonsi and nothing
else.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111679] Mesa build breaks when only building radv and radeonsi due to missing llvm coroutines symbols

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111679

--- Comment #2 from tele4...@hotmail.com ---
Hello Shmerl, this issue should have been fixed with
https://gitlab.freedesktop.org/mesa/mesa/commit/8d286776b6ca177a5e55a9c706081a40ebbcf091
, did you encounter this with git master after that commit?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111444] [TRACKER] Mesa 19.2 release tracker

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111444
Bug 111444 depends on bug 110814, which changed state.

Bug 110814 Summary: KWin compositor crashes on launch
https://bugs.freedesktop.org/show_bug.cgi?id=110814

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111679] Mesa build breaks when only building radv and radeonsi due to missing llvm coroutines symbols

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111679

--- Comment #1 from Shmerl  ---
Created attachment 145339
  --> https://bugs.freedesktop.org/attachment.cgi?id=145339=edit
Patch to prevent build breakage on missing llvm coroutines

Actually, I just tested, and it doesn't happen when building radv alone. So
attaching a better fix.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111679] Mesa build breaks when only building radv and radeonsi due to missing llvm coroutines symbols

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111679

Bug ID: 111679
   Summary: Mesa build breaks when only building radv and radeonsi
due to missing llvm coroutines symbols
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: not set
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: shtetl...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org

When building only radeonsi and radv, Mesa builds fails like this:

[1135/1135] Linking target src/gallium/targets/dri/libgallium_dri.so.
FAILED: src/gallium/targets/dri/libgallium_dri.so 
g++-9  -o src/gallium/targets/dri/libgallium_dri.so <...>
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_init.c.o): in
function `init_gallivm_state':
lp_bld_init.c:(.text+0x2ad): undefined reference to `LLVMAddCoroEarlyPass'
/usr/bin/ld: lp_bld_init.c:(.text+0x2b6): undefined reference to
`LLVMAddCoroSplitPass'
/usr/bin/ld: lp_bld_init.c:(.text+0x2bf): undefined reference to
`LLVMAddCoroElidePass'
/usr/bin/ld: lp_bld_init.c:(.text+0x31d): undefined reference to
`LLVMAddCoroCleanupPass'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
build failed!

To fix, it, llvm coroutines module can be enabled for example like this:

diff --git a/meson.build b/meson.build
index 29d7981d13d..9ca40e3e896 100644
--- a/meson.build
+++ b/meson.build
@@ -1244,7 +1244,7 @@ endif
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
 llvm_optional_modules = []
 if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
-  llvm_modules += ['amdgpu', 'native', 'bitreader', 'ipo']
+  llvm_modules += ['amdgpu', 'native', 'bitreader', 'ipo', 'coroutines']
   if with_gallium_r600
 llvm_modules += 'asmparser'
   endif

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111478] Add OpenGL ES (GLES) 1.0, 1.1 and 2.0 to docs/features.txt

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111478

Mike Lothian  changed:

   What|Removed |Added

 CC||m...@fireburn.co.uk

--- Comment #10 from Mike Lothian  ---
Maybe if you're going down that route we could use the information to update
https://people.freedesktop.org/~imirkin/glxinfo/ too

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111549] 19.2.0_rc1 fails lp_test_arit, u_format_test, PIPE_FORMAT_DXT5_RGBA (unorm8)

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111549

--- Comment #4 from Roland Scheidegger  ---
I guess it could be made switchable between fast and correct (like the gallivm
filtering hacks). Honestly though I don't particularly care about such old x86
cpus so personally I wouldn't reject a patch switching it to correct...

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111549] 19.2.0_rc1 fails lp_test_arit, u_format_test, PIPE_FORMAT_DXT5_RGBA (unorm8)

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111549

--- Comment #3 from erhar...@mailbox.org ---
I prefer correctness over speed, as far as I am concerned. Also hard to
distinguish if it's bad code or 'just fast code' when a test fails then. But I
am not the one to decide.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Propose: Add transform buffer in egl/drivers/dir2/platform_android.c

2019-09-12 Thread Rob Clark
On Wed, Sep 11, 2019 at 9:14 PM Cici Ruan  wrote:
>
> Hi Mesa developers,
>
> I would like to add a feature in egl/drivers/dir2/platform_android.c to 
> respect he transform hint and rotation in Android buffer and transform buffer 
> to pre-rotated buffer, so display hardware can do a simple linear read from 
> the buffer to scan it out.
>
> It's my first time to do something in Mesa repository here. According to the 
> document, I need propose first. If anyone has a different opinion, please let 
> me know. Or I will go ahead to work on it.
>

I think it is ok to go ahead and propose a patch.  I've added Fritz
who has been doing some work on y-flip extension, which I guess has
some overlap.  Although I'm not sure quite how it would work to
support arbitrary transformations (without an extra blit), since I
think this would have some effect on gl_FragCoord and some other
things like that.

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

[Mesa-dev] [Bug 111478] Add OpenGL ES (GLES) 1.0, 1.1 and 2.0 to docs/features.txt

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111478

--- Comment #9 from Rob Clark  ---
(In reply to Creak from comment #8)
> (In reply to Rob Clark from comment #7)
> > hmm, [1] looks like an older iteration of drm-shim.. have a look at:
> > 
> >   ./src/freedreno/drm-shim
> >   ./src/broadcom/drm-shim
> > 
> > in the mesa src tree.  They are an $LD_PRELOAD'd thing to spoof enough of
> > the kernel uabi to "run" the driver.  Ie. you can't actually do drawing, but
> > it is enough to run shader-db.  And so I think it should be pretty much
> > enough to run glxinfo.
> 
> Thanks! Are broadcom and freedreno the only two drivers having drm-shim?
> Because in order to generate entirely features.txt, I guess all the drivers
> should have it, right?

currently yes

perhaps mesamatrix.net could pull data from a different sources for drivers
that run glxinfo in CI?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111444] [TRACKER] Mesa 19.2 release tracker

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111444

tele4...@hotmail.com changed:

   What|Removed |Added

 Depends on||111527


Referenced Bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=111527
[Bug 111527] obs-studio + latest mesa on amdgpu/vega64 leaks kernel memory
rapidly
-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 111666] drm.h:50:9: error: unknown type name 'uint8_t'

2019-09-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111666

Michel Dänzer  changed:

   What|Removed |Added

 CC||e...@anholt.net

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] st/nir: fix illegal designated initializer in st_glsl_to_nir.cpp

2019-09-12 Thread Brian Paul

On 09/11/2019 03:06 PM, Ian Romanick wrote:

On 9/10/19 10:53 PM, Brian Paul wrote:

IIRC, designated initializers are not legal C++.
Fixes the MSVC build.

Fixes: 83fd1e58 ("glsl/nir: Add and use a gl_nir_link() function")
---
  src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 280a778..d6a0264 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -688,7 +688,7 @@ st_link_nir(struct gl_context *ctx,
  */
 if (shader_program->data->spirv) {
static const gl_nir_linker_options opts = {
- .fill_parameters = true,
+ true /*fill_parameters */


Could we get a comment in the definition of gl_nir_linker_options to
remind people to either add options only to the end or double check all
of the places that initialize the structures?  If someone adds 'bool
do_foo_instead_of_bar' option at the beginning of that struct, it will
cause problems.


};
if (!gl_nir_link(ctx, shader_program, ))
   return GL_FALSE;





How about something simple like this instead:


diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
b/src/mesa/state_tracker

index d6a0264..4f5acfd 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -687,9 +687,14 @@ st_link_nir(struct gl_context *ctx,
 * st_nir_preprocess.
 */
if (shader_program->data->spirv) {
-  static const gl_nir_linker_options opts = {
- true /*fill_parameters */
-  };
+  /* Note: this object could be static const but designated
+   * initializers are not part of the C++ standard (allowed by GCC
+   * but not MSVC.)
+   */
+  gl_nir_linker_options opts = { 0 };
+
+  opts.fill_parameters = true;
+
   if (!gl_nir_link(ctx, shader_program, ))
  return GL_FALSE;


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