Skip to content

Commit

Permalink
Update copyright notices and API, fix GCC/Clang compile
Browse files Browse the repository at this point in the history
  • Loading branch information
elasota committed Aug 22, 2018
1 parent 671bd63 commit cc8472a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 27 deletions.
4 changes: 3 additions & 1 deletion ConvectionKernels/ConvectionKernels.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

Expand Down
23 changes: 23 additions & 0 deletions ConvectionKernels/ConvectionKernels.h
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
52 changes: 26 additions & 26 deletions DirectXTex/BCParallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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++)
{
Expand All @@ -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];

Expand Down Expand Up @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

Expand All @@ -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));
}

0 comments on commit cc8472a

Please sign in to comment.