Add ExternalTexture Rotate and FlipY Functionality

Adds functionality to Dawn and Tint to rotate and flip-Y external
textures through the shader transform. Tests are included.

Bug: chromium:1316671
Change-Id: I40a6b67eaeb2a348f469e4879eeb585bc40537b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Brandon Jones 2022-11-30 21:32:26 +00:00 committed by Dawn LUCI CQ
parent 94706ecba7
commit 85ceb08d5c
67 changed files with 4930 additions and 1671 deletions

View File

@ -1366,6 +1366,16 @@
} }
] ]
}, },
"external texture rotation":{
"category": "enum",
"tags": ["dawn"],
"values": [
{"value": 0, "name": "rotate 0 degrees"},
{"value": 1, "name": "rotate 90 degrees"},
{"value": 2, "name": "rotate 180 degrees"},
{"value": 3, "name": "rotate 270 degrees"}
]
},
"external texture descriptor": { "external texture descriptor": {
"category": "structure", "category": "structure",
"extensible": "in", "extensible": "in",
@ -1384,7 +1394,9 @@
{"name": "dst transfer function parameters", "type": "float", "annotation": "const*", {"name": "dst transfer function parameters", "type": "float", "annotation": "const*",
"length": 7}, "length": 7},
{"name": "gamut conversion matrix", "type": "float", "annotation": "const*", {"name": "gamut conversion matrix", "type": "float", "annotation": "const*",
"length": 9} "length": 9},
{"name": "flip y", "type": "bool", "default": "false"},
{"name": "rotation", "type": "external texture rotation", "default": "rotate 0 degrees"}
] ]
}, },
"feature name": { "feature name": {

View File

@ -209,6 +209,28 @@ MaybeError ExternalTextureBase::Initialize(DeviceBase* device,
const float* dstFn = descriptor->dstTransferFunctionParameters; const float* dstFn = descriptor->dstTransferFunctionParameters;
std::copy(dstFn, dstFn + 7, params.gammaEncodingParams.begin()); std::copy(dstFn, dstFn + 7, params.gammaEncodingParams.begin());
float flipY = 1;
if (descriptor->flipY) {
flipY = -1;
}
// We can perform the flip-Y operation by multiplying the y-component portion of the matrix by
// -1.
switch (descriptor->rotation) {
case wgpu::ExternalTextureRotation::Rotate0Degrees:
params.coordTransformMatrix = {1.0, 0.0, 0.0, 1.0f * flipY};
break;
case wgpu::ExternalTextureRotation::Rotate90Degrees:
params.coordTransformMatrix = {0.0, 1.0f * flipY, -1.0, 0.0};
break;
case wgpu::ExternalTextureRotation::Rotate180Degrees:
params.coordTransformMatrix = {-1.0, 0.0, 0.0, -1.0f * flipY};
break;
case wgpu::ExternalTextureRotation::Rotate270Degrees:
params.coordTransformMatrix = {0.0, -1.0f * flipY, 1.0, 0.0};
break;
}
DAWN_TRY(device->GetQueue()->WriteBuffer(mParamsBuffer.Get(), 0, &params, DAWN_TRY(device->GetQueue()->WriteBuffer(mParamsBuffer.Get(), 0, &params,
sizeof(ExternalTextureParams))); sizeof(ExternalTextureParams)));

View File

@ -35,6 +35,7 @@ struct ExternalTextureParams {
std::array<float, 8> gammaDecodingParams = {}; std::array<float, 8> gammaDecodingParams = {};
std::array<float, 8> gammaEncodingParams = {}; std::array<float, 8> gammaEncodingParams = {};
std::array<float, 12> gamutConversionMatrix = {}; std::array<float, 12> gamutConversionMatrix = {};
std::array<float, 4> coordTransformMatrix = {};
}; };
MaybeError ValidateExternalTextureDescriptor(const DeviceBase* device, MaybeError ValidateExternalTextureDescriptor(const DeviceBase* device,

View File

@ -37,6 +37,32 @@ wgpu::Texture Create2DTexture(wgpu::Device device,
class ExternalTextureTests : public DawnTest { class ExternalTextureTests : public DawnTest {
protected: protected:
void SetUp() override {
DawnTest::SetUp();
vsModule = utils::CreateShaderModule(device, R"(
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> {
var positions = array<vec4<f32>, 6>(
vec4<f32>(-1.0, 1.0, 0.0, 1.0),
vec4<f32>(-1.0, -1.0, 0.0, 1.0),
vec4<f32>(1.0, 1.0, 0.0, 1.0),
vec4<f32>(1.0, -1.0, 0.0, 1.0),
vec4<f32>(-1.0, -1.0, 0.0, 1.0),
vec4<f32>(1.0, 1.0, 0.0, 1.0)
);
return positions[VertexIndex];
})");
fsSampleExternalTextureModule = utils::CreateShaderModule(device, R"(
@group(0) @binding(0) var s : sampler;
@group(0) @binding(1) var t : texture_external;
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
return textureSampleBaseClampToEdge(t, s, FragCoord.xy / vec2<f32>(4.0, 4.0));
})");
}
wgpu::ExternalTextureDescriptor CreateDefaultExternalTextureDescriptor() { wgpu::ExternalTextureDescriptor CreateDefaultExternalTextureDescriptor() {
wgpu::ExternalTextureDescriptor desc; wgpu::ExternalTextureDescriptor desc;
desc.yuvToRgbConversionMatrix = yuvBT709ToRGBSRGB.yuvToRgbConversionMatrix.data(); desc.yuvToRgbConversionMatrix = yuvBT709ToRGBSRGB.yuvToRgbConversionMatrix.data();
@ -47,12 +73,39 @@ class ExternalTextureTests : public DawnTest {
return desc; return desc;
} }
void RenderToSourceTexture(wgpu::ShaderModule fragmentShader, wgpu::Texture texture) {
{
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fragmentShader;
descriptor.cTargets[0].format = texture.GetFormat();
wgpu::RenderPipeline pipeline1 = device.CreateRenderPipeline(&descriptor);
wgpu::Sampler sampler = device.CreateSampler();
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::TextureView renderView = texture.CreateView();
utils::ComboRenderPassDescriptor renderPass({renderView}, nullptr);
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{
pass.SetPipeline(pipeline1);
pass.Draw(6);
pass.End();
}
wgpu::CommandBuffer copy = encoder.Finish();
queue.Submit(1, &copy);
}
}
static constexpr uint32_t kWidth = 4; static constexpr uint32_t kWidth = 4;
static constexpr uint32_t kHeight = 4; static constexpr uint32_t kHeight = 4;
static constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm; static constexpr wgpu::TextureFormat kFormat = wgpu::TextureFormat::RGBA8Unorm;
static constexpr wgpu::TextureUsage kSampledUsage = wgpu::TextureUsage::TextureBinding; static constexpr wgpu::TextureUsage kSampledUsage = wgpu::TextureUsage::TextureBinding;
utils::ColorSpaceConversionInfo yuvBT709ToRGBSRGB = utils::ColorSpaceConversionInfo yuvBT709ToRGBSRGB =
utils::GetYUVBT709ToRGBSRGBColorSpaceConversionInfo(); utils::GetYUVBT709ToRGBSRGBColorSpaceConversionInfo();
wgpu::ShaderModule vsModule;
wgpu::ShaderModule fsSampleExternalTextureModule;
}; };
} // anonymous namespace } // anonymous namespace
@ -73,29 +126,10 @@ TEST_P(ExternalTextureTests, CreateExternalTextureSuccess) {
} }
TEST_P(ExternalTextureTests, SampleExternalTexture) { TEST_P(ExternalTextureTests, SampleExternalTexture) {
// TODO(crbug.com/dawn/1263): SPIR-V has an issue compiling the output from Tint's external // TODO(crbug.com/tint/1774): Tint has an issue compiling shaders that use external textures on
// texture transform. Re-enable this test for OpenGL when the switch to Tint is complete. // OpenGL/OpenGLES.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
const wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> {
var positions = array<vec4<f32>, 3>(
vec4<f32>(-1.0, 1.0, 0.0, 1.0),
vec4<f32>(-1.0, -1.0, 0.0, 1.0),
vec4<f32>(1.0, 1.0, 0.0, 1.0)
);
return positions[VertexIndex];
})");
const wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@group(0) @binding(0) var s : sampler;
@group(0) @binding(1) var t : texture_external;
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
return textureSampleBaseClampToEdge(t, s, FragCoord.xy / vec2<f32>(4.0, 4.0));
})");
wgpu::Texture sampledTexture = wgpu::Texture sampledTexture =
Create2DTexture(device, kWidth, kHeight, kFormat, Create2DTexture(device, kWidth, kHeight, kFormat,
wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment); wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
@ -121,7 +155,7 @@ TEST_P(ExternalTextureTests, SampleExternalTexture) {
// Pipeline Creation // Pipeline Creation
utils::ComboRenderPipelineDescriptor descriptor; utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule; descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsModule; descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat; descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
@ -158,29 +192,10 @@ TEST_P(ExternalTextureTests, SampleExternalTexture) {
} }
TEST_P(ExternalTextureTests, SampleMultiplanarExternalTexture) { TEST_P(ExternalTextureTests, SampleMultiplanarExternalTexture) {
// TODO(crbug.com/dawn/1263): SPIR-V has an issue compiling the output from Tint's external // TODO(crbug.com/tint/1774): Tint has an issue compiling shaders that use external textures on
// texture transform. Re-enable this test for OpenGL when the switch to Tint is complete. // OpenGL/OpenGLES.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
const wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> {
var positions = array<vec4<f32>, 3>(
vec4<f32>(-1.0, 1.0, 0.0, 1.0),
vec4<f32>(-1.0, -1.0, 0.0, 1.0),
vec4<f32>(1.0, 1.0, 0.0, 1.0)
);
return positions[VertexIndex];
})");
const wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@group(0) @binding(0) var s : sampler;
@group(0) @binding(1) var t : texture_external;
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
return textureSampleBaseClampToEdge(t, s, FragCoord.xy / vec2<f32>(4.0, 4.0));
})");
wgpu::Texture sampledTexturePlane0 = wgpu::Texture sampledTexturePlane0 =
Create2DTexture(device, kWidth, kHeight, wgpu::TextureFormat::R8Unorm, Create2DTexture(device, kWidth, kHeight, wgpu::TextureFormat::R8Unorm,
wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment); wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
@ -213,7 +228,7 @@ TEST_P(ExternalTextureTests, SampleMultiplanarExternalTexture) {
{0.5423, 0.5323, 0.4222, {120, 162, 169, 255}}, {0.5423, 0.5323, 0.4222, {120, 162, 169, 255}},
{0.2345, 0.4383, 0.6342, {126, 53, 33, 255}}}}; {0.2345, 0.4383, 0.6342, {126, 53, 33, 255}}}};
for (ConversionExpectation expectation : expectations) { for (const ConversionExpectation& expectation : expectations) {
// Initialize the texture planes with YUV data // Initialize the texture planes with YUV data
{ {
utils::ComboRenderPassDescriptor renderPass({externalViewPlane0, externalViewPlane1}, utils::ComboRenderPassDescriptor renderPass({externalViewPlane0, externalViewPlane1},
@ -232,7 +247,7 @@ TEST_P(ExternalTextureTests, SampleMultiplanarExternalTexture) {
utils::ComboRenderPipelineDescriptor descriptor; utils::ComboRenderPipelineDescriptor descriptor;
// descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); // descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl);
descriptor.vertex.module = vsModule; descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsModule; descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat; descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
@ -270,6 +285,346 @@ TEST_P(ExternalTextureTests, SampleMultiplanarExternalTexture) {
} }
} }
// Test draws a green square in the upper left quadrant, a black square in the upper right, a red
// square in the lower left and a blue square in the lower right. The image is then sampled as an
// external texture and rotated 0, 90, 180, and 270 degrees with and without the y-axis flipped.
TEST_P(ExternalTextureTests, RotateAndOrFlipSinglePlane) {
// TODO(crbug.com/tint/1774): Tint has an issue compiling shaders that use external textures on
// OpenGL/OpenGLES.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
const wgpu::ShaderModule sourceTextureFsModule = utils::CreateShaderModule(device, R"(
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
if(FragCoord.y < 2.0 && FragCoord.x < 2.0) {
return vec4<f32>(0.0, 1.0, 0.0, 1.0);
}
if(FragCoord.y >= 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(0.0, 0.0, 1.0, 1.0);
}
if(FragCoord.y < 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(0.0, 0.0, 0.0, 1.0);
}
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
})");
wgpu::Texture sourceTexture =
Create2DTexture(device, kWidth, kHeight, kFormat,
wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
RenderToSourceTexture(sourceTextureFsModule, sourceTexture);
wgpu::Texture renderTexture =
Create2DTexture(device, kWidth, kHeight, kFormat,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
// Control case to verify flipY and rotation defaults
{
// Pipeline Creation
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
// Create an ExternalTextureDescriptor from the texture view
wgpu::ExternalTextureDescriptor externalDesc = CreateDefaultExternalTextureDescriptor();
externalDesc.plane0 = sourceTexture.CreateView();
// Import the external texture
wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&externalDesc);
// Create a sampler and bind group
wgpu::Sampler sampler = device.CreateSampler();
wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, externalTexture}});
// Run the shader, which should sample from the external texture and draw a triangle into
// the upper left corner of the render texture.
wgpu::TextureView renderView = renderTexture.CreateView();
utils::ComboRenderPassDescriptor renderPass({renderView}, nullptr);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6);
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kGreen, renderTexture, 0, 0);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kBlack, renderTexture, 3, 0);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kRed, renderTexture, 0, 3);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kBlue, renderTexture, 3, 3);
}
struct RotationExpectation {
wgpu::ExternalTextureRotation rotation;
bool flipY;
utils::RGBA8 upperLeftColor;
utils::RGBA8 upperRightColor;
utils::RGBA8 lowerLeftColor;
utils::RGBA8 lowerRightColor;
};
std::array<RotationExpectation, 8> expectations = {
{{wgpu::ExternalTextureRotation::Rotate0Degrees, false, utils::RGBA8::kGreen,
utils::RGBA8::kBlack, utils::RGBA8::kRed, utils::RGBA8::kBlue},
{wgpu::ExternalTextureRotation::Rotate90Degrees, false, utils::RGBA8::kRed,
utils::RGBA8::kGreen, utils::RGBA8::kBlue, utils::RGBA8::kBlack},
{wgpu::ExternalTextureRotation::Rotate180Degrees, false, utils::RGBA8::kBlue,
utils::RGBA8::kRed, utils::RGBA8::kBlack, utils::RGBA8::kGreen},
{wgpu::ExternalTextureRotation::Rotate270Degrees, false, utils::RGBA8::kBlack,
utils::RGBA8::kBlue, utils::RGBA8::kGreen, utils::RGBA8::kRed},
{wgpu::ExternalTextureRotation::Rotate0Degrees, true, utils::RGBA8::kRed,
utils::RGBA8::kBlue, utils::RGBA8::kGreen, utils::RGBA8::kBlack},
{wgpu::ExternalTextureRotation::Rotate90Degrees, true, utils::RGBA8::kBlue,
utils::RGBA8::kBlack, utils::RGBA8::kRed, utils::RGBA8::kGreen},
{wgpu::ExternalTextureRotation::Rotate180Degrees, true, utils::RGBA8::kBlack,
utils::RGBA8::kGreen, utils::RGBA8::kBlue, utils::RGBA8::kRed},
{wgpu::ExternalTextureRotation::Rotate270Degrees, true, utils::RGBA8::kGreen,
utils::RGBA8::kRed, utils::RGBA8::kBlack, utils::RGBA8::kBlue}}};
for (const RotationExpectation& exp : expectations) {
// Pipeline Creation
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
// Create an ExternalTextureDescriptor from the texture view
wgpu::ExternalTextureDescriptor externalDesc = CreateDefaultExternalTextureDescriptor();
externalDesc.plane0 = sourceTexture.CreateView();
externalDesc.rotation = exp.rotation;
externalDesc.flipY = exp.flipY;
// Import the external texture
wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&externalDesc);
// Create a sampler and bind group
wgpu::Sampler sampler = device.CreateSampler();
wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, externalTexture}});
// Run the shader, which should sample from the external texture and draw a triangle into
// the upper left corner of the render texture.
wgpu::TextureView renderView = renderTexture.CreateView();
utils::ComboRenderPassDescriptor renderPass({renderView}, nullptr);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6);
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
EXPECT_PIXEL_RGBA8_EQ(exp.upperLeftColor, renderTexture, 0, 0);
EXPECT_PIXEL_RGBA8_EQ(exp.upperLeftColor, renderTexture, 1, 1);
EXPECT_PIXEL_RGBA8_EQ(exp.upperRightColor, renderTexture, 3, 0);
EXPECT_PIXEL_RGBA8_EQ(exp.upperRightColor, renderTexture, 2, 1);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerLeftColor, renderTexture, 0, 3);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerLeftColor, renderTexture, 1, 2);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerRightColor, renderTexture, 3, 3);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerRightColor, renderTexture, 2, 2);
}
}
// Test draws a green square in the upper left quadrant, a black square in the upper right, a red
// square in the lower left and a blue square in the lower right. The image is then sampled as an
// external texture and rotated 0, 90, 180, and 270 degrees with and without the y-axis flipped.
TEST_P(ExternalTextureTests, RotateAndOrFlipMultiplanar) {
// TODO(crbug.com/tint/1774): Tint has an issue compiling shaders that use external textures on
// OpenGL/OpenGLES.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
const wgpu::ShaderModule sourceTexturePlane0FsModule = utils::CreateShaderModule(device, R"(
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
if(FragCoord.y < 2.0 && FragCoord.x < 2.0) {
return vec4<f32>(0.7152, 0.0, 0.0, 0.0);
}
if(FragCoord.y >= 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(0.0722, 0.0, 1.0, 1.0);
}
if(FragCoord.y < 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
return vec4<f32>(0.2126, 0.0, 0.0, 0.0);
})");
const wgpu::ShaderModule sourceTexturePlane1FsModule = utils::CreateShaderModule(device, R"(
@fragment fn main(@builtin(position) FragCoord : vec4<f32>)
-> @location(0) vec4<f32> {
if(FragCoord.x < 2.0 && FragCoord.y < 2.0) {
return vec4<f32>(0.1402, 0.0175, 0.0, 0.0);
}
if(FragCoord.y >= 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(1.0, 0.4937, 0.0, 0.0);
}
if(FragCoord.y < 2.0 && FragCoord.x >= 2.0) {
return vec4<f32>(0.5, 0.5, 0.0, 0.0);
}
return vec4<f32>(0.4172, 1.0, 0.0, 0.0);
})");
wgpu::Texture sourceTexturePlane0 =
Create2DTexture(device, kWidth, kHeight, wgpu::TextureFormat::R8Unorm,
wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
wgpu::Texture sourceTexturePlane1 =
Create2DTexture(device, kWidth, kHeight, wgpu::TextureFormat::RG8Unorm,
wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::RenderAttachment);
RenderToSourceTexture(sourceTexturePlane0FsModule, sourceTexturePlane0);
RenderToSourceTexture(sourceTexturePlane1FsModule, sourceTexturePlane1);
wgpu::Texture renderTexture =
Create2DTexture(device, kWidth, kHeight, kFormat,
wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::RenderAttachment);
// Control case to verify flipY and rotation defaults
{
// Pipeline Creation
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
// Create an ExternalTextureDescriptor from the texture view
wgpu::ExternalTextureDescriptor externalDesc = CreateDefaultExternalTextureDescriptor();
externalDesc.plane0 = sourceTexturePlane0.CreateView();
externalDesc.plane1 = sourceTexturePlane1.CreateView();
// Import the external texture
wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&externalDesc);
// Create a sampler and bind group
wgpu::Sampler sampler = device.CreateSampler();
wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, externalTexture}});
// Run the shader, which should sample from the external texture and draw a triangle into
// the upper left corner of the render texture.
wgpu::TextureView renderView = renderTexture.CreateView();
utils::ComboRenderPassDescriptor renderPass({renderView}, nullptr);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6);
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kGreen, renderTexture, 0, 0);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kBlack, renderTexture, 3, 0);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kRed, renderTexture, 0, 3);
EXPECT_PIXEL_RGBA8_EQ(utils::RGBA8::kBlue, renderTexture, 3, 3);
}
struct RotationExpectation {
wgpu::ExternalTextureRotation rotation;
bool flipY;
utils::RGBA8 upperLeftColor;
utils::RGBA8 upperRightColor;
utils::RGBA8 lowerLeftColor;
utils::RGBA8 lowerRightColor;
};
std::array<RotationExpectation, 8> expectations = {
{{wgpu::ExternalTextureRotation::Rotate0Degrees, false, utils::RGBA8::kGreen,
utils::RGBA8::kBlack, utils::RGBA8::kRed, utils::RGBA8::kBlue},
{wgpu::ExternalTextureRotation::Rotate90Degrees, false, utils::RGBA8::kRed,
utils::RGBA8::kGreen, utils::RGBA8::kBlue, utils::RGBA8::kBlack},
{wgpu::ExternalTextureRotation::Rotate180Degrees, false, utils::RGBA8::kBlue,
utils::RGBA8::kRed, utils::RGBA8::kBlack, utils::RGBA8::kGreen},
{wgpu::ExternalTextureRotation::Rotate270Degrees, false, utils::RGBA8::kBlack,
utils::RGBA8::kBlue, utils::RGBA8::kGreen, utils::RGBA8::kRed},
{wgpu::ExternalTextureRotation::Rotate0Degrees, true, utils::RGBA8::kRed,
utils::RGBA8::kBlue, utils::RGBA8::kGreen, utils::RGBA8::kBlack},
{wgpu::ExternalTextureRotation::Rotate90Degrees, true, utils::RGBA8::kBlue,
utils::RGBA8::kBlack, utils::RGBA8::kRed, utils::RGBA8::kGreen},
{wgpu::ExternalTextureRotation::Rotate180Degrees, true, utils::RGBA8::kBlack,
utils::RGBA8::kGreen, utils::RGBA8::kBlue, utils::RGBA8::kRed},
{wgpu::ExternalTextureRotation::Rotate270Degrees, true, utils::RGBA8::kGreen,
utils::RGBA8::kRed, utils::RGBA8::kBlack, utils::RGBA8::kBlue}}};
for (const RotationExpectation& exp : expectations) {
// Pipeline Creation
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsSampleExternalTextureModule;
descriptor.cTargets[0].format = kFormat;
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
// Create an ExternalTextureDescriptor from the texture view
wgpu::ExternalTextureDescriptor externalDesc = CreateDefaultExternalTextureDescriptor();
externalDesc.plane0 = sourceTexturePlane0.CreateView();
externalDesc.plane1 = sourceTexturePlane1.CreateView();
externalDesc.rotation = exp.rotation;
externalDesc.flipY = exp.flipY;
// Import the external texture
wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&externalDesc);
// Create a sampler and bind group
wgpu::Sampler sampler = device.CreateSampler();
wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, externalTexture}});
// Run the shader, which should sample from the external texture and draw a triangle into
// the upper left corner of the render texture.
wgpu::TextureView renderView = renderTexture.CreateView();
utils::ComboRenderPassDescriptor renderPass({renderView}, nullptr);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6);
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands);
EXPECT_PIXEL_RGBA8_EQ(exp.upperLeftColor, renderTexture, 0, 0);
EXPECT_PIXEL_RGBA8_EQ(exp.upperLeftColor, renderTexture, 1, 1);
EXPECT_PIXEL_RGBA8_EQ(exp.upperRightColor, renderTexture, 3, 0);
EXPECT_PIXEL_RGBA8_EQ(exp.upperRightColor, renderTexture, 2, 1);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerLeftColor, renderTexture, 0, 3);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerLeftColor, renderTexture, 1, 2);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerRightColor, renderTexture, 3, 3);
EXPECT_PIXEL_RGBA8_EQ(exp.lowerRightColor, renderTexture, 2, 2);
}
}
DAWN_INSTANTIATE_TEST(ExternalTextureTests, DAWN_INSTANTIATE_TEST(ExternalTextureTests,
D3D12Backend(), D3D12Backend(),
MetalBackend(), MetalBackend(),

View File

@ -258,10 +258,11 @@ struct MultiplanarExternalTexture::State {
utils::Vector ext_tex_params_member_list{ utils::Vector ext_tex_params_member_list{
b.Member("numPlanes", b.ty.u32()), b.Member("numPlanes", b.ty.u32()),
b.Member("doYuvToRgbConversionOnly", b.ty.u32()), b.Member("doYuvToRgbConversionOnly", b.ty.u32()),
b.Member("yuvToRgbConversionMatrix", b.ty.mat3x4(b.ty.f32())), b.Member("yuvToRgbConversionMatrix", b.ty.mat3x4<f32>()),
b.Member("gammaDecodeParams", b.ty.type_name("GammaTransferParams")), b.Member("gammaDecodeParams", b.ty.type_name("GammaTransferParams")),
b.Member("gammaEncodeParams", b.ty.type_name("GammaTransferParams")), b.Member("gammaEncodeParams", b.ty.type_name("GammaTransferParams")),
b.Member("gamutConversionMatrix", b.ty.mat3x3(b.ty.f32()))}; b.Member("gamutConversionMatrix", b.ty.mat3x3<f32>()),
b.Member("rotationMatrix", b.ty.mat2x2<f32>())};
params_struct_sym = b.Symbols().New("ExternalTextureParams"); params_struct_sym = b.Symbols().New("ExternalTextureParams");
@ -314,22 +315,27 @@ struct MultiplanarExternalTexture::State {
const ast::CallExpression* plane_1_call = nullptr; const ast::CallExpression* plane_1_call = nullptr;
switch (call_type) { switch (call_type) {
case sem::BuiltinType::kTextureSampleBaseClampToEdge: case sem::BuiltinType::kTextureSampleBaseClampToEdge:
stmts.Push(b.Decl(b.Let("modifiedCoords",
b.Add(b.Mul(b.Sub("coord", f32(0.5)),
b.MemberAccessor("params", "rotationMatrix")),
f32(0.5)))));
stmts.Push(b.Decl(b.Let( stmts.Push(b.Decl(b.Let(
"plane0_dims", "plane0_dims",
b.Construct(b.ty.vec2<f32>(), b.Call("textureDimensions", "plane0", 0_a))))); b.Construct(b.ty.vec2<f32>(), b.Call("textureDimensions", "plane0", 0_a)))));
stmts.Push( stmts.Push(
b.Decl(b.Let("plane0_half_texel", b.Div(b.vec2<f32>(0.5_a), "plane0_dims")))); b.Decl(b.Let("plane0_half_texel", b.Div(b.vec2<f32>(0.5_a), "plane0_dims"))));
stmts.Push( stmts.Push(b.Decl(
b.Decl(b.Let("plane0_clamped", b.Call("clamp", "coord", "plane0_half_texel", b.Let("plane0_clamped", b.Call("clamp", "modifiedCoords", "plane0_half_texel",
b.Sub(1_a, "plane0_half_texel"))))); b.Sub(1_a, "plane0_half_texel")))));
stmts.Push(b.Decl(b.Let( stmts.Push(b.Decl(b.Let(
"plane1_dims", "plane1_dims",
b.Construct(b.ty.vec2<f32>(), b.Call("textureDimensions", "plane1", 0_a))))); b.Construct(b.ty.vec2<f32>(), b.Call("textureDimensions", "plane1", 0_a)))));
stmts.Push( stmts.Push(
b.Decl(b.Let("plane1_half_texel", b.Div(b.vec2<f32>(0.5_a), "plane1_dims")))); b.Decl(b.Let("plane1_half_texel", b.Div(b.vec2<f32>(0.5_a), "plane1_dims"))));
stmts.Push( stmts.Push(b.Decl(
b.Decl(b.Let("plane1_clamped", b.Call("clamp", "coord", "plane1_half_texel", b.Let("plane1_clamped", b.Call("clamp", "modifiedCoords", "plane1_half_texel",
b.Sub(1_a, "plane1_half_texel"))))); b.Sub(1_a, "plane1_half_texel")))));
// textureSampleLevel(plane0, smp, plane0_clamped, 0.0); // textureSampleLevel(plane0, smp, plane0_clamped, 0.0);
single_plane_call = single_plane_call =

View File

@ -138,6 +138,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>;
@ -193,6 +194,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>;
@ -247,6 +249,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -265,12 +268,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -329,6 +333,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -343,12 +348,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -412,6 +418,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>;
@ -504,6 +511,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(1) var ext_tex_plane_1 : texture_2d<f32>;
@ -595,6 +603,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -613,12 +622,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -692,6 +702,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -706,12 +717,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -795,6 +807,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(4) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(4) var ext_tex_plane_1 : texture_2d<f32>;
@ -831,12 +844,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -904,6 +918,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -918,12 +933,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -995,6 +1011,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1014,12 +1031,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1086,6 +1104,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1100,12 +1119,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1179,6 +1199,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(3) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(3) var ext_tex_plane_1 : texture_2d<f32>;
@ -1197,12 +1218,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1281,6 +1303,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(3) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(3) var ext_tex_plane_1 : texture_2d<f32>;
@ -1304,12 +1327,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1384,6 +1408,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1398,12 +1423,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1483,6 +1509,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1497,12 +1524,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1570,6 +1598,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
fn f(ext_tex : texture_2d<f32>, ext_tex_plane_1 : texture_2d<f32>, ext_tex_params : ExternalTextureParams) -> vec2<u32> { fn f(ext_tex : texture_2d<f32>, ext_tex_plane_1 : texture_2d<f32>, ext_tex_params : ExternalTextureParams) -> vec2<u32> {
@ -1621,6 +1650,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1637,12 +1667,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;
@ -1715,6 +1746,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;
@ -1734,12 +1766,13 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
} }
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
let modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
let plane0_dims = vec2<f32>(textureDimensions(plane0, 0)); let plane0_dims = vec2<f32>(textureDimensions(plane0, 0));
let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims); let plane0_half_texel = (vec2<f32>(0.5) / plane0_dims);
let plane0_clamped = clamp(coord, plane0_half_texel, (1 - plane0_half_texel)); let plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1 - plane0_half_texel));
let plane1_dims = vec2<f32>(textureDimensions(plane1, 0)); let plane1_dims = vec2<f32>(textureDimensions(plane1, 0));
let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims); let plane1_half_texel = (vec2<f32>(0.5) / plane1_dims);
let plane1_clamped = clamp(coord, plane1_half_texel, (1 - plane1_half_texel)); let plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1 - plane1_half_texel));
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1)) { if ((params.numPlanes == 1)) {
color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb; color = textureSampleLevel(plane0, smp, plane0_clamped, 0).rgb;

View File

@ -19,11 +19,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space0); Texture2D<float4> ext_tex_plane_1 : register(t2, space0);
cbuffer cbuffer_ext_tex_params : register(b3, space0) { cbuffer cbuffer_ext_tex_params : register(b3, space0) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> t : register(t0, space0); Texture2D<float4> t : register(t0, space0);
RWTexture2D<float4> outImage : register(u1, space0); RWTexture2D<float4> outImage : register(u1, space0);
@ -50,14 +51,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_6(uint4 buffer[11], uint offset) { float3x4 tint_symbol_6(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_8(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_8(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -66,22 +67,30 @@ GammaTransferParams tint_symbol_8(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_14 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_12; return tint_symbol_14;
} }
float3x3 tint_symbol_10(uint4 buffer[11], uint offset) { float3x3 tint_symbol_10(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_4(uint4 buffer[11], uint offset) { float2x2 tint_symbol_12(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_13; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_4(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_15 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u)), tint_symbol_12(buffer, (offset + 176u))};
return tint_symbol_15;
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -19,11 +19,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space0); Texture2D<float4> ext_tex_plane_1 : register(t2, space0);
cbuffer cbuffer_ext_tex_params : register(b3, space0) { cbuffer cbuffer_ext_tex_params : register(b3, space0) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> t : register(t0, space0); Texture2D<float4> t : register(t0, space0);
RWTexture2D<float4> outImage : register(u1, space0); RWTexture2D<float4> outImage : register(u1, space0);
@ -50,14 +51,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_6(uint4 buffer[11], uint offset) { float3x4 tint_symbol_6(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_8(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_8(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -66,22 +67,30 @@ GammaTransferParams tint_symbol_8(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_14 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_12; return tint_symbol_14;
} }
float3x3 tint_symbol_10(uint4 buffer[11], uint offset) { float3x3 tint_symbol_10(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_4(uint4 buffer[11], uint offset) { float2x2 tint_symbol_12(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_13; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_4(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_15 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u)), tint_symbol_12(buffer, (offset + 176u))};
return tint_symbol_15;
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -20,10 +20,24 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
uint pad;
uint pad_1;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
layout(rgba8) uniform highp writeonly image2D outImage; layout(rgba8) uniform highp writeonly image2D outImage;
@ -51,10 +65,14 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D t_2; uniform highp sampler2D t_2;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void tint_symbol() { void tint_symbol() {
vec4 red = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(10), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), ext_tex_params.inner); vec4 red = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(10), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), conv_ExternalTextureParams(ext_tex_params.inner));
imageStore(outImage, clamp(ivec2(0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), red); imageStore(outImage, clamp(ivec2(0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), red);
vec4 green = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(70, 118), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), ext_tex_params.inner); vec4 green = textureLoadExternal(t_2, ext_tex_plane_1_1, clamp(ivec2(70, 118), ivec2(0), ivec2((uvec2(uvec2(textureSize(t_2, 0))) - uvec2(1u)))), conv_ExternalTextureParams(ext_tex_params.inner));
imageStore(outImage, clamp(ivec2(1, 0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), green); imageStore(outImage, clamp(ivec2(1, 0), ivec2(0), ivec2((uvec2(uvec2(imageSize(outImage))) - uvec2(1u)))), green);
return; return;
} }

View File

@ -37,6 +37,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,22 +1,22 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 177 ; Bound: 195
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability ImageQuery OpCapability ImageQuery
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1 OpExecutionMode %main LocalSize 1 1 1
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -26,8 +26,10 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %t "t" OpName %t "t"
OpName %outImage "outImage" OpName %outImage "outImage"
@ -38,25 +40,35 @@
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %main "main" OpName %main "main"
OpName %red "red" OpName %red "red"
OpName %green "green" OpName %green "green"
OpDecorate %ext_tex_plane_1 DescriptorSet 0 OpDecorate %ext_tex_plane_1 DescriptorSet 0
OpDecorate %ext_tex_plane_1 Binding 2 OpDecorate %ext_tex_plane_1 Binding 2
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -65,10 +77,12 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 0 OpDecorate %ext_tex_params DescriptorSet 0
OpDecorate %ext_tex_params Binding 3 OpDecorate %ext_tex_params Binding 3
@ -77,6 +91,19 @@
OpDecorate %outImage NonReadable OpDecorate %outImage NonReadable
OpDecorate %outImage DescriptorSet 0 OpDecorate %outImage DescriptorSet 0
OpDecorate %outImage Binding 1 OpDecorate %outImage Binding 1
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%3 = OpTypeImage %float 2D 0 0 0 1 Unknown %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@ -87,186 +114,206 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%t = OpVariable %_ptr_UniformConstant_3 UniformConstant %t = OpVariable %_ptr_UniformConstant_3 UniformConstant
%18 = OpTypeImage %float 2D 0 0 0 2 Rgba8 %19 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 %_ptr_UniformConstant_19 = OpTypePointer UniformConstant %19
%outImage = OpVariable %_ptr_UniformConstant_18 UniformConstant %outImage = OpVariable %_ptr_UniformConstant_19 UniformConstant
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2 %v2int = OpTypeVector %int 2
%19 = OpTypeFunction %v2int %v2int %v2int %v2int %20 = OpTypeFunction %v2int %v2int %v2int %v2int
%30 = OpTypeFunction %v3float %v3float %GammaTransferParams %31 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%49 = OpConstantNull %v3float %50 = OpConstantNull %v3float
%69 = OpTypeFunction %v4float %3 %3 %v2int %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%70 = OpTypeFunction %v4float %3 %3 %v2int %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%84 = OpConstantNull %int %87 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%98 = OpConstantNull %uint %100 = OpConstantNull %uint
%118 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%116 = OpTypeFunction %void %132 = OpTypeFunction %void
%int_10 = OpConstant %int 10 %int_10 = OpConstant %int 10
%122 = OpConstantComposite %v2int %int_10 %int_10 %138 = OpConstantComposite %v2int %int_10 %int_10
%123 = OpConstantNull %v2int %139 = OpConstantNull %v2int
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%int_0 = OpConstant %int 0 %int_0 = OpConstant %int 0
%130 = OpConstantComposite %v2uint %uint_1 %uint_1 %146 = OpConstantComposite %v2uint %uint_1 %uint_1
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%141 = OpConstantNull %v4float %158 = OpConstantNull %v4float
%int_70 = OpConstant %int 70 %int_70 = OpConstant %int 70
%int_118 = OpConstant %int 118 %int_118 = OpConstant %int 118
%154 = OpConstantComposite %v2int %int_70 %int_118 %171 = OpConstantComposite %v2int %int_70 %int_118
%int_1 = OpConstant %int 1 %int_1 = OpConstant %int 1
%168 = OpConstantComposite %v2int %int_1 %84 %186 = OpConstantComposite %v2int %int_1 %87
%tint_clamp = OpFunction %v2int None %19 %tint_clamp = OpFunction %v2int None %20
%e = OpFunctionParameter %v2int %e = OpFunctionParameter %v2int
%low = OpFunctionParameter %v2int %low = OpFunctionParameter %v2int
%high = OpFunctionParameter %v2int %high = OpFunctionParameter %v2int
%26 = OpLabel %27 = OpLabel
%29 = OpExtInst %v2int %28 SMax %e %low %30 = OpExtInst %v2int %29 SMax %e %low
%27 = OpExtInst %v2int %28 SMin %29 %high %28 = OpExtInst %v2int %29 SMin %30 %high
OpReturnValue %27 OpReturnValue %28
OpFunctionEnd OpFunctionEnd
%gammaCorrection = OpFunction %v3float None %30 %gammaCorrection = OpFunction %v3float None %31
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%34 = OpLabel %35 = OpLabel
%47 = OpVariable %_ptr_Function_v3float Function %49 %48 = OpVariable %_ptr_Function_v3float Function %50
%59 = OpVariable %_ptr_Function_v3float Function %49 %60 = OpVariable %_ptr_Function_v3float Function %50
%65 = OpVariable %_ptr_Function_v3float Function %49 %66 = OpVariable %_ptr_Function_v3float Function %50
%35 = OpExtInst %v3float %28 FAbs %v %36 = OpExtInst %v3float %29 FAbs %v
%36 = OpCompositeExtract %float %params 4 %37 = OpCompositeExtract %float %params 4
%37 = OpCompositeConstruct %v3float %36 %36 %36 %38 = OpCompositeConstruct %v3float %37 %37 %37
%38 = OpFOrdLessThan %v3bool %35 %37 %39 = OpFOrdLessThan %v3bool %36 %38
%41 = OpExtInst %v3float %28 FSign %v %42 = OpExtInst %v3float %29 FSign %v
%42 = OpCompositeExtract %float %params 3 %43 = OpCompositeExtract %float %params 3
%43 = OpExtInst %v3float %28 FAbs %v %44 = OpExtInst %v3float %29 FAbs %v
%44 = OpVectorTimesScalar %v3float %43 %42 %45 = OpVectorTimesScalar %v3float %44 %43
%45 = OpCompositeExtract %float %params 6 %46 = OpCompositeExtract %float %params 6
%50 = OpCompositeConstruct %v3float %45 %45 %45 %51 = OpCompositeConstruct %v3float %46 %46 %46
%46 = OpFAdd %v3float %44 %50 %47 = OpFAdd %v3float %45 %51
%51 = OpFMul %v3float %41 %46 %52 = OpFMul %v3float %42 %47
%52 = OpExtInst %v3float %28 FSign %v %53 = OpExtInst %v3float %29 FSign %v
%54 = OpCompositeExtract %float %params 1 %55 = OpCompositeExtract %float %params 1
%55 = OpExtInst %v3float %28 FAbs %v %56 = OpExtInst %v3float %29 FAbs %v
%56 = OpVectorTimesScalar %v3float %55 %54 %57 = OpVectorTimesScalar %v3float %56 %55
%57 = OpCompositeExtract %float %params 2 %58 = OpCompositeExtract %float %params 2
%60 = OpCompositeConstruct %v3float %57 %57 %57 %61 = OpCompositeConstruct %v3float %58 %58 %58
%58 = OpFAdd %v3float %56 %60 %59 = OpFAdd %v3float %57 %61
%61 = OpCompositeExtract %float %params 0 %62 = OpCompositeExtract %float %params 0
%62 = OpCompositeConstruct %v3float %61 %61 %61 %63 = OpCompositeConstruct %v3float %62 %62 %62
%53 = OpExtInst %v3float %28 Pow %58 %62 %54 = OpExtInst %v3float %29 Pow %59 %63
%63 = OpCompositeExtract %float %params 5 %64 = OpCompositeExtract %float %params 5
%66 = OpCompositeConstruct %v3float %63 %63 %63 %67 = OpCompositeConstruct %v3float %64 %64 %64
%64 = OpFAdd %v3float %53 %66 %65 = OpFAdd %v3float %54 %67
%67 = OpFMul %v3float %52 %64 %68 = OpFMul %v3float %53 %65
%68 = OpSelect %v3float %38 %51 %67 %69 = OpSelect %v3float %39 %52 %68
OpReturnValue %68 OpReturnValue %69
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %69 %textureLoadExternal = OpFunction %v4float None %70
%plane0 = OpFunctionParameter %3 %plane0 = OpFunctionParameter %3
%plane1 = OpFunctionParameter %3 %plane1 = OpFunctionParameter %3
%coord = OpFunctionParameter %v2int %coord = OpFunctionParameter %v2int
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%75 = OpLabel %78 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %49 %color = OpVariable %_ptr_Function_v3float Function %50
%77 = OpCompositeExtract %uint %params_0 0 %80 = OpCompositeExtract %uint %params_0 0
%79 = OpIEqual %bool %77 %uint_1 %82 = OpIEqual %bool %80 %uint_1
OpSelectionMerge %80 None OpSelectionMerge %83 None
OpBranchConditional %79 %81 %82 OpBranchConditional %82 %84 %85
%81 = OpLabel %84 = OpLabel
%83 = OpImageFetch %v4float %plane0 %coord Lod %84 %86 = OpImageFetch %v4float %plane0 %coord Lod %87
%85 = OpVectorShuffle %v3float %83 %83 0 1 2 %88 = OpVectorShuffle %v3float %86 %86 0 1 2
OpStore %color %85 OpStore %color %88
OpBranch %80 OpBranch %83
%82 = OpLabel %85 = OpLabel
%86 = OpImageFetch %v4float %plane0 %coord Lod %84 %89 = OpImageFetch %v4float %plane0 %coord Lod %87
%87 = OpCompositeExtract %float %86 0 %90 = OpCompositeExtract %float %89 0
%88 = OpImageFetch %v4float %plane1 %coord Lod %84 %91 = OpImageFetch %v4float %plane1 %coord Lod %87
%90 = OpVectorShuffle %v2float %88 %88 0 1 %92 = OpVectorShuffle %v2float %91 %91 0 1
%91 = OpCompositeExtract %float %90 0 %93 = OpCompositeExtract %float %92 0
%92 = OpCompositeExtract %float %90 1 %94 = OpCompositeExtract %float %92 1
%94 = OpCompositeConstruct %v4float %87 %91 %92 %float_1 %96 = OpCompositeConstruct %v4float %90 %93 %94 %float_1
%95 = OpCompositeExtract %mat3v4float %params_0 2 %97 = OpCompositeExtract %mat3v4float %params_0 2
%96 = OpVectorTimesMatrix %v3float %94 %95 %98 = OpVectorTimesMatrix %v3float %96 %97
OpStore %color %96 OpStore %color %98
OpBranch %80 OpBranch %83
%80 = OpLabel %83 = OpLabel
%97 = OpCompositeExtract %uint %params_0 1 %99 = OpCompositeExtract %uint %params_0 1
%99 = OpIEqual %bool %97 %98 %101 = OpIEqual %bool %99 %100
OpSelectionMerge %100 None OpSelectionMerge %102 None
OpBranchConditional %99 %101 %100 OpBranchConditional %101 %103 %102
%101 = OpLabel %103 = OpLabel
%103 = OpLoad %v3float %color %105 = OpLoad %v3float %color
%104 = OpCompositeExtract %GammaTransferParams %params_0 3 %106 = OpCompositeExtract %GammaTransferParams %params_0 3
%102 = OpFunctionCall %v3float %gammaCorrection %103 %104 %104 = OpFunctionCall %v3float %gammaCorrection %105 %106
OpStore %color %102 OpStore %color %104
%105 = OpCompositeExtract %mat3v3float %params_0 5 %107 = OpCompositeExtract %mat3v3float %params_0 5
%106 = OpLoad %v3float %color %108 = OpLoad %v3float %color
%107 = OpMatrixTimesVector %v3float %105 %106 %109 = OpMatrixTimesVector %v3float %107 %108
OpStore %color %107 OpStore %color %109
%109 = OpLoad %v3float %color
%110 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpFunctionCall %v3float %gammaCorrection %109 %110
OpStore %color %108
OpBranch %100
%100 = OpLabel
%111 = OpLoad %v3float %color %111 = OpLoad %v3float %color
%112 = OpCompositeExtract %float %111 0 %112 = OpCompositeExtract %GammaTransferParams %params_0 4
%113 = OpCompositeExtract %float %111 1 %110 = OpFunctionCall %v3float %gammaCorrection %111 %112
%114 = OpCompositeExtract %float %111 2 OpStore %color %110
%115 = OpCompositeConstruct %v4float %112 %113 %114 %float_1 OpBranch %102
OpReturnValue %115 %102 = OpLabel
%113 = OpLoad %v3float %color
%114 = OpCompositeExtract %float %113 0
%115 = OpCompositeExtract %float %113 1
%116 = OpCompositeExtract %float %113 2
%117 = OpCompositeConstruct %v4float %114 %115 %116 %float_1
OpReturnValue %117
OpFunctionEnd OpFunctionEnd
%main = OpFunction %void None %116 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %118
%119 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%red = OpVariable %_ptr_Function_v4float Function %141 %121 = OpLabel
%green = OpVariable %_ptr_Function_v4float Function %141 %122 = OpCompositeExtract %uint %val 0
%128 = OpLoad %3 %t %123 = OpCompositeExtract %uint %val 1
%127 = OpImageQuerySizeLod %v2uint %128 %int_0 %124 = OpCompositeExtract %mat3v4float %val 2
%131 = OpISub %v2uint %127 %130 %125 = OpCompositeExtract %GammaTransferParams %val 3
%124 = OpBitcast %v2int %131 %126 = OpCompositeExtract %GammaTransferParams %val 4
%120 = OpFunctionCall %v2int %tint_clamp %122 %123 %124 %127 = OpCompositeExtract %mat3v3float %val 5
%133 = OpLoad %3 %t %128 = OpCompositeExtract %v2float %val 6
%134 = OpLoad %3 %ext_tex_plane_1 %129 = OpCompositeExtract %v2float %val 7
%137 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %130 = OpCompositeConstruct %mat2v2float %128 %129
%138 = OpLoad %ExternalTextureParams %137 %131 = OpCompositeConstruct %ExternalTextureParams %122 %123 %124 %125 %126 %127 %130
%132 = OpFunctionCall %v4float %textureLoadExternal %133 %134 %120 %138 OpReturnValue %131
OpStore %red %132 OpFunctionEnd
%146 = OpLoad %18 %outImage %main = OpFunction %void None %132
%145 = OpImageQuerySize %v2uint %146 %135 = OpLabel
%147 = OpISub %v2uint %145 %130 %red = OpVariable %_ptr_Function_v4float Function %158
%143 = OpBitcast %v2int %147 %green = OpVariable %_ptr_Function_v4float Function %158
%142 = OpFunctionCall %v2int %tint_clamp %123 %123 %143 %144 = OpLoad %3 %t
%149 = OpLoad %18 %outImage %143 = OpImageQuerySizeLod %v2uint %144 %int_0
%150 = OpLoad %v4float %red %147 = OpISub %v2uint %143 %146
OpImageWrite %149 %142 %150 %140 = OpBitcast %v2int %147
%158 = OpLoad %3 %t %136 = OpFunctionCall %v2int %tint_clamp %138 %139 %140
%157 = OpImageQuerySizeLod %v2uint %158 %int_0 %149 = OpLoad %3 %t
%159 = OpISub %v2uint %157 %130 %150 = OpLoad %3 %ext_tex_plane_1
%155 = OpBitcast %v2int %159 %154 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%151 = OpFunctionCall %v2int %tint_clamp %154 %123 %155 %155 = OpLoad %ExternalTextureParams_std140 %154
%161 = OpLoad %3 %t %151 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %155
%162 = OpLoad %3 %ext_tex_plane_1 %148 = OpFunctionCall %v4float %textureLoadExternal %149 %150 %136 %151
%163 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 OpStore %red %148
%164 = OpLoad %ExternalTextureParams %163 %163 = OpLoad %19 %outImage
%160 = OpFunctionCall %v4float %textureLoadExternal %161 %162 %151 %164 %162 = OpImageQuerySize %v2uint %163
OpStore %green %160 %164 = OpISub %v2uint %162 %146
%172 = OpLoad %18 %outImage %160 = OpBitcast %v2int %164
%171 = OpImageQuerySize %v2uint %172 %159 = OpFunctionCall %v2int %tint_clamp %139 %139 %160
%173 = OpISub %v2uint %171 %130 %166 = OpLoad %19 %outImage
%169 = OpBitcast %v2int %173 %167 = OpLoad %v4float %red
%166 = OpFunctionCall %v2int %tint_clamp %168 %123 %169 OpImageWrite %166 %159 %167
%175 = OpLoad %18 %outImage %175 = OpLoad %3 %t
%176 = OpLoad %v4float %green %174 = OpImageQuerySizeLod %v2uint %175 %int_0
OpImageWrite %175 %166 %176 %176 = OpISub %v2uint %174 %146
%172 = OpBitcast %v2int %176
%168 = OpFunctionCall %v2int %tint_clamp %171 %139 %172
%178 = OpLoad %3 %t
%179 = OpLoad %3 %ext_tex_plane_1
%181 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%182 = OpLoad %ExternalTextureParams_std140 %181
%180 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %182
%177 = OpFunctionCall %v4float %textureLoadExternal %178 %179 %168 %180
OpStore %green %177
%190 = OpLoad %19 %outImage
%189 = OpImageQuerySize %v2uint %190
%191 = OpISub %v2uint %189 %146
%187 = OpBitcast %v2int %191
%184 = OpFunctionCall %v2int %tint_clamp %186 %139 %187
%193 = OpLoad %19 %outImage
%194 = OpLoad %v4float %green
OpImageWrite %193 %184 %194
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -16,6 +16,7 @@ struct ExternalTextureParams {
gammaDecodeParams : GammaTransferParams, gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams, gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>, gamutConversionMatrix : mat3x3<f32>,
rotationMatrix : mat2x2<f32>,
} }
@group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>; @group(0) @binding(2) var ext_tex_plane_1 : texture_2d<f32>;

View File

@ -1,6 +1,6 @@
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);

View File

@ -1,6 +1,6 @@
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
@ -63,10 +75,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
@ -102,10 +126,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;

View File

@ -19,6 +19,7 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) { void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {

View File

@ -1,7 +1,7 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 48 ; Bound: 49
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability ImageQuery OpCapability ImageQuery
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,8 +30,10 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9" OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
@ -44,14 +46,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -60,10 +62,12 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
@ -85,47 +89,48 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%void = OpTypeVoid %void = OpTypeVoid
%22 = OpTypeFunction %void %23 = OpTypeFunction %void
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%int_0 = OpConstant %int 0 %int_0 = OpConstant %int 0
%_ptr_Function_v2uint = OpTypePointer Function %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint
%33 = OpConstantNull %v2uint %34 = OpConstantNull %v2uint
%34 = OpTypeFunction %v4float %35 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%textureDimensions_cdc6c9 = OpFunction %void None %22 %textureDimensions_cdc6c9 = OpFunction %void None %23
%25 = OpLabel %26 = OpLabel
%res = OpVariable %_ptr_Function_v2uint Function %33 %res = OpVariable %_ptr_Function_v2uint Function %34
%28 = OpLoad %11 %arg_0 %29 = OpLoad %11 %arg_0
%26 = OpImageQuerySizeLod %v2uint %28 %int_0 %27 = OpImageQuerySizeLod %v2uint %29 %int_0
OpStore %res %26 OpStore %res %27
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %34 %vertex_main_inner = OpFunction %v4float None %35
%36 = OpLabel %37 = OpLabel
%37 = OpFunctionCall %void %textureDimensions_cdc6c9 %38 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %22 %vertex_main = OpFunction %void None %23
%39 = OpLabel %40 = OpLabel
%40 = OpFunctionCall %v4float %vertex_main_inner %41 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %40 OpStore %value %41
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %22 %fragment_main = OpFunction %void None %23
%43 = OpLabel %44 = OpLabel
%44 = OpFunctionCall %void %textureDimensions_cdc6c9 %45 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %22 %compute_main = OpFunction %void None %23
%46 = OpLabel %47 = OpLabel
%47 = OpFunctionCall %void %textureDimensions_cdc6c9 %48 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, u
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, u
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -48,8 +60,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -86,10 +102,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -116,8 +144,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -148,10 +180,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -178,8 +222,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,10 +1,10 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 138 ; Bound: 155
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,19 +30,31 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureLoad_1bfdfb "textureLoad_1bfdfb" OpName %textureLoad_1bfdfb "textureLoad_1bfdfb"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -53,14 +65,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -69,15 +81,30 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -94,152 +121,171 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%22 = OpTypeFunction %v3float %v3float %GammaTransferParams %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%42 = OpConstantNull %v3float %43 = OpConstantNull %v3float
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%62 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%63 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%79 = OpConstantNull %int %82 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%93 = OpConstantNull %uint %95 = OpConstantNull %uint
%113 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%111 = OpTypeFunction %void %127 = OpTypeFunction %void
%118 = OpConstantComposite %v2uint %uint_1 %uint_1 %134 = OpConstantComposite %v2uint %uint_1 %uint_1
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%125 = OpTypeFunction %v4float %142 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22 %gammaCorrection = OpFunction %v3float None %23
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%26 = OpLabel %27 = OpLabel
%40 = OpVariable %_ptr_Function_v3float Function %42 %41 = OpVariable %_ptr_Function_v3float Function %43
%52 = OpVariable %_ptr_Function_v3float Function %42 %53 = OpVariable %_ptr_Function_v3float Function %43
%58 = OpVariable %_ptr_Function_v3float Function %42 %59 = OpVariable %_ptr_Function_v3float Function %43
%27 = OpExtInst %v3float %28 FAbs %v %28 = OpExtInst %v3float %29 FAbs %v
%29 = OpCompositeExtract %float %params 4 %30 = OpCompositeExtract %float %params 4
%30 = OpCompositeConstruct %v3float %29 %29 %29 %31 = OpCompositeConstruct %v3float %30 %30 %30
%31 = OpFOrdLessThan %v3bool %27 %30 %32 = OpFOrdLessThan %v3bool %28 %31
%34 = OpExtInst %v3float %28 FSign %v %35 = OpExtInst %v3float %29 FSign %v
%35 = OpCompositeExtract %float %params 3 %36 = OpCompositeExtract %float %params 3
%36 = OpExtInst %v3float %28 FAbs %v %37 = OpExtInst %v3float %29 FAbs %v
%37 = OpVectorTimesScalar %v3float %36 %35 %38 = OpVectorTimesScalar %v3float %37 %36
%38 = OpCompositeExtract %float %params 6 %39 = OpCompositeExtract %float %params 6
%43 = OpCompositeConstruct %v3float %38 %38 %38 %44 = OpCompositeConstruct %v3float %39 %39 %39
%39 = OpFAdd %v3float %37 %43 %40 = OpFAdd %v3float %38 %44
%44 = OpFMul %v3float %34 %39 %45 = OpFMul %v3float %35 %40
%45 = OpExtInst %v3float %28 FSign %v %46 = OpExtInst %v3float %29 FSign %v
%47 = OpCompositeExtract %float %params 1 %48 = OpCompositeExtract %float %params 1
%48 = OpExtInst %v3float %28 FAbs %v %49 = OpExtInst %v3float %29 FAbs %v
%49 = OpVectorTimesScalar %v3float %48 %47 %50 = OpVectorTimesScalar %v3float %49 %48
%50 = OpCompositeExtract %float %params 2 %51 = OpCompositeExtract %float %params 2
%53 = OpCompositeConstruct %v3float %50 %50 %50 %54 = OpCompositeConstruct %v3float %51 %51 %51
%51 = OpFAdd %v3float %49 %53 %52 = OpFAdd %v3float %50 %54
%54 = OpCompositeExtract %float %params 0 %55 = OpCompositeExtract %float %params 0
%55 = OpCompositeConstruct %v3float %54 %54 %54 %56 = OpCompositeConstruct %v3float %55 %55 %55
%46 = OpExtInst %v3float %28 Pow %51 %55 %47 = OpExtInst %v3float %29 Pow %52 %56
%56 = OpCompositeExtract %float %params 5 %57 = OpCompositeExtract %float %params 5
%59 = OpCompositeConstruct %v3float %56 %56 %56 %60 = OpCompositeConstruct %v3float %57 %57 %57
%57 = OpFAdd %v3float %46 %59 %58 = OpFAdd %v3float %47 %60
%60 = OpFMul %v3float %45 %57 %61 = OpFMul %v3float %46 %58
%61 = OpSelect %v3float %31 %44 %60 %62 = OpSelect %v3float %32 %45 %61
OpReturnValue %61 OpReturnValue %62
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %62 %textureLoadExternal = OpFunction %v4float None %63
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%coord = OpFunctionParameter %v2uint %coord = OpFunctionParameter %v2uint
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%69 = OpLabel %72 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %42 %color = OpVariable %_ptr_Function_v3float Function %43
%71 = OpCompositeExtract %uint %params_0 0 %74 = OpCompositeExtract %uint %params_0 0
%73 = OpIEqual %bool %71 %uint_1 %76 = OpIEqual %bool %74 %uint_1
OpSelectionMerge %74 None OpSelectionMerge %77 None
OpBranchConditional %73 %75 %76 OpBranchConditional %76 %78 %79
%75 = OpLabel %78 = OpLabel
%77 = OpImageFetch %v4float %plane0 %coord Lod %79 %80 = OpImageFetch %v4float %plane0 %coord Lod %82
%80 = OpVectorShuffle %v3float %77 %77 0 1 2 %83 = OpVectorShuffle %v3float %80 %80 0 1 2
OpStore %color %80 OpStore %color %83
OpBranch %74 OpBranch %77
%76 = OpLabel %79 = OpLabel
%81 = OpImageFetch %v4float %plane0 %coord Lod %79 %84 = OpImageFetch %v4float %plane0 %coord Lod %82
%82 = OpCompositeExtract %float %81 0 %85 = OpCompositeExtract %float %84 0
%83 = OpImageFetch %v4float %plane1 %coord Lod %79 %86 = OpImageFetch %v4float %plane1 %coord Lod %82
%85 = OpVectorShuffle %v2float %83 %83 0 1 %87 = OpVectorShuffle %v2float %86 %86 0 1
%86 = OpCompositeExtract %float %85 0 %88 = OpCompositeExtract %float %87 0
%87 = OpCompositeExtract %float %85 1 %89 = OpCompositeExtract %float %87 1
%89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1 %91 = OpCompositeConstruct %v4float %85 %88 %89 %float_1
%90 = OpCompositeExtract %mat3v4float %params_0 2 %92 = OpCompositeExtract %mat3v4float %params_0 2
%91 = OpVectorTimesMatrix %v3float %89 %90 %93 = OpVectorTimesMatrix %v3float %91 %92
OpStore %color %91 OpStore %color %93
OpBranch %74 OpBranch %77
%74 = OpLabel %77 = OpLabel
%92 = OpCompositeExtract %uint %params_0 1 %94 = OpCompositeExtract %uint %params_0 1
%94 = OpIEqual %bool %92 %93 %96 = OpIEqual %bool %94 %95
OpSelectionMerge %95 None OpSelectionMerge %97 None
OpBranchConditional %94 %96 %95 OpBranchConditional %96 %98 %97
%96 = OpLabel %98 = OpLabel
%98 = OpLoad %v3float %color %100 = OpLoad %v3float %color
%99 = OpCompositeExtract %GammaTransferParams %params_0 3 %101 = OpCompositeExtract %GammaTransferParams %params_0 3
%97 = OpFunctionCall %v3float %gammaCorrection %98 %99 %99 = OpFunctionCall %v3float %gammaCorrection %100 %101
OpStore %color %97 OpStore %color %99
%100 = OpCompositeExtract %mat3v3float %params_0 5 %102 = OpCompositeExtract %mat3v3float %params_0 5
%101 = OpLoad %v3float %color %103 = OpLoad %v3float %color
%102 = OpMatrixTimesVector %v3float %100 %101 %104 = OpMatrixTimesVector %v3float %102 %103
OpStore %color %102 OpStore %color %104
%104 = OpLoad %v3float %color
%105 = OpCompositeExtract %GammaTransferParams %params_0 4
%103 = OpFunctionCall %v3float %gammaCorrection %104 %105
OpStore %color %103
OpBranch %95
%95 = OpLabel
%106 = OpLoad %v3float %color %106 = OpLoad %v3float %color
%107 = OpCompositeExtract %float %106 0 %107 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpCompositeExtract %float %106 1 %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
%109 = OpCompositeExtract %float %106 2 OpStore %color %105
%110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1 OpBranch %97
OpReturnValue %110 %97 = OpLabel
%108 = OpLoad %v3float %color
%109 = OpCompositeExtract %float %108 0
%110 = OpCompositeExtract %float %108 1
%111 = OpCompositeExtract %float %108 2
%112 = OpCompositeConstruct %v4float %109 %110 %111 %float_1
OpReturnValue %112
OpFunctionEnd OpFunctionEnd
%textureLoad_1bfdfb = OpFunction %void None %111 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %113
%114 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%116 = OpLabel
%117 = OpCompositeExtract %uint %val 0
%118 = OpCompositeExtract %uint %val 1
%119 = OpCompositeExtract %mat3v4float %val 2
%120 = OpCompositeExtract %GammaTransferParams %val 3
%121 = OpCompositeExtract %GammaTransferParams %val 4
%122 = OpCompositeExtract %mat3v3float %val 5
%123 = OpCompositeExtract %v2float %val 6
%124 = OpCompositeExtract %v2float %val 7
%125 = OpCompositeConstruct %mat2v2float %123 %124
%126 = OpCompositeConstruct %ExternalTextureParams %117 %118 %119 %120 %121 %122 %125
OpReturnValue %126
OpFunctionEnd
%textureLoad_1bfdfb = OpFunction %void None %127
%130 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%116 = OpLoad %11 %arg_0 %132 = OpLoad %11 %arg_0
%117 = OpLoad %11 %ext_tex_plane_1 %133 = OpLoad %11 %ext_tex_plane_1
%121 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %138 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%122 = OpLoad %ExternalTextureParams %121 %139 = OpLoad %ExternalTextureParams_std140 %138
%115 = OpFunctionCall %v4float %textureLoadExternal %116 %117 %118 %122 %135 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %139
OpStore %res %115 %131 = OpFunctionCall %v4float %textureLoadExternal %132 %133 %134 %135
OpStore %res %131
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %125 %vertex_main_inner = OpFunction %v4float None %142
%127 = OpLabel %144 = OpLabel
%128 = OpFunctionCall %void %textureLoad_1bfdfb %145 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %111 %vertex_main = OpFunction %void None %127
%130 = OpLabel %147 = OpLabel
%131 = OpFunctionCall %v4float %vertex_main_inner %148 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %131 OpStore %value %148
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %111 %fragment_main = OpFunction %void None %127
%133 = OpLabel %150 = OpLabel
%134 = OpFunctionCall %void %textureLoad_1bfdfb %151 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %111 %compute_main = OpFunction %void None %127
%136 = OpLabel %153 = OpLabel
%137 = OpFunctionCall %void %textureLoad_1bfdfb %154 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_8acf41() { void textureLoad_8acf41() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_8acf41() { void textureLoad_8acf41() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -48,8 +60,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -86,10 +102,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -116,8 +144,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -148,10 +180,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -178,8 +222,12 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,10 +1,10 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 139 ; Bound: 156
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,19 +30,31 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureLoad_8acf41 "textureLoad_8acf41" OpName %textureLoad_8acf41 "textureLoad_8acf41"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -53,14 +65,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -69,15 +81,30 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -94,153 +121,172 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%22 = OpTypeFunction %v3float %v3float %GammaTransferParams %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%42 = OpConstantNull %v3float %43 = OpConstantNull %v3float
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2 %v2int = OpTypeVector %int 2
%62 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%63 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%79 = OpConstantNull %int %82 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%93 = OpConstantNull %uint %95 = OpConstantNull %uint
%113 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%111 = OpTypeFunction %void %127 = OpTypeFunction %void
%int_1 = OpConstant %int 1 %int_1 = OpConstant %int 1
%119 = OpConstantComposite %v2int %int_1 %int_1 %135 = OpConstantComposite %v2int %int_1 %int_1
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%126 = OpTypeFunction %v4float %143 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22 %gammaCorrection = OpFunction %v3float None %23
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%26 = OpLabel %27 = OpLabel
%40 = OpVariable %_ptr_Function_v3float Function %42 %41 = OpVariable %_ptr_Function_v3float Function %43
%52 = OpVariable %_ptr_Function_v3float Function %42 %53 = OpVariable %_ptr_Function_v3float Function %43
%58 = OpVariable %_ptr_Function_v3float Function %42 %59 = OpVariable %_ptr_Function_v3float Function %43
%27 = OpExtInst %v3float %28 FAbs %v %28 = OpExtInst %v3float %29 FAbs %v
%29 = OpCompositeExtract %float %params 4 %30 = OpCompositeExtract %float %params 4
%30 = OpCompositeConstruct %v3float %29 %29 %29 %31 = OpCompositeConstruct %v3float %30 %30 %30
%31 = OpFOrdLessThan %v3bool %27 %30 %32 = OpFOrdLessThan %v3bool %28 %31
%34 = OpExtInst %v3float %28 FSign %v %35 = OpExtInst %v3float %29 FSign %v
%35 = OpCompositeExtract %float %params 3 %36 = OpCompositeExtract %float %params 3
%36 = OpExtInst %v3float %28 FAbs %v %37 = OpExtInst %v3float %29 FAbs %v
%37 = OpVectorTimesScalar %v3float %36 %35 %38 = OpVectorTimesScalar %v3float %37 %36
%38 = OpCompositeExtract %float %params 6 %39 = OpCompositeExtract %float %params 6
%43 = OpCompositeConstruct %v3float %38 %38 %38 %44 = OpCompositeConstruct %v3float %39 %39 %39
%39 = OpFAdd %v3float %37 %43 %40 = OpFAdd %v3float %38 %44
%44 = OpFMul %v3float %34 %39 %45 = OpFMul %v3float %35 %40
%45 = OpExtInst %v3float %28 FSign %v %46 = OpExtInst %v3float %29 FSign %v
%47 = OpCompositeExtract %float %params 1 %48 = OpCompositeExtract %float %params 1
%48 = OpExtInst %v3float %28 FAbs %v %49 = OpExtInst %v3float %29 FAbs %v
%49 = OpVectorTimesScalar %v3float %48 %47 %50 = OpVectorTimesScalar %v3float %49 %48
%50 = OpCompositeExtract %float %params 2 %51 = OpCompositeExtract %float %params 2
%53 = OpCompositeConstruct %v3float %50 %50 %50 %54 = OpCompositeConstruct %v3float %51 %51 %51
%51 = OpFAdd %v3float %49 %53 %52 = OpFAdd %v3float %50 %54
%54 = OpCompositeExtract %float %params 0 %55 = OpCompositeExtract %float %params 0
%55 = OpCompositeConstruct %v3float %54 %54 %54 %56 = OpCompositeConstruct %v3float %55 %55 %55
%46 = OpExtInst %v3float %28 Pow %51 %55 %47 = OpExtInst %v3float %29 Pow %52 %56
%56 = OpCompositeExtract %float %params 5 %57 = OpCompositeExtract %float %params 5
%59 = OpCompositeConstruct %v3float %56 %56 %56 %60 = OpCompositeConstruct %v3float %57 %57 %57
%57 = OpFAdd %v3float %46 %59 %58 = OpFAdd %v3float %47 %60
%60 = OpFMul %v3float %45 %57 %61 = OpFMul %v3float %46 %58
%61 = OpSelect %v3float %31 %44 %60 %62 = OpSelect %v3float %32 %45 %61
OpReturnValue %61 OpReturnValue %62
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %62 %textureLoadExternal = OpFunction %v4float None %63
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%coord = OpFunctionParameter %v2int %coord = OpFunctionParameter %v2int
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%70 = OpLabel %73 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %42 %color = OpVariable %_ptr_Function_v3float Function %43
%72 = OpCompositeExtract %uint %params_0 0 %75 = OpCompositeExtract %uint %params_0 0
%74 = OpIEqual %bool %72 %uint_1 %77 = OpIEqual %bool %75 %uint_1
OpSelectionMerge %75 None OpSelectionMerge %78 None
OpBranchConditional %74 %76 %77 OpBranchConditional %77 %79 %80
%76 = OpLabel %79 = OpLabel
%78 = OpImageFetch %v4float %plane0 %coord Lod %79 %81 = OpImageFetch %v4float %plane0 %coord Lod %82
%80 = OpVectorShuffle %v3float %78 %78 0 1 2 %83 = OpVectorShuffle %v3float %81 %81 0 1 2
OpStore %color %80 OpStore %color %83
OpBranch %75 OpBranch %78
%77 = OpLabel %80 = OpLabel
%81 = OpImageFetch %v4float %plane0 %coord Lod %79 %84 = OpImageFetch %v4float %plane0 %coord Lod %82
%82 = OpCompositeExtract %float %81 0 %85 = OpCompositeExtract %float %84 0
%83 = OpImageFetch %v4float %plane1 %coord Lod %79 %86 = OpImageFetch %v4float %plane1 %coord Lod %82
%85 = OpVectorShuffle %v2float %83 %83 0 1 %87 = OpVectorShuffle %v2float %86 %86 0 1
%86 = OpCompositeExtract %float %85 0 %88 = OpCompositeExtract %float %87 0
%87 = OpCompositeExtract %float %85 1 %89 = OpCompositeExtract %float %87 1
%89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1 %91 = OpCompositeConstruct %v4float %85 %88 %89 %float_1
%90 = OpCompositeExtract %mat3v4float %params_0 2 %92 = OpCompositeExtract %mat3v4float %params_0 2
%91 = OpVectorTimesMatrix %v3float %89 %90 %93 = OpVectorTimesMatrix %v3float %91 %92
OpStore %color %91 OpStore %color %93
OpBranch %75 OpBranch %78
%75 = OpLabel %78 = OpLabel
%92 = OpCompositeExtract %uint %params_0 1 %94 = OpCompositeExtract %uint %params_0 1
%94 = OpIEqual %bool %92 %93 %96 = OpIEqual %bool %94 %95
OpSelectionMerge %95 None OpSelectionMerge %97 None
OpBranchConditional %94 %96 %95 OpBranchConditional %96 %98 %97
%96 = OpLabel %98 = OpLabel
%98 = OpLoad %v3float %color %100 = OpLoad %v3float %color
%99 = OpCompositeExtract %GammaTransferParams %params_0 3 %101 = OpCompositeExtract %GammaTransferParams %params_0 3
%97 = OpFunctionCall %v3float %gammaCorrection %98 %99 %99 = OpFunctionCall %v3float %gammaCorrection %100 %101
OpStore %color %97 OpStore %color %99
%100 = OpCompositeExtract %mat3v3float %params_0 5 %102 = OpCompositeExtract %mat3v3float %params_0 5
%101 = OpLoad %v3float %color %103 = OpLoad %v3float %color
%102 = OpMatrixTimesVector %v3float %100 %101 %104 = OpMatrixTimesVector %v3float %102 %103
OpStore %color %102 OpStore %color %104
%104 = OpLoad %v3float %color
%105 = OpCompositeExtract %GammaTransferParams %params_0 4
%103 = OpFunctionCall %v3float %gammaCorrection %104 %105
OpStore %color %103
OpBranch %95
%95 = OpLabel
%106 = OpLoad %v3float %color %106 = OpLoad %v3float %color
%107 = OpCompositeExtract %float %106 0 %107 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpCompositeExtract %float %106 1 %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
%109 = OpCompositeExtract %float %106 2 OpStore %color %105
%110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1 OpBranch %97
OpReturnValue %110 %97 = OpLabel
%108 = OpLoad %v3float %color
%109 = OpCompositeExtract %float %108 0
%110 = OpCompositeExtract %float %108 1
%111 = OpCompositeExtract %float %108 2
%112 = OpCompositeConstruct %v4float %109 %110 %111 %float_1
OpReturnValue %112
OpFunctionEnd OpFunctionEnd
%textureLoad_8acf41 = OpFunction %void None %111 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %113
%114 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%116 = OpLabel
%117 = OpCompositeExtract %uint %val 0
%118 = OpCompositeExtract %uint %val 1
%119 = OpCompositeExtract %mat3v4float %val 2
%120 = OpCompositeExtract %GammaTransferParams %val 3
%121 = OpCompositeExtract %GammaTransferParams %val 4
%122 = OpCompositeExtract %mat3v3float %val 5
%123 = OpCompositeExtract %v2float %val 6
%124 = OpCompositeExtract %v2float %val 7
%125 = OpCompositeConstruct %mat2v2float %123 %124
%126 = OpCompositeConstruct %ExternalTextureParams %117 %118 %119 %120 %121 %122 %125
OpReturnValue %126
OpFunctionEnd
%textureLoad_8acf41 = OpFunction %void None %127
%130 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%116 = OpLoad %11 %arg_0 %132 = OpLoad %11 %arg_0
%117 = OpLoad %11 %ext_tex_plane_1 %133 = OpLoad %11 %ext_tex_plane_1
%122 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %139 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%123 = OpLoad %ExternalTextureParams %122 %140 = OpLoad %ExternalTextureParams_std140 %139
%115 = OpFunctionCall %v4float %textureLoadExternal %116 %117 %119 %123 %136 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %140
OpStore %res %115 %131 = OpFunctionCall %v4float %textureLoadExternal %132 %133 %135 %136
OpStore %res %131
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %126 %vertex_main_inner = OpFunction %v4float None %143
%128 = OpLabel %145 = OpLabel
%129 = OpFunctionCall %void %textureLoad_8acf41 %146 = OpFunctionCall %void %textureLoad_8acf41
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %111 %vertex_main = OpFunction %void None %127
%131 = OpLabel %148 = OpLabel
%132 = OpFunctionCall %v4float %vertex_main_inner %149 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %132 OpStore %value %149
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %111 %fragment_main = OpFunction %void None %127
%134 = OpLabel %151 = OpLabel
%135 = OpFunctionCall %void %textureLoad_8acf41 %152 = OpFunctionCall %void %textureLoad_8acf41
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %111 %compute_main = OpFunction %void None %127
%137 = OpLabel %154 = OpLabel
%138 = OpFunctionCall %void %textureLoad_8acf41 %155 = OpFunctionCall %void %textureLoad_8acf41
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space1); Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) { cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1); SamplerState arg_1 : register(s1, space1);
@ -32,16 +33,17 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
const float2 modifiedCoords = (mul(params.rotationMatrix, (coord - 0.5f)) + 0.5f);
int3 tint_tmp; int3 tint_tmp;
plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
const float2 plane0_dims = float2(tint_tmp.xy); const float2 plane0_dims = float2(tint_tmp.xy);
const float2 plane0_half_texel = ((0.5f).xx / plane0_dims); const float2 plane0_half_texel = ((0.5f).xx / plane0_dims);
const float2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); const float2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
int3 tint_tmp_1; int3 tint_tmp_1;
plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z); plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
const float2 plane1_dims = float2(tint_tmp_1.xy); const float2 plane1_dims = float2(tint_tmp_1.xy);
const float2 plane1_half_texel = ((0.5f).xx / plane1_dims); const float2 plane1_half_texel = ((0.5f).xx / plane1_dims);
const float2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); const float2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = float3(0.0f, 0.0f, 0.0f); float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb; color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb;
@ -56,14 +58,14 @@ float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1,
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -72,22 +74,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space1); Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) { cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1); SamplerState arg_1 : register(s1, space1);
@ -32,16 +33,17 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
const float2 modifiedCoords = (mul(params.rotationMatrix, (coord - 0.5f)) + 0.5f);
int3 tint_tmp; int3 tint_tmp;
plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
const float2 plane0_dims = float2(tint_tmp.xy); const float2 plane0_dims = float2(tint_tmp.xy);
const float2 plane0_half_texel = ((0.5f).xx / plane0_dims); const float2 plane0_half_texel = ((0.5f).xx / plane0_dims);
const float2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); const float2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
int3 tint_tmp_1; int3 tint_tmp_1;
plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z); plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
const float2 plane1_dims = float2(tint_tmp_1.xy); const float2 plane1_dims = float2(tint_tmp_1.xy);
const float2 plane1_half_texel = ((0.5f).xx / plane1_dims); const float2 plane1_half_texel = ((0.5f).xx / plane1_dims);
const float2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); const float2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = float3(0.0f, 0.0f, 0.0f); float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb; color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb;
@ -56,14 +58,14 @@ float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1,
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -72,22 +74,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -33,12 +45,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -57,8 +70,12 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -95,10 +112,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -110,12 +139,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -134,8 +164,12 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -166,10 +200,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -181,12 +227,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -205,8 +252,12 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {
@ -43,12 +44,13 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
float2 const modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0))); float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0)));
float2 const plane0_half_texel = (float2(0.5f) / plane0_dims); float2 const plane0_half_texel = (float2(0.5f) / plane0_dims);
float2 const plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); float2 const plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0))); float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0)));
float2 const plane1_half_texel = (float2(0.5f) / plane1_dims); float2 const plane1_half_texel = (float2(0.5f) / plane1_dims);
float2 const plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); float2 const plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = 0.0f; float3 color = 0.0f;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = float4(plane0.sample(smp, plane0_clamped, level(0.0f))).rgb; color = float4(plane0.sample(smp, plane0_clamped, level(0.0f))).rgb;

