Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
cfe73af6
There was an error fetching the commit references. Please try again later.
Commit
cfe73af6
authored
1 year ago
by
Ameer J
Browse files
Options
Downloads
Patches
Plain Diff
emit_glsl_warp: Fix shfl_in_bounds conditional
parent
8becf13e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shader_recompiler/backend/glsl/emit_glsl.cpp
+1
-0
1 addition, 0 deletions
src/shader_recompiler/backend/glsl/emit_glsl.cpp
src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
+8
-4
8 additions, 4 deletions
src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
with
9 additions
and
4 deletions
src/shader_recompiler/backend/glsl/emit_glsl.cpp
+
1
−
0
View file @
cfe73af6
...
...
@@ -242,6 +242,7 @@ std::string EmitGLSL(const Profile& profile, const RuntimeInfo& runtime_info, IR
}
if
(
program
.
info
.
uses_subgroup_shuffles
)
{
ctx
.
header
+=
"bool shfl_in_bounds;"
;
ctx
.
header
+=
"uint shfl_result;"
;
}
ctx
.
code
.
insert
(
0
,
ctx
.
header
);
ctx
.
code
+=
'}'
;
...
...
This diff is collapsed.
Click to expand it.
src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
+
8
−
4
View file @
cfe73af6
...
...
@@ -141,7 +141,8 @@ void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value,
const
auto
src_thread_id
{
fmt
::
format
(
"({})|({})"
,
lhs
,
min_thread_id
)};
ctx
.
Add
(
"shfl_in_bounds=int({})<=int({});"
,
src_thread_id
,
max_thread_id
);
SetInBoundsFlag
(
ctx
,
inst
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?readInvocationARB({},{}):{};"
,
inst
,
value
,
src_thread_id
,
value
);
ctx
.
Add
(
"shfl_result=readInvocationARB({},{});"
,
value
,
src_thread_id
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?shfl_result:{};"
,
inst
,
value
);
}
void
EmitShuffleUp
(
EmitContext
&
ctx
,
IR
::
Inst
&
inst
,
std
::
string_view
value
,
std
::
string_view
index
,
...
...
@@ -158,7 +159,8 @@ void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string_view value, std
const
auto
src_thread_id
{
fmt
::
format
(
"({}-{})"
,
THREAD_ID
,
index
)};
ctx
.
Add
(
"shfl_in_bounds=int({})>=int({});"
,
src_thread_id
,
max_thread_id
);
SetInBoundsFlag
(
ctx
,
inst
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?readInvocationARB({},{}):{};"
,
inst
,
value
,
src_thread_id
,
value
);
ctx
.
Add
(
"shfl_result=readInvocationARB({},{});"
,
value
,
src_thread_id
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?shfl_result:{};"
,
inst
,
value
);
}
void
EmitShuffleDown
(
EmitContext
&
ctx
,
IR
::
Inst
&
inst
,
std
::
string_view
value
,
...
...
@@ -175,7 +177,8 @@ void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string_view value,
const
auto
src_thread_id
{
fmt
::
format
(
"({}+{})"
,
THREAD_ID
,
index
)};
ctx
.
Add
(
"shfl_in_bounds=int({})<=int({});"
,
src_thread_id
,
max_thread_id
);
SetInBoundsFlag
(
ctx
,
inst
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?readInvocationARB({},{}):{};"
,
inst
,
value
,
src_thread_id
,
value
);
ctx
.
Add
(
"shfl_result=readInvocationARB({},{});"
,
value
,
src_thread_id
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?shfl_result:{};"
,
inst
,
value
);
}
void
EmitShuffleButterfly
(
EmitContext
&
ctx
,
IR
::
Inst
&
inst
,
std
::
string_view
value
,
...
...
@@ -193,7 +196,8 @@ void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string_view val
const
auto
src_thread_id
{
fmt
::
format
(
"({}^{})"
,
THREAD_ID
,
index
)};
ctx
.
Add
(
"shfl_in_bounds=int({})<=int({});"
,
src_thread_id
,
max_thread_id
);
SetInBoundsFlag
(
ctx
,
inst
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?readInvocationARB({},{}):{};"
,
inst
,
value
,
src_thread_id
,
value
);
ctx
.
Add
(
"shfl_result=readInvocationARB({},{});"
,
value
,
src_thread_id
);
ctx
.
AddU32
(
"{}=shfl_in_bounds?shfl_result:{};"
,
inst
,
value
);
}
void
EmitFSwizzleAdd
(
EmitContext
&
ctx
,
IR
::
Inst
&
inst
,
std
::
string_view
op_a
,
std
::
string_view
op_b
,
...
...
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