From 3d5546600fb4c585b6f6f6dcdb5e122698d1225e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 5 Mar 2019 14:53:44 -0500 Subject: Hotfix/texture2d gather (#876) * First pass test to see if GatherRed works. * Add support for generating R_Float32 textures. * Set default texture format. * * Alter the texture2d-gather to work with a R_Float32 texture * Add support for scalar Texture2d types with GatherXXX in stdlib * Remove some left over commented out test code from texture2d-gather.hlsl --- tools/render-test/shader-renderer-util.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/render-test/shader-renderer-util.cpp') diff --git a/tools/render-test/shader-renderer-util.cpp b/tools/render-test/shader-renderer-util.cpp index 0d0f8a3a5..3dc717c5b 100644 --- a/tools/render-test/shader-renderer-util.cpp +++ b/tools/render-test/shader-renderer-util.cpp @@ -28,7 +28,10 @@ void BindingStateImpl::apply(Renderer* renderer, PipelineType pipelineType) TextureResource::Desc textureResourceDesc; textureResourceDesc.init(Resource::Type::Unknown); - textureResourceDesc.format = Format::RGBA_Unorm_UInt8; + // Default to RGBA_Unorm_UInt8 + const Format format = (inputDesc.format == Format::Unknown) ? Format::RGBA_Unorm_UInt8 : inputDesc.format; + + textureResourceDesc.format = format; textureResourceDesc.numMipLevels = texData.mipLevels; textureResourceDesc.arraySize = inputDesc.arrayLength; textureResourceDesc.bindFlags = bindFlags; -- cgit v1.2.3