mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Implement struct single inheritance.
Here, we implement single inheritance by inserting a field at the beginning of the derived struct with name "$super". For the following struct declarations struct a { float4 aa; float4 bb; }; struct b : a { float4 cc; }; struct c : b { float4 bb; }; this commit generates the following: struct a { float4 aa; float4 bb; }; struct b { struct a $super; float4 cc; }; struct c { struct b $super; float4 bb; };
This commit is contained in:
Notes:
Henri Verbeet
2024-10-16 21:47:12 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1157
@@ -1,4 +1,4 @@
|
||||
[pixel shader todo(sm<6)]
|
||||
[pixel shader]
|
||||
|
||||
struct a
|
||||
{
|
||||
@@ -28,12 +28,12 @@ uniform 0 float4 1 0 0 0
|
||||
uniform 4 float4 0 2 0 0
|
||||
uniform 8 float4 0 0 3 0
|
||||
uniform 12 float4 0 0 0 4
|
||||
todo(sm<6) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (1, 0, 3, 4)
|
||||
|
||||
% Test writing to a field derived from a base class.
|
||||
|
||||
[pixel shader todo(sm<6)]
|
||||
[pixel shader]
|
||||
|
||||
struct a
|
||||
{
|
||||
@@ -66,7 +66,7 @@ uniform 0 float4 1 0 0 0
|
||||
uniform 4 float4 0 2 0 0
|
||||
uniform 8 float4 0 0 3 0
|
||||
uniform 12 float4 0 0 0 4
|
||||
todo(sm<6) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (-1, 0, 3, -4)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user