Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dfdutils-included vulkan_core.h. #783

Merged
merged 16 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ script:
if [ "$CHECK_REUSE" = "YES" -o "$CHECK_REUSE" = "ONLY" ]; then
echo "Calling reuse lint."
set -e # because the if below swallows a bad exit status.
reuse lint
reuse --suppress-deprecation lint
set +e
fi
if [ "$CHECK_REUSE" != "ONLY" ]; then
Expand Down
18 changes: 10 additions & 8 deletions cmake/mkvk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@

# Code generation scripts that require a Vulkan SDK installation

set(skip_mkvk_message "-> skipping mkvk target (this is harmless; only needed when re-generating of vulkan headers and dfdutils is required)")
#set(skip_mkvk_message "-> skipping mkvk target (this is harmless; only needed when re-generating of vulkan headers and dfdutils is required)")

if (NOT IOS)
# find_package doesn't find the Vulkan SDK when building for IOS.
# I haven't investigated why.
find_package(Vulkan)
if(NOT Vulkan_FOUND)
message(STATUS "Vulkan SDK not found ${skip_mkvk_message}")
return()
endif()
# Not needed as local custom vulkan_core.h is used. Keeping
# in case we go back to the standard one.
# # find_package doesn't find the Vulkan SDK when building for IOS.
# # I haven't investigated why.
# find_package(Vulkan)
# if(NOT Vulkan_FOUND)
# message(STATUS "Vulkan SDK not found ${skip_mkvk_message}")
# return()
# endif()
else()
# Skip mkvk. We don't need to run it when building for iOS.
return()
Expand Down
16 changes: 16 additions & 0 deletions interface/java_binding/src/main/java/org/khronos/ktx/VkFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,22 @@ public class VkFormat {
public static final int VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005;
public static final int VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006;
public static final int VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007;
public static final int VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000;
public static final int VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001;
public static final int VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002;
public static final int VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003;
public static final int VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004;
public static final int VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005;
public static final int VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006;
public static final int VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007;
public static final int VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008;
public static final int VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009;
public static final int VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010;
public static final int VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011;
public static final int VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012;
public static final int VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013;
public static final int VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000;
public static final int VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001;
public static final int VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = 1000066000;
public static final int VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = 1000066001;
public static final int VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = 1000066002;
Expand Down
18 changes: 14 additions & 4 deletions lib/dfdutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ targets := testcreatedfd testinterpretdfd testbidirectionalmapping doc

all: $(addprefix out/,${targets})

CFLAGS=-I.

# Note. Currently we use an unreleased version of vulkan_core.h with enums
# for ASTC 3D. Since this is temporary, the sources still use <angled>
# includes. The -I. causes our local copy to be found while the VULKAN_SDK
# part keeps compilers from warning that the file was not found with
# <angled> include.
$(out)/testcreatedfd: createdfd.c createdfdtest.c printdfd.c vk2dfd.c vk2dfd.inl KHR/khr_df.h dfd.h | out
gcc createdfdtest.c createdfd.c printdfd.c -I. $(if VULKAN_SDK,-I${VULKAN_SDK}/include) -o $@ -std=c99 -W -Wall -pedantic -O2 -Wno-strict-aliasing
gcc createdfdtest.c createdfd.c printdfd.c -I. $(if $(VULKAN_SDK),-I$(VULKAN_SDK)/include) -o $@ -std=c99 -W -Wall -pedantic -O2 -Wno-strict-aliasing -Wno-unused-parameter

$(out)/testinterpretdfd: createdfd.c interpretdfd.c interpretdfdtest.c printdfd.c KHR/khr_df.h dfd.h | out
gcc interpretdfd.c createdfd.c interpretdfdtest.c printdfd.c -o $@ -I. $(if VULKAN_SDK,-I${VULKAN_SDK}/include) -O -W -Wall -std=c99 -pedantic
gcc interpretdfd.c createdfd.c interpretdfdtest.c printdfd.c -o $@ -I. $(if $(VULKAN_SDK),-I$(VULKAN_SDK)/include) -O -W -Wall -std=c99 -pedantic -Wno-unused-parameter

$(out)/testbidirectionalmapping: testbidirectionalmapping.c interpretdfd.c createdfd.c dfd2vk.c dfd2vk.inl vk2dfd.c vk2dfd.inl KHR/khr_df.h dfd.h | out
gcc testbidirectionalmapping.c interpretdfd.c createdfd.c -o $@ -I. $(if VULKAN_SDK,-I${VULKAN_SDK}/include) -g -W -Wall -std=c99 -pedantic
gcc testbidirectionalmapping.c interpretdfd.c createdfd.c -o $@ -I. $(if $(VULKAN_SDK),-I$(VULKAN_SDK)/include) -g -W -Wall -std=c99 -pedantic -Wno-unused-parameter

$(out)/doc: colourspaces.c createdfd.c createdfdtest.c printdfd.c queries.c KHR/khr_df.h dfd.h | out
doxygen dfdutils.doxy
Expand All @@ -28,20 +30,28 @@ build out:
mkdir -p $@

clean:
rm -rf $(out)/dfd2vk.o $(out)/vk2dfd.o

clobber: clean
rm -rf $(addprefix out/,${targets})

doc: $(out)/doc

switches: dfd2vk.inl vk2dfd.inl
# Generate the switch bodies and test build the including code.
switches: dfd2vk.inl $(out)/dfd2vk.o vk2dfd.inl $(out)/vk2dfd.o

dfd2vk.inl: vulkan/vulkan_core.h makedfd2vk.pl
./makedfd2vk.pl $< $@

vk2dfd.inl: vulkan/vulkan_core.h makevk2dfd.pl
./makevk2dfd.pl $< $@

$(out)/vk2dfd.o: vk2dfd.c | $(out)
cc -c -o $@ -I . $<

$(out)/dfd2vk.o: dfd2vk.c | $(out)
cc -c -o $@ -I . $<

# For those who wish to generate a project from the gyp file so
# as to use xcode for debugging.
xcodeproj: build/project.pbxproj
Expand Down
2 changes: 1 addition & 1 deletion lib/dfdutils/createdfdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#define TESTRGB565 1

int main()
int main(int argc, char** argv)
{
#ifdef TESTRGBA8888
uint32_t *DFD = createDFDUnpacked(0, 4, 1, 1, s_UNORM);
Expand Down
Loading