mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
gl: Fix shader extension requirements
This commit is contained in:
parent
577b5ef2bd
commit
55886b0a50
1 changed files with 15 additions and 3 deletions
|
@ -28,21 +28,33 @@ std::string GLFragmentDecompilerThread::compareFunction(COMPARE f, const std::st
|
||||||
|
|
||||||
void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
|
void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
OS << "#version 430\n";
|
int gl_version = 430;
|
||||||
|
std::vector<std::string> required_extensions;
|
||||||
|
|
||||||
if (device_props.has_native_half_support)
|
if (device_props.has_native_half_support)
|
||||||
{
|
{
|
||||||
const auto driver_caps = gl::get_driver_caps();
|
const auto driver_caps = gl::get_driver_caps();
|
||||||
if (driver_caps.NV_gpu_shader5_supported)
|
if (driver_caps.NV_gpu_shader5_supported)
|
||||||
{
|
{
|
||||||
OS << "#extension GL_NV_gpu_shader5: require\n";
|
required_extensions.push_back("GL_NV_gpu_shader5");
|
||||||
}
|
}
|
||||||
else if (driver_caps.AMD_gpu_shader_half_float_supported)
|
else if (driver_caps.AMD_gpu_shader_half_float_supported)
|
||||||
{
|
{
|
||||||
OS << "#extension GL_AMD_gpu_shader_half_float: require\n";
|
required_extensions.push_back("GL_AMD_gpu_shader_half_float");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_prog.ctrl & RSX_SHADER_CONTROL_ATTRIBUTE_INTERPOLATION)
|
||||||
|
{
|
||||||
|
required_extensions.push_back("GL_NV_fragment_shader_barycentric");
|
||||||
|
}
|
||||||
|
|
||||||
|
OS << "#version " << gl_version << "\n";
|
||||||
|
for (const auto& ext : required_extensions)
|
||||||
|
{
|
||||||
|
OS << "#extension " << ext << ": require\n";
|
||||||
|
}
|
||||||
|
|
||||||
glsl::insert_subheader_block(OS);
|
glsl::insert_subheader_block(OS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue