1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[d3d11] Don't use spec constants for video blitter

Store required info in the UBO instead.
This commit is contained in:
Philip Rebohle 2022-06-30 18:44:16 +02:00
parent c7afe0dd23
commit 185331df9c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 4 additions and 3 deletions

View File

@ -1278,6 +1278,7 @@ namespace dxvk {
uboData.coordMatrix[1][1] = 1.0f;
uboData.yMin = 0.0f;
uboData.yMax = 1.0f;
uboData.isPlanar = cViews[1] != nullptr;
if (cIsYCbCr)
ApplyYCbCrMatrix(uboData.colorMatrix, cStreamState.colorSpace.YCbCr_Matrix);

View File

@ -585,6 +585,7 @@ namespace dxvk {
float colorMatrix[3][4];
float coordMatrix[3][2];
float yMin, yMax;
VkBool32 isPlanar;
};
D3D11ImmediateContext* m_ctx;

View File

@ -1,7 +1,5 @@
#version 450
layout(constant_id = 3) const bool c_planar = true;
// Can't use matrix types here since even a two-row
// matrix will be padded to 16 bytes per column for
// absolutely no reason
@ -15,6 +13,7 @@ uniform ubo_t {
vec2 coord_matrix_c3;
float y_min;
float y_max;
bool is_planar;
};
layout(location = 0) in vec2 i_texcoord;
@ -37,7 +36,7 @@ void main() {
// Fetch source image color
vec4 color = vec4(0.0f, 0.0f, 0.0f, 1.0f);
if (c_planar) {
if (is_planar) {
color.g = texture(sampler2D(s_inputY, s_sampler), coord).r;
color.rb = texture(sampler2D(s_inputCbCr, s_sampler), coord).gr;
color.g = clamp((color.g - y_min) / (y_max - y_min), 0.0f, 1.0f);