[dxvk] Change spec constant IDs

We no longer support per-resource spec constants, so there is no good
reason not to use a 1:1 mapping for user-defined constants.
This commit is contained in:
Philip Rebohle 2022-06-30 20:47:50 +02:00
parent 2e73e46799
commit 7c4d602863
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
9 changed files with 11 additions and 16 deletions

View File

@ -3,7 +3,7 @@
#include "d3d9_convert_common.h"
layout(constant_id = 1225) const bool s_is_uyvy = false;
layout(constant_id = 0) const bool s_is_uyvy = false;
layout(
local_size_x = 8,

View File

@ -152,7 +152,6 @@ namespace dxvk {
// Set up some specialization constants
DxvkSpecConstants specData;
specData.set(uint32_t(DxvkSpecConstantId::RasterizerSampleCount), sampleCount, VK_SAMPLE_COUNT_1_BIT);
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
if ((m_fsOut & (1 << i)) != 0) {

View File

@ -24,14 +24,10 @@ namespace dxvk {
* implementation at pipeline compilation time.
*/
enum class DxvkSpecConstantId : uint32_t {
FirstPipelineConstant = 0,
/// Special constant ranges that do not count
/// towards the spec constant min/max values
ColorComponentMappings = MaxNumResourceSlots,
// Specialization constants for pipeline state
SpecConstantRangeStart = ColorComponentMappings + MaxNumRenderTargets,
RasterizerSampleCount = SpecConstantRangeStart + 0,
FirstPipelineConstant
ColorComponentMappings = DxvkLimits::MaxNumSpecConstants,
};
/**

View File

@ -1,6 +1,6 @@
#version 450
layout(constant_id = 1225) const bool srgbSwapchain = false;
layout(constant_id = 0) const bool srgbSwapchain = false;
layout(location = 0) in vec2 v_coord;
layout(location = 0) out vec4 o_color;

View File

@ -1,6 +1,6 @@
#version 450
layout(constant_id = 1225) const bool srgbSwapchain = false;
layout(constant_id = 0) const bool srgbSwapchain = false;
layout(binding = 2) uniform sampler2D s_font;

View File

@ -1,6 +1,6 @@
#version 450
layout(constant_id = 1226) const bool s_gamma_bound = false;
layout(constant_id = 1) const bool s_gamma_bound = false;
layout(binding = 0) uniform sampler2D s_image;
layout(binding = 1) uniform sampler1D s_gamma;

View File

@ -1,6 +1,6 @@
#version 450
layout(constant_id = 1226) const bool s_gamma_bound = false;
layout(constant_id = 1) const bool s_gamma_bound = false;
layout(binding = 0) uniform sampler2D s_image;
layout(binding = 1) uniform sampler1D s_gamma;

View File

@ -1,7 +1,7 @@
#version 450
layout(constant_id = 1225) const uint c_samples = 0;
layout(constant_id = 1226) const bool s_gamma_bound = false;
layout(constant_id = 0) const uint c_samples = 0;
layout(constant_id = 1) const bool s_gamma_bound = false;
layout(binding = 0) uniform sampler2DMS s_image;
layout(binding = 1) uniform sampler1D s_gamma;

View File

@ -2,8 +2,8 @@
#extension GL_AMD_shader_fragment_mask: enable
layout(constant_id = 1225) const uint c_samples = 0;
layout(constant_id = 1226) const bool s_gamma_bound = false;
layout(constant_id = 0) const uint c_samples = 0;
layout(constant_id = 1) const bool s_gamma_bound = false;
layout(binding = 0) uniform sampler2DMS s_image;
layout(binding = 1) uniform sampler1D s_gamma;