View File

@ -1,11 +1,11 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 165 ; Bound: 190
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability ImageQuery OpCapability ImageQuery
%31 = OpExtInstImport "GLSL.std.450" %32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -15,13 +15,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -31,14 +31,24 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1" OpName %arg_1 "arg_1"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureSampleExternal "textureSampleExternal" OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
@ -46,6 +56,8 @@
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureSampleBaseClampToEdge_7c04e6 "textureSampleBaseClampToEdge_7c04e6" OpName %textureSampleBaseClampToEdge_7c04e6 "textureSampleBaseClampToEdge_7c04e6"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -56,14 +68,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 2 OpDecorate %ext_tex_plane_1 Binding 2
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -72,10 +84,12 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 3 OpDecorate %ext_tex_params Binding 3
@ -83,6 +97,19 @@
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1 OpDecorate %arg_1 Binding 1
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -99,179 +126,206 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%24 = OpTypeSampler %25 = OpTypeSampler
%_ptr_UniformConstant_24 = OpTypePointer UniformConstant %24 %_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%arg_1 = OpVariable %_ptr_UniformConstant_24 UniformConstant %arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
%25 = OpTypeFunction %v3float %v3float %GammaTransferParams %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%45 = OpConstantNull %v3float %46 = OpConstantNull %v3float
%v2float = OpTypeVector %float 2 %mat2v2float = OpTypeMatrix %v2float 2
%65 = OpTypeFunction %v4float %11 %11 %24 %v2float %ExternalTextureParams %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
%float_0_5 = OpConstant %float 0.5
%_ptr_Function_v2float = OpTypePointer Function %v2float
%80 = OpConstantNull %v2float
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%78 = OpConstantNull %int %91 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5 %92 = OpConstantComposite %v2float %float_0_5 %float_0_5
%80 = OpConstantComposite %v2float %float_0_5 %float_0_5
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%87 = OpConstantNull %v2float
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%104 = OpTypeSampledImage %11 %114 = OpTypeSampledImage %11
%119 = OpConstantNull %uint %129 = OpConstantNull %uint
%147 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%137 = OpTypeFunction %void %161 = OpTypeFunction %void
%145 = OpConstantComposite %v2float %float_1 %float_1 %169 = OpConstantComposite %v2float %float_1 %float_1
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%152 = OpTypeFunction %v4float %177 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %25 %gammaCorrection = OpFunction %v3float None %26
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%29 = OpLabel %30 = OpLabel
%43 = OpVariable %_ptr_Function_v3float Function %45 %44 = OpVariable %_ptr_Function_v3float Function %46
%55 = OpVariable %_ptr_Function_v3float Function %45 %56 = OpVariable %_ptr_Function_v3float Function %46
%61 = OpVariable %_ptr_Function_v3float Function %45 %62 = OpVariable %_ptr_Function_v3float Function %46
%30 = OpExtInst %v3float %31 FAbs %v %31 = OpExtInst %v3float %32 FAbs %v
%32 = OpCompositeExtract %float %params 4 %33 = OpCompositeExtract %float %params 4
%33 = OpCompositeConstruct %v3float %32 %32 %32 %34 = OpCompositeConstruct %v3float %33 %33 %33
%34 = OpFOrdLessThan %v3bool %30 %33 %35 = OpFOrdLessThan %v3bool %31 %34
%37 = OpExtInst %v3float %31 FSign %v %38 = OpExtInst %v3float %32 FSign %v
%38 = OpCompositeExtract %float %params 3 %39 = OpCompositeExtract %float %params 3
%39 = OpExtInst %v3float %31 FAbs %v %40 = OpExtInst %v3float %32 FAbs %v
%40 = OpVectorTimesScalar %v3float %39 %38 %41 = OpVectorTimesScalar %v3float %40 %39
%41 = OpCompositeExtract %float %params 6 %42 = OpCompositeExtract %float %params 6
%46 = OpCompositeConstruct %v3float %41 %41 %41 %47 = OpCompositeConstruct %v3float %42 %42 %42
%42 = OpFAdd %v3float %40 %46 %43 = OpFAdd %v3float %41 %47
%47 = OpFMul %v3float %37 %42 %48 = OpFMul %v3float %38 %43
%48 = OpExtInst %v3float %31 FSign %v %49 = OpExtInst %v3float %32 FSign %v
%50 = OpCompositeExtract %float %params 1 %51 = OpCompositeExtract %float %params 1
%51 = OpExtInst %v3float %31 FAbs %v %52 = OpExtInst %v3float %32 FAbs %v
%52 = OpVectorTimesScalar %v3float %51 %50 %53 = OpVectorTimesScalar %v3float %52 %51
%53 = OpCompositeExtract %float %params 2 %54 = OpCompositeExtract %float %params 2
%56 = OpCompositeConstruct %v3float %53 %53 %53 %57 = OpCompositeConstruct %v3float %54 %54 %54
%54 = OpFAdd %v3float %52 %56 %55 = OpFAdd %v3float %53 %57
%57 = OpCompositeExtract %float %params 0 %58 = OpCompositeExtract %float %params 0
%58 = OpCompositeConstruct %v3float %57 %57 %57 %59 = OpCompositeConstruct %v3float %58 %58 %58
%49 = OpExtInst %v3float %31 Pow %54 %58 %50 = OpExtInst %v3float %32 Pow %55 %59
%59 = OpCompositeExtract %float %params 5 %60 = OpCompositeExtract %float %params 5
%62 = OpCompositeConstruct %v3float %59 %59 %59 %63 = OpCompositeConstruct %v3float %60 %60 %60
%60 = OpFAdd %v3float %49 %62 %61 = OpFAdd %v3float %50 %63
%63 = OpFMul %v3float %48 %60 %64 = OpFMul %v3float %49 %61
%64 = OpSelect %v3float %34 %47 %63 %65 = OpSelect %v3float %35 %48 %64
OpReturnValue %64 OpReturnValue %65
OpFunctionEnd OpFunctionEnd
%textureSampleExternal = OpFunction %v4float None %65 %textureSampleExternal = OpFunction %v4float None %66
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%smp = OpFunctionParameter %24 %smp = OpFunctionParameter %25
%coord = OpFunctionParameter %v2float %coord = OpFunctionParameter %v2float
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%73 = OpLabel %75 = OpLabel
%85 = OpVariable %_ptr_Function_v2float Function %87 %78 = OpVariable %_ptr_Function_v2float Function %80
%94 = OpVariable %_ptr_Function_v2float Function %87 %85 = OpVariable %_ptr_Function_v2float Function %80
%color = OpVariable %_ptr_Function_v3float Function %45 %97 = OpVariable %_ptr_Function_v2float Function %80
%75 = OpImageQuerySizeLod %v2uint %plane0 %78 %104 = OpVariable %_ptr_Function_v2float Function %80
%74 = OpConvertUToF %v2float %75 %color = OpVariable %_ptr_Function_v3float Function %46
%81 = OpFDiv %v2float %80 %74 %81 = OpCompositeConstruct %v2float %float_0_5 %float_0_5
%88 = OpCompositeConstruct %v2float %float_1 %float_1 %77 = OpFSub %v2float %coord %81
%84 = OpFSub %v2float %88 %81 %82 = OpCompositeExtract %mat2v2float %params_0 6
%82 = OpExtInst %v2float %31 NClamp %coord %81 %84 %83 = OpVectorTimesMatrix %v2float %77 %82
%90 = OpImageQuerySizeLod %v2uint %plane1 %78 %86 = OpCompositeConstruct %v2float %float_0_5 %float_0_5
%89 = OpConvertUToF %v2float %90 %84 = OpFAdd %v2float %83 %86
%91 = OpFDiv %v2float %80 %89 %88 = OpImageQuerySizeLod %v2uint %plane0 %91
%95 = OpCompositeConstruct %v2float %float_1 %float_1 %87 = OpConvertUToF %v2float %88
%93 = OpFSub %v2float %95 %91 %93 = OpFDiv %v2float %92 %87
%92 = OpExtInst %v2float %31 NClamp %coord %91 %93 %98 = OpCompositeConstruct %v2float %float_1 %float_1
%97 = OpCompositeExtract %uint %params_0 0 %96 = OpFSub %v2float %98 %93
%99 = OpIEqual %bool %97 %uint_1 %94 = OpExtInst %v2float %32 NClamp %84 %93 %96
OpSelectionMerge %100 None %100 = OpImageQuerySizeLod %v2uint %plane1 %91
OpBranchConditional %99 %101 %102 %99 = OpConvertUToF %v2float %100
%101 = OpLabel %101 = OpFDiv %v2float %92 %99
%105 = OpSampledImage %104 %plane0 %smp %105 = OpCompositeConstruct %v2float %float_1 %float_1
%103 = OpImageSampleExplicitLod %v4float %105 %82 Lod %8 %103 = OpFSub %v2float %105 %101
%106 = OpVectorShuffle %v3float %103 %103 0 1 2 %102 = OpExtInst %v2float %32 NClamp %84 %101 %103
OpStore %color %106 %107 = OpCompositeExtract %uint %params_0 0
OpBranch %100 %109 = OpIEqual %bool %107 %uint_1
%102 = OpLabel OpSelectionMerge %110 None
%108 = OpSampledImage %104 %plane0 %smp OpBranchConditional %109 %111 %112
%107 = OpImageSampleExplicitLod %v4float %108 %82 Lod %8 %111 = OpLabel
%109 = OpCompositeExtract %float %107 0 %115 = OpSampledImage %114 %plane0 %smp
%111 = OpSampledImage %104 %plane1 %smp %113 = OpImageSampleExplicitLod %v4float %115 %94 Lod %8
%110 = OpImageSampleExplicitLod %v4float %111 %92 Lod %8 %116 = OpVectorShuffle %v3float %113 %113 0 1 2
%112 = OpVectorShuffle %v2float %110 %110 0 1 OpStore %color %116
%113 = OpCompositeExtract %float %112 0 OpBranch %110
%114 = OpCompositeExtract %float %112 1 %112 = OpLabel
%115 = OpCompositeConstruct %v4float %109 %113 %114 %float_1 %118 = OpSampledImage %114 %plane0 %smp
%116 = OpCompositeExtract %mat3v4float %params_0 2 %117 = OpImageSampleExplicitLod %v4float %118 %94 Lod %8
%117 = OpVectorTimesMatrix %v3float %115 %116 %119 = OpCompositeExtract %float %117 0
OpStore %color %117 %121 = OpSampledImage %114 %plane1 %smp
OpBranch %100 %120 = OpImageSampleExplicitLod %v4float %121 %102 Lod %8
%100 = OpLabel %122 = OpVectorShuffle %v2float %120 %120 0 1
%118 = OpCompositeExtract %uint %params_0 1 %123 = OpCompositeExtract %float %122 0
%120 = OpIEqual %bool %118 %119 %124 = OpCompositeExtract %float %122 1
OpSelectionMerge %121 None %125 = OpCompositeConstruct %v4float %119 %123 %124 %float_1
OpBranchConditional %120 %122 %121 %126 = OpCompositeExtract %mat3v4float %params_0 2
%122 = OpLabel %127 = OpVectorTimesMatrix %v3float %125 %126
%124 = OpLoad %v3float %color OpStore %color %127
%125 = OpCompositeExtract %GammaTransferParams %params_0 3 OpBranch %110
%123 = OpFunctionCall %v3float %gammaCorrection %124 %125 %110 = OpLabel
OpStore %color %123 %128 = OpCompositeExtract %uint %params_0 1
%126 = OpCompositeExtract %mat3v3float %params_0 5 %130 = OpIEqual %bool %128 %129
%127 = OpLoad %v3float %color OpSelectionMerge %131 None
%128 = OpMatrixTimesVector %v3float %126 %127 OpBranchConditional %130 %132 %131
OpStore %color %128 %132 = OpLabel
%130 = OpLoad %v3float %color %134 = OpLoad %v3float %color
%131 = OpCompositeExtract %GammaTransferParams %params_0 4 %135 = OpCompositeExtract %GammaTransferParams %params_0 3
%129 = OpFunctionCall %v3float %gammaCorrection %130 %131 %133 = OpFunctionCall %v3float %gammaCorrection %134 %135
OpStore %color %129 OpStore %color %133
OpBranch %121 %136 = OpCompositeExtract %mat3v3float %params_0 5
%121 = OpLabel %137 = OpLoad %v3float %color
%132 = OpLoad %v3float %color %138 = OpMatrixTimesVector %v3float %136 %137
%133 = OpCompositeExtract %float %132 0 OpStore %color %138
%134 = OpCompositeExtract %float %132 1 %140 = OpLoad %v3float %color
%135 = OpCompositeExtract %float %132 2 %141 = OpCompositeExtract %GammaTransferParams %params_0 4
%136 = OpCompositeConstruct %v4float %133 %134 %135 %float_1 %139 = OpFunctionCall %v3float %gammaCorrection %140 %141
OpReturnValue %136 OpStore %color %139
OpBranch %131
%131 = OpLabel
%142 = OpLoad %v3float %color
%143 = OpCompositeExtract %float %142 0
%144 = OpCompositeExtract %float %142 1
%145 = OpCompositeExtract %float %142 2
%146 = OpCompositeConstruct %v4float %143 %144 %145 %float_1
OpReturnValue %146
OpFunctionEnd OpFunctionEnd
%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %137 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %147
%140 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%150 = OpLabel
%151 = OpCompositeExtract %uint %val 0
%152 = OpCompositeExtract %uint %val 1
%153 = OpCompositeExtract %mat3v4float %val 2
%154 = OpCompositeExtract %GammaTransferParams %val 3
%155 = OpCompositeExtract %GammaTransferParams %val 4
%156 = OpCompositeExtract %mat3v3float %val 5
%157 = OpCompositeExtract %v2float %val 6
%158 = OpCompositeExtract %v2float %val 7
%159 = OpCompositeConstruct %mat2v2float %157 %158
%160 = OpCompositeConstruct %ExternalTextureParams %151 %152 %153 %154 %155 %156 %159
OpReturnValue %160
OpFunctionEnd
%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %161
%164 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%142 = OpLoad %11 %arg_0 %166 = OpLoad %11 %arg_0
%143 = OpLoad %11 %ext_tex_plane_1 %167 = OpLoad %11 %ext_tex_plane_1
%144 = OpLoad %24 %arg_1 %168 = OpLoad %25 %arg_1
%148 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %173 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%149 = OpLoad %ExternalTextureParams %148 %174 = OpLoad %ExternalTextureParams_std140 %173
%141 = OpFunctionCall %v4float %textureSampleExternal %142 %143 %144 %145 %149 %170 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %174
OpStore %res %141 %165 = OpFunctionCall %v4float %textureSampleExternal %166 %167 %168 %169 %170
OpStore %res %165
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %152 %vertex_main_inner = OpFunction %v4float None %177
%154 = OpLabel %179 = OpLabel
%155 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %180 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %137 %vertex_main = OpFunction %void None %161
%157 = OpLabel %182 = OpLabel
%158 = OpFunctionCall %v4float %vertex_main_inner %183 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %158 OpStore %value %183
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %137 %fragment_main = OpFunction %void None %161
%160 = OpLabel %185 = OpLabel
%161 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %186 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %137 %compute_main = OpFunction %void None %161
%163 = OpLabel %188 = OpLabel
%164 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %189 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -0,0 +1,127 @@
builtins/gen/literal/textureSampleLevel/979816.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f));
^^^^^^^^^^^^^^^^^^
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
float3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
uint flipY;
float2x2 rotationMatrix;
};
Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[13];
};
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
float3 gammaCorrection(float3 v, GammaTransferParams params) {
const bool3 cond = (abs(v) < float3((params.D).xxx));
const float3 t = (sign(v) * ((params.C * abs(v)) + params.F));
const float3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), float3((params.G).xxx)) + params.E));
return (cond ? t : f);
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, coord, 0.0f).rgb;
} else {
color = mul(params.yuvToRgbConversionMatrix, float4(plane0.SampleLevel(smp, coord, 0.0f).r, plane1.SampleLevel(smp, coord, 0.0f).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = mul(color, params.gamutConversionMatrix);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
float3x4 tint_symbol_3(uint4 buffer[13], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
}
GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4;
const uint scalar_offset_6 = ((offset + 12u)) / 4;
const uint scalar_offset_7 = ((offset + 16u)) / 4;
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_11;
}
float3x3 tint_symbol_7(uint4 buffer[13], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
}
float2x2 tint_symbol_9(uint4 buffer[13], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4;
uint4 ubo_load = buffer[scalar_offset_14 / 4];
const uint scalar_offset_15 = ((offset + 8u)) / 4;
uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const uint scalar_offset_18 = ((offset + 176u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_9(buffer, (offset + 184u))};
return tint_symbol_12;
}
void textureSampleLevel_979816() {
float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, tint_symbol_1(ext_tex_params, 0u));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
textureSampleLevel_979816();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
textureSampleLevel_979816();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
textureSampleLevel_979816();
return;
}

View File

@ -0,0 +1,127 @@
builtins/gen/literal/textureSampleLevel/979816.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f));
^^^^^^^^^^^^^^^^^^
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
float3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
uint flipY;
float2x2 rotationMatrix;
};
Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[13];
};
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
float3 gammaCorrection(float3 v, GammaTransferParams params) {
const bool3 cond = (abs(v) < float3((params.D).xxx));
const float3 t = (sign(v) * ((params.C * abs(v)) + params.F));
const float3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), float3((params.G).xxx)) + params.E));
return (cond ? t : f);
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, coord, 0.0f).rgb;
} else {
color = mul(params.yuvToRgbConversionMatrix, float4(plane0.SampleLevel(smp, coord, 0.0f).r, plane1.SampleLevel(smp, coord, 0.0f).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = mul(color, params.gamutConversionMatrix);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
float3x4 tint_symbol_3(uint4 buffer[13], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
}
GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4;
const uint scalar_offset_6 = ((offset + 12u)) / 4;
const uint scalar_offset_7 = ((offset + 16u)) / 4;
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_11;
}
float3x3 tint_symbol_7(uint4 buffer[13], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
}
float2x2 tint_symbol_9(uint4 buffer[13], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4;
uint4 ubo_load = buffer[scalar_offset_14 / 4];
const uint scalar_offset_15 = ((offset + 8u)) / 4;
uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const uint scalar_offset_18 = ((offset + 176u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_9(buffer, (offset + 184u))};
return tint_symbol_12;
}
void textureSampleLevel_979816() {
float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, tint_symbol_1(ext_tex_params, 0u));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
textureSampleLevel_979816();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
textureSampleLevel_979816();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
textureSampleLevel_979816();
return;
}

View File

@ -0,0 +1,254 @@
builtins/gen/literal/textureSampleLevel/979816.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f));
^^^^^^^^^^^^^^^^^^
#version 310 es
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
}
vec4 vertex_main() {
textureSampleLevel_979816();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
}
void fragment_main() {
textureSampleLevel_979816();
}
void main() {
fragment_main();
return;
}
#version 310 es
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
}
void compute_main() {
textureSampleLevel_979816();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,97 @@
builtins/gen/literal/textureSampleLevel/979816.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f));
^^^^^^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct GammaTransferParams {
/* 0x0000 */ float G;
/* 0x0004 */ float A;
/* 0x0008 */ float B;
/* 0x000c */ float C;
/* 0x0010 */ float D;
/* 0x0014 */ float E;
/* 0x0018 */ float F;
/* 0x001c */ uint padding;
};
struct ExternalTextureParams {
/* 0x0000 */ uint numPlanes;
/* 0x0004 */ uint doYuvToRgbConversionOnly;
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ uint flipY;
/* 0x00b4 */ tint_array<int8_t, 4> tint_pad_1;
/* 0x00b8 */ float2x2 rotationMatrix;
/* 0x00c8 */ tint_array<int8_t, 8> tint_pad_2;
};
float3 gammaCorrection(float3 v, GammaTransferParams params) {
bool3 const cond = (fabs(v) < float3(params.D));
float3 const t = (sign(v) * ((params.C * fabs(v)) + params.F));
float3 const f = (sign(v) * (pow(((params.A * fabs(v)) + params.B), float3(params.G)) + params.E));
return select(f, t, cond);
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
float3 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = float4(plane0.sample(smp, coord, level(0.0f))).rgb;
} else {
color = (float4(plane0.sample(smp, coord, level(0.0f))[0], float4(plane1.sample(smp, coord, level(0.0f))).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
void textureSampleLevel_979816(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams* const tint_symbol_4) {
float4 res = textureSampleExternal(tint_symbol_1, tint_symbol_2, tint_symbol_3, float2(1.0f), *(tint_symbol_4));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, sampler tint_symbol_7, const constant ExternalTextureParams* const tint_symbol_8) {
textureSampleLevel_979816(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
return float4(0.0f);
}
vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], sampler tint_symbol_11 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_12 [[buffer(2)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], sampler tint_symbol_15 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_16 [[buffer(2)]]) {
textureSampleLevel_979816(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
return;
}
kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], sampler tint_symbol_19 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_20 [[buffer(2)]]) {
textureSampleLevel_979816(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
return;
}

View File

@ -0,0 +1,310 @@
builtins/gen/literal/textureSampleLevel/979816.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f));
^^^^^^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 162
; Schema: 0
OpCapability Shader
%32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A"
OpMemberName %GammaTransferParams 2 "B"
OpMemberName %GammaTransferParams 3 "C"
OpMemberName %GammaTransferParams 4 "D"
OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "flipY"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 8 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
OpName %gammaCorrection "gammaCorrection"
OpName %v "v"
OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "flipY"
OpMemberName %ExternalTextureParams 7 "rotationMatrix"
OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0"
OpName %plane1 "plane1"
OpName %smp "smp"
OpName %coord "coord"
OpName %params_0 "params"
OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureSampleLevel_979816 "textureSampleLevel_979816"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 2
OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8
OpMemberDecorate %GammaTransferParams 3 Offset 12
OpMemberDecorate %GammaTransferParams 4 Offset 16
OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpMemberDecorate %ExternalTextureParams_std140 8 Offset 192
OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 3
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 7 Offset 184
OpMemberDecorate %ExternalTextureParams 7 ColMajor
OpMemberDecorate %ExternalTextureParams 7 MatrixStride 8
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%11 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%uint = OpTypeInt 32 0
%mat3v4float = OpTypeMatrix %v4float 3
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%v2float = OpTypeVector %float 2
%ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %uint %v2float %v2float
%ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%25 = OpTypeSampler
%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
%26 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%46 = OpConstantNull %v3float
%mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %uint %mat2v2float
%66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
%uint_1 = OpConstant %uint 1
%84 = OpTypeSampledImage %11
%float_1 = OpConstant %float 1
%100 = OpConstantNull %uint
%118 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid
%133 = OpTypeFunction %void
%141 = OpConstantComposite %v2float %float_1 %float_1
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float
%149 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %26
%v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams
%30 = OpLabel
%44 = OpVariable %_ptr_Function_v3float Function %46
%56 = OpVariable %_ptr_Function_v3float Function %46
%62 = OpVariable %_ptr_Function_v3float Function %46
%31 = OpExtInst %v3float %32 FAbs %v
%33 = OpCompositeExtract %float %params 4
%34 = OpCompositeConstruct %v3float %33 %33 %33
%35 = OpFOrdLessThan %v3bool %31 %34
%38 = OpExtInst %v3float %32 FSign %v
%39 = OpCompositeExtract %float %params 3
%40 = OpExtInst %v3float %32 FAbs %v
%41 = OpVectorTimesScalar %v3float %40 %39
%42 = OpCompositeExtract %float %params 6
%47 = OpCompositeConstruct %v3float %42 %42 %42
%43 = OpFAdd %v3float %41 %47
%48 = OpFMul %v3float %38 %43
%49 = OpExtInst %v3float %32 FSign %v
%51 = OpCompositeExtract %float %params 1
%52 = OpExtInst %v3float %32 FAbs %v
%53 = OpVectorTimesScalar %v3float %52 %51
%54 = OpCompositeExtract %float %params 2
%57 = OpCompositeConstruct %v3float %54 %54 %54
%55 = OpFAdd %v3float %53 %57
%58 = OpCompositeExtract %float %params 0
%59 = OpCompositeConstruct %v3float %58 %58 %58
%50 = OpExtInst %v3float %32 Pow %55 %59
%60 = OpCompositeExtract %float %params 5
%63 = OpCompositeConstruct %v3float %60 %60 %60
%61 = OpFAdd %v3float %50 %63
%64 = OpFMul %v3float %49 %61
%65 = OpSelect %v3float %35 %48 %64
OpReturnValue %65
OpFunctionEnd
%textureSampleExternal = OpFunction %v4float None %66
%plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11
%smp = OpFunctionParameter %25
%coord = OpFunctionParameter %v2float
%params_0 = OpFunctionParameter %ExternalTextureParams
%75 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %46
%77 = OpCompositeExtract %uint %params_0 0
%79 = OpIEqual %bool %77 %uint_1
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
%85 = OpSampledImage %84 %plane0 %smp
%83 = OpImageSampleExplicitLod %v4float %85 %coord Lod %8
%86 = OpVectorShuffle %v3float %83 %83 0 1 2
OpStore %color %86
OpBranch %80
%82 = OpLabel
%88 = OpSampledImage %84 %plane0 %smp
%87 = OpImageSampleExplicitLod %v4float %88 %coord Lod %8
%89 = OpCompositeExtract %float %87 0
%91 = OpSampledImage %84 %plane1 %smp
%90 = OpImageSampleExplicitLod %v4float %91 %coord Lod %8
%92 = OpVectorShuffle %v2float %90 %90 0 1
%93 = OpCompositeExtract %float %92 0
%94 = OpCompositeExtract %float %92 1
%96 = OpCompositeConstruct %v4float %89 %93 %94 %float_1
%97 = OpCompositeExtract %mat3v4float %params_0 2
%98 = OpVectorTimesMatrix %v3float %96 %97
OpStore %color %98
OpBranch %80
%80 = OpLabel
%99 = OpCompositeExtract %uint %params_0 1
%101 = OpIEqual %bool %99 %100
OpSelectionMerge %102 None
OpBranchConditional %101 %103 %102
%103 = OpLabel
%105 = OpLoad %v3float %color
%106 = OpCompositeExtract %GammaTransferParams %params_0 3
%104 = OpFunctionCall %v3float %gammaCorrection %105 %106
OpStore %color %104
%107 = OpCompositeExtract %mat3v3float %params_0 5
%108 = OpLoad %v3float %color
%109 = OpMatrixTimesVector %v3float %107 %108
OpStore %color %109
%111 = OpLoad %v3float %color
%112 = OpCompositeExtract %GammaTransferParams %params_0 4
%110 = OpFunctionCall %v3float %gammaCorrection %111 %112
OpStore %color %110
OpBranch %102
%102 = OpLabel
%113 = OpLoad %v3float %color
%114 = OpCompositeExtract %float %113 0
%115 = OpCompositeExtract %float %113 1
%116 = OpCompositeExtract %float %113 2
%117 = OpCompositeConstruct %v4float %114 %115 %116 %float_1
OpReturnValue %117
OpFunctionEnd
%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %118
%val = OpFunctionParameter %ExternalTextureParams_std140
%121 = OpLabel
%122 = OpCompositeExtract %uint %val 0
%123 = OpCompositeExtract %uint %val 1
%124 = OpCompositeExtract %mat3v4float %val 2
%125 = OpCompositeExtract %GammaTransferParams %val 3
%126 = OpCompositeExtract %GammaTransferParams %val 4
%127 = OpCompositeExtract %mat3v3float %val 5
%128 = OpCompositeExtract %uint %val 6
%129 = OpCompositeExtract %v2float %val 7
%130 = OpCompositeExtract %v2float %val 8
%131 = OpCompositeConstruct %mat2v2float %129 %130
%132 = OpCompositeConstruct %ExternalTextureParams %122 %123 %124 %125 %126 %127 %128 %131
OpReturnValue %132
OpFunctionEnd
%textureSampleLevel_979816 = OpFunction %void None %133
%136 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
%138 = OpLoad %11 %arg_0
%139 = OpLoad %11 %ext_tex_plane_1
%140 = OpLoad %25 %arg_1
%145 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%146 = OpLoad %ExternalTextureParams_std140 %145
%142 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %146
%137 = OpFunctionCall %v4float %textureSampleExternal %138 %139 %140 %141 %142
OpStore %res %137
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %149
%151 = OpLabel
%152 = OpFunctionCall %void %textureSampleLevel_979816
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %133
%154 = OpLabel
%155 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %155
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %133
%157 = OpLabel
%158 = OpFunctionCall %void %textureSampleLevel_979816
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %133
%160 = OpLabel
%161 = OpFunctionCall %void %textureSampleLevel_979816
OpReturn
OpFunctionEnd

View File

@ -1,6 +1,6 @@
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);

