mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-26 15:00:06 +00:00
Merge pull request #1505 from FernandoS27/tex-3d
Implemented 3D Textures
This commit is contained in:
commit
6acd8d166a
@ -448,7 +448,10 @@ public:
|
|||||||
BitField<8, 3, u32> block_depth;
|
BitField<8, 3, u32> block_depth;
|
||||||
BitField<12, 1, InvMemoryLayout> type;
|
BitField<12, 1, InvMemoryLayout> type;
|
||||||
} memory_layout;
|
} memory_layout;
|
||||||
u32 array_mode;
|
union {
|
||||||
|
BitField<0, 16, u32> array_mode;
|
||||||
|
BitField<16, 1, u32> volume;
|
||||||
|
};
|
||||||
u32 layer_stride;
|
u32 layer_stride;
|
||||||
u32 base_layer;
|
u32 base_layer;
|
||||||
INSERT_PADDING_WORDS(7);
|
INSERT_PADDING_WORDS(7);
|
||||||
|
@ -155,6 +155,7 @@ void SurfaceParams::InitCacheParameters(Tegra::GPUVAddr gpu_addr_) {
|
|||||||
params.rt.index = static_cast<u32>(index);
|
params.rt.index = static_cast<u32>(index);
|
||||||
params.rt.array_mode = config.array_mode;
|
params.rt.array_mode = config.array_mode;
|
||||||
params.rt.layer_stride = config.layer_stride;
|
params.rt.layer_stride = config.layer_stride;
|
||||||
|
params.rt.volume = config.volume;
|
||||||
params.rt.base_layer = config.base_layer;
|
params.rt.base_layer = config.base_layer;
|
||||||
|
|
||||||
params.InitCacheParameters(config.Address());
|
params.InitCacheParameters(config.Address());
|
||||||
@ -1122,8 +1123,8 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool pres
|
|||||||
} else if (preserve_contents) {
|
} else if (preserve_contents) {
|
||||||
// If surface parameters changed and we care about keeping the previous data, recreate
|
// If surface parameters changed and we care about keeping the previous data, recreate
|
||||||
// the surface from the old one
|
// the surface from the old one
|
||||||
Unregister(surface);
|
|
||||||
Surface new_surface{RecreateSurface(surface, params)};
|
Surface new_surface{RecreateSurface(surface, params)};
|
||||||
|
Unregister(surface);
|
||||||
Register(new_surface);
|
Register(new_surface);
|
||||||
return new_surface;
|
return new_surface;
|
||||||
} else {
|
} else {
|
||||||
@ -1220,6 +1221,9 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
|||||||
CopySurface(old_surface, new_surface, copy_pbo.handle);
|
CopySurface(old_surface, new_surface, copy_pbo.handle);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SurfaceParams::SurfaceTarget::Texture3D:
|
||||||
|
AccurateCopySurface(old_surface, new_surface);
|
||||||
|
break;
|
||||||
case SurfaceParams::SurfaceTarget::TextureCubemap: {
|
case SurfaceParams::SurfaceTarget::TextureCubemap: {
|
||||||
if (old_params.rt.array_mode != 1) {
|
if (old_params.rt.array_mode != 1) {
|
||||||
// TODO(bunnei): This is used by Breath of the Wild, I'm not sure how to implement this
|
// TODO(bunnei): This is used by Breath of the Wild, I'm not sure how to implement this
|
||||||
|
@ -132,6 +132,8 @@ struct SurfaceParams {
|
|||||||
case Tegra::Texture::TextureType::Texture2D:
|
case Tegra::Texture::TextureType::Texture2D:
|
||||||
case Tegra::Texture::TextureType::Texture2DNoMipmap:
|
case Tegra::Texture::TextureType::Texture2DNoMipmap:
|
||||||
return SurfaceTarget::Texture2D;
|
return SurfaceTarget::Texture2D;
|
||||||
|
case Tegra::Texture::TextureType::Texture3D:
|
||||||
|
return SurfaceTarget::Texture3D;
|
||||||
case Tegra::Texture::TextureType::TextureCubemap:
|
case Tegra::Texture::TextureType::TextureCubemap:
|
||||||
return SurfaceTarget::TextureCubemap;
|
return SurfaceTarget::TextureCubemap;
|
||||||
case Tegra::Texture::TextureType::Texture1DArray:
|
case Tegra::Texture::TextureType::Texture1DArray:
|
||||||
@ -791,6 +793,7 @@ struct SurfaceParams {
|
|||||||
struct {
|
struct {
|
||||||
u32 index;
|
u32 index;
|
||||||
u32 array_mode;
|
u32 array_mode;
|
||||||
|
u32 volume;
|
||||||
u32 layer_stride;
|
u32 layer_stride;
|
||||||
u32 base_layer;
|
u32 base_layer;
|
||||||
} rt;
|
} rt;
|
||||||
|
@ -1142,6 +1142,7 @@ private:
|
|||||||
case Tegra::Shader::TextureType::Texture2D: {
|
case Tegra::Shader::TextureType::Texture2D: {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
case Tegra::Shader::TextureType::Texture3D:
|
||||||
case Tegra::Shader::TextureType::TextureCube: {
|
case Tegra::Shader::TextureType::TextureCube: {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user