mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-20 08:24:14 +00:00
Workaround for cubemap view data upload bug on Intel (#2539)
* Workaround for cubemap view data upload bug on Intel * Trigger CI
This commit is contained in:
parent
c3e2646f9e
commit
d44d8f2eb6
1 changed files with 15 additions and 4 deletions
|
@ -435,8 +435,19 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
private void ReadFrom(IntPtr data, int size)
|
private void ReadFrom(IntPtr data, int size)
|
||||||
{
|
{
|
||||||
TextureTarget target = Target.Convert();
|
TextureTarget target = Target.Convert();
|
||||||
|
int baseLevel = 0;
|
||||||
|
|
||||||
|
// glTexSubImage on cubemap views is broken on Intel, we have to use the storage instead.
|
||||||
|
if (Target == Target.Cubemap && HwCapabilities.Vendor == HwCapabilities.GpuVendor.IntelWindows)
|
||||||
|
{
|
||||||
|
GL.ActiveTexture(TextureUnit.Texture0);
|
||||||
|
GL.BindTexture(target, Storage.Handle);
|
||||||
|
baseLevel = FirstLevel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Bind(target, 0);
|
Bind(target, 0);
|
||||||
|
}
|
||||||
|
|
||||||
FormatInfo format = FormatTable.GetFormatInfo(Info.Format);
|
FormatInfo format = FormatTable.GetFormatInfo(Info.Format);
|
||||||
|
|
||||||
|
@ -457,7 +468,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Info.Target)
|
switch (Target)
|
||||||
{
|
{
|
||||||
case Target.Texture1D:
|
case Target.Texture1D:
|
||||||
if (format.IsCompressed)
|
if (format.IsCompressed)
|
||||||
|
@ -558,7 +569,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
{
|
{
|
||||||
GL.CompressedTexSubImage2D(
|
GL.CompressedTexSubImage2D(
|
||||||
TextureTarget.TextureCubeMapPositiveX + face,
|
TextureTarget.TextureCubeMapPositiveX + face,
|
||||||
level,
|
baseLevel + level,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
width,
|
width,
|
||||||
|
@ -571,7 +582,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
{
|
{
|
||||||
GL.TexSubImage2D(
|
GL.TexSubImage2D(
|
||||||
TextureTarget.TextureCubeMapPositiveX + face,
|
TextureTarget.TextureCubeMapPositiveX + face,
|
||||||
level,
|
baseLevel + level,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
width,
|
width,
|
||||||
|
|
Loading…
Reference in a new issue