mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-12 23:48:58 +01:00
Merge pull request #12370 from iwubcode/more_samplers
VideoBackends / VideoCommon: update max pixel shader samplers from 8 to 16
This commit is contained in:
commit
bcd74a81a9
@ -659,7 +659,7 @@ void Gfx::UpdateDescriptorTables()
|
|||||||
bool Gfx::UpdateSRVDescriptorTable()
|
bool Gfx::UpdateSRVDescriptorTable()
|
||||||
{
|
{
|
||||||
static constexpr std::array<UINT, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> src_sizes = {
|
static constexpr std::array<UINT, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> src_sizes = {
|
||||||
1, 1, 1, 1, 1, 1, 1, 1};
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
|
||||||
DescriptorHandle dst_base_handle;
|
DescriptorHandle dst_base_handle;
|
||||||
const UINT dst_handle_sizes = VideoCommon::MAX_PIXEL_SHADER_SAMPLERS;
|
const UINT dst_handle_sizes = VideoCommon::MAX_PIXEL_SHADER_SAMPLERS;
|
||||||
if (!g_dx_context->GetDescriptorAllocator()->Allocate(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS,
|
if (!g_dx_context->GetDescriptorAllocator()->Allocate(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS,
|
||||||
|
@ -99,7 +99,7 @@ bool SamplerAllocator::GetGroupHandle(const SamplerStateSet& sss,
|
|||||||
|
|
||||||
// Copy samplers from the sampler heap.
|
// Copy samplers from the sampler heap.
|
||||||
static constexpr std::array<UINT, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> source_sizes = {
|
static constexpr std::array<UINT, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> source_sizes = {
|
||||||
{1, 1, 1, 1, 1, 1, 1, 1}};
|
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}};
|
||||||
g_dx_context->GetDevice()->CopyDescriptors(
|
g_dx_context->GetDevice()->CopyDescriptors(
|
||||||
1, &allocation.cpu_handle, &VideoCommon::MAX_PIXEL_SHADER_SAMPLERS,
|
1, &allocation.cpu_handle, &VideoCommon::MAX_PIXEL_SHADER_SAMPLERS,
|
||||||
VideoCommon::MAX_PIXEL_SHADER_SAMPLERS, source_handles.data(), source_sizes.data(),
|
VideoCommon::MAX_PIXEL_SHADER_SAMPLERS, source_handles.data(), source_sizes.data(),
|
||||||
|
@ -199,7 +199,7 @@ private:
|
|||||||
|
|
||||||
// MARK: State
|
// MARK: State
|
||||||
u16 m_dirty_textures;
|
u16 m_dirty_textures;
|
||||||
u8 m_dirty_samplers;
|
u16 m_dirty_samplers;
|
||||||
static_assert(sizeof(m_dirty_textures) * 8 >= MAX_TEXTURES, "Make this bigger");
|
static_assert(sizeof(m_dirty_textures) * 8 >= MAX_TEXTURES, "Make this bigger");
|
||||||
static_assert(sizeof(m_dirty_samplers) * 8 >= MAX_SAMPLERS, "Make this bigger");
|
static_assert(sizeof(m_dirty_samplers) * 8 >= MAX_SAMPLERS, "Make this bigger");
|
||||||
union Flags
|
union Flags
|
||||||
|
@ -121,10 +121,24 @@ bool ObjectCache::CreateDescriptorSetLayouts()
|
|||||||
VK_SHADER_STAGE_GEOMETRY_BIT},
|
VK_SHADER_STAGE_GEOMETRY_BIT},
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static const std::array<VkDescriptorSetLayoutBinding, 1> standard_sampler_bindings{{
|
constexpr u32 MAX_PIXEL_SAMPLER_ARRAY_SIZE = 8;
|
||||||
{0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
|
constexpr u32 TOTAL_PIXEL_SAMPLER_BINDINGS =
|
||||||
static_cast<u32>(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS), VK_SHADER_STAGE_FRAGMENT_BIT},
|
1 + (VideoCommon::MAX_PIXEL_SHADER_SAMPLERS - MAX_PIXEL_SAMPLER_ARRAY_SIZE);
|
||||||
}};
|
static_assert(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS == 16, "Update descriptor sampler bindings");
|
||||||
|
|
||||||
|
static const std::array<VkDescriptorSetLayoutBinding, TOTAL_PIXEL_SAMPLER_BINDINGS>
|
||||||
|
standard_sampler_bindings{{
|
||||||
|
{0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, MAX_PIXEL_SAMPLER_ARRAY_SIZE,
|
||||||
|
VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{8, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{9, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{10, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{11, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{12, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{13, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{14, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
{15, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
|
||||||
|
}};
|
||||||
|
|
||||||
// The dynamic veretex loader's vertex buffer must be last here, for similar reasons
|
// The dynamic veretex loader's vertex buffer must be last here, for similar reasons
|
||||||
static const std::array<VkDescriptorSetLayoutBinding, 2> standard_ssbo_bindings{{
|
static const std::array<VkDescriptorSetLayoutBinding, 2> standard_ssbo_bindings{{
|
||||||
|
@ -7,6 +7,6 @@
|
|||||||
|
|
||||||
namespace VideoCommon
|
namespace VideoCommon
|
||||||
{
|
{
|
||||||
constexpr u32 MAX_PIXEL_SHADER_SAMPLERS = 8;
|
constexpr u32 MAX_PIXEL_SHADER_SAMPLERS = 16;
|
||||||
constexpr u32 MAX_COMPUTE_SHADER_SAMPLERS = 8;
|
constexpr u32 MAX_COMPUTE_SHADER_SAMPLERS = 8;
|
||||||
} // namespace VideoCommon
|
} // namespace VideoCommon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user