Commit Graph

92 Commits

Author SHA1 Message Date
pheonix
56ad576dcd
[shaderc] Clean up (#3258)
* Add Metal Shading Language version options to shaderc. Reference version options from: https://developer.apple.com/documentation/metal/mtllanguageversion?language=objc
Add configuration options for MSL compiler based on MSL version and Platform
Configure MSL->SPIR-V version configuration based on when ray tracing types become available
Set default metal compiler option to be metal 1.2, which is the default version assigned in the current SPIRV-Cross being used

* Add Metal Shading Language version options to shaderc. Reference version options from: https://developer.apple.com/documentation/metal/mtllanguageversion?language=objc
Add configuration options for MSL compiler based on MSL version and Platform
Configure MSL->SPIR-V version configuration based on when ray tracing types become available
Set default metal compiler option to be metal 1.2, which is the default version assigned in the current SPIRV-Cross being used

* Group ios and osx platform code paths
Reduce the size of temp buffer used in writing the MSL preprocessor define
Fix a compiler warning about size_t to int32_t truncation
Adjust whitespace in usage text

* Remove indented scope left-over from branch condition removal

* Remove some testing code

* Adjust whitespace for function arguments

* Replace BX_ASSERT with bx::write to message handler in spirv generation
2024-02-27 07:32:52 -08:00
Бранимир Караџић
83dfadf673 Happy New Year! 2024-01-14 01:56:36 -08:00
Бранимир Караџић
0c8292f2af Updated glslang. 2023-11-27 22:27:59 -08:00
Бранимир Караџић
49c0e49527
Removed WebGPU. (#3198) 2023-11-09 17:15:22 -08:00
Edu Garcia
b01c5d597a
Enable debug information for Vulkan shaders (#3193)
* Enable debug information for Vulkan shaders

* Enable debug information for Metal shaders
2023-11-06 11:14:29 -08:00
Branimir Karadžić
290295136b Added bx::Location, and removed allocator macros. 2023-04-23 19:19:22 -07:00
Jorge Rodriguez
70ac58fd38
Write messages to a stream specified by the caller of compilerShader … (#3054)
* Write messages to a stream specified by the caller of compilerShader rather than directly to stdOut, to allow tool writers to easily capture it.

* PR updates

* Missed a write

* PR updates
2023-03-06 10:30:06 -08:00
Бранимир Караџић
466c6a4e95 Happy New Year! 2023-01-14 10:05:12 -08:00
pheonix
e33efb8b42
shaderc updates (#3018)
- add support for Vulkan 1.3 using SPIR-V 1.6 as a profile target
- move ordering of help information of SPIR-V block
- update SPIR-V to Vulkan mapping documentation
2023-01-07 09:07:15 -08:00
Бранимир Караџић
c4d4b90e32 shaderc: Fixed SPIR-V uniform array size reflection. Issue #2964. 2022-10-27 19:43:17 -07:00
Бранимир Караџић
24c5c2f096 shaderc: Updated to new glslang. 2022-10-02 23:18:33 -07:00
Бранимир Караџић
4581f14cd4 Happy New Year! 2022-01-15 11:59:06 -08:00
Raziel Alphadios
094d34194c
Cleanup: change POD casts from static_cast to functional/ctor casts, for consistency (#2648)
Co-authored-by: Raziel Alphadios <raziely@gmail.com>
2021-10-31 15:54:10 -07:00
Christophe Dehais
89c8e61abd
Strip flags from UniformType before calling getUniformTypeName() (#2635) 2021-10-26 10:07:27 -07:00
Branimir Karadžić
4763f97205 More fixes. 2021-10-25 19:26:38 -07:00
Бранимир Караџић
8392a44b3a Fixed assert macros, and improved error handling. 2021-10-25 18:59:32 -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
Бранимир Караџић
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
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
pheonix
d89ff312a7
Fix leak - using no fancy smanshy new age voodoo (#2390) 2021-02-11 21:43:22 -08:00
Бранимир Караџић
af49c5d264 Happy New Year! 2021-01-14 15:53:49 -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
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
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
Бранимир Караџић
a95ddd1c0c Reemoved use of old LineReader. 2020-06-20 15:14:54 -07:00
Бранимир Караџић
d86c16213e Cleanup. 2020-06-18 21:20:01 -07:00
Hugo Amnov
e1c211b537
WebGPU various small fixes (#2140) 2020-05-10 17:48:25 -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
Бранимир Караџић
7f7c8a9bc0 Updated glslang. 2020-05-04 21:14:04 -07:00
Hugo Amnov
b48b084d25
Vulkan cleanup for Webgpu (#2127)
* Harmonize and simplify Vulkan SPIRV bindings mappings

* Handle Vulkan V-flip properly

* Update Embedded shaders
2020-05-03 13:54:30 -07:00
Бранимир Караџић
ba5a6b0e46 Fixed build. 2020-04-07 22:49:55 -07:00
Бранимир Караџић
82f56b5987 Happy New Year! 2020-01-14 21:37:06 -08:00
Бранимир Караџић
35abd01cfb Fixed warnings. 2019-10-05 09:52:04 -07:00
attilaz
3a6f9ff5b0 Fixed isampler and usampler for metal/spirv (#1903) 2019-10-04 20:03:27 -07:00
Бранимир Караџић
010676412e Fixed issue #1894. 2019-09-28 19:30:23 +02:00
Sandy
78614c9b55 shaderc: Add before hlsl validation option to spirv (#1892)
Fixes opaque type in struct error by disabling check.
```
Error: In Vulkan, OpTypeStruct must not contain an opaque type.
  %BgfxSampler2D = OpTypeStruct %6 %8
```
2019-09-26 19:00:44 +00:00
Бранимир Караџић
5edeea64a9 Cleanup. 2019-08-15 21:37:35 -07:00
Rinthel
2fa32d855d implement compute shader support 2019-08-13 18:44:42 -07:00
Rinthel Kwon
6927a9179b vulkan renderer draft implementation 2019-08-04 19:51:16 -07:00
Бранимир Караџић
bd39b5580a Cleanup. 2019-07-24 20:12:07 -07:00
Бранимир Караџић
3564e2a289 Updated spirv-cross. 2019-04-14 21:53:50 -07:00
Nick Waanders
88da162438 shaderc_spirv now emitting sampler uniforms
ShaderC now emits sampler uniforms for Metal and Spirv.
2019-03-12 15:23:10 -07:00
attilaz
5dba3a93af MSL vs/fs shaders use spirv-cross 2019-01-22 22:31:41 +01:00
attilaz
de94da4ab2 MSL Shadow Sampler fix and working on to support vs/fs with spirv-cross 2019-01-20 11:16:58 +01:00