Commit graph

338 commits

Author SHA1 Message Date
sunho
88f6a41208 shader: fix type in vtst
It was using wrong type before.
2020-09-04 15:26:08 +09:00
sunho
7565425a30 shader: int type conversion in vpck
We can now remove this conversion table and use utiliy function. Once it's in right type, store function should work correctly.
2020-09-04 15:26:08 +09:00
sunho
afe8028b57 shader: int type conversion in vbw
The destination is uint32
2020-09-04 15:26:08 +09:00
sunho
6cb683c3f1 shader: int type conversion in sop 2020-09-04 15:26:08 +09:00
sunho
a445f17f6f shader: int type conversion in texture fetch & fragment output 2020-09-04 15:26:08 +09:00
sunho
c4eb07d4f4 shader: add type conversion utility functions 2020-09-04 15:26:08 +09:00
sunho
432e574f90 shader: store and load int values with ivec and uvec in glsl
We were loading and storing using normalized float before, but this can be quite troublesome when we start to seriously implement int instructions.

1. The rounding error can result in the change in value. The error caused by rounding error assuming 0.5 ulp is +-(1/2)*2^(1-23) * 2^16 * x = +-x*1.1920929e-7*2^16 = +-0.0078125*x where x is the value we want to store. It can be serious enough to change the value after one store & load.
2. We will need a paramter that decides the final type of load that can be normalized float, float, and integer. But, we're already specifying type by op.type! Load function is given another responsibility: type conversion. This becomes more confusing in store function. The function doesn't know whether source is normalized or not, so we need another parameter. And, this parameter should mean nothing in immediate register bank, etc. aaaaa

For this reason, I'm moving to integer loading and storing using ivec & uvec. This way load and store function has less side effect. The ouput and input type of oprand is just decided by the op.type and dest_type. Instructions using load and store is in charge of type conversion now and it wouldn't be insane because they have more context.
2020-09-04 15:26:08 +09:00
sunho
d81fd7a62b shader: fix ubo not binding 2020-08-29 09:20:00 +09:00
sunho
a8bd23bbcc shader: uniform buffers inside program_input 2020-08-29 06:10:15 +09:00
sunho
cee3ecbc50 shader: add comments 2020-08-29 06:10:15 +09:00
sunho
8b176ce65b shader: fix non ubo uniforms
We copied it to pa before instead of sa.
2020-08-29 06:10:15 +09:00
sunho
d4f2b676f1 shader: refactor gxp parameter parsing
We need parsed parameters in many applications such as analyzer/fuzzer/debugger. I separated parsing part from recompiler. In the way, I fixed some bugs that are not apparent because of parsing code mixed with spirv generation code.
2020-08-29 06:10:15 +09:00
sunho
caf102d956 shader: add missing F32 in get_parameter_type_store_and_name 2020-08-29 06:10:15 +09:00
sunho
3c3ae5d94f shader: add translate_generic_type 2020-08-29 06:10:15 +09:00
sunho
88500bad81 shader: refactor uniform buffer parsing 2020-08-29 06:10:15 +09:00
sunho
f05cd22127 shader: refactor get_parameter_type_and_name 2020-08-29 06:10:15 +09:00
sunho
1bbc744e4a shader: use swizzle decoing function instead of constant 2020-08-29 06:10:15 +09:00
sunho
4b87fb6b3e shader: implement dual frcp 2020-08-29 06:05:30 +09:00
sunho
db81fa0450 shader: output of dot product is scalar 2020-08-29 06:05:30 +09:00
sunho
096f6b6342 shader: implement dual frsq 2020-08-29 06:05:30 +09:00
sunho
f332307b0e shader: initialize vertex outputs to 0 2020-08-29 06:05:23 +09:00
sunho
83aeb849fa shader: use constants for register array size 2020-08-29 06:05:23 +09:00
sunho
f9ae3cb12a shader: vldst should not match special 2020-08-20 05:52:20 +09:00
sunho
32a734d741 shader: move int and illegal instructions to separate files 2020-08-20 05:52:20 +09:00
sunho
9b93ea736f shader: log unimplemented and illegal opcodes 2020-08-20 05:52:20 +09:00
sunho
d3c4ec4ed0 shader: add dummy decoders for unimplemented instructios & order instructions according to opcode1 2020-08-20 05:52:20 +09:00
sunho
712275e0b3 shader: rename some instructions 2020-08-20 05:52:20 +09:00
KorewaWatchful
83e7cb5509 shader: account for parameter-less buffers
Co-authored-by: 1whatleytay <1whatleytay@hdsb.ca>
2020-08-20 04:00:36 +09:00
sunho
c6cdb9fef4 shader: implement imad 2020-08-18 06:14:23 +09:00
sunho
468465470f shader: consider Immediate in operand_to_str 2020-08-18 06:14:23 +09:00
sunho
f4bb756b3e shader: implement integer load and store 2020-08-18 06:14:23 +09:00
sunho
04791a3170 shader: add imad decoder 2020-08-18 06:14:23 +09:00
sunho
e9ebe16084 shader: Implement unpacking & packing one of int and uint values 2020-08-17 18:59:28 +09:00
sunho
167c21363e shader: swizzle cycling in uint8 vpck 2020-08-15 22:51:28 +09:00
sunho
5de2aa1751 shader: do not bitcast integer types 2020-08-15 22:51:28 +09:00
sunho
31112ac530 shader: use normalized value as default for unpacked uint8 vector 2020-08-15 22:51:28 +09:00
sunho
096e0d92cb shader: update TODO 2020-08-15 22:51:28 +09:00
sunho
cea6d5b703 shader: consider normalization of uint8 input, output and texture 2020-08-15 22:51:28 +09:00
sunho
576f04085e shader: cast uint8 bytes in differnet way in vpck 2020-08-15 22:51:28 +09:00
sunho
67cf704f7c shader: use uint8 in sop2 2020-08-15 22:51:28 +09:00
sunho
fabee5907b shader: implement pakcing & unpacking uint8 2020-08-15 22:51:28 +09:00
sunho
29797bca47 shader: add unwrap_type utility function 2020-08-15 22:51:28 +09:00
sunho
7ac71a203f shader: log scale in vpck 2020-08-15 22:51:28 +09:00
sunho
a7e3897380 shader: stub uint8 unpack & pack 2020-08-15 22:51:28 +09:00
sunho
4b22c0606d shader: log sop2 2020-08-15 22:51:28 +09:00
sunho
4283dbe409 shader: support uchar sampler 2020-08-15 22:51:28 +09:00
sunho
89e9acd728 shader: support fmin and fmax in sop2 2020-08-15 22:51:28 +09:00
sunho
f15c84ca77 shader: correct predicate field of sop2 2020-08-15 22:51:28 +09:00
sunho
447a8f8f1a shdaer: adjust pa offset in non native color 2020-08-02 10:35:49 +09:00
Sunho Kim
3f2c8b69f3 shader: dump shader before crashing 2020-08-01 05:34:08 +09:00