Commit Graph

608 Commits

Author SHA1 Message Date
Бранимир Караџић
8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -07:00
Бранимир Караџић
53c4fc9d17 Fixed build. 2021-10-16 12:27:27 -07:00
Бранимир Караџић
c5d1a1a8e3 Moving bounds from bgfx to bx. 2021-10-16 10:41:42 -07:00
Branimir Karadžić
a923b86aab Fixed warnings. 2021-10-06 09:55:26 -07:00
Бранимир Караџић
e180849b89 shaderc: Fixed SPIRV outputting useless uniforms. 2021-10-01 20:13:46 -07:00
MooZ
b8d2f01b98
Fixed shadow map sampling for 130 and above glsl profiles. (#2496)
* Fixed shadowmap sampling for 130 and above glsl profiles.

* Fixed shadowmap sampling on OpenGL ES 3 and onwards.
2021-09-27 07:03:06 -07:00
Бранимир Караџић
f1ddf67114 Added initializer types. 2021-09-06 09:03:26 -07:00
C.Even
13e6100681
Fix shaderc consistency (#2553)
* shaderc: Initialize 'texFormat' in uniform.

* glsl-optimizer: Fix consistency error of 'print_float'
2021-07-20 06:06:56 -07:00
Barrett Kepler
c8b32d38dd
Add compute shader type to shaderc help. (#2559) 2021-07-18 16:53:24 -07:00
Branimir Karadžić
f569fe32a6 Rebuilt all embedded shaders. 2021-06-06 14:51:46 -07:00
kingscallop
e65d185ed6
Fix DebugDraw shaders compilation (#2362)
* Fix DebugDraw shaders compilation

Pull request #2317 broke compilation of the DebugDraw shaders (vs_debugdraw_fill.sc, etc)
on the Intel mesa driver. Shaders with a version lower than 130 have no
support for uvec or ivec by default on OpenGL.

This patch detects when these shaders are present and bumps the version when appropriate.

* Removed the ivecs from the patch
It seems the ivecs are infact supported on versions lower than 130 on
OpenGL.
2021-06-06 14:05:14 -07:00
kingscallop
1ab27e277b
Fix hardcoded bgfx dir from include paths in makefiles (#2532)
Only these four makefiles had these hardcoded paths.
All other makefiles don't specify the bgfx dir name.
2021-06-05 13:55:19 -07:00
kingscallop
8247e061f0
Fixes texturev embedded shaders compilation (#2531)
Compiling 'fs_texture_array.sc' with shaderc for OpenGLES fails with a syntax error,
because the matrix transpose function definitions occur before extension directives,
in this case EXT_texture_array.
2021-06-05 13:54:38 -07:00
Бранимир Караџић
67e628d8e3 Cleanup. 2021-04-25 20:23:36 -07:00
Бранимир Караџић
7ae40fb95d texturev: Added renderer .ini setting. 2021-04-25 19:09:26 -07:00
Branimir Karadžić
f27f44f974 texturev: Updated shaders. 2021-04-25 18:07:57 -07:00
Бранимир Караџић
74b146eb83 Fixed build. 2021-04-21 22:11:36 -07:00
Hugo Amnov
ec36cf9872
Simplify SPIRV bindings shifts (shaderc bin version 11) (#2487) 2021-04-21 09:33:12 -07:00
Hugo Amnov
07e9af249c
Cleanup old debug and Metal code in SPIRV shaderc paths (#2484)
* Shaderc: Remove unused MTL path in SPIRV compiler

* Shaderc: Remove unused SPIRV reflection code
2021-04-21 07:45:03 -07:00
Hugo Amnov
24be4a38d0
WebGPU: Add texture format to shaderc (bin version 10) + streamline storage Images in shaders (#2482)
* WebGPU: Add texture format (shaderc bin version 10)

* WebGPU: Simplify storage images + Fix format decorations

* Shaderc: Cleanup Texture name assumption in textures
2021-04-20 20:18:49 -07:00
Hugo Amnov
b2d72b1495
Shaderc: Add missing raw compilation targets (#2478) 2021-04-18 11:45:33 -07:00
pheonix
1781308312
Remove obsolete branch point. (#2429) 2021-03-21 18:49:34 -07:00
Aleš Mlakar
dc3a92ef99
Vulkan shader compiler uniform size fix (>255). (#2421)
Co-authored-by: Aleš Mlakar <ales.ambits@gmail.com>
2021-03-08 07:48:17 -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
Branimir Karadžić
da555b0721 Rebuild tools embedded shaders. 2021-02-26 18:49:02 -08:00
pheonix
d89ff312a7
Fix leak - using no fancy smanshy new age voodoo (#2390) 2021-02-11 21:43:22 -08:00
Бранимир Караџић
0123d43c96 Fixed build. 2021-02-11 08:35:16 -08:00
elvencache
7f758a06a7
Improve Bokeh example (#2377)
* display bokeh sample pattern, add bokeh shape, improve look

draw sample pattern to texture and display in ui to see number of samples and their arrangment

add bokeh shape controls

remove adhoc 'sqrt' pattern since display makes existing pattern easier to understand and it looks nicer.

switch to floating point color texture and leave lighting results in linear space until after dof is performed. provides better results and bright spots can make more noticeable bokeh shapes.

change default values to use take more samples at reduced resolution so initial experience when loading the sample is better looking image

* update screenshot, minor change to ui

fix height of ui element so scrollbar not required by default layout
update screenshot

* fix typo in texturev

atleast, i'm pretty sure that's a typo don't see a reason to set width twice
2021-02-04 20:28:54 -08:00
Kartoffelsaft
c3c3f869f5
add newline at end of error (#2374) 2021-01-31 11:27:25 -08:00
Бранимир Караџић
af49c5d264 Happy New Year! 2021-01-14 15:53:49 -08:00
MooZ
465c13ad37
Set profile id for metal and pssl to avoid d3d9 codepath. (#2355) 2021-01-13 07:10:23 -08:00
Sandy
6072d4eda0
shaderc_glsl: parse int samplers like float samplers (#2341) 2020-12-30 15:58:39 -08:00
Бранимир Караџић
0f0a664a47 Cleanup. 2020-12-28 17:27:50 -08:00
MooZ
d65dac2000
Shaderc OpenGL fixes. (#2317)
* Reworked profile cli argument.

* Added missing GLSL profile.

* Fixed essl shader preambule.

* Fixed uniform "parsing" and hlsl profiles.

* Reworked hlsl profiles.

* Fixed missing extension for gl_FragDepth.

* Cleanup.

* Removed version preamble and reverted shadow samplers translation.

* Fixed HLSL profile tests.
2020-12-28 11:24:49 -08:00
Бранимир Караџић
812f7712f1 shaderc: Added gl_ViewportIndex and gl_Layer. 2020-12-12 12:45:15 -08:00
Бранимир Караџић
3bffe3a05d Fixed undefined behavior. 2020-11-13 20:53:11 -08:00
pheonix
e541312851
Update g_verbose SpirvToolsDisassemble to output based on spirv target env for Metal and SPIRV. (#2306)
Fix up alignment in shaderc help string.
2020-11-08 10:57:03 -08:00
Бранимир Караџић
f7f32319c6 Fixed build. 2020-10-26 12:40:40 -07:00
Christophe Dehais
2fee82dc56
Add missing preprocessor macro for ESSL (#2298)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-10-26 10:42:55 -07:00
pheonix
72b04e3913
Shaderc SPIR-V profile additions (#2284)
* [shaderc] Add SPIR-V profiles to support Vulkan 1.1 and Vulkan 1.2.

* * Add support for Vulkan 1.1 with SPIR-V 1.4.
* Update "spirv" values to correlate with shaderc spirv profile name mappings.
* Expand on spirv profile naming and encoding documentation.
* Address PR notes
2020-10-17 20:02:51 -07:00
Christophe Dehais
daa61822d2
Accept GLSL and SPIRV on Windows (#2286)
Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
2020-10-14 09:16:34 -07:00
Бранимир Караџић
adf93db26b Updated ImGui. 2020-10-09 08:50:40 -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
Kitchen
c0bce01cc9
fix texture bind info missed in vertex shader after compiled (#2270) 2020-09-24 23:33:57 -07:00
云风
03871f12db
fix gcc warnings (#2253) 2020-09-01 20:49:08 -07:00
Martijn Courteaux
1ca9f894d1
Fix uniform stripping procedure for unexpected newlines in Metal shaderc. (#2223) 2020-08-16 21:08:01 -07:00
Бранимир Караџић
22df26ab70 Cleanup. 2020-07-15 10:42:23 -07:00
Бранимир Караџић
a84b13a77c Cleanup. 2020-07-05 21:36:04 -07:00
Бранимир Караџић
301629ed16 Cleanup. 2020-07-05 21:30:52 -07:00
Бранимир Караџић
a95ddd1c0c Reemoved use of old LineReader. 2020-06-20 15:14:54 -07:00