summaryrefslogtreecommitdiffstats
path: root/src/runtimerender/resourcemanager
Commit message (Collapse)AuthorAgeFilesLines
* Fix crashing with missing OpenGL contextJanne Koskinen2021-03-301-0/+4
| | | | | | | | | Safeguard. Loading sub-presentation with delayed loading causes resources to be loaded from job threads with no OpenGL context. Fixes: QT3DS-4213 Change-Id: I1b62741905284e2aacca63f832f3fa68bd784f8d Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix black screen in the editorAntti Määttä2020-10-212-18/+38
| | | | | | | | | Clear and destroy resource manager resources between switching projects. Task-number: QT3DS-4190 Change-Id: Id650481ab41038d4b274809f1ea87bf3e2271e49 Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add option for always premultiplied astcKaj Grönholm2020-10-152-0/+21
| | | | | | | | | | When QT3DS_ALL_ASTC_PREMULTIPLIED is defined or set as environment variable, all astc images are considered to be premultiplied. Task-number: QT3DS-4182 Change-Id: Ibe039b65322f252158bd38a2ca5b57d270c3d209 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add RGBA_ETC2 format to scan for transparency functionAntti Määttä2020-10-081-0/+1
| | | | | | | This prevents assert in debug mode. Change-Id: I90d8bd5fe93d857bfef3f57104a840c343fced02 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix crash when slide change occursAntti Määttä2020-10-066-163/+136
| | | | | | | | | | The buffer manager needs to use resolved paths for each image loading function. Also convert to use QString to avoid unnecessary string conversions. Also fix image loading task to use resolved paths. Task-number: QT3DS-4177 Change-Id: I79fae56a8f49ccbdcaed1fa9eb9a9d875583d0dd Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Try to resolve images only onceKaj Grönholm2020-10-012-8/+24
| | | | | | | | Task-number: QT3DS-4176 Change-Id: Ib1bcdd201a973122a36550971d9ce16148ef8d28 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Prevent duplicates in searchPaths and reverse itTomi Korpipaa2020-09-281-4/+5
| | | | | | | | | | | | The first 3 paths in the searchPaths are for finding the other things we need to search for, the last ones are for source paths. Reversing the order drops the required search count in a usual case from 4 attempts to 1 or 2. Task-number: QT3DS-4172 Change-Id: I0d7665566be6b8a9d5e7b918f7596f70126ad958 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Unify source path usage in runtimeAntti Määttä2020-09-246-105/+259
| | | | | | | | | | | There are several fixes done to source paths before their usage, but they are done in different places. Put these all into function and call this function before using the source paths. Task-number: QT3DS-4162 Change-Id: I0d3e3fd2db0cb11c6e9cb28fb3054568884059db Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Remove unused codeAntti Määttä2020-09-211-4/+0
| | | | | | Change-Id: I686f6e333e2b1d918de111201c4a600dce1f9688 Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Remove unused functionsAntti Määttä2020-09-211-22/+0
| | | | | | Change-Id: I9b57152d059b7e2ea8eed6ce3fbb47e4005e735a Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Ignore schema when comparing texture keysJanne Koskinen2020-09-141-0/+5
| | | | | | | | | | Use only filepath as the key for textures. Removes double loading of textures accessed in different style. Task-number: QT3DS-4154 Change-Id: I46dbfcef35944b61d74c821374d103a0d1b65134 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Try loading files outside of UIP/UIAJanne Koskinen2020-09-141-0/+14
| | | | | | | | | | Delayed loading ignores files not listed in UIP, try loading them if not found from the texture map. Task-number: QT3DS-4159 Change-Id: I32011390976493e9c43126b6d162516fa24bca6a Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Support automatic detection of texture file extensionKaj Grönholm2020-09-041-5/+43
| | | | | | | | | | | | | | | When using setAttribute() it is now possible to give filename without the extension and engine automatically locates the most suitable existing file. If preferKTX is set, compressed texture formats (ktx, astc, dds) are preferred over non-compressed ones (e.g. png, jpg). The behavior is similar to Qt Quick Image automatic detection of file extension. Includes autotest to confirm the behavior. Task-number: QT3DS-4059 Change-Id: I1d4ab0d86b34f5deb704d450e5c36e86afde7d3b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add ECT2_EAC to supported ktx formatsAntti Määttä2020-05-071-0/+2
| | | | | | Task-number: QT3DS-4102 Change-Id: I2dc4ab64715ffa3c2a13309b716ca4ffcdd51b3e Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Make attributes referenced for custom materialsJanne Kangas2020-04-071-6/+21
| | | | | | | | | | | | | | Mark custom material attributes as referenced always in order to make it possible to use setAttribute. Also fix file path error for images used in custom materials that also have "controlledproperty" attribute (=datainput controller) set. Task-id: QT3DS-4091 Task-id: QT3DS-4092 Task-id: QT3DS-4072 Change-Id: Icf39269ac3fed3f615cb5f7d52cd4e28176f5350 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add warning for missing images during batch loadJere Tuliniemi2020-01-271-0/+2
| | | | | | Task-number: QT3DS-4046 Change-Id: I0eac5cb7b4f6f474f0c0ef38573349401e1901d8 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix assert when scanning hdr image for transparencyAntti Määttä2020-01-101-0/+1
| | | | | | | | Add the missing enum to the switch. Change-Id: I617df9d9c18c3769d6bb61f0fa7eb529baed0a0a Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Support RGBE hdr images directlyAntti Määttä2019-12-134-78/+326
| | | | | | | | | | Do not convert RGBE images to 16-bit floating point, but use then directly in the shaders. Task-number: QT3DS-4031 Change-Id: Iecfc775247553d5fd8976c77c572435462b79e64 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add project setting for automatically flipping compressed texturesJanne Kangas2019-12-126-20/+52
| | | | | | | | | | | Flip ktx and astc textures in shader if project settings has flipCompressedTextures flag set as true. Also, fix bug in shader generator UV flipping code. Task-id: QT3DS-4015 Change-Id: Ic406569c15e172c513f5d412ba41ab84348a392b Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Improve perf logging #2Kaj Grönholm2019-12-092-3/+3
| | | | | | | | | | | | | | | Improve startup perf logging, including: - Move outputting startup perf logs into better place. Previously only part of the logs were printed as output happened too soon, now printing at first frame rendering. - Show also amount of calls and cumulative timestamps. - Improve log labels formatting. - Add more logging points into hot spots. Task-number: QT3DS-4021 Change-Id: I7db5a11ff10be1ccb691f82b10161e8ba7c316a6 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix opaque pixel detectionJere Tuliniemi2019-12-051-2/+3
| | | | | | | | | | | The scan would stop upon first transparent pixel, so subsequent opaque pixels wouldn't be detected. Task-number: QT3DS-4012 Change-Id: I2b12104393433ef142812234fec5ee5ca6732691 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Improve perf logging & timersKaj Grönholm2019-12-032-3/+3
| | | | | | | | | | | | | | | | | OpenGL runtime contains perf timers but they are not documented so probably not much used. Switch to using QT3DS_PERF_SCOPED_TIMER macro instead of direct SStackPerfTimer usage. Then SStackPerfTimer debugs overhead can be fully removed when QT3DS_ENABLE_PERF_LOGGING is not defined (default). Print first frame render time when qt3ds.perf_info is on. Task-number: QT3DS-4021 Change-Id: Id11a1c5bb8bf24f545e9bceb333212f345b29bb7 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Support LEGACY_ASTC_LOADING with delayed loadingJere Tuliniemi2019-11-201-0/+2
| | | | | | | | | | Images were never loaded if both the legacy flag and delayed loading were on. Task-number: QT3DS-3999 Change-Id: I3729c8d111236ed88c2d3db6dadd269cae365f01 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Remove extra memcopy from ASTC loadingJanne Koskinen2019-10-111-4/+4
| | | | | | | Read the data directly into the structure. Change-Id: I28289b66ce7bd59f747cc517388d51cf57213de8 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add transparency mode selection to standard materialsJere Tuliniemi2019-09-191-0/+29
| | | | | | | | | | | | | | | | | | | | ASTC textures would need to be decompressed upon loading to scan for transparency, or the texture files would need their own user-defined settings to enable transparency. Instead, as a work-around, materials can be forced to be treated as transparent without manipulating opacity. This is implemented with a transparency mode drop down list containing "Default", "Force Transparent" and "Force Opaque" options. "Force Opaque" can be used to force the material to be treated as opaque even when the textures used are transparent. By default ASTC textures are treated as non-transparent. Task-number: QT3DS-3904 Change-Id: I22255ffb2e2be5efea3e56466d58ddcc46490bb2 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix ASTC loadingKimmo Ollila2019-09-171-0/+5
| | | | | | | | Task-number: QT3DS-3903 Change-Id: I0f0cb49ea4d630f2af5e384569f1dd1a1880ae71 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add support for loading ASTC texture containersAndy Nichols2019-09-173-0/+207
| | | | | | | | Task-number: QT3DS-3903 Change-Id: Icf8d71e77a37d30ffc46322f8d03c9e94f63ac7b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Check more than S3/DXT support for compressed texturesAndy Nichols2019-09-171-6/+8
| | | | | | | | Task-number: QT3DS-3903 Change-Id: I23e50102857067324681c6ffaa0f166336214695 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Support QQuickImageProvider in the runtimeJere Tuliniemi2019-09-175-10/+63
| | | | | | | | | | | | | | | With QQuickImageProvider the user can make a callback method returning a custom QPixmap or QImage to the engine without accessing the filesystem. Texture sourcepaths are set using an image url scheme. For example "image://colors/blue" where "image://" tells the runtime to look for an image provider, "colors" is the image provider id and rest are the image id the provider uses to create the image. Task-number: QT3DS-3761 Change-Id: I830649359f9969e957a972a0c08d0ede6e46ee78 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Implement two-pass rendering for transparent objectsAntti Määttä2019-09-124-19/+53
| | | | | | | | | | | | | | If object has both opaque parts and transparent parts it will be rendered incorrectly due to no z-buffering. Add two-pass method to render the opaque and transparent parts separately. - Add opaque pixel check to transparency check of images. - Add alpha test rendering to default material shadows too. Task-number: QT3DS-3515 Change-Id: I9700b8fb463df9143c5bb9cbe66c7570081ebf5c Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Long live the slayer!Pasi Keränen2019-06-0724-0/+8777
Initial commit of OpenGL Runtime to repository. Based on SHA1 61823aaccc6510699a54b34a2fe3f7523dab3b4e of qt3dstudio repository. Task-number: QT3DS-3600 Change-Id: Iaeb80237399f0e5656a19ebec9d1ab3a681d8832 Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>