View File

@ -1,6 +1,6 @@
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
@ -63,10 +75,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
@ -102,10 +126,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;

View File

@ -19,6 +19,7 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) { void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {

View File

@ -1,7 +1,7 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 48 ; Bound: 49
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability ImageQuery OpCapability ImageQuery
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,8 +30,10 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9" OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
@ -44,14 +46,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -60,10 +62,12 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
@ -85,47 +89,48 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%void = OpTypeVoid %void = OpTypeVoid
%22 = OpTypeFunction %void %23 = OpTypeFunction %void
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%int_0 = OpConstant %int 0 %int_0 = OpConstant %int 0
%_ptr_Function_v2uint = OpTypePointer Function %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint
%33 = OpConstantNull %v2uint %34 = OpConstantNull %v2uint
%34 = OpTypeFunction %v4float %35 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%textureDimensions_cdc6c9 = OpFunction %void None %22 %textureDimensions_cdc6c9 = OpFunction %void None %23
%25 = OpLabel %26 = OpLabel
%res = OpVariable %_ptr_Function_v2uint Function %33 %res = OpVariable %_ptr_Function_v2uint Function %34
%28 = OpLoad %11 %arg_0 %29 = OpLoad %11 %arg_0
%26 = OpImageQuerySizeLod %v2uint %28 %int_0 %27 = OpImageQuerySizeLod %v2uint %29 %int_0
OpStore %res %26 OpStore %res %27
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %34 %vertex_main_inner = OpFunction %v4float None %35
%36 = OpLabel %37 = OpLabel
%37 = OpFunctionCall %void %textureDimensions_cdc6c9 %38 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %22 %vertex_main = OpFunction %void None %23
%39 = OpLabel %40 = OpLabel
%40 = OpFunctionCall %v4float %vertex_main_inner %41 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %40 OpStore %value %41
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %22 %fragment_main = OpFunction %void None %23
%43 = OpLabel %44 = OpLabel
%44 = OpFunctionCall %void %textureDimensions_cdc6c9 %45 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %22 %compute_main = OpFunction %void None %23
%46 = OpLabel %47 = OpLabel
%47 = OpFunctionCall %void %textureDimensions_cdc6c9 %48 = OpFunctionCall %void %textureDimensions_cdc6c9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, u
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, u
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -48,9 +60,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
uvec2 arg_1 = uvec2(1u); uvec2 arg_1 = uvec2(1u);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -87,10 +103,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -117,9 +145,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
uvec2 arg_1 = uvec2(1u); uvec2 arg_1 = uvec2(1u);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -150,10 +182,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -180,9 +224,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uve
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_1bfdfb() { void textureLoad_1bfdfb() {
uvec2 arg_1 = uvec2(1u); uvec2 arg_1 = uvec2(1u);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,10 +1,10 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 142 ; Bound: 159
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,19 +30,31 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureLoad_1bfdfb "textureLoad_1bfdfb" OpName %textureLoad_1bfdfb "textureLoad_1bfdfb"
OpName %arg_1 "arg_1" OpName %arg_1 "arg_1"
OpName %res "res" OpName %res "res"
@ -54,14 +66,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -70,15 +82,30 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -95,157 +122,176 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%22 = OpTypeFunction %v3float %v3float %GammaTransferParams %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%42 = OpConstantNull %v3float %43 = OpConstantNull %v3float
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%62 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%63 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%79 = OpConstantNull %int %82 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%93 = OpConstantNull %uint %95 = OpConstantNull %uint
%113 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%111 = OpTypeFunction %void %127 = OpTypeFunction %void
%115 = OpConstantComposite %v2uint %uint_1 %uint_1 %131 = OpConstantComposite %v2uint %uint_1 %uint_1
%_ptr_Function_v2uint = OpTypePointer Function %v2uint %_ptr_Function_v2uint = OpTypePointer Function %v2uint
%118 = OpConstantNull %v2uint %134 = OpConstantNull %v2uint
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%129 = OpTypeFunction %v4float %146 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22 %gammaCorrection = OpFunction %v3float None %23
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%26 = OpLabel %27 = OpLabel
%40 = OpVariable %_ptr_Function_v3float Function %42 %41 = OpVariable %_ptr_Function_v3float Function %43
%52 = OpVariable %_ptr_Function_v3float Function %42 %53 = OpVariable %_ptr_Function_v3float Function %43
%58 = OpVariable %_ptr_Function_v3float Function %42 %59 = OpVariable %_ptr_Function_v3float Function %43
%27 = OpExtInst %v3float %28 FAbs %v %28 = OpExtInst %v3float %29 FAbs %v
%29 = OpCompositeExtract %float %params 4 %30 = OpCompositeExtract %float %params 4
%30 = OpCompositeConstruct %v3float %29 %29 %29 %31 = OpCompositeConstruct %v3float %30 %30 %30
%31 = OpFOrdLessThan %v3bool %27 %30 %32 = OpFOrdLessThan %v3bool %28 %31
%34 = OpExtInst %v3float %28 FSign %v %35 = OpExtInst %v3float %29 FSign %v
%35 = OpCompositeExtract %float %params 3 %36 = OpCompositeExtract %float %params 3
%36 = OpExtInst %v3float %28 FAbs %v %37 = OpExtInst %v3float %29 FAbs %v
%37 = OpVectorTimesScalar %v3float %36 %35 %38 = OpVectorTimesScalar %v3float %37 %36
%38 = OpCompositeExtract %float %params 6 %39 = OpCompositeExtract %float %params 6
%43 = OpCompositeConstruct %v3float %38 %38 %38 %44 = OpCompositeConstruct %v3float %39 %39 %39
%39 = OpFAdd %v3float %37 %43 %40 = OpFAdd %v3float %38 %44
%44 = OpFMul %v3float %34 %39 %45 = OpFMul %v3float %35 %40
%45 = OpExtInst %v3float %28 FSign %v %46 = OpExtInst %v3float %29 FSign %v
%47 = OpCompositeExtract %float %params 1 %48 = OpCompositeExtract %float %params 1
%48 = OpExtInst %v3float %28 FAbs %v %49 = OpExtInst %v3float %29 FAbs %v
%49 = OpVectorTimesScalar %v3float %48 %47 %50 = OpVectorTimesScalar %v3float %49 %48
%50 = OpCompositeExtract %float %params 2 %51 = OpCompositeExtract %float %params 2
%53 = OpCompositeConstruct %v3float %50 %50 %50 %54 = OpCompositeConstruct %v3float %51 %51 %51
%51 = OpFAdd %v3float %49 %53 %52 = OpFAdd %v3float %50 %54
%54 = OpCompositeExtract %float %params 0 %55 = OpCompositeExtract %float %params 0
%55 = OpCompositeConstruct %v3float %54 %54 %54 %56 = OpCompositeConstruct %v3float %55 %55 %55
%46 = OpExtInst %v3float %28 Pow %51 %55 %47 = OpExtInst %v3float %29 Pow %52 %56
%56 = OpCompositeExtract %float %params 5 %57 = OpCompositeExtract %float %params 5
%59 = OpCompositeConstruct %v3float %56 %56 %56 %60 = OpCompositeConstruct %v3float %57 %57 %57
%57 = OpFAdd %v3float %46 %59 %58 = OpFAdd %v3float %47 %60
%60 = OpFMul %v3float %45 %57 %61 = OpFMul %v3float %46 %58
%61 = OpSelect %v3float %31 %44 %60 %62 = OpSelect %v3float %32 %45 %61
OpReturnValue %61 OpReturnValue %62
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %62 %textureLoadExternal = OpFunction %v4float None %63
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%coord = OpFunctionParameter %v2uint %coord = OpFunctionParameter %v2uint
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%69 = OpLabel %72 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %42 %color = OpVariable %_ptr_Function_v3float Function %43
%71 = OpCompositeExtract %uint %params_0 0 %74 = OpCompositeExtract %uint %params_0 0
%73 = OpIEqual %bool %71 %uint_1 %76 = OpIEqual %bool %74 %uint_1
OpSelectionMerge %74 None OpSelectionMerge %77 None
OpBranchConditional %73 %75 %76 OpBranchConditional %76 %78 %79
%75 = OpLabel %78 = OpLabel
%77 = OpImageFetch %v4float %plane0 %coord Lod %79 %80 = OpImageFetch %v4float %plane0 %coord Lod %82
%80 = OpVectorShuffle %v3float %77 %77 0 1 2 %83 = OpVectorShuffle %v3float %80 %80 0 1 2
OpStore %color %80 OpStore %color %83
OpBranch %74 OpBranch %77
%76 = OpLabel %79 = OpLabel
%81 = OpImageFetch %v4float %plane0 %coord Lod %79 %84 = OpImageFetch %v4float %plane0 %coord Lod %82
%82 = OpCompositeExtract %float %81 0 %85 = OpCompositeExtract %float %84 0
%83 = OpImageFetch %v4float %plane1 %coord Lod %79 %86 = OpImageFetch %v4float %plane1 %coord Lod %82
%85 = OpVectorShuffle %v2float %83 %83 0 1 %87 = OpVectorShuffle %v2float %86 %86 0 1
%86 = OpCompositeExtract %float %85 0 %88 = OpCompositeExtract %float %87 0
%87 = OpCompositeExtract %float %85 1 %89 = OpCompositeExtract %float %87 1
%89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1 %91 = OpCompositeConstruct %v4float %85 %88 %89 %float_1
%90 = OpCompositeExtract %mat3v4float %params_0 2 %92 = OpCompositeExtract %mat3v4float %params_0 2
%91 = OpVectorTimesMatrix %v3float %89 %90 %93 = OpVectorTimesMatrix %v3float %91 %92
OpStore %color %91 OpStore %color %93
OpBranch %74 OpBranch %77
%74 = OpLabel %77 = OpLabel
%92 = OpCompositeExtract %uint %params_0 1 %94 = OpCompositeExtract %uint %params_0 1
%94 = OpIEqual %bool %92 %93 %96 = OpIEqual %bool %94 %95
OpSelectionMerge %95 None OpSelectionMerge %97 None
OpBranchConditional %94 %96 %95 OpBranchConditional %96 %98 %97
%96 = OpLabel %98 = OpLabel
%98 = OpLoad %v3float %color %100 = OpLoad %v3float %color
%99 = OpCompositeExtract %GammaTransferParams %params_0 3 %101 = OpCompositeExtract %GammaTransferParams %params_0 3
%97 = OpFunctionCall %v3float %gammaCorrection %98 %99 %99 = OpFunctionCall %v3float %gammaCorrection %100 %101
OpStore %color %97 OpStore %color %99
%100 = OpCompositeExtract %mat3v3float %params_0 5 %102 = OpCompositeExtract %mat3v3float %params_0 5
%101 = OpLoad %v3float %color %103 = OpLoad %v3float %color
%102 = OpMatrixTimesVector %v3float %100 %101 %104 = OpMatrixTimesVector %v3float %102 %103
OpStore %color %102 OpStore %color %104
%104 = OpLoad %v3float %color
%105 = OpCompositeExtract %GammaTransferParams %params_0 4
%103 = OpFunctionCall %v3float %gammaCorrection %104 %105
OpStore %color %103
OpBranch %95
%95 = OpLabel
%106 = OpLoad %v3float %color %106 = OpLoad %v3float %color
%107 = OpCompositeExtract %float %106 0 %107 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpCompositeExtract %float %106 1 %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
%109 = OpCompositeExtract %float %106 2 OpStore %color %105
%110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1 OpBranch %97
OpReturnValue %110 %97 = OpLabel
%108 = OpLoad %v3float %color
%109 = OpCompositeExtract %float %108 0
%110 = OpCompositeExtract %float %108 1
%111 = OpCompositeExtract %float %108 2
%112 = OpCompositeConstruct %v4float %109 %110 %111 %float_1
OpReturnValue %112
OpFunctionEnd OpFunctionEnd
%textureLoad_1bfdfb = OpFunction %void None %111 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %113
%114 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%arg_1 = OpVariable %_ptr_Function_v2uint Function %118 %116 = OpLabel
%117 = OpCompositeExtract %uint %val 0
%118 = OpCompositeExtract %uint %val 1
%119 = OpCompositeExtract %mat3v4float %val 2
%120 = OpCompositeExtract %GammaTransferParams %val 3
%121 = OpCompositeExtract %GammaTransferParams %val 4
%122 = OpCompositeExtract %mat3v3float %val 5
%123 = OpCompositeExtract %v2float %val 6
%124 = OpCompositeExtract %v2float %val 7
%125 = OpCompositeConstruct %mat2v2float %123 %124
%126 = OpCompositeConstruct %ExternalTextureParams %117 %118 %119 %120 %121 %122 %125
OpReturnValue %126
OpFunctionEnd
%textureLoad_1bfdfb = OpFunction %void None %127
%130 = OpLabel
%arg_1 = OpVariable %_ptr_Function_v2uint Function %134
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
OpStore %arg_1 %115 OpStore %arg_1 %131
%120 = OpLoad %11 %arg_0 %136 = OpLoad %11 %arg_0
%121 = OpLoad %11 %ext_tex_plane_1 %137 = OpLoad %11 %ext_tex_plane_1
%122 = OpLoad %v2uint %arg_1 %138 = OpLoad %v2uint %arg_1
%125 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %142 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%126 = OpLoad %ExternalTextureParams %125 %143 = OpLoad %ExternalTextureParams_std140 %142
%119 = OpFunctionCall %v4float %textureLoadExternal %120 %121 %122 %126 %139 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %143
OpStore %res %119 %135 = OpFunctionCall %v4float %textureLoadExternal %136 %137 %138 %139
OpStore %res %135
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %129 %vertex_main_inner = OpFunction %v4float None %146
%131 = OpLabel %148 = OpLabel
%132 = OpFunctionCall %void %textureLoad_1bfdfb %149 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %111 %vertex_main = OpFunction %void None %127
%134 = OpLabel %151 = OpLabel
%135 = OpFunctionCall %v4float %vertex_main_inner %152 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %135 OpStore %value %152
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %111 %fragment_main = OpFunction %void None %127
%137 = OpLabel %154 = OpLabel
%138 = OpFunctionCall %void %textureLoad_1bfdfb %155 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %111 %compute_main = OpFunction %void None %127
%140 = OpLabel %157 = OpLabel
%141 = OpFunctionCall %void %textureLoad_1bfdfb %158 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_8acf41() { void textureLoad_8acf41() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -45,14 +46,14 @@ float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, i
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -61,22 +62,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureLoad_8acf41() { void textureLoad_8acf41() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -48,9 +60,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
ivec2 arg_1 = ivec2(1); ivec2 arg_1 = ivec2(1);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -87,10 +103,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -117,9 +145,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
ivec2 arg_1 = ivec2(1); ivec2 arg_1 = ivec2(1);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -150,10 +182,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -180,9 +224,13 @@ vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ive
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureLoad_8acf41() { void textureLoad_8acf41() {
ivec2 arg_1 = ivec2(1); ivec2 arg_1 = ivec2(1);
vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, ext_tex_params.inner); vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,10 +1,10 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 143 ; Bound: 160
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,19 +30,31 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureLoad_8acf41 "textureLoad_8acf41" OpName %textureLoad_8acf41 "textureLoad_8acf41"
OpName %arg_1 "arg_1" OpName %arg_1 "arg_1"
OpName %res "res" OpName %res "res"
@ -54,14 +66,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -70,15 +82,30 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -95,158 +122,177 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%22 = OpTypeFunction %v3float %v3float %GammaTransferParams %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%42 = OpConstantNull %v3float %43 = OpConstantNull %v3float
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2 %v2int = OpTypeVector %int 2
%62 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%63 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%79 = OpConstantNull %int %82 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%93 = OpConstantNull %uint %95 = OpConstantNull %uint
%113 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%111 = OpTypeFunction %void %127 = OpTypeFunction %void
%int_1 = OpConstant %int 1 %int_1 = OpConstant %int 1
%116 = OpConstantComposite %v2int %int_1 %int_1 %132 = OpConstantComposite %v2int %int_1 %int_1
%_ptr_Function_v2int = OpTypePointer Function %v2int %_ptr_Function_v2int = OpTypePointer Function %v2int
%119 = OpConstantNull %v2int %135 = OpConstantNull %v2int
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%130 = OpTypeFunction %v4float %147 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22 %gammaCorrection = OpFunction %v3float None %23
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%26 = OpLabel %27 = OpLabel
%40 = OpVariable %_ptr_Function_v3float Function %42 %41 = OpVariable %_ptr_Function_v3float Function %43
%52 = OpVariable %_ptr_Function_v3float Function %42 %53 = OpVariable %_ptr_Function_v3float Function %43
%58 = OpVariable %_ptr_Function_v3float Function %42 %59 = OpVariable %_ptr_Function_v3float Function %43
%27 = OpExtInst %v3float %28 FAbs %v %28 = OpExtInst %v3float %29 FAbs %v
%29 = OpCompositeExtract %float %params 4 %30 = OpCompositeExtract %float %params 4
%30 = OpCompositeConstruct %v3float %29 %29 %29 %31 = OpCompositeConstruct %v3float %30 %30 %30
%31 = OpFOrdLessThan %v3bool %27 %30 %32 = OpFOrdLessThan %v3bool %28 %31
%34 = OpExtInst %v3float %28 FSign %v %35 = OpExtInst %v3float %29 FSign %v
%35 = OpCompositeExtract %float %params 3 %36 = OpCompositeExtract %float %params 3
%36 = OpExtInst %v3float %28 FAbs %v %37 = OpExtInst %v3float %29 FAbs %v
%37 = OpVectorTimesScalar %v3float %36 %35 %38 = OpVectorTimesScalar %v3float %37 %36
%38 = OpCompositeExtract %float %params 6 %39 = OpCompositeExtract %float %params 6
%43 = OpCompositeConstruct %v3float %38 %38 %38 %44 = OpCompositeConstruct %v3float %39 %39 %39
%39 = OpFAdd %v3float %37 %43 %40 = OpFAdd %v3float %38 %44
%44 = OpFMul %v3float %34 %39 %45 = OpFMul %v3float %35 %40
%45 = OpExtInst %v3float %28 FSign %v %46 = OpExtInst %v3float %29 FSign %v
%47 = OpCompositeExtract %float %params 1 %48 = OpCompositeExtract %float %params 1
%48 = OpExtInst %v3float %28 FAbs %v %49 = OpExtInst %v3float %29 FAbs %v
%49 = OpVectorTimesScalar %v3float %48 %47 %50 = OpVectorTimesScalar %v3float %49 %48
%50 = OpCompositeExtract %float %params 2 %51 = OpCompositeExtract %float %params 2
%53 = OpCompositeConstruct %v3float %50 %50 %50 %54 = OpCompositeConstruct %v3float %51 %51 %51
%51 = OpFAdd %v3float %49 %53 %52 = OpFAdd %v3float %50 %54
%54 = OpCompositeExtract %float %params 0 %55 = OpCompositeExtract %float %params 0
%55 = OpCompositeConstruct %v3float %54 %54 %54 %56 = OpCompositeConstruct %v3float %55 %55 %55
%46 = OpExtInst %v3float %28 Pow %51 %55 %47 = OpExtInst %v3float %29 Pow %52 %56
%56 = OpCompositeExtract %float %params 5 %57 = OpCompositeExtract %float %params 5
%59 = OpCompositeConstruct %v3float %56 %56 %56 %60 = OpCompositeConstruct %v3float %57 %57 %57
%57 = OpFAdd %v3float %46 %59 %58 = OpFAdd %v3float %47 %60
%60 = OpFMul %v3float %45 %57 %61 = OpFMul %v3float %46 %58
%61 = OpSelect %v3float %31 %44 %60 %62 = OpSelect %v3float %32 %45 %61
OpReturnValue %61 OpReturnValue %62
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %62 %textureLoadExternal = OpFunction %v4float None %63
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%coord = OpFunctionParameter %v2int %coord = OpFunctionParameter %v2int
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%70 = OpLabel %73 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %42 %color = OpVariable %_ptr_Function_v3float Function %43
%72 = OpCompositeExtract %uint %params_0 0 %75 = OpCompositeExtract %uint %params_0 0
%74 = OpIEqual %bool %72 %uint_1 %77 = OpIEqual %bool %75 %uint_1
OpSelectionMerge %75 None OpSelectionMerge %78 None
OpBranchConditional %74 %76 %77 OpBranchConditional %77 %79 %80
%76 = OpLabel %79 = OpLabel
%78 = OpImageFetch %v4float %plane0 %coord Lod %79 %81 = OpImageFetch %v4float %plane0 %coord Lod %82
%80 = OpVectorShuffle %v3float %78 %78 0 1 2 %83 = OpVectorShuffle %v3float %81 %81 0 1 2
OpStore %color %80 OpStore %color %83
OpBranch %75 OpBranch %78
%77 = OpLabel %80 = OpLabel
%81 = OpImageFetch %v4float %plane0 %coord Lod %79 %84 = OpImageFetch %v4float %plane0 %coord Lod %82
%82 = OpCompositeExtract %float %81 0 %85 = OpCompositeExtract %float %84 0
%83 = OpImageFetch %v4float %plane1 %coord Lod %79 %86 = OpImageFetch %v4float %plane1 %coord Lod %82
%85 = OpVectorShuffle %v2float %83 %83 0 1 %87 = OpVectorShuffle %v2float %86 %86 0 1
%86 = OpCompositeExtract %float %85 0 %88 = OpCompositeExtract %float %87 0
%87 = OpCompositeExtract %float %85 1 %89 = OpCompositeExtract %float %87 1
%89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1 %91 = OpCompositeConstruct %v4float %85 %88 %89 %float_1
%90 = OpCompositeExtract %mat3v4float %params_0 2 %92 = OpCompositeExtract %mat3v4float %params_0 2
%91 = OpVectorTimesMatrix %v3float %89 %90 %93 = OpVectorTimesMatrix %v3float %91 %92
OpStore %color %91 OpStore %color %93
OpBranch %75 OpBranch %78
%75 = OpLabel %78 = OpLabel
%92 = OpCompositeExtract %uint %params_0 1 %94 = OpCompositeExtract %uint %params_0 1
%94 = OpIEqual %bool %92 %93 %96 = OpIEqual %bool %94 %95
OpSelectionMerge %95 None OpSelectionMerge %97 None
OpBranchConditional %94 %96 %95 OpBranchConditional %96 %98 %97
%96 = OpLabel %98 = OpLabel
%98 = OpLoad %v3float %color %100 = OpLoad %v3float %color
%99 = OpCompositeExtract %GammaTransferParams %params_0 3 %101 = OpCompositeExtract %GammaTransferParams %params_0 3
%97 = OpFunctionCall %v3float %gammaCorrection %98 %99 %99 = OpFunctionCall %v3float %gammaCorrection %100 %101
OpStore %color %97 OpStore %color %99
%100 = OpCompositeExtract %mat3v3float %params_0 5 %102 = OpCompositeExtract %mat3v3float %params_0 5
%101 = OpLoad %v3float %color %103 = OpLoad %v3float %color
%102 = OpMatrixTimesVector %v3float %100 %101 %104 = OpMatrixTimesVector %v3float %102 %103
OpStore %color %102 OpStore %color %104
%104 = OpLoad %v3float %color
%105 = OpCompositeExtract %GammaTransferParams %params_0 4
%103 = OpFunctionCall %v3float %gammaCorrection %104 %105
OpStore %color %103
OpBranch %95
%95 = OpLabel
%106 = OpLoad %v3float %color %106 = OpLoad %v3float %color
%107 = OpCompositeExtract %float %106 0 %107 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpCompositeExtract %float %106 1 %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
%109 = OpCompositeExtract %float %106 2 OpStore %color %105
%110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1 OpBranch %97
OpReturnValue %110 %97 = OpLabel
%108 = OpLoad %v3float %color
%109 = OpCompositeExtract %float %108 0
%110 = OpCompositeExtract %float %108 1
%111 = OpCompositeExtract %float %108 2
%112 = OpCompositeConstruct %v4float %109 %110 %111 %float_1
OpReturnValue %112
OpFunctionEnd OpFunctionEnd
%textureLoad_8acf41 = OpFunction %void None %111 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %113
%114 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%arg_1 = OpVariable %_ptr_Function_v2int Function %119 %116 = OpLabel
%117 = OpCompositeExtract %uint %val 0
%118 = OpCompositeExtract %uint %val 1
%119 = OpCompositeExtract %mat3v4float %val 2
%120 = OpCompositeExtract %GammaTransferParams %val 3
%121 = OpCompositeExtract %GammaTransferParams %val 4
%122 = OpCompositeExtract %mat3v3float %val 5
%123 = OpCompositeExtract %v2float %val 6
%124 = OpCompositeExtract %v2float %val 7
%125 = OpCompositeConstruct %mat2v2float %123 %124
%126 = OpCompositeConstruct %ExternalTextureParams %117 %118 %119 %120 %121 %122 %125
OpReturnValue %126
OpFunctionEnd
%textureLoad_8acf41 = OpFunction %void None %127
%130 = OpLabel
%arg_1 = OpVariable %_ptr_Function_v2int Function %135
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
OpStore %arg_1 %116 OpStore %arg_1 %132
%121 = OpLoad %11 %arg_0 %137 = OpLoad %11 %arg_0
%122 = OpLoad %11 %ext_tex_plane_1 %138 = OpLoad %11 %ext_tex_plane_1
%123 = OpLoad %v2int %arg_1 %139 = OpLoad %v2int %arg_1
%126 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %143 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%127 = OpLoad %ExternalTextureParams %126 %144 = OpLoad %ExternalTextureParams_std140 %143
%120 = OpFunctionCall %v4float %textureLoadExternal %121 %122 %123 %127 %140 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %144
OpStore %res %120 %136 = OpFunctionCall %v4float %textureLoadExternal %137 %138 %139 %140
OpStore %res %136
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %130 %vertex_main_inner = OpFunction %v4float None %147
%132 = OpLabel %149 = OpLabel
%133 = OpFunctionCall %void %textureLoad_8acf41 %150 = OpFunctionCall %void %textureLoad_8acf41
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %111 %vertex_main = OpFunction %void None %127
%135 = OpLabel %152 = OpLabel
%136 = OpFunctionCall %v4float %vertex_main_inner %153 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %136 OpStore %value %153
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %111 %fragment_main = OpFunction %void None %127
%138 = OpLabel %155 = OpLabel
%139 = OpFunctionCall %void %textureLoad_8acf41 %156 = OpFunctionCall %void %textureLoad_8acf41
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %111 %compute_main = OpFunction %void None %127
%141 = OpLabel %158 = OpLabel
%142 = OpFunctionCall %void %textureLoad_8acf41 %159 = OpFunctionCall %void %textureLoad_8acf41
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space1); Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) { cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1); SamplerState arg_1 : register(s1, space1);
@ -32,16 +33,17 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
const float2 modifiedCoords = (mul(params.rotationMatrix, (coord - 0.5f)) + 0.5f);
int3 tint_tmp; int3 tint_tmp;
plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
const float2 plane0_dims = float2(tint_tmp.xy); const float2 plane0_dims = float2(tint_tmp.xy);
const float2 plane0_half_texel = ((0.5f).xx / plane0_dims); const float2 plane0_half_texel = ((0.5f).xx / plane0_dims);
const float2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); const float2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
int3 tint_tmp_1; int3 tint_tmp_1;
plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z); plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
const float2 plane1_dims = float2(tint_tmp_1.xy); const float2 plane1_dims = float2(tint_tmp_1.xy);
const float2 plane1_half_texel = ((0.5f).xx / plane1_dims); const float2 plane1_half_texel = ((0.5f).xx / plane1_dims);
const float2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); const float2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = float3(0.0f, 0.0f, 0.0f); float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb; color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb;
@ -56,14 +58,14 @@ float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1,
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -72,22 +74,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t2, space1); Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) { cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1); SamplerState arg_1 : register(s1, space1);
@ -32,16 +33,17 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
const float2 modifiedCoords = (mul(params.rotationMatrix, (coord - 0.5f)) + 0.5f);
int3 tint_tmp; int3 tint_tmp;
plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); plane0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
const float2 plane0_dims = float2(tint_tmp.xy); const float2 plane0_dims = float2(tint_tmp.xy);
const float2 plane0_half_texel = ((0.5f).xx / plane0_dims); const float2 plane0_half_texel = ((0.5f).xx / plane0_dims);
const float2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); const float2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
int3 tint_tmp_1; int3 tint_tmp_1;
plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z); plane1.GetDimensions(0, tint_tmp_1.x, tint_tmp_1.y, tint_tmp_1.z);
const float2 plane1_dims = float2(tint_tmp_1.xy); const float2 plane1_dims = float2(tint_tmp_1.xy);
const float2 plane1_half_texel = ((0.5f).xx / plane1_dims); const float2 plane1_half_texel = ((0.5f).xx / plane1_dims);
const float2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); const float2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = float3(0.0f, 0.0f, 0.0f); float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb; color = plane0.SampleLevel(smp, plane0_clamped, 0.0f).rgb;
@ -56,14 +58,14 @@ float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1,
return float4(color, 1.0f); return float4(color, 1.0f);
} }
float3x4 tint_symbol_3(uint4 buffer[11], uint offset) { float3x4 tint_symbol_3(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_5(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -72,22 +74,30 @@ GammaTransferParams tint_symbol_5(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_9 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_9; return tint_symbol_11;
} }
float3x3 tint_symbol_7(uint4 buffer[11], uint offset) { float3x3 tint_symbol_7(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_1(uint4 buffer[11], uint offset) { float2x2 tint_symbol_9(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_10 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_10; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))};
return tint_symbol_12;
} }
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -33,12 +45,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -57,9 +70,13 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec2 arg_2 = vec2(1.0f); vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -96,10 +113,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -111,12 +140,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -135,9 +165,13 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec2 arg_2 = vec2(1.0f); vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void fragment_main() { void fragment_main() {
@ -168,10 +202,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 3, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -183,12 +229,13 @@ vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) { vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec2 modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0))); vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims); vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); vec2 plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0))); vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims); vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); vec2 plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f); vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb; color = textureLod(plane0_smp, plane0_clamped, 0.0f).rgb;
@ -207,9 +254,13 @@ uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1; uniform highp sampler2D ext_tex_plane_1_1;
uniform highp sampler2D arg_0_arg_1; uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1; uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleBaseClampToEdge_7c04e6() { void textureSampleBaseClampToEdge_7c04e6() {
vec2 arg_2 = vec2(1.0f); vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, ext_tex_params.inner); vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {
@ -43,12 +44,13 @@ float3 gammaCorrection(float3 v, GammaTransferParams params) {
} }
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) { float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
float2 const modifiedCoords = (((coord - 0.5f) * params.rotationMatrix) + 0.5f);
float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0))); float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0)));
float2 const plane0_half_texel = (float2(0.5f) / plane0_dims); float2 const plane0_half_texel = (float2(0.5f) / plane0_dims);
float2 const plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel)); float2 const plane0_clamped = clamp(modifiedCoords, plane0_half_texel, (1.0f - plane0_half_texel));
float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0))); float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0)));
float2 const plane1_half_texel = (float2(0.5f) / plane1_dims); float2 const plane1_half_texel = (float2(0.5f) / plane1_dims);
float2 const plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel)); float2 const plane1_clamped = clamp(modifiedCoords, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = 0.0f; float3 color = 0.0f;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = float4(plane0.sample(smp, plane0_clamped, level(0.0f))).rgb; color = float4(plane0.sample(smp, plane0_clamped, level(0.0f))).rgb;

View File

@ -1,11 +1,11 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 167 ; Bound: 192
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability ImageQuery OpCapability ImageQuery
%31 = OpExtInstImport "GLSL.std.450" %32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -15,13 +15,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -31,14 +31,24 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1" OpName %arg_1 "arg_1"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureSampleExternal "textureSampleExternal" OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
@ -46,6 +56,8 @@
OpName %coord "coord" OpName %coord "coord"
OpName %params_0 "params" OpName %params_0 "params"
OpName %color "color" OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureSampleBaseClampToEdge_7c04e6 "textureSampleBaseClampToEdge_7c04e6" OpName %textureSampleBaseClampToEdge_7c04e6 "textureSampleBaseClampToEdge_7c04e6"
OpName %arg_2 "arg_2" OpName %arg_2 "arg_2"
OpName %res "res" OpName %res "res"
@ -57,14 +69,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 2 OpDecorate %ext_tex_plane_1 Binding 2
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -73,10 +85,12 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 3 OpDecorate %ext_tex_params Binding 3
@ -84,6 +98,19 @@
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1 OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1 OpDecorate %arg_1 Binding 1
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -100,182 +127,209 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%24 = OpTypeSampler %25 = OpTypeSampler
%_ptr_UniformConstant_24 = OpTypePointer UniformConstant %24 %_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%arg_1 = OpVariable %_ptr_UniformConstant_24 UniformConstant %arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
%25 = OpTypeFunction %v3float %v3float %GammaTransferParams %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%45 = OpConstantNull %v3float %46 = OpConstantNull %v3float
%v2float = OpTypeVector %float 2 %mat2v2float = OpTypeMatrix %v2float 2
%65 = OpTypeFunction %v4float %11 %11 %24 %v2float %ExternalTextureParams %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
%float_0_5 = OpConstant %float 0.5
%_ptr_Function_v2float = OpTypePointer Function %v2float
%80 = OpConstantNull %v2float
%v2uint = OpTypeVector %uint 2 %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%78 = OpConstantNull %int %91 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5 %92 = OpConstantComposite %v2float %float_0_5 %float_0_5
%80 = OpConstantComposite %v2float %float_0_5 %float_0_5
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%87 = OpConstantNull %v2float
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%104 = OpTypeSampledImage %11 %114 = OpTypeSampledImage %11
%119 = OpConstantNull %uint %129 = OpConstantNull %uint
%147 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%137 = OpTypeFunction %void %161 = OpTypeFunction %void
%141 = OpConstantComposite %v2float %float_1 %float_1 %165 = OpConstantComposite %v2float %float_1 %float_1
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%154 = OpTypeFunction %v4float %179 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %25 %gammaCorrection = OpFunction %v3float None %26
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%29 = OpLabel %30 = OpLabel
%43 = OpVariable %_ptr_Function_v3float Function %45 %44 = OpVariable %_ptr_Function_v3float Function %46
%55 = OpVariable %_ptr_Function_v3float Function %45 %56 = OpVariable %_ptr_Function_v3float Function %46
%61 = OpVariable %_ptr_Function_v3float Function %45 %62 = OpVariable %_ptr_Function_v3float Function %46
%30 = OpExtInst %v3float %31 FAbs %v %31 = OpExtInst %v3float %32 FAbs %v
%32 = OpCompositeExtract %float %params 4 %33 = OpCompositeExtract %float %params 4
%33 = OpCompositeConstruct %v3float %32 %32 %32 %34 = OpCompositeConstruct %v3float %33 %33 %33
%34 = OpFOrdLessThan %v3bool %30 %33 %35 = OpFOrdLessThan %v3bool %31 %34
%37 = OpExtInst %v3float %31 FSign %v %38 = OpExtInst %v3float %32 FSign %v
%38 = OpCompositeExtract %float %params 3 %39 = OpCompositeExtract %float %params 3
%39 = OpExtInst %v3float %31 FAbs %v %40 = OpExtInst %v3float %32 FAbs %v
%40 = OpVectorTimesScalar %v3float %39 %38 %41 = OpVectorTimesScalar %v3float %40 %39
%41 = OpCompositeExtract %float %params 6 %42 = OpCompositeExtract %float %params 6
%46 = OpCompositeConstruct %v3float %41 %41 %41 %47 = OpCompositeConstruct %v3float %42 %42 %42
%42 = OpFAdd %v3float %40 %46 %43 = OpFAdd %v3float %41 %47
%47 = OpFMul %v3float %37 %42 %48 = OpFMul %v3float %38 %43
%48 = OpExtInst %v3float %31 FSign %v %49 = OpExtInst %v3float %32 FSign %v
%50 = OpCompositeExtract %float %params 1 %51 = OpCompositeExtract %float %params 1
%51 = OpExtInst %v3float %31 FAbs %v %52 = OpExtInst %v3float %32 FAbs %v
%52 = OpVectorTimesScalar %v3float %51 %50 %53 = OpVectorTimesScalar %v3float %52 %51
%53 = OpCompositeExtract %float %params 2 %54 = OpCompositeExtract %float %params 2
%56 = OpCompositeConstruct %v3float %53 %53 %53 %57 = OpCompositeConstruct %v3float %54 %54 %54
%54 = OpFAdd %v3float %52 %56 %55 = OpFAdd %v3float %53 %57
%57 = OpCompositeExtract %float %params 0 %58 = OpCompositeExtract %float %params 0
%58 = OpCompositeConstruct %v3float %57 %57 %57 %59 = OpCompositeConstruct %v3float %58 %58 %58
%49 = OpExtInst %v3float %31 Pow %54 %58 %50 = OpExtInst %v3float %32 Pow %55 %59
%59 = OpCompositeExtract %float %params 5 %60 = OpCompositeExtract %float %params 5
%62 = OpCompositeConstruct %v3float %59 %59 %59 %63 = OpCompositeConstruct %v3float %60 %60 %60
%60 = OpFAdd %v3float %49 %62 %61 = OpFAdd %v3float %50 %63
%63 = OpFMul %v3float %48 %60 %64 = OpFMul %v3float %49 %61
%64 = OpSelect %v3float %34 %47 %63 %65 = OpSelect %v3float %35 %48 %64
OpReturnValue %64 OpReturnValue %65
OpFunctionEnd OpFunctionEnd
%textureSampleExternal = OpFunction %v4float None %65 %textureSampleExternal = OpFunction %v4float None %66
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%smp = OpFunctionParameter %24 %smp = OpFunctionParameter %25
%coord = OpFunctionParameter %v2float %coord = OpFunctionParameter %v2float
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%73 = OpLabel %75 = OpLabel
%85 = OpVariable %_ptr_Function_v2float Function %87 %78 = OpVariable %_ptr_Function_v2float Function %80
%94 = OpVariable %_ptr_Function_v2float Function %87 %85 = OpVariable %_ptr_Function_v2float Function %80
%color = OpVariable %_ptr_Function_v3float Function %45 %97 = OpVariable %_ptr_Function_v2float Function %80
%75 = OpImageQuerySizeLod %v2uint %plane0 %78 %104 = OpVariable %_ptr_Function_v2float Function %80
%74 = OpConvertUToF %v2float %75 %color = OpVariable %_ptr_Function_v3float Function %46
%81 = OpFDiv %v2float %80 %74 %81 = OpCompositeConstruct %v2float %float_0_5 %float_0_5
%88 = OpCompositeConstruct %v2float %float_1 %float_1 %77 = OpFSub %v2float %coord %81
%84 = OpFSub %v2float %88 %81 %82 = OpCompositeExtract %mat2v2float %params_0 6
%82 = OpExtInst %v2float %31 NClamp %coord %81 %84 %83 = OpVectorTimesMatrix %v2float %77 %82
%90 = OpImageQuerySizeLod %v2uint %plane1 %78 %86 = OpCompositeConstruct %v2float %float_0_5 %float_0_5
%89 = OpConvertUToF %v2float %90 %84 = OpFAdd %v2float %83 %86
%91 = OpFDiv %v2float %80 %89 %88 = OpImageQuerySizeLod %v2uint %plane0 %91
%95 = OpCompositeConstruct %v2float %float_1 %float_1 %87 = OpConvertUToF %v2float %88
%93 = OpFSub %v2float %95 %91 %93 = OpFDiv %v2float %92 %87
%92 = OpExtInst %v2float %31 NClamp %coord %91 %93 %98 = OpCompositeConstruct %v2float %float_1 %float_1
%97 = OpCompositeExtract %uint %params_0 0 %96 = OpFSub %v2float %98 %93
%99 = OpIEqual %bool %97 %uint_1 %94 = OpExtInst %v2float %32 NClamp %84 %93 %96
OpSelectionMerge %100 None %100 = OpImageQuerySizeLod %v2uint %plane1 %91
OpBranchConditional %99 %101 %102 %99 = OpConvertUToF %v2float %100
%101 = OpLabel %101 = OpFDiv %v2float %92 %99
%105 = OpSampledImage %104 %plane0 %smp %105 = OpCompositeConstruct %v2float %float_1 %float_1
%103 = OpImageSampleExplicitLod %v4float %105 %82 Lod %8 %103 = OpFSub %v2float %105 %101
%106 = OpVectorShuffle %v3float %103 %103 0 1 2 %102 = OpExtInst %v2float %32 NClamp %84 %101 %103
OpStore %color %106 %107 = OpCompositeExtract %uint %params_0 0
OpBranch %100 %109 = OpIEqual %bool %107 %uint_1
%102 = OpLabel OpSelectionMerge %110 None
%108 = OpSampledImage %104 %plane0 %smp OpBranchConditional %109 %111 %112
%107 = OpImageSampleExplicitLod %v4float %108 %82 Lod %8 %111 = OpLabel
%109 = OpCompositeExtract %float %107 0 %115 = OpSampledImage %114 %plane0 %smp
%111 = OpSampledImage %104 %plane1 %smp %113 = OpImageSampleExplicitLod %v4float %115 %94 Lod %8
%110 = OpImageSampleExplicitLod %v4float %111 %92 Lod %8 %116 = OpVectorShuffle %v3float %113 %113 0 1 2
%112 = OpVectorShuffle %v2float %110 %110 0 1 OpStore %color %116
%113 = OpCompositeExtract %float %112 0 OpBranch %110
%114 = OpCompositeExtract %float %112 1 %112 = OpLabel
%115 = OpCompositeConstruct %v4float %109 %113 %114 %float_1 %118 = OpSampledImage %114 %plane0 %smp
%116 = OpCompositeExtract %mat3v4float %params_0 2 %117 = OpImageSampleExplicitLod %v4float %118 %94 Lod %8
%117 = OpVectorTimesMatrix %v3float %115 %116 %119 = OpCompositeExtract %float %117 0
OpStore %color %117 %121 = OpSampledImage %114 %plane1 %smp
OpBranch %100 %120 = OpImageSampleExplicitLod %v4float %121 %102 Lod %8
%100 = OpLabel %122 = OpVectorShuffle %v2float %120 %120 0 1
%118 = OpCompositeExtract %uint %params_0 1 %123 = OpCompositeExtract %float %122 0
%120 = OpIEqual %bool %118 %119 %124 = OpCompositeExtract %float %122 1
OpSelectionMerge %121 None %125 = OpCompositeConstruct %v4float %119 %123 %124 %float_1
OpBranchConditional %120 %122 %121 %126 = OpCompositeExtract %mat3v4float %params_0 2
%122 = OpLabel %127 = OpVectorTimesMatrix %v3float %125 %126
%124 = OpLoad %v3float %color OpStore %color %127
%125 = OpCompositeExtract %GammaTransferParams %params_0 3 OpBranch %110
%123 = OpFunctionCall %v3float %gammaCorrection %124 %125 %110 = OpLabel
OpStore %color %123 %128 = OpCompositeExtract %uint %params_0 1
%126 = OpCompositeExtract %mat3v3float %params_0 5 %130 = OpIEqual %bool %128 %129
%127 = OpLoad %v3float %color OpSelectionMerge %131 None
%128 = OpMatrixTimesVector %v3float %126 %127 OpBranchConditional %130 %132 %131
OpStore %color %128 %132 = OpLabel
%130 = OpLoad %v3float %color %134 = OpLoad %v3float %color
%131 = OpCompositeExtract %GammaTransferParams %params_0 4 %135 = OpCompositeExtract %GammaTransferParams %params_0 3
%129 = OpFunctionCall %v3float %gammaCorrection %130 %131 %133 = OpFunctionCall %v3float %gammaCorrection %134 %135
OpStore %color %129 OpStore %color %133
OpBranch %121 %136 = OpCompositeExtract %mat3v3float %params_0 5
%121 = OpLabel %137 = OpLoad %v3float %color
%132 = OpLoad %v3float %color %138 = OpMatrixTimesVector %v3float %136 %137
%133 = OpCompositeExtract %float %132 0 OpStore %color %138
%134 = OpCompositeExtract %float %132 1 %140 = OpLoad %v3float %color
%135 = OpCompositeExtract %float %132 2 %141 = OpCompositeExtract %GammaTransferParams %params_0 4
%136 = OpCompositeConstruct %v4float %133 %134 %135 %float_1 %139 = OpFunctionCall %v3float %gammaCorrection %140 %141
OpReturnValue %136 OpStore %color %139
OpBranch %131
%131 = OpLabel
%142 = OpLoad %v3float %color
%143 = OpCompositeExtract %float %142 0
%144 = OpCompositeExtract %float %142 1
%145 = OpCompositeExtract %float %142 2
%146 = OpCompositeConstruct %v4float %143 %144 %145 %float_1
OpReturnValue %146
OpFunctionEnd OpFunctionEnd
%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %137 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %147
%140 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%arg_2 = OpVariable %_ptr_Function_v2float Function %87 %150 = OpLabel
%151 = OpCompositeExtract %uint %val 0
%152 = OpCompositeExtract %uint %val 1
%153 = OpCompositeExtract %mat3v4float %val 2
%154 = OpCompositeExtract %GammaTransferParams %val 3
%155 = OpCompositeExtract %GammaTransferParams %val 4
%156 = OpCompositeExtract %mat3v3float %val 5
%157 = OpCompositeExtract %v2float %val 6
%158 = OpCompositeExtract %v2float %val 7
%159 = OpCompositeConstruct %mat2v2float %157 %158
%160 = OpCompositeConstruct %ExternalTextureParams %151 %152 %153 %154 %155 %156 %159
OpReturnValue %160
OpFunctionEnd
%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %161
%164 = OpLabel
%arg_2 = OpVariable %_ptr_Function_v2float Function %80
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
OpStore %arg_2 %141 OpStore %arg_2 %165
%144 = OpLoad %11 %arg_0 %168 = OpLoad %11 %arg_0
%145 = OpLoad %11 %ext_tex_plane_1 %169 = OpLoad %11 %ext_tex_plane_1
%146 = OpLoad %24 %arg_1 %170 = OpLoad %25 %arg_1
%147 = OpLoad %v2float %arg_2 %171 = OpLoad %v2float %arg_2
%150 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %175 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%151 = OpLoad %ExternalTextureParams %150 %176 = OpLoad %ExternalTextureParams_std140 %175
%143 = OpFunctionCall %v4float %textureSampleExternal %144 %145 %146 %147 %151 %172 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %176
OpStore %res %143 %167 = OpFunctionCall %v4float %textureSampleExternal %168 %169 %170 %171 %172
OpStore %res %167
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %154 %vertex_main_inner = OpFunction %v4float None %179
%156 = OpLabel %181 = OpLabel
%157 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %182 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %137 %vertex_main = OpFunction %void None %161
%159 = OpLabel %184 = OpLabel
%160 = OpFunctionCall %v4float %vertex_main_inner %185 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %160 OpStore %value %185
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %137 %fragment_main = OpFunction %void None %161
%162 = OpLabel %187 = OpLabel
%163 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %188 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %137 %compute_main = OpFunction %void None %161
%165 = OpLabel %190 = OpLabel
%166 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6 %191 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -0,0 +1,128 @@
builtins/gen/var/textureSampleLevel/979816.wgsl:29:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2);
^^^^^^^^^^^^^^^^^^
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
float3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
uint flipY;
float2x2 rotationMatrix;
};
Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[13];
};
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
float3 gammaCorrection(float3 v, GammaTransferParams params) {
const bool3 cond = (abs(v) < float3((params.D).xxx));
const float3 t = (sign(v) * ((params.C * abs(v)) + params.F));
const float3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), float3((params.G).xxx)) + params.E));
return (cond ? t : f);
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, coord, 0.0f).rgb;
} else {
color = mul(params.yuvToRgbConversionMatrix, float4(plane0.SampleLevel(smp, coord, 0.0f).r, plane1.SampleLevel(smp, coord, 0.0f).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = mul(color, params.gamutConversionMatrix);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
float3x4 tint_symbol_3(uint4 buffer[13], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
}
GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4;
const uint scalar_offset_6 = ((offset + 12u)) / 4;
const uint scalar_offset_7 = ((offset + 16u)) / 4;
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_11;
}
float3x3 tint_symbol_7(uint4 buffer[13], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
}
float2x2 tint_symbol_9(uint4 buffer[13], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4;
uint4 ubo_load = buffer[scalar_offset_14 / 4];
const uint scalar_offset_15 = ((offset + 8u)) / 4;
uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const uint scalar_offset_18 = ((offset + 176u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_9(buffer, (offset + 184u))};
return tint_symbol_12;
}
void textureSampleLevel_979816() {
float2 arg_2 = (1.0f).xx;
float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, tint_symbol_1(ext_tex_params, 0u));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
textureSampleLevel_979816();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
textureSampleLevel_979816();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
textureSampleLevel_979816();
return;
}

View File

@ -0,0 +1,128 @@
builtins/gen/var/textureSampleLevel/979816.wgsl:29:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2);
^^^^^^^^^^^^^^^^^^
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
float3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
uint flipY;
float2x2 rotationMatrix;
};
Texture2D<float4> ext_tex_plane_1 : register(t2, space1);
cbuffer cbuffer_ext_tex_params : register(b3, space1) {
uint4 ext_tex_params[13];
};
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
float3 gammaCorrection(float3 v, GammaTransferParams params) {
const bool3 cond = (abs(v) < float3((params.D).xxx));
const float3 t = (sign(v) * ((params.C * abs(v)) + params.F));
const float3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), float3((params.G).xxx)) + params.E));
return (cond ? t : f);
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.SampleLevel(smp, coord, 0.0f).rgb;
} else {
color = mul(params.yuvToRgbConversionMatrix, float4(plane0.SampleLevel(smp, coord, 0.0f).r, plane1.SampleLevel(smp, coord, 0.0f).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = mul(color, params.gamutConversionMatrix);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
float3x4 tint_symbol_3(uint4 buffer[13], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
}
GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4;
const uint scalar_offset_6 = ((offset + 12u)) / 4;
const uint scalar_offset_7 = ((offset + 16u)) / 4;
const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_11;
}
float3x3 tint_symbol_7(uint4 buffer[13], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
}
float2x2 tint_symbol_9(uint4 buffer[13], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4;
uint4 ubo_load = buffer[scalar_offset_14 / 4];
const uint scalar_offset_15 = ((offset + 8u)) / 4;
uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const uint scalar_offset_18 = ((offset + 176u)) / 4;
const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_9(buffer, (offset + 184u))};
return tint_symbol_12;
}
void textureSampleLevel_979816() {
float2 arg_2 = (1.0f).xx;
float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, tint_symbol_1(ext_tex_params, 0u));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
textureSampleLevel_979816();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
textureSampleLevel_979816();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
textureSampleLevel_979816();
return;
}

View File

@ -0,0 +1,257 @@
builtins/gen/var/textureSampleLevel/979816.wgsl:29:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2);
^^^^^^^^^^^^^^^^^^
#version 310 es
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
}
vec4 vertex_main() {
textureSampleLevel_979816();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
}
void fragment_main() {
textureSampleLevel_979816();
}
void main() {
fragment_main();
return;
}
#version 310 es
struct GammaTransferParams {
float G;
float A;
float B;
float C;
float D;
float E;
float F;
uint padding;
};
struct ExternalTextureParams {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
mat2 rotationMatrix;
};
struct ExternalTextureParams_std140 {
uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
uint flipY;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 3, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
bvec3 cond = lessThan(abs(v), vec3(params.D));
vec3 t = (sign(v) * ((params.C * abs(v)) + params.F));
vec3 f = (sign(v) * (pow(((params.A * abs(v)) + params.B), vec3(params.G)) + params.E));
return mix(f, t, cond);
}
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = textureLod(plane0_smp, coord, 0.0f).rgb;
} else {
color = (vec4(textureLod(plane0_smp, coord, 0.0f).r, textureLod(plane1_smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return vec4(color, 1.0f);
}
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, val.flipY, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void textureSampleLevel_979816() {
vec2 arg_2 = vec2(1.0f);
vec4 res = textureSampleExternal(arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
}
void compute_main() {
textureSampleLevel_979816();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,98 @@
builtins/gen/var/textureSampleLevel/979816.wgsl:29:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2);
^^^^^^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct GammaTransferParams {
/* 0x0000 */ float G;
/* 0x0004 */ float A;
/* 0x0008 */ float B;
/* 0x000c */ float C;
/* 0x0010 */ float D;
/* 0x0014 */ float E;
/* 0x0018 */ float F;
/* 0x001c */ uint padding;
};
struct ExternalTextureParams {
/* 0x0000 */ uint numPlanes;
/* 0x0004 */ uint doYuvToRgbConversionOnly;
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ uint flipY;
/* 0x00b4 */ tint_array<int8_t, 4> tint_pad_1;
/* 0x00b8 */ float2x2 rotationMatrix;
/* 0x00c8 */ tint_array<int8_t, 8> tint_pad_2;
};
float3 gammaCorrection(float3 v, GammaTransferParams params) {
bool3 const cond = (fabs(v) < float3(params.D));
float3 const t = (sign(v) * ((params.C * fabs(v)) + params.F));
float3 const f = (sign(v) * (pow(((params.A * fabs(v)) + params.B), float3(params.G)) + params.E));
return select(f, t, cond);
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
float3 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = float4(plane0.sample(smp, coord, level(0.0f))).rgb;
} else {
color = (float4(plane0.sample(smp, coord, level(0.0f))[0], float4(plane1.sample(smp, coord, level(0.0f))).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams);
}
return float4(color, 1.0f);
}
void textureSampleLevel_979816(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams* const tint_symbol_4) {
float2 arg_2 = float2(1.0f);
float4 res = textureSampleExternal(tint_symbol_1, tint_symbol_2, tint_symbol_3, arg_2, *(tint_symbol_4));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, sampler tint_symbol_7, const constant ExternalTextureParams* const tint_symbol_8) {
textureSampleLevel_979816(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
return float4(0.0f);
}
vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], sampler tint_symbol_11 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_12 [[buffer(2)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], sampler tint_symbol_15 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_16 [[buffer(2)]]) {
textureSampleLevel_979816(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
return;
}
kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], sampler tint_symbol_19 [[sampler(0)]], const constant ExternalTextureParams* tint_symbol_20 [[buffer(2)]]) {
textureSampleLevel_979816(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
return;
}

View File

@ -0,0 +1,316 @@
builtins/gen/var/textureSampleLevel/979816.wgsl:29:24 warning: use of deprecated builtin
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2);
^^^^^^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 166
; Schema: 0
OpCapability Shader
%32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A"
OpMemberName %GammaTransferParams 2 "B"
OpMemberName %GammaTransferParams 3 "C"
OpMemberName %GammaTransferParams 4 "D"
OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "flipY"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 8 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
OpName %gammaCorrection "gammaCorrection"
OpName %v "v"
OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "flipY"
OpMemberName %ExternalTextureParams 7 "rotationMatrix"
OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0"
OpName %plane1 "plane1"
OpName %smp "smp"
OpName %coord "coord"
OpName %params_0 "params"
OpName %color "color"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %textureSampleLevel_979816 "textureSampleLevel_979816"
OpName %arg_2 "arg_2"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 2
OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8
OpMemberDecorate %GammaTransferParams 3 Offset 12
OpMemberDecorate %GammaTransferParams 4 Offset 16
OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpMemberDecorate %ExternalTextureParams_std140 8 Offset 192
OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 3
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 7 Offset 184
OpMemberDecorate %ExternalTextureParams 7 ColMajor
OpMemberDecorate %ExternalTextureParams 7 MatrixStride 8
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%11 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%uint = OpTypeInt 32 0
%mat3v4float = OpTypeMatrix %v4float 3
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%v2float = OpTypeVector %float 2
%ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %uint %v2float %v2float
%ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%25 = OpTypeSampler
%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
%26 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%46 = OpConstantNull %v3float
%mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %uint %mat2v2float
%66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
%uint_1 = OpConstant %uint 1
%84 = OpTypeSampledImage %11
%float_1 = OpConstant %float 1
%100 = OpConstantNull %uint
%118 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid
%133 = OpTypeFunction %void
%137 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%140 = OpConstantNull %v2float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%_ptr_Function_v4float = OpTypePointer Function %v4float
%153 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %26
%v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams
%30 = OpLabel
%44 = OpVariable %_ptr_Function_v3float Function %46
%56 = OpVariable %_ptr_Function_v3float Function %46
%62 = OpVariable %_ptr_Function_v3float Function %46
%31 = OpExtInst %v3float %32 FAbs %v
%33 = OpCompositeExtract %float %params 4
%34 = OpCompositeConstruct %v3float %33 %33 %33
%35 = OpFOrdLessThan %v3bool %31 %34
%38 = OpExtInst %v3float %32 FSign %v
%39 = OpCompositeExtract %float %params 3
%40 = OpExtInst %v3float %32 FAbs %v
%41 = OpVectorTimesScalar %v3float %40 %39
%42 = OpCompositeExtract %float %params 6
%47 = OpCompositeConstruct %v3float %42 %42 %42
%43 = OpFAdd %v3float %41 %47
%48 = OpFMul %v3float %38 %43
%49 = OpExtInst %v3float %32 FSign %v
%51 = OpCompositeExtract %float %params 1
%52 = OpExtInst %v3float %32 FAbs %v
%53 = OpVectorTimesScalar %v3float %52 %51
%54 = OpCompositeExtract %float %params 2
%57 = OpCompositeConstruct %v3float %54 %54 %54
%55 = OpFAdd %v3float %53 %57
%58 = OpCompositeExtract %float %params 0
%59 = OpCompositeConstruct %v3float %58 %58 %58
%50 = OpExtInst %v3float %32 Pow %55 %59
%60 = OpCompositeExtract %float %params 5
%63 = OpCompositeConstruct %v3float %60 %60 %60
%61 = OpFAdd %v3float %50 %63
%64 = OpFMul %v3float %49 %61
%65 = OpSelect %v3float %35 %48 %64
OpReturnValue %65
OpFunctionEnd
%textureSampleExternal = OpFunction %v4float None %66
%plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11
%smp = OpFunctionParameter %25
%coord = OpFunctionParameter %v2float
%params_0 = OpFunctionParameter %ExternalTextureParams
%75 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %46
%77 = OpCompositeExtract %uint %params_0 0
%79 = OpIEqual %bool %77 %uint_1
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
%85 = OpSampledImage %84 %plane0 %smp
%83 = OpImageSampleExplicitLod %v4float %85 %coord Lod %8
%86 = OpVectorShuffle %v3float %83 %83 0 1 2
OpStore %color %86
OpBranch %80
%82 = OpLabel
%88 = OpSampledImage %84 %plane0 %smp
%87 = OpImageSampleExplicitLod %v4float %88 %coord Lod %8
%89 = OpCompositeExtract %float %87 0
%91 = OpSampledImage %84 %plane1 %smp
%90 = OpImageSampleExplicitLod %v4float %91 %coord Lod %8
%92 = OpVectorShuffle %v2float %90 %90 0 1
%93 = OpCompositeExtract %float %92 0
%94 = OpCompositeExtract %float %92 1
%96 = OpCompositeConstruct %v4float %89 %93 %94 %float_1
%97 = OpCompositeExtract %mat3v4float %params_0 2
%98 = OpVectorTimesMatrix %v3float %96 %97
OpStore %color %98
OpBranch %80
%80 = OpLabel
%99 = OpCompositeExtract %uint %params_0 1
%101 = OpIEqual %bool %99 %100
OpSelectionMerge %102 None
OpBranchConditional %101 %103 %102
%103 = OpLabel
%105 = OpLoad %v3float %color
%106 = OpCompositeExtract %GammaTransferParams %params_0 3
%104 = OpFunctionCall %v3float %gammaCorrection %105 %106
OpStore %color %104
%107 = OpCompositeExtract %mat3v3float %params_0 5
%108 = OpLoad %v3float %color
%109 = OpMatrixTimesVector %v3float %107 %108
OpStore %color %109
%111 = OpLoad %v3float %color
%112 = OpCompositeExtract %GammaTransferParams %params_0 4
%110 = OpFunctionCall %v3float %gammaCorrection %111 %112
OpStore %color %110
OpBranch %102
%102 = OpLabel
%113 = OpLoad %v3float %color
%114 = OpCompositeExtract %float %113 0
%115 = OpCompositeExtract %float %113 1
%116 = OpCompositeExtract %float %113 2
%117 = OpCompositeConstruct %v4float %114 %115 %116 %float_1
OpReturnValue %117
OpFunctionEnd
%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %118
%val = OpFunctionParameter %ExternalTextureParams_std140
%121 = OpLabel
%122 = OpCompositeExtract %uint %val 0
%123 = OpCompositeExtract %uint %val 1
%124 = OpCompositeExtract %mat3v4float %val 2
%125 = OpCompositeExtract %GammaTransferParams %val 3
%126 = OpCompositeExtract %GammaTransferParams %val 4
%127 = OpCompositeExtract %mat3v3float %val 5
%128 = OpCompositeExtract %uint %val 6
%129 = OpCompositeExtract %v2float %val 7
%130 = OpCompositeExtract %v2float %val 8
%131 = OpCompositeConstruct %mat2v2float %129 %130
%132 = OpCompositeConstruct %ExternalTextureParams %122 %123 %124 %125 %126 %127 %128 %131
OpReturnValue %132
OpFunctionEnd
%textureSampleLevel_979816 = OpFunction %void None %133
%136 = OpLabel
%arg_2 = OpVariable %_ptr_Function_v2float Function %140
%res = OpVariable %_ptr_Function_v4float Function %5
OpStore %arg_2 %137
%142 = OpLoad %11 %arg_0
%143 = OpLoad %11 %ext_tex_plane_1
%144 = OpLoad %25 %arg_1
%145 = OpLoad %v2float %arg_2
%149 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%150 = OpLoad %ExternalTextureParams_std140 %149
%146 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %150
%141 = OpFunctionCall %v4float %textureSampleExternal %142 %143 %144 %145 %146
OpStore %res %141
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %153
%155 = OpLabel
%156 = OpFunctionCall %void %textureSampleLevel_979816
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %133
%158 = OpLabel
%159 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %159
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %133
%161 = OpLabel
%162 = OpFunctionCall %void %textureSampleLevel_979816
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %133
%164 = OpLabel
%165 = OpFunctionCall %void %textureSampleLevel_979816
OpReturn
OpFunctionEnd

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -49,14 +50,14 @@ float4 textureLoad2d(Texture2D<float4> tint_symbol, Texture2D<float4> ext_tex_pl
return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1); return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1);
} }
float3x4 tint_symbol_4(uint4 buffer[11], uint offset) { float3x4 tint_symbol_4(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_6(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_6(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -65,22 +66,30 @@ GammaTransferParams tint_symbol_6(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_10 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_10; return tint_symbol_12;
} }
float3x3 tint_symbol_8(uint4 buffer[11], uint offset) { float3x3 tint_symbol_8(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_2(uint4 buffer[11], uint offset) { float2x2 tint_symbol_10(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_11 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_11; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_2(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u)), tint_symbol_10(buffer, (offset + 176u))};
return tint_symbol_13;
} }
void doTextureLoad() { void doTextureLoad() {

View File

@ -15,11 +15,12 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix; float3x3 gamutConversionMatrix;
float2x2 rotationMatrix;
}; };
Texture2D<float4> ext_tex_plane_1 : register(t1, space1); Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
cbuffer cbuffer_ext_tex_params : register(b2, space1) { cbuffer cbuffer_ext_tex_params : register(b2, space1) {
uint4 ext_tex_params[11]; uint4 ext_tex_params[12];
}; };
Texture2D<float4> arg_0 : register(t0, space1); Texture2D<float4> arg_0 : register(t0, space1);
@ -49,14 +50,14 @@ float4 textureLoad2d(Texture2D<float4> tint_symbol, Texture2D<float4> ext_tex_pl
return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1); return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1);
} }
float3x4 tint_symbol_4(uint4 buffer[11], uint offset) { float3x4 tint_symbol_4(uint4 buffer[12], uint offset) {
const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset = ((offset + 0u)) / 4;
const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4;
const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4;
return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]));
} }
GammaTransferParams tint_symbol_6(uint4 buffer[11], uint offset) { GammaTransferParams tint_symbol_6(uint4 buffer[12], uint offset) {
const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 0u)) / 4;
const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4;
const uint scalar_offset_5 = ((offset + 8u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4;
@ -65,22 +66,30 @@ GammaTransferParams tint_symbol_6(uint4 buffer[11], uint offset) {
const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_8 = ((offset + 20u)) / 4;
const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4;
const uint scalar_offset_10 = ((offset + 28u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4;
const GammaTransferParams tint_symbol_10 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]};
return tint_symbol_10; return tint_symbol_12;
} }
float3x3 tint_symbol_8(uint4 buffer[11], uint offset) { float3x3 tint_symbol_8(uint4 buffer[12], uint offset) {
const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_11 = ((offset + 0u)) / 4;
const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4;
const uint scalar_offset_13 = ((offset + 32u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4;
return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz));
} }
ExternalTextureParams tint_symbol_2(uint4 buffer[11], uint offset) { float2x2 tint_symbol_10(uint4 buffer[12], uint offset) {
const uint scalar_offset_14 = ((offset + 0u)) / 4; const uint scalar_offset_14 = ((offset + 0u)) / 4;
const uint scalar_offset_15 = ((offset + 4u)) / 4; uint4 ubo_load = buffer[scalar_offset_14 / 4];
const ExternalTextureParams tint_symbol_11 = {buffer[scalar_offset_14 / 4][scalar_offset_14 % 4], buffer[scalar_offset_15 / 4][scalar_offset_15 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u))}; const uint scalar_offset_15 = ((offset + 8u)) / 4;
return tint_symbol_11; uint4 ubo_load_1 = buffer[scalar_offset_15 / 4];
return float2x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
}
ExternalTextureParams tint_symbol_2(uint4 buffer[12], uint offset) {
const uint scalar_offset_16 = ((offset + 0u)) / 4;
const uint scalar_offset_17 = ((offset + 4u)) / 4;
const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_16 / 4][scalar_offset_16 % 4], buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u)), tint_symbol_10(buffer, (offset + 176u))};
return tint_symbol_13;
} }
void doTextureLoad() { void doTextureLoad() {

View File

@ -18,10 +18,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -52,8 +64,12 @@ vec4 textureLoad2d(highp sampler2D tint_symbol_1, highp sampler2D ext_tex_plane_
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2; uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void doTextureLoad() { void doTextureLoad() {
vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, ext_tex_params.inner, ivec2(0)); vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, conv_ExternalTextureParams(ext_tex_params.inner), ivec2(0));
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -90,10 +106,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -124,8 +152,12 @@ vec4 textureLoad2d(highp sampler2D tint_symbol_1, highp sampler2D ext_tex_plane_
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2; uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void doTextureLoad() { void doTextureLoad() {
vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, ext_tex_params.inner, ivec2(0)); vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, conv_ExternalTextureParams(ext_tex_params.inner), ivec2(0));
} }
void fragment_main() { void fragment_main() {
@ -156,10 +188,22 @@ struct ExternalTextureParams {
GammaTransferParams gammaDecodeParams; GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams; GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix; mat3 gamutConversionMatrix;
mat2 rotationMatrix;
}; };
layout(binding = 2, std140) uniform ext_tex_params_block_ubo { struct ExternalTextureParams_std140 {
ExternalTextureParams inner; uint numPlanes;
uint doYuvToRgbConversionOnly;
mat3x4 yuvToRgbConversionMatrix;
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
vec2 rotationMatrix_0;
vec2 rotationMatrix_1;
};
layout(binding = 2, std140) uniform ext_tex_params_block_std140_ubo {
ExternalTextureParams_std140 inner;
} ext_tex_params; } ext_tex_params;
vec3 gammaCorrection(vec3 v, GammaTransferParams params) { vec3 gammaCorrection(vec3 v, GammaTransferParams params) {
@ -190,8 +234,12 @@ vec4 textureLoad2d(highp sampler2D tint_symbol_1, highp sampler2D ext_tex_plane_
uniform highp sampler2D arg_0_1; uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2; uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat2(val.rotationMatrix_0, val.rotationMatrix_1));
}
void doTextureLoad() { void doTextureLoad() {
vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, ext_tex_params.inner, ivec2(0)); vec4 res = textureLoad2d(arg_0_1, ext_tex_plane_1_2, conv_ExternalTextureParams(ext_tex_params.inner), ivec2(0));
} }
void compute_main() { void compute_main() {

View File

@ -33,6 +33,7 @@ struct ExternalTextureParams {
/* 0x0040 */ GammaTransferParams gammaDecodeParams; /* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams; /* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ float3x3 gamutConversionMatrix; /* 0x0080 */ float3x3 gamutConversionMatrix;
/* 0x00b0 */ float2x2 rotationMatrix;
}; };
float3 gammaCorrection(float3 v, GammaTransferParams params) { float3 gammaCorrection(float3 v, GammaTransferParams params) {

View File

@ -1,10 +1,10 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 146 ; Bound: 163
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450" %29 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -14,13 +14,13 @@
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %ext_tex_plane_1 "ext_tex_plane_1" OpName %ext_tex_plane_1 "ext_tex_plane_1"
OpName %ext_tex_params_block "ext_tex_params_block" OpName %ext_tex_params_block_std140 "ext_tex_params_block_std140"
OpMemberName %ext_tex_params_block 0 "inner" OpMemberName %ext_tex_params_block_std140 0 "inner"
OpName %ExternalTextureParams "ExternalTextureParams" OpName %ExternalTextureParams_std140 "ExternalTextureParams_std140"
OpMemberName %ExternalTextureParams 0 "numPlanes" OpMemberName %ExternalTextureParams_std140 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly" OpMemberName %ExternalTextureParams_std140 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix" OpMemberName %ExternalTextureParams_std140 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams" OpMemberName %ExternalTextureParams_std140 3 "gammaDecodeParams"
OpName %GammaTransferParams "GammaTransferParams" OpName %GammaTransferParams "GammaTransferParams"
OpMemberName %GammaTransferParams 0 "G" OpMemberName %GammaTransferParams 0 "G"
OpMemberName %GammaTransferParams 1 "A" OpMemberName %GammaTransferParams 1 "A"
@ -30,13 +30,23 @@
OpMemberName %GammaTransferParams 5 "E" OpMemberName %GammaTransferParams 5 "E"
OpMemberName %GammaTransferParams 6 "F" OpMemberName %GammaTransferParams 6 "F"
OpMemberName %GammaTransferParams 7 "padding" OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams" OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix" OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams_std140 6 "rotationMatrix_0"
OpMemberName %ExternalTextureParams_std140 7 "rotationMatrix_1"
OpName %ext_tex_params "ext_tex_params" OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0" OpName %arg_0 "arg_0"
OpName %gammaCorrection "gammaCorrection" OpName %gammaCorrection "gammaCorrection"
OpName %v "v" OpName %v "v"
OpName %params "params" OpName %params "params"
OpName %ExternalTextureParams "ExternalTextureParams"
OpMemberName %ExternalTextureParams 0 "numPlanes"
OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
OpMemberName %ExternalTextureParams 6 "rotationMatrix"
OpName %textureLoadExternal "textureLoadExternal" OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0" OpName %plane0 "plane0"
OpName %plane1 "plane1" OpName %plane1 "plane1"
@ -48,6 +58,8 @@
OpName %ext_tex_plane_1_1 "ext_tex_plane_1_1" OpName %ext_tex_plane_1_1 "ext_tex_plane_1_1"
OpName %ext_tex_params_1 "ext_tex_params_1" OpName %ext_tex_params_1 "ext_tex_params_1"
OpName %coords "coords" OpName %coords "coords"
OpName %conv_ExternalTextureParams "conv_ExternalTextureParams"
OpName %val "val"
OpName %doTextureLoad "doTextureLoad" OpName %doTextureLoad "doTextureLoad"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -58,14 +70,14 @@
OpDecorate %vertex_point_size BuiltIn PointSize OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %ext_tex_plane_1 DescriptorSet 1 OpDecorate %ext_tex_plane_1 DescriptorSet 1
OpDecorate %ext_tex_plane_1 Binding 1 OpDecorate %ext_tex_plane_1 Binding 1
OpDecorate %ext_tex_params_block Block OpDecorate %ext_tex_params_block_std140 Block
OpMemberDecorate %ext_tex_params_block 0 Offset 0 OpMemberDecorate %ext_tex_params_block_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0 OpMemberDecorate %ExternalTextureParams_std140 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4 OpMemberDecorate %ExternalTextureParams_std140 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16 OpMemberDecorate %ExternalTextureParams_std140 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor OpMemberDecorate %ExternalTextureParams_std140 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64 OpMemberDecorate %ExternalTextureParams_std140 3 Offset 64
OpMemberDecorate %GammaTransferParams 0 Offset 0 OpMemberDecorate %GammaTransferParams 0 Offset 0
OpMemberDecorate %GammaTransferParams 1 Offset 4 OpMemberDecorate %GammaTransferParams 1 Offset 4
OpMemberDecorate %GammaTransferParams 2 Offset 8 OpMemberDecorate %GammaTransferParams 2 Offset 8
@ -74,15 +86,30 @@
OpMemberDecorate %GammaTransferParams 5 Offset 20 OpMemberDecorate %GammaTransferParams 5 Offset 20
OpMemberDecorate %GammaTransferParams 6 Offset 24 OpMemberDecorate %GammaTransferParams 6 Offset 24
OpMemberDecorate %GammaTransferParams 7 Offset 28 OpMemberDecorate %GammaTransferParams 7 Offset 28
OpMemberDecorate %ExternalTextureParams 4 Offset 96 OpMemberDecorate %ExternalTextureParams_std140 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128 OpMemberDecorate %ExternalTextureParams_std140 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor OpMemberDecorate %ExternalTextureParams_std140 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16 OpMemberDecorate %ExternalTextureParams_std140 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams_std140 6 Offset 176
OpMemberDecorate %ExternalTextureParams_std140 7 Offset 184
OpDecorate %ext_tex_params NonWritable OpDecorate %ext_tex_params NonWritable
OpDecorate %ext_tex_params DescriptorSet 1 OpDecorate %ext_tex_params DescriptorSet 1
OpDecorate %ext_tex_params Binding 2 OpDecorate %ext_tex_params Binding 2
OpDecorate %arg_0 DescriptorSet 1 OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0 OpDecorate %arg_0 Binding 0
OpMemberDecorate %ExternalTextureParams 0 Offset 0
OpMemberDecorate %ExternalTextureParams 1 Offset 4
OpMemberDecorate %ExternalTextureParams 2 Offset 16
OpMemberDecorate %ExternalTextureParams 2 ColMajor
OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 3 Offset 64
OpMemberDecorate %ExternalTextureParams 4 Offset 96
OpMemberDecorate %ExternalTextureParams 5 Offset 128
OpMemberDecorate %ExternalTextureParams 5 ColMajor
OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
OpMemberDecorate %ExternalTextureParams 6 Offset 176
OpMemberDecorate %ExternalTextureParams 6 ColMajor
OpMemberDecorate %ExternalTextureParams 6 MatrixStride 8
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -99,162 +126,181 @@
%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint %GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3 %mat3v3float = OpTypeMatrix %v3float 3
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float = OpTypeVector %float 2
%ext_tex_params_block = OpTypeStruct %ExternalTextureParams %ExternalTextureParams_std140 = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %v2float %v2float
%_ptr_Uniform_ext_tex_params_block = OpTypePointer Uniform %ext_tex_params_block %ext_tex_params_block_std140 = OpTypeStruct %ExternalTextureParams_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block Uniform %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
%ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
%22 = OpTypeFunction %v3float %v3float %GammaTransferParams %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
%bool = OpTypeBool %bool = OpTypeBool
%v3bool = OpTypeVector %bool 3 %v3bool = OpTypeVector %bool 3
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%42 = OpConstantNull %v3float %43 = OpConstantNull %v3float
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2 %v2int = OpTypeVector %int 2
%62 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams %mat2v2float = OpTypeMatrix %v2float 2
%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat2v2float
%63 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
%uint_1 = OpConstant %uint 1 %uint_1 = OpConstant %uint 1
%79 = OpConstantNull %int %82 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%93 = OpConstantNull %uint %95 = OpConstantNull %uint
%111 = OpTypeFunction %v4float %11 %11 %ExternalTextureParams %v2int %113 = OpTypeFunction %v4float %11 %11 %ExternalTextureParams %v2int
%121 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
%void = OpTypeVoid %void = OpTypeVoid
%119 = OpTypeFunction %void %135 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0 %uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
%130 = OpConstantNull %v2int %147 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%133 = OpTypeFunction %v4float %150 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22 %gammaCorrection = OpFunction %v3float None %23
%v = OpFunctionParameter %v3float %v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams %params = OpFunctionParameter %GammaTransferParams
%26 = OpLabel %27 = OpLabel
%40 = OpVariable %_ptr_Function_v3float Function %42 %41 = OpVariable %_ptr_Function_v3float Function %43
%52 = OpVariable %_ptr_Function_v3float Function %42 %53 = OpVariable %_ptr_Function_v3float Function %43
%58 = OpVariable %_ptr_Function_v3float Function %42 %59 = OpVariable %_ptr_Function_v3float Function %43
%27 = OpExtInst %v3float %28 FAbs %v %28 = OpExtInst %v3float %29 FAbs %v
%29 = OpCompositeExtract %float %params 4 %30 = OpCompositeExtract %float %params 4
%30 = OpCompositeConstruct %v3float %29 %29 %29 %31 = OpCompositeConstruct %v3float %30 %30 %30
%31 = OpFOrdLessThan %v3bool %27 %30 %32 = OpFOrdLessThan %v3bool %28 %31
%34 = OpExtInst %v3float %28 FSign %v %35 = OpExtInst %v3float %29 FSign %v
%35 = OpCompositeExtract %float %params 3 %36 = OpCompositeExtract %float %params 3
%36 = OpExtInst %v3float %28 FAbs %v %37 = OpExtInst %v3float %29 FAbs %v
%37 = OpVectorTimesScalar %v3float %36 %35 %38 = OpVectorTimesScalar %v3float %37 %36
%38 = OpCompositeExtract %float %params 6 %39 = OpCompositeExtract %float %params 6
%43 = OpCompositeConstruct %v3float %38 %38 %38 %44 = OpCompositeConstruct %v3float %39 %39 %39
%39 = OpFAdd %v3float %37 %43 %40 = OpFAdd %v3float %38 %44
%44 = OpFMul %v3float %34 %39 %45 = OpFMul %v3float %35 %40
%45 = OpExtInst %v3float %28 FSign %v %46 = OpExtInst %v3float %29 FSign %v
%47 = OpCompositeExtract %float %params 1 %48 = OpCompositeExtract %float %params 1
%48 = OpExtInst %v3float %28 FAbs %v %49 = OpExtInst %v3float %29 FAbs %v
%49 = OpVectorTimesScalar %v3float %48 %47 %50 = OpVectorTimesScalar %v3float %49 %48
%50 = OpCompositeExtract %float %params 2 %51 = OpCompositeExtract %float %params 2
%53 = OpCompositeConstruct %v3float %50 %50 %50 %54 = OpCompositeConstruct %v3float %51 %51 %51
%51 = OpFAdd %v3float %49 %53 %52 = OpFAdd %v3float %50 %54
%54 = OpCompositeExtract %float %params 0 %55 = OpCompositeExtract %float %params 0
%55 = OpCompositeConstruct %v3float %54 %54 %54 %56 = OpCompositeConstruct %v3float %55 %55 %55
%46 = OpExtInst %v3float %28 Pow %51 %55 %47 = OpExtInst %v3float %29 Pow %52 %56
%56 = OpCompositeExtract %float %params 5 %57 = OpCompositeExtract %float %params 5
%59 = OpCompositeConstruct %v3float %56 %56 %56 %60 = OpCompositeConstruct %v3float %57 %57 %57
%57 = OpFAdd %v3float %46 %59 %58 = OpFAdd %v3float %47 %60
%60 = OpFMul %v3float %45 %57 %61 = OpFMul %v3float %46 %58
%61 = OpSelect %v3float %31 %44 %60 %62 = OpSelect %v3float %32 %45 %61
OpReturnValue %61 OpReturnValue %62
OpFunctionEnd OpFunctionEnd
%textureLoadExternal = OpFunction %v4float None %62 %textureLoadExternal = OpFunction %v4float None %63
%plane0 = OpFunctionParameter %11 %plane0 = OpFunctionParameter %11
%plane1 = OpFunctionParameter %11 %plane1 = OpFunctionParameter %11
%coord = OpFunctionParameter %v2int %coord = OpFunctionParameter %v2int
%params_0 = OpFunctionParameter %ExternalTextureParams %params_0 = OpFunctionParameter %ExternalTextureParams
%70 = OpLabel %73 = OpLabel
%color = OpVariable %_ptr_Function_v3float Function %42 %color = OpVariable %_ptr_Function_v3float Function %43
%72 = OpCompositeExtract %uint %params_0 0 %75 = OpCompositeExtract %uint %params_0 0
%74 = OpIEqual %bool %72 %uint_1 %77 = OpIEqual %bool %75 %uint_1
OpSelectionMerge %75 None OpSelectionMerge %78 None
OpBranchConditional %74 %76 %77 OpBranchConditional %77 %79 %80
%76 = OpLabel %79 = OpLabel
%78 = OpImageFetch %v4float %plane0 %coord Lod %79 %81 = OpImageFetch %v4float %plane0 %coord Lod %82
%80 = OpVectorShuffle %v3float %78 %78 0 1 2 %83 = OpVectorShuffle %v3float %81 %81 0 1 2
OpStore %color %80 OpStore %color %83
OpBranch %75 OpBranch %78
%77 = OpLabel %80 = OpLabel
%81 = OpImageFetch %v4float %plane0 %coord Lod %79 %84 = OpImageFetch %v4float %plane0 %coord Lod %82
%82 = OpCompositeExtract %float %81 0 %85 = OpCompositeExtract %float %84 0
%83 = OpImageFetch %v4float %plane1 %coord Lod %79 %86 = OpImageFetch %v4float %plane1 %coord Lod %82
%85 = OpVectorShuffle %v2float %83 %83 0 1 %87 = OpVectorShuffle %v2float %86 %86 0 1
%86 = OpCompositeExtract %float %85 0 %88 = OpCompositeExtract %float %87 0
%87 = OpCompositeExtract %float %85 1 %89 = OpCompositeExtract %float %87 1
%89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1 %91 = OpCompositeConstruct %v4float %85 %88 %89 %float_1
%90 = OpCompositeExtract %mat3v4float %params_0 2 %92 = OpCompositeExtract %mat3v4float %params_0 2
%91 = OpVectorTimesMatrix %v3float %89 %90 %93 = OpVectorTimesMatrix %v3float %91 %92
OpStore %color %91 OpStore %color %93
OpBranch %75 OpBranch %78
%75 = OpLabel %78 = OpLabel
%92 = OpCompositeExtract %uint %params_0 1 %94 = OpCompositeExtract %uint %params_0 1
%94 = OpIEqual %bool %92 %93 %96 = OpIEqual %bool %94 %95
OpSelectionMerge %95 None OpSelectionMerge %97 None
OpBranchConditional %94 %96 %95 OpBranchConditional %96 %98 %97
%96 = OpLabel %98 = OpLabel
%98 = OpLoad %v3float %color %100 = OpLoad %v3float %color
%99 = OpCompositeExtract %GammaTransferParams %params_0 3 %101 = OpCompositeExtract %GammaTransferParams %params_0 3
%97 = OpFunctionCall %v3float %gammaCorrection %98 %99 %99 = OpFunctionCall %v3float %gammaCorrection %100 %101
OpStore %color %97 OpStore %color %99
%100 = OpCompositeExtract %mat3v3float %params_0 5 %102 = OpCompositeExtract %mat3v3float %params_0 5
%101 = OpLoad %v3float %color %103 = OpLoad %v3float %color
%102 = OpMatrixTimesVector %v3float %100 %101 %104 = OpMatrixTimesVector %v3float %102 %103
OpStore %color %102 OpStore %color %104
%104 = OpLoad %v3float %color
%105 = OpCompositeExtract %GammaTransferParams %params_0 4
%103 = OpFunctionCall %v3float %gammaCorrection %104 %105
OpStore %color %103
OpBranch %95
%95 = OpLabel
%106 = OpLoad %v3float %color %106 = OpLoad %v3float %color
%107 = OpCompositeExtract %float %106 0 %107 = OpCompositeExtract %GammaTransferParams %params_0 4
%108 = OpCompositeExtract %float %106 1 %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
%109 = OpCompositeExtract %float %106 2 OpStore %color %105
%110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1 OpBranch %97
OpReturnValue %110 %97 = OpLabel
%108 = OpLoad %v3float %color
%109 = OpCompositeExtract %float %108 0
%110 = OpCompositeExtract %float %108 1
%111 = OpCompositeExtract %float %108 2
%112 = OpCompositeConstruct %v4float %109 %110 %111 %float_1
OpReturnValue %112
OpFunctionEnd OpFunctionEnd
%textureLoad2d = OpFunction %v4float None %111 %textureLoad2d = OpFunction %v4float None %113
%texture = OpFunctionParameter %11 %texture = OpFunctionParameter %11
%ext_tex_plane_1_1 = OpFunctionParameter %11 %ext_tex_plane_1_1 = OpFunctionParameter %11
%ext_tex_params_1 = OpFunctionParameter %ExternalTextureParams %ext_tex_params_1 = OpFunctionParameter %ExternalTextureParams
%coords = OpFunctionParameter %v2int %coords = OpFunctionParameter %v2int
%117 = OpLabel %119 = OpLabel
%118 = OpFunctionCall %v4float %textureLoadExternal %texture %ext_tex_plane_1_1 %coords %ext_tex_params_1 %120 = OpFunctionCall %v4float %textureLoadExternal %texture %ext_tex_plane_1_1 %coords %ext_tex_params_1
OpReturnValue %118 OpReturnValue %120
OpFunctionEnd OpFunctionEnd
%doTextureLoad = OpFunction %void None %119 %conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %121
%122 = OpLabel %val = OpFunctionParameter %ExternalTextureParams_std140
%124 = OpLabel
%125 = OpCompositeExtract %uint %val 0
%126 = OpCompositeExtract %uint %val 1
%127 = OpCompositeExtract %mat3v4float %val 2
%128 = OpCompositeExtract %GammaTransferParams %val 3
%129 = OpCompositeExtract %GammaTransferParams %val 4
%130 = OpCompositeExtract %mat3v3float %val 5
%131 = OpCompositeExtract %v2float %val 6
%132 = OpCompositeExtract %v2float %val 7
%133 = OpCompositeConstruct %mat2v2float %131 %132
%134 = OpCompositeConstruct %ExternalTextureParams %125 %126 %127 %128 %129 %130 %133
OpReturnValue %134
OpFunctionEnd
%doTextureLoad = OpFunction %void None %135
%138 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%124 = OpLoad %11 %arg_0 %140 = OpLoad %11 %arg_0
%125 = OpLoad %11 %ext_tex_plane_1 %141 = OpLoad %11 %ext_tex_plane_1
%128 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0 %145 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
%129 = OpLoad %ExternalTextureParams %128 %146 = OpLoad %ExternalTextureParams_std140 %145
%123 = OpFunctionCall %v4float %textureLoad2d %124 %125 %129 %130 %142 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %146
OpStore %res %123 %139 = OpFunctionCall %v4float %textureLoad2d %140 %141 %142 %147
OpStore %res %139
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %133 %vertex_main_inner = OpFunction %v4float None %150
%135 = OpLabel %152 = OpLabel
%136 = OpFunctionCall %void %doTextureLoad %153 = OpFunctionCall %void %doTextureLoad
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %119 %vertex_main = OpFunction %void None %135
%138 = OpLabel %155 = OpLabel
%139 = OpFunctionCall %v4float %vertex_main_inner %156 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %139 OpStore %value %156
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %119 %fragment_main = OpFunction %void None %135
%141 = OpLabel %158 = OpLabel
%142 = OpFunctionCall %void %doTextureLoad %159 = OpFunctionCall %void %doTextureLoad
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %119 %compute_main = OpFunction %void None %135
%144 = OpLabel %161 = OpLabel
%145 = OpFunctionCall %void %doTextureLoad %162 = OpFunctionCall %void %doTextureLoad
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd