Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nikolay Sivov
vkd3d
Commits
37491716
Commit
37491716
authored
1 month ago
by
Nikolay Sivov
Committed by
Henri Verbeet
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/fx: Output object initialiser IDs for fx_2_0.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
d34f5fba
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-shader/fx.c
+34
-3
34 additions, 3 deletions
libs/vkd3d-shader/fx.c
with
34 additions
and
3 deletions
libs/vkd3d-shader/fx.c
+
34
−
3
View file @
37491716
...
...
@@ -3543,6 +3543,21 @@ static void fx_parse_fx_2_type(struct fx_parser *parser, uint32_t offset)
}
}
static
void
parse_fx_2_object_value
(
struct
fx_parser
*
parser
,
uint32_t
element_count
,
uint32_t
offset
)
{
uint32_t
id
;
element_count
=
max
(
element_count
,
1
);
for
(
uint32_t
i
=
0
;
i
<
element_count
;
++
i
,
offset
+=
4
)
{
fx_parser_read_unstructured
(
parser
,
&
id
,
offset
,
sizeof
(
id
));
vkd3d_string_buffer_printf
(
&
parser
->
buffer
,
"<object id %u>"
,
id
);
if
(
element_count
>
1
)
vkd3d_string_buffer_printf
(
&
parser
->
buffer
,
", "
);
}
}
static
void
parse_fx_2_numeric_value
(
struct
fx_parser
*
parser
,
uint32_t
offset
,
unsigned
int
size
,
uint32_t
base_type
)
{
...
...
@@ -3595,6 +3610,15 @@ static void fx_parse_fx_2_parameter(struct fx_parser *parser, uint32_t offset)
vkd3d_string_buffer_printf
(
&
parser
->
buffer
,
"[%u]"
,
var
.
element_count
);
}
static
bool
is_fx_2_sampler
(
uint32_t
type
)
{
return
type
==
D3DXPT_SAMPLER
||
type
==
D3DXPT_SAMPLER1D
||
type
==
D3DXPT_SAMPLER2D
||
type
==
D3DXPT_SAMPLER3D
||
type
==
D3DXPT_SAMPLERCUBE
;
}
static
void
fx_parse_fx_2_initial_value
(
struct
fx_parser
*
parser
,
uint32_t
param
,
uint32_t
value
)
{
struct
fx_2_var
...
...
@@ -3620,11 +3644,18 @@ static void fx_parse_fx_2_initial_value(struct fx_parser *parser, uint32_t param
if
(
var
.
element_count
)
vkd3d_string_buffer_printf
(
&
parser
->
buffer
,
"{ "
);
if
(
var
.
type
==
D3DXPT_STRING
)
fx_parser_error
(
parser
,
VKD3D_SHADER_ERROR_FX_NOT_IMPLEMENTED
,
"Only numeric initial values are supported."
);
if
(
var
.
class
==
D3DXPC_OBJECT
)
{
if
(
is_fx_2_sampler
(
var
.
type
))
fx_parser_error
(
parser
,
VKD3D_SHADER_ERROR_FX_NOT_IMPLEMENTED
,
"Parsing sampler initializers is not supported."
);
else
parse_fx_2_object_value
(
parser
,
var
.
element_count
,
value
);
}
else
{
parse_fx_2_numeric_value
(
parser
,
value
,
size
,
var
.
type
);
}
if
(
var
.
element_count
)
vkd3d_string_buffer_printf
(
&
parser
->
buffer
,
" }"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment