aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Image/TextureView.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-08-11 18:19:28 -0300
committerGitHub <noreply@github.com>2021-08-11 23:19:28 +0200
commitd44d8f2eb6bb97f185add50e61443e79e8581123 (patch)
tree0b2aef3cdc4d4f8951f85e2e755be9605f057782 /Ryujinx.Graphics.OpenGL/Image/TextureView.cs
parentc3e2646f9e330633b0ed5e0038a976e33054a819 (diff)
Workaround for cubemap view data upload bug on Intel (#2539)
* Workaround for cubemap view data upload bug on Intel * Trigger CI
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Image/TextureView.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Image/TextureView.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs
index 460d1da4..ce0582ce 100644
--- a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs
+++ b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs
@@ -435,8 +435,19 @@ namespace Ryujinx.Graphics.OpenGL.Image
private void ReadFrom(IntPtr data, int size)
{
TextureTarget target = Target.Convert();
+ int baseLevel = 0;
- Bind(target, 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);
+ }
FormatInfo format = FormatTable.GetFormatInfo(Info.Format);
@@ -457,7 +468,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
return;
}
- switch (Info.Target)
+ switch (Target)
{
case Target.Texture1D:
if (format.IsCompressed)
@@ -558,7 +569,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
{
GL.CompressedTexSubImage2D(
TextureTarget.TextureCubeMapPositiveX + face,
- level,
+ baseLevel + level,
0,
0,
width,
@@ -571,7 +582,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
{
GL.TexSubImage2D(
TextureTarget.TextureCubeMapPositiveX + face,
- level,
+ baseLevel + level,
0,
0,
width,