glsl: Implement fswzadd
and wip nv thread shuffle impl
This commit is contained in:
parent
c542204113
commit
8bb8bbf4ae
5 changed files with 45 additions and 5 deletions
|
@ -306,6 +306,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
|
|||
SetupImages(bindings);
|
||||
SetupTextures(bindings);
|
||||
DefineHelperFunctions();
|
||||
DefineConstants();
|
||||
}
|
||||
|
||||
void EmitContext::SetupExtensions(std::string&) {
|
||||
|
@ -339,6 +340,9 @@ void EmitContext::SetupExtensions(std::string&) {
|
|||
if (!info.uses_int64) {
|
||||
header += "#extension GL_ARB_gpu_shader_int64 : enable\n";
|
||||
}
|
||||
if (profile.support_gl_warp_intrinsics) {
|
||||
header += "#extension GL_NV_shader_thread_shuffle : enable\n";
|
||||
}
|
||||
}
|
||||
if (info.stores_viewport_index && profile.support_viewport_index_layer_non_geometry &&
|
||||
stage != Stage::Geometry) {
|
||||
|
@ -605,4 +609,11 @@ void EmitContext::SetupTextures(Bindings& bindings) {
|
|||
}
|
||||
}
|
||||
|
||||
void EmitContext::DefineConstants() {
|
||||
if (info.uses_fswzadd) {
|
||||
header += "const float FSWZ_A[]=float[4](-1.f,1.f,-1.f,0.f);"
|
||||
"const float FSWZ_B[]=float[4](-1.f,-1.f,1.f,-1.f);";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Shader::Backend::GLSL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue