Commit graph

104 commits

Author SHA1 Message Date
Samuliak
e99f9e2af0 format 2024-09-28 19:03:01 -04:00
Samuliak
bc3fd22f05 use 0 instead of undef 2024-09-28 19:03:01 -04:00
Samuliak
fefdabf257 fix: pass array index as an additional argument to sample 2024-09-28 19:03:01 -04:00
Samuliak
73bb0712a8 don't declare samplers for separate textures 2024-09-28 19:03:01 -04:00
Samuliak
75781ba698 don't hardcode texture type 2024-09-28 19:03:01 -04:00
Samuliak
262452f586 offset storage buffer bindings by 15 2024-09-28 19:03:01 -04:00
Samuliak
f56117a5c7 fix: incorrect abs instruction 2024-09-28 19:03:01 -04:00
Samuliak
aff8fdb2f8 add: vertex and instance id arguments 2024-09-28 19:03:01 -04:00
Samuliak
3651e8ea32 determine type of buffer by its field types 2024-09-28 19:03:01 -04:00
Samuliak
320c317113 add: textures and samplers as shader arguments & fix: issue with casting 2024-09-28 19:03:01 -04:00
Samuliak
6295153a28 support fragment coord as an input to a shader 2024-09-28 19:03:01 -04:00
Isaac Marovitz
5a320cca19 Buffer bindings in shader…
Will need to be reworked
2024-09-28 19:03:01 -04:00
Isaac Marovitz
ebc53d7961 Fix buffer access syntax 2024-09-28 19:03:01 -04:00
Isaac Marovitz
70ba3506b0 Cleanup Shader I/O 2024-09-28 19:03:01 -04:00
Isaac Marovitz
35cc208435 Fix fragment shader bindings 2024-09-28 19:03:01 -04:00
Isaac Marovitz
e517cfeb8f Fix some shader gen problems… 2024-09-28 19:03:01 -04:00
Isaac Marovitz
4a30b58e0b Formatting 2024-09-28 19:03:01 -04:00
Isaac Marovitz
bdd9ede4fd Make TypeConversion failure an error 2024-09-28 19:03:01 -04:00
Isaac Marovitz
84a8edf675 Fix MSL Reinterpret Casts 2024-09-28 19:03:01 -04:00
Isaac Marovitz
df8fca012f Formatting 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a9e9819b33 Dont specify [[stage_in]] on fragment 2024-09-28 19:03:01 -04:00
Isaac Marovitz
511db833db Fix fragment shaders (and fuck everything up) 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ed11cdda8d Fix fragment output color 2024-09-28 19:03:01 -04:00
Isaac Marovitz
98e2ab5a49 Fix IoMap variable names
Output struct

Lazy Vertex IO

Output fixes

Fix output struct definition

MSL Binding Model description

Might need tweaks/adjustments

Cleanup

Typo + Format
2024-09-28 19:03:01 -04:00
Isaac Marovitz
81b1ae4bcf Partial TextureQuerySamples 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ce5f383f5d Fix instructions 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a1b314acd2 Back to where we were
First special instruction

Start Load/Store implementation

Start TextureSample

Sample progress

I/O Load/Store Progress

Rest of load/store

TODO: Currently, the generator still assumes the GLSL style of I/O attributres. On MSL, the vertex function should output a struct which contains a float4 with the required position attribute.

TextureSize and VectorExtract

Fix UserDefined IO Vars

Fix stage input struct names
2024-09-28 19:03:01 -04:00
Isaac Marovitz
163be0a159 Update for new Shader IR format 2024-09-28 19:03:01 -04:00
Isaac Marovitz
bbc2ac2e9b Vertex Input Attributes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
f07327166c More Shader Gen Stuff
Mostly copied from GLSL since in terms of syntax within blocks they’re pretty similar. Likely the result will need tweaking…

Isn’t that conveniant?

“Do the simd_shuffle”

atomics

Remaining instructions

Remove removed special instructions

