Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Lots of warnings inside spirvcross_stdlib.ispc #7

Open
emoon opened this issue Sep 25, 2018 · 1 comment
Open

Lots of warnings inside spirvcross_stdlib.ispc #7

emoon opened this issue Sep 25, 2018 · 1 comment

Comments

@emoon
Copy link

emoon commented Sep 25, 2018

When compiling with the latest availible binary of ISPC https://ispc.github.io/downloads.html (1.9.2) there are lots of warnings inside this file and this list goes on for a while.

c:\\temp/spirvcross_stdlib.ispc:395:92: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(uniform int2 a, varying int b) { varying int2 ret = { a.x / b , a.y / b }; return ret; }
                                                                                           ^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:395:102: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(uniform int2 a, varying int b) { varying int2 ret = { a.x / b , a.y / b }; return ret; }
                                                                                                     ^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:396:93: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(uniform int2 a, varying int2 b) { varying int2 ret = { a.x / b.x , a.y / b.y }; return ret; }
                                                                                            ^^^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:396:105: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(uniform int2 a, varying int2 b) { varying int2 ret = { a.x / b.x , a.y / b.y }; return ret; }
                                                                                                        ^^^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:397:92: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(varying int2 a, uniform int b) { varying int2 ret = { a.x / b , a.y / b }; return ret; }
                                                                                           ^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:397:102: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(varying int2 a, uniform int b) { varying int2 ret = { a.x / b , a.y / b }; return ret; }
                                                                                                     ^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:398:93: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(varying int2 a, uniform int2 b) { varying int2 ret = { a.x / b.x , a.y / b.y }; return ret; }
                                                                                            ^^^^^^^^^

c:\\temp/spirvcross_stdlib.ispc:398:105: Performance Warning: Division with varying integer types is very inefficient.
static SPIRV_INLINE varying int2 operator/(varying int2 a, uniform int2 b) { varying int2 ret = { a.x / b.x , a.y / b.y }; return ret; }
@jonckennedy
Copy link

Hi,

Thanks for reporting this but it is a known issue. I codegen many operators/functions with lots of combinations of arguments which are varying/uniforms etc, mainly for completeness. This can generate code which is not efficient in some cases, like division with a varying. In the ideal world, these would only output warnings if they are used however, ISPC doesn't support this currently.

Looks like they now support disabling local warnings (ispc/ispc#1342) so I shall add this support as soon as they next make a release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants