Commit Graph

507 Commits

Author SHA1 Message Date
blackhole a8a10b0b89
Adds example 49-hextile (#2922)
* First commit - tested with dx11 on windows

* Minor changes & adding some comments.

* Update hextile.cpp

* update some bin files

* rename texture

* minor comment update

* Added support to configure tile rate as well as tile rotation strength, update bin files & screenshot

* use texture from polyhaven, updated screenshot, updated bin files & minor changes to shader.

* missed pushing texture

* update license

* Update hextile.cpp

* Fix regular tiling

* use ktx with mipmaps

* minor change to ensure that regular tiling & hextile matches with default tile rate.

* minor c

Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2022-09-15 19:03:07 -07:00
Бранимир Караџић 9ad3825cee D3D12: Linux build. 2022-09-14 20:59:59 -07:00
Branimir Karadžić 358f48879a Updated directx-headers. 2022-09-12 20:19:21 -07:00
SnapperTT 135dc7fa27
Adds example 48-multidrawindirect (#2894)
* Added example 48-multidrawindirect

* Added example 48-multidrawindirect

* enable shader.mk to build directories that only have compute shaders

* compiled shaders for example 48

* MultidrawIndirect example renamed to DrawIndirect, sets draw mtx in compute

* update 48-drawindirect shaders

* fix typos

* fixed bgfx::setPlatformData change for example48

* fix docs

* added name to cs_drawindirect.sc

* style updates for example 44

* add slider to example 48-drawindirect
2022-08-26 21:32:15 -07:00
Sandy 85910e9778
Add BGR versions of 16 bit formats (#2897)
* pixelformats: Add BGRA4

* pixelformats: Add BGR5A1

* pixelformats: Add B5G6R5

* make idl
2022-08-25 16:08:06 -07:00
Michał Cichoń 549077fc0b
Pixelformats example mupltiple sources (#2889)
* Added texture conversion for pixelformat to runtime asset.

* pixelformats: Support multiple sources, cleanup
2022-08-23 12:51:00 -07:00
ichordev e9e9605304
Updated BGFX_PCI_ID docs to reflect GPU priority & added missing enums (#2888)
* Add new BGFX_PCI_ID enums

* Updated BGFX_PCI_ID docs to reflect GPU priority & added missing enums

* Updated bgx.idl; minor corrections; ran GENie
2022-08-23 09:30:01 -07:00
Sandy 651432df1d
examples: Add imageformats example (#2872)
* examples: Add imageformats example

Example which renders RGBA color wheel, alpha gradient and full value channel textures to
catch conversion errors and bad internal type representations between different backend
renderers.

The example uses bimg to convert from a master texture to different textures.

Each texture is rendered in an ImGui list using `ImGui::Image`. A close-up is visible
when hovering over each image.

U and I textures are skipped because they don't work for sampling.
Compressed textures are skipped because they don't have conversion functions.
Depth textures are not rendered because they don't work with channels.

* pixelformats: Present texture format in table

* Update pixelformats.cpp

* Update pixelformats.cpp

* pixelformats: Update screenshot

* pixelformats: Add checkerboard background

Co-authored-by: Michał Cichoń <michcic@gmail.com>
Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2022-08-22 12:16:58 -07:00
Бранимир Караџић 758d02db1e Updated spirv-tools. 2022-07-29 21:41:54 -07:00
Cedric Guillemet a3d52fab32
premultiplied backbuffer for UWP/SwapchainPanel (#2837)
* premultiplied backbuffer for UWP/SwapchainPanel

* init flag

* caps and feedback/opengl premul

* reduced #ifdef form

* removed ifdef
2022-07-18 09:23:57 -07:00
luzpaz e7936efa6a
Fix typos (#2839)
Found via `codespell -q 3 -S ./3rdparty,*.ttf -L attribut,ba,clude,conly,indext,inout,lod,nclude,retur,struc,unknwn,utput`
2022-07-12 14:21:31 -07:00
Бранимир Караџић f06d7257b2 Fixed docs. 2022-07-11 05:45:02 -07:00
Cedric Guillemet f0cf1794e7
Fix MSAA with ARM Mali OpenGL ES (#2818)
* Fix MSAA with ARM Mali OpenGL ES

* indenting
2022-06-15 03:35:19 -07:00
Бранимир Караџић 6cf243f469 Cleanup. 2022-06-04 11:03:41 -07:00
Бранимир Караџић 05b60be3c2 Remove 17-drawstress from Emscripten build. 2022-06-02 12:03:01 -07:00
Catalin Moldovan 9204a536dd
Fixed indentation on zig wrapper functions and converted to uppercase 2D/3D (#2809) 2022-05-29 07:50:14 -07:00
Catalin Moldovan f0741047d8
more idiomatic zig bindings (#2804) 2022-05-22 18:43:03 -07:00
Jared Miller c084dd2616
Update Zig binding generation (#2765) 2022-04-08 06:41:00 -07:00
Catalin Moldovan 21f5f941bb
Added zig bindings generation (#2757) 2022-04-03 18:42:43 -07:00
Бранимир Караџић 6940ddd85e Cleanup. 2022-03-31 20:21:32 -07:00
ichordev 81c6610293
Minor rewording & increase of clarity (#2752)
* Minor rewording & increase of clarity

* Corrected a noun that was being used as a verb

* Slight rewording of the C99 bindings notices

* Actually, this sounds better & looks nicer
2022-03-31 18:07:21 -07:00
ichordev 6bc813fb76
Updated D bindings: enums expanded; added some C++ pre-processor functions (#2742)
* D binds: expanded enums; added some C++ pre-processor functions

* Updated D bindings files
2022-03-08 11:25:54 -08:00
ichordev 630890f5de
Fixed uint8_t being bound to byte instead of ubyte (#2735) 2022-03-05 16:32:38 -08:00
luzpaz 6875e96bcb
Fix various typos (#2719)
Found via `codespell -q 3 -S ./3rdparty,*.ttf -L attribut,ba,clude,conly,indext,inout,lod,nclude,retur,utput`
2022-02-05 11:34:15 -08:00
Бранимир Караџић 4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Бранимир Караџић 949142a75f Metal: Added GPU vendorId/deviceId detection. Fixed #2688. 2021-12-19 23:11:33 -08:00
Бранимир Караџић 1e2ca25424 Added Apple vendor id. 2021-12-19 21:05:20 -08:00
jwdevel fd9bcf541a
Enhance docs for BGFX_DEBUG_PROFILER, showing relation to per-view stats. (#2683)
Current docs are a little ambiguous with the term "profiling"; sometimes it means
bgfx::CallbackI functions, and sometimes per-view stats collection. This makes it a little clearer.
2021-12-13 12:46:06 -08:00
Бранимир Караџић 60c64a3f77 Cleanup. 2021-12-01 11:22:36 -08:00
Cedric Guillemet 64a28415a8
Disable Batch indirect mode for Microsoft WARP (#2672)
* Disable Batch indirect mode for Microsoft WARP

* idl

Co-authored-by: Cedric Guillemet <ceguille@microsoft.com>
2021-12-01 11:19:47 -08:00
Branimir Karadžić 00df353f0b Fixed project groups. 2021-10-26 20:13:30 -07:00
Бранимир Караџић 8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -07:00
Branimir Karadžić b7213445db Added 46-fsr example. 2021-10-06 17:40:57 -07:00
Daniel Collin 0a4ed20b59
Cleanup bgfx.idl (#2597) 2021-08-29 11:07:02 -07:00
Бранимир Караџић ee0fbea726 Added AGC renderer stub. 2021-08-24 19:35:09 -07:00
kingscallop 17c9300afd
Allow shaders to be compiled on msys2 (#2539)
Adds support on tools.mk for the msys2 environment. The OS is still
considered windows but the command line tools for mkdir and rmdir
behave as if on linux.

The variable SHADER_TMP on the makefiles also had to be quoted to make
it work on msys2.
2021-06-12 11:36:54 -07:00
kingscallop c0adb2a51e
Make the generated embedded shader headers the same between linux and gnuwin32 (#2538)
This echo command on the makefile behaves differently between linux and gnuwin32:
```
-@echo extern const uint8_t* $(basename $(<))_pssl;>> $(@)
```

On linux the semicolon immediately ends the echo command and its output is never piped to the embedded shader's header.
If you try to fix it by quoting the string:
```
-@echo "extern const uint8_t* $(basename $(<))_pssl;" >> $(@)
```

It will work on linux but not on gnuwin32 because the quotes will appear on the outputted string.
The solution was to use printf which works consistently between the two.

Also on gnuwin32 the outputted string has 'CRLF' line endings, which clashes with the rest of the 'LF' line endings
of the embedded shaders header which were produced by shaderc.
The solution was to remove the 'CR' from the outputted string by using the tr command.
2021-06-12 10:22:19 -07:00
kingscallop 73784ac9eb
Split embedded shaders into essl and glsl - Part 1 (#2535)
In non-embedded shaders there is a separation between essl binaries (examples/runtime/shaders/essl)
and glsl binaries (examples/runtime/shaders/glsl). On embedded shaders there is no such separation
and by default essl shaders are being used by the OpenGL runtime. This usually doesn't cause any
issues but in the case of the debugdraw shaders, that started using uvec4, this now leads to a
runtime error. This patch fixes this by splitting the embedded shaders into essl and glsl.

As asked, this is the first part of the change.

To be able to compile the 'examples/common/debugdraw' shaders, pull
request #2362 is needed.
2021-06-06 13:53:26 -07:00
Бранимир Караџић 08e3d51a9e Fixed docs. 2021-05-25 20:13:59 -07:00
Бранимир Караџић 6baa370801 Fixed transient index buffer functions to all have 32-bit indices support, and removed 16-bit only restriction from docs. 2021-05-25 12:47:28 -07:00
Бранимир Караџић 117c999d6e Added bgfx::Init capabilities mask. 2021-04-22 20:18:48 -07:00
Hugo Amnov cf8ff18263
WebGPU update (#2477)
* WebGPU: Update to latest changes + Fixes

* WebGPU: Fix RG11B10F format as framebuffer
2021-04-18 11:39:52 -07:00
Бранимир Караџић 6109697ade Added bgfx::isFrameBufferValid API. 2021-04-16 22:13:26 -07:00
Бранимир Караџић 69fb21f50e Cleanup. 2021-04-13 21:55:56 -07:00
Sam 49fb72842a
Minor alteration to clarify that BGFX_DISCARD_STATE also discards uniforms (#2464)
Signed-off-by: Samuel Hellawell <sshellawell@gmail.com>
2021-04-09 21:51:03 -07:00
Aleš Mlakar f2a42ec216
Updated Beef bindings (#2426)
* Vulkan shader compiler uniform size fix (>255).

* Updated IDL Beef bindings

Co-authored-by: Aleš Mlakar <ales.ambits@gmail.com>
2021-03-17 17:49:01 -07:00
Бранимир Караџић a735fccd15 Cleanup. 2021-03-05 18:07:45 -08:00
pezcode 302c978b1d
Make shaderc output independent of backend enums (#2411)
* Fix typo in SPIR-V id

* Use backend-agnostic shaderc output

...as opposed to directly storing and comparing against Vulkan and WebGPU enums. This is backwards-compatible with existing code and shaders.

* Remove comments and Undefined value
2021-02-28 12:38:12 -08:00
Julian Sikorski 39cdaace39
Fix building with wayland (#2412) 2021-02-28 10:15:09 -08:00
Бранимир Караџић 7daf5e0ba7 Cleanup. 2021-02-07 15:01:02 -08:00
Бранимир Караџић 239ce7a612 Fixed typo. 2021-02-07 07:35:18 -08:00
Branimir Karadžić 1401a5333d 45-bokeh: Built shaders and added example. 2021-01-31 10:07:49 -08:00
Hugo Amnov a515dd3c3d
WebGPU update (#2364)
* Update WebGPU renderer to match new state of API

* Update WebGPU files
2021-01-19 15:18:30 -08:00
Бранимир Караџић af49c5d264 Happy New Year! 2021-01-14 15:53:49 -08:00
Branimir Karadžić 4c18b80c9d 44-sss: Built shaders and added example to GENie script. 2021-01-10 11:24:28 -08:00
Branimir Karadžić 4760628bb1 43-denoise: Added shaders. 2021-01-02 10:46:43 -08:00
Бранимир Караџић 76f3e0590f OSX: Added separate osx-arm64 build configuration. 2020-12-31 18:17:39 -08:00
Бранимир Караџић f232f93017 Added build rule to examples makefile. 2020-12-28 11:58:03 -08:00
Branimir Karadžić 5c304dad3b Fixed issue #2330. Added support for 32-bit indices in transient index buffer. 2020-12-15 19:01:25 -08:00
Бранимир Караџић 796acfa98b Added Attachment.numLayers needed for viewport layer array support. 2020-12-12 10:04:14 -08:00
Бранимир Караџић 8dd39d42df Cleanup. 2020-12-02 21:08:25 -08:00
Aleš Mlakar 93f0cdfaf4
IDL Beef bindings (#2290)
Co-authored-by: Aleš Mlakar <ales.ambits@gmail.com>
2020-10-19 06:54:18 -07:00
kingscallop 436b7fab9e
Adds UAV support for D3D12, Vulkan and reworked for OpenGL, D3D11 (#2119)
* Adds UAV support for D3D12, Vulkan and reworked support for OpenGL, D3D11

UAV support is now uniform across compute and draw.
To set a UAV you just use bgfx::setImage() and IMAGE2D in the shader, just like in compute.
Due to these changes shaders will have to be recompiled.

The changes include:
	- D3D11 requires patching of the UAV slot number (which is now done by modifying the DXBC instead of using a macro)
	- If the DXBC binary includes a debug chunk, that is also patched to match the new slot number
	- All the other renderers don't need any kind of patching
	- There are some shader annotations to better convert the UAV format used in hlsl to spirv

Possibility of further enhancements:
	- bgfx::setViewFrameBuffer() only supports binding to a framebuffer or, using BGFX_INVALID_HANDLE, to bind the default backbuffer. This doesn't allow for the case where there is no need to bind to either one of them, for example when using a fragment shader only to read and write to an UAV.

* Bump shader version, because they need to be recompiled.
2020-10-04 21:51:41 -07:00
Бранимир Караџић 115661d158 Updated natvis. 2020-09-30 13:49:34 -07:00
Бранимир Караџић 86402fec24 Updated version number. 2020-09-05 11:24:50 -07:00
云风 0e1c095c3b
add *_with_layout APIs (#2251) 2020-09-01 20:19:14 -07:00
云风 4d6445896e
Add missing VertexLayoutHandle for C APIs (#2249) 2020-09-01 08:36:52 -07:00
Johan Sköld 74aae908ce
Updating xcode config. (#2198)
Changing the xcode platform to just `Native`. This lets xcode handle
all the target stuff, and works regardless of target.
2020-07-11 20:40:33 -07:00
Бранимир Караџић 9215cc8199 Updated glslang. 2020-07-10 17:17:00 -07:00
Бранимир Караџић b152cba968 shaderc: Disabled warnings. 2020-07-10 16:24:50 -07:00
Бранимир Караџић 79964ffe13 Fixed build. 2020-06-20 09:06:37 -07:00
Mohamed Shazan f8a9721fb3
Small fix on soname defining on ldflags (#2176)
Based on https://stackoverflow.com/questions/47279824/android-ndk-dlopen-failed
2020-06-20 09:02:51 -07:00
Бранимир Караџић e9946b1be6 Cleanup. 2020-06-20 08:11:00 -07:00
Бранимир Караџић 7f3bd1f9bb Cleanup. 2020-06-20 08:06:26 -07:00
Mohamed Shazan c6e4f528cb
Fix target extension on android for shared-library (#2175)
* Fix target extension on android for shared-library

* Add soname for linker

To avoid runtime dlopen() errors
2020-06-20 08:05:12 -07:00
Christophe Dehais 4a0b6dc3ff
Package runtime data alongside HTML5 examples (#2173)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-06-18 10:32:10 -07:00
Бранимир Караџић 8065659e90 Added configurable minimum resource command buffer size. 2020-06-03 17:58:54 -07:00
Бранимир Караџић 977188e9de Added weldVertices 32-bit indices support. 2020-05-30 21:38:41 -07:00
云风 be95d12307
Add examples 42 : BunnyLOD (#2155) 2020-05-30 10:49:06 -07:00
Бранимир Караџић 2baa857065 Fixed IDL generator mix of short/long Doxygen comments. 2020-05-30 09:21:49 -07:00
Бранимир Караџић 1c063fdc67 Fixed spelling. 2020-05-30 08:22:08 -07:00
云风 79166dfe17
Allow passing config macros from env (#2147) 2020-05-17 21:04:31 -07:00
juj 098e6194d9
Update examples to build on Emscripten Wasm. Add separate wasm and wasm2js targets. (#2145) 2020-05-16 19:45:55 -07:00
Бранимир Караџић e08de6dd2c Fixed GENie script when action is not specified. 2020-05-10 22:15:06 -07:00
Бранимир Караџић 1359503a62 Cleanup. 2020-05-10 17:47:10 -07:00
Бранимир Караџић bbd41124b7 Cleanup. 2020-05-09 10:24:23 -07:00
Бранимир Караџић 4e41f3d0bd Fixed build. 2020-05-08 09:03:02 -07:00
Hugo Amnov b62302631e
Add Webgpu backend (#2132)
* WebGPU first draft (shaderc bin version 8)

* WebGPU scripts
2020-05-08 08:53:53 -07:00
Бранимир Караџић f2e79bbe41 Fixed #2133. 2020-05-03 19:58:15 -07:00
Бранимир Караџић 60b51dcf85 Fixed #2128. 2020-05-03 18:18:26 -07:00
Бранимир Караџић 7792a893af Cleanup. 2020-04-25 09:50:52 -07:00
Бранимир Караџић 00d1225cc6 Updated docs. 2020-04-16 21:27:48 -07:00
Бранимир Караџић 6a1db4c2a2 Updated docs. 2020-04-14 20:13:22 -07:00
Бранимир Караџић 000a3b704c Cleanup. 2020-04-14 08:37:07 -07:00
Бранимир Караџић 06460b8ac2 Fixed discard flags. 2020-04-02 19:04:13 -07:00
Бранимир Караџић c306e3b4bf Added bgfx version number. 2020-04-01 20:50:44 -07:00
Бранимир Караџић 23f9ba6552 Cleanup dicard flags. 2020-04-01 19:23:40 -07:00
Бранимир Караџић 6c0c5c9921 Renamed vertexdecl.* to vertexlayout.* 2020-03-28 20:06:03 -07:00
Cedric Guillemet dbb83d2525 PR feedback 2020-03-18 02:14:20 +00:00
Cedric Guillemet 0881d98bd2 Discard flags for submit call 2020-03-18 02:14:20 +00:00