Getting somewhere…
2024-09-28 19:03:01 -04:00
Isaac Marovitz
1cb2ec7ebc Formatting 2024-09-28 19:03:01 -04:00
Isaac Marovitz
4ec37d1798 Start of MSL instructions
Remaining functions
2024-09-28 19:03:01 -04:00
Isaac Marovitz
27effab989 Warn when generating unsupported shader 2024-09-28 19:03:01 -04:00
Isaac Marovitz
0f3358b931 IoMap 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ebaf1d8258 Start Metal Backend
Revert build yml changes
2024-09-28 19:03:01 -04:00
riperiperi
04d68ca616
GPU: Ensure all clip distances are initialized when used (#7363)
* GPU: Ensure all clip distances are initialized when used

* Shader cache version
2024-09-26 14:19:12 -03:00
gdkchan
d717aef2be
Shader: Assume the only remaining source is the right one when all others are undefined (#7331)
* Shader: Assume the only remaining source is the right one when all other are undefined

* Shader cache version bump

* Improve comment
2024-09-19 21:23:09 -03:00
gdkchan
ef81658fbd
Implement support for shader ATOM.EXCH instruction (#7320)
* Implement support for shader ATOM.EXCH instruction

* Shader cache version bump

* Check type
2024-09-18 15:48:55 -03:00
gdkchan
56b2f84702
Fix shader RegisterUsage pass only taking first operation dest into account (#7131)
* Fix shader RegisterUsage pass only taking first operation dest into account

* Shader cache version bump
2024-07-30 21:57:55 -03:00
gdkchan
3193ef1083
Extend bindless elimination to catch a few more specific cases (#6921)
* Catch more cases on bindless elimination

* Match blocks with the same comparison condition

* Shader cache version bump
2024-06-16 14:46:27 -03:00
gdkchan
c0f2491eae
Vulkan separate descriptor set fixes (#6895)
* Ensure descriptor sets are only re-used when all command buffers using it have completed

* Fix some SPIR-V capabilities

* Set update after bind flag if we exceed limits

* Simpler fix for Intel

* Format whitespace

* Make struct readonly

* Add barriers for extra set arrays too
2024-06-02 22:40:28 -03:00
gdkchan
c41fddd25e
Vulkan: Extend full bindless to cover cases with phi nodes (#6853)
* Key textures using set and binding (rather than just binding)

* Extend full bindless to cover cases with phi nodes

* Log error on bindless access failure

* Shader cache version bump

* Remove constant buffer match to reduce the chances of full bindless triggering

* Re-enable it for constant buffers, paper mario does actually need it

* Format whitespace
2024-05-26 15:20:10 -03:00
gdkchan
53d096e392
Allow texture arrays to use separate descriptor sets on Vulkan (#6870)
* Report base and extra sets from the backend

* Pass texture set index everywhere

* Key textures using set and binding (rather than just binding)

* Start using extra sets for array textures

* Shader cache version bump

* Separate new commands, some PR feedback

* Introduce new manual descriptor set reservation method that prevents it from being used by something else while owned by an array

* Move bind extra sets logic to new method

* Should only use separate array is MaximumExtraSets is not zero

* Format whitespace
2024-05-26 13:30:19 -03:00
gdkchan
3a3b51893e
Add support for bindless textures from storage buffer on Vulkan (#6721)
* Halve primitive ID when converting quads to triangles

* Shader cache version bump

* Add support for bindless textures from storage buffer on Vulkan
2024-05-14 16:47:16 +02:00
gdkchan
c6f8bfed90
Add support for bindless textures from shader input (vertex buffer) on Vulkan (#6577)
* Add support for bindless textures from shader input (vertex buffer)

* Shader cache version bump

* Format whitespace

* Remove cache entries on pool removal, disable for OpenGL

* PR feedback
2024-04-22 15:05:55 -03:00
gdkchan
3e6e0e4afa
Add support for large sampler arrays on Vulkan (#6489)
* Add support for large sampler arrays on Vulkan

* Shader cache version bump

* Format whitespace

* Move DescriptorSetManager to PipelineLayoutCacheEntry to allow different pool sizes per layout

* Handle array textures with different types on the same buffer

* Somewhat better caching system

* Avoid useless buffer data modification checks

* Move redundant bindings update checking to the backend

* Fix an issue where texture arrays would get the same bindings across stages on Vulkan

* Backport some fixes from part 2

* Fix typo

* PR feedback

* Format whitespace

* Add some missing XML docs
2024-04-07 18:25:55 -03:00
standstaff
e19e7622a3
chore: remove repetitive words (#6500)
Signed-off-by: standstaff <zhengxingru@yeah.net>
2024-03-16 19:49:54 +01:00
Nicolas Abram
d9a18919b0
Fix geometry shader passthrough issue (#6462)
* Fix geometry shader passthrough issue (Diagnosed by gdkchan)

* Fix whitespace formatting

* Fix whitespace formatting

* Bump shader cache version

* Don't apply PassthroughNV decorations to output geometry shader variables
2024-03-13 17:26:19 -03:00
gdkchan
5a900f38c5
Fix lost copy and swap problem on shader SSA deconstruction (#6455)
* Fix lost copy on shader SSA deconstruction

* Shader cache version bump
2024-03-10 21:16:40 -03:00
Mary Guillemard
e59dba42ef
Set PointSize in shader on OpenGL (#6292)
Previously we were only doing it for Vulkan, but it turns out that
not setting it when PROGRAM_POINT_SIZE is set is considered UB
on OpenGL Core.

Signed-off-by: Mary <mary@mary.zone>
2024-02-10 20:27:17 +01:00