From cc8472a04ba110fe999c686d07af40f7839051fd Mon Sep 17 00:00:00 2001 From: elasota Date: Tue, 21 Aug 2018 20:50:38 -0400 Subject: [PATCH] Update copyright notices and API, fix GCC/Clang compile --- ConvectionKernels/ConvectionKernels.cpp | 4 +- ConvectionKernels/ConvectionKernels.h | 23 +++++++++++ DirectXTex/BCParallel.cpp | 52 ++++++++++++------------- 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/ConvectionKernels/ConvectionKernels.cpp b/ConvectionKernels/ConvectionKernels.cpp index b807d88f..6661d812 100644 --- a/ConvectionKernels/ConvectionKernels.cpp +++ b/ConvectionKernels/ConvectionKernels.cpp @@ -1,5 +1,5 @@ /* -Based on codec from Convection Texture Tools +Convection Texture Tools Copyright (c) 2018 Eric Lasota Permission is hereby granted, free of charge, to any person obtaining @@ -23,6 +23,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------------- +Portions based on DirectX Texture Library (DirectXTex) + Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. diff --git a/ConvectionKernels/ConvectionKernels.h b/ConvectionKernels/ConvectionKernels.h index 9703dc91..fb5ca130 100644 --- a/ConvectionKernels/ConvectionKernels.h +++ b/ConvectionKernels/ConvectionKernels.h @@ -1,3 +1,26 @@ +/* +Convection Texture Tools +Copyright (c) 2018 Eric Lasota + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ #pragma once #ifndef __CVTT_CONVECTION_KERNELS__ #define __CVTT_CONVECTION_KERNELS__ diff --git a/DirectXTex/BCParallel.cpp b/DirectXTex/BCParallel.cpp index db5cabd0..12a4ceb8 100644 --- a/DirectXTex/BCParallel.cpp +++ b/DirectXTex/BCParallel.cpp @@ -38,11 +38,11 @@ static_assert(NUM_PARALLEL_BLOCKS == cvtt::NumParallelBlocks, "NUM_PARALLEL_BLOC using namespace DirectX; using namespace DirectX::PackedVector; -static void PrepareInputBlockU8(cvtt::InputBlockU8 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) +static void PreparePixelBlockU8(cvtt::PixelBlockU8 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) { for (size_t block = 0; block < cvtt::NumParallelBlocks; block++) { - cvtt::InputBlockU8& inputBlock = inputBlocks[block]; + cvtt::PixelBlockU8& inputBlock = inputBlocks[block]; for (size_t px = 0; px < NUM_PIXELS_PER_BLOCK; px++) { @@ -54,11 +54,11 @@ static void PrepareInputBlockU8(cvtt::InputBlockU8 inputBlocks[cvtt::NumParallel } } -static void PrepareInputBlockS8(cvtt::InputBlockS8 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) +static void PreparePixelBlockS8(cvtt::PixelBlockS8 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) { for (size_t block = 0; block < cvtt::NumParallelBlocks; block++) { - cvtt::InputBlockS8& inputBlock = inputBlocks[block]; + cvtt::PixelBlockS8& inputBlock = inputBlocks[block]; for (size_t px = 0; px < NUM_PIXELS_PER_BLOCK; px++) { @@ -70,11 +70,11 @@ static void PrepareInputBlockS8(cvtt::InputBlockS8 inputBlocks[cvtt::NumParallel } } -static void PrepareInputBlockF16(cvtt::InputBlockF16 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) +static void PreparePixelBlockF16(cvtt::PixelBlockF16 inputBlocks[cvtt::NumParallelBlocks], const XMVECTOR *&pColor) { for (size_t block = 0; block < cvtt::NumParallelBlocks; block++) { - cvtt::InputBlockF16& inputBlock = inputBlocks[block]; + cvtt::PixelBlockF16& inputBlock = inputBlocks[block]; XMHALF4 packedHalfs[NUM_PIXELS_PER_BLOCK]; @@ -112,8 +112,8 @@ void DirectX::D3DXEncodeBC7Parallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC7(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -123,8 +123,8 @@ void DirectX::D3DXEncodeBC6HUParallel(uint8_t *pBC, const XMVECTOR *pColor, cons assert(pColor); assert(pBC); - cvtt::InputBlockF16 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockF16(inputBlocks, pColor); + cvtt::PixelBlockF16 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockF16(inputBlocks, pColor); cvtt::Kernels::EncodeBC6HU(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -134,8 +134,8 @@ void DirectX::D3DXEncodeBC6HSParallel(uint8_t *pBC, const XMVECTOR *pColor, cons assert(pColor); assert(pBC); - cvtt::InputBlockF16 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockF16(inputBlocks, pColor); + cvtt::PixelBlockF16 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockF16(inputBlocks, pColor); cvtt::Kernels::EncodeBC6HS(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -145,8 +145,8 @@ void DirectX::D3DXEncodeBC1Parallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC1(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -156,8 +156,8 @@ void DirectX::D3DXEncodeBC2Parallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC2(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -167,8 +167,8 @@ void DirectX::D3DXEncodeBC3Parallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC3(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -177,8 +177,8 @@ void DirectX::D3DXEncodeBC4UParallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC4U(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -187,8 +187,8 @@ void DirectX::D3DXEncodeBC4SParallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockS8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockS8(inputBlocks, pColor); + cvtt::PixelBlockS8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockS8(inputBlocks, pColor); cvtt::Kernels::EncodeBC4S(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -197,8 +197,8 @@ void DirectX::D3DXEncodeBC5UParallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockU8(inputBlocks, pColor); + cvtt::PixelBlockU8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockU8(inputBlocks, pColor); cvtt::Kernels::EncodeBC5U(pBC, inputBlocks, GenerateCVTTOptions(options)); } @@ -208,7 +208,7 @@ void DirectX::D3DXEncodeBC5SParallel(uint8_t *pBC, const XMVECTOR *pColor, const assert(pColor); assert(pBC); - cvtt::InputBlockS8 inputBlocks[NUM_PARALLEL_BLOCKS]; - PrepareInputBlockS8(inputBlocks, pColor); + cvtt::PixelBlockS8 inputBlocks[NUM_PARALLEL_BLOCKS]; + PreparePixelBlockS8(inputBlocks, pColor); cvtt::Kernels::EncodeBC5S(pBC, inputBlocks, GenerateCVTTOptions(options)); }