<commit_before>#include "V3DDevice.h"
#include "V3DInstance.h"
#include "V3DAdapter.h"
#include "V3DFence.h"
#include "V3DQueryPool.h"
#include "V3DQueue.h"
#include "V3DCommandPool.h"
#include "V3DCommandBuffer.h"
#include "V3DSwapChain.h"
#include "V3DShaderModule.h"
#include "V3DResourceMemory.h"
#include "V3DBuffer.h"
#include "V3DImage.h"
#include "V3DBufferView.h"
#include "V3DImageView.h"
#include "V3DSampler.h"
#include "V3DRenderPass.h"
#include "V3DFrameBuffer.h"
#include "V3DDescriptorSetLayout.h"
#include "V3DDescriptorSet.h"
#include "V3DPipelineLayout.h"
#include "V3DGraphicsPipeline.h"
#include "V3DComputePipeline.h"

/**********************/
/* public - V3DDevice */
/**********************/

V3DDevice* V3DDevice::Create()
{
	return V3D_NEW_T(V3DDevice);
}

V3D_RESULT V3DDevice::Initialize(V3DInstance* pInstance, IV3DAdapter* pAdapter, const wchar_t* pDebugName)
{
	V3D_ASSERT(pAdapter != nullptr);

	m_pInstance = static_cast<V3DInstance*>(V3D_TO_ADD_REF(pInstance));
	m_pAdapter = static_cast<V3DAdapter*>(V3D_TO_ADD_REF(pAdapter));

	const V3DAdapter::Source& adapterSource = m_pAdapter->GetSource();

	// ----------------------------------------------------------------------------------------------------
	// C[̗
	// ----------------------------------------------------------------------------------------------------

	uint32_t vkLayerCount;
	VkResult vkResult = vkEnumerateDeviceLayerProperties(adapterSource.physicalDevice, &vkLayerCount, nullptr);
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<VkLayerProperties> vkLayerProps;
	vkLayerProps.resize(vkLayerCount);
	vkResult = vkEnumerateDeviceLayerProperties(adapterSource.physicalDevice, &vkLayerCount, vkLayerProps.data());
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<const char*> vkEnableLayers;
	if (m_pInstance->GetLayerType() == V3D_LAYER_STANDARD_VALIDATION)
	{
		if (std::find_if(vkLayerProps.begin(), vkLayerProps.end(), V3DFindLayer(V3D_LAYER_LUNARG_standard_validation)) != vkLayerProps.end())
		{
			vkEnableLayers.push_back(V3D_LAYER_LUNARG_standard_validation);
		}
	}

	// ----------------------------------------------------------------------------------------------------
	// GNXeV̗
	// ----------------------------------------------------------------------------------------------------

	uint32_t vkExtensionCount;
	vkResult = vkEnumerateDeviceExtensionProperties(adapterSource.physicalDevice, nullptr, &vkExtensionCount, nullptr);
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<VkExtensionProperties> vkExtensionProps;
	vkExtensionProps.resize(vkExtensionCount);
	vkResult = vkEnumerateDeviceExtensionProperties(adapterSource.physicalDevice, nullptr, &vkExtensionCount, vkExtensionProps.data());
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	if (std::find_if(vkExtensionProps.begin(), vkExtensionProps.end(), V3DFindExtension(V3D_DEVICE_EXTENSION_swapchain)) == vkExtensionProps.end())
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<const char*> vkEnableExtensions;
	vkEnableExtensions.reserve(vkExtensionCount);
	for (uint32_t i = 0; i < vkExtensionCount; i++)
	{
		vkEnableExtensions.push_back(vkExtensionProps[i].extensionName);
	}

	V3DFlags extensionFlags = 0;
	if (std::find_if(vkExtensionProps.begin(), vkExtensionProps.end(), V3DFindExtension(V3D_DEVICE_EXTENSION_push_descriptor)) != vkExtensionProps.end())
	{
		extensionFlags |= V3D_DEVICE_EXTENSION_PUSH_DESCRIPTOR_SET;
	}

	// ----------------------------------------------------------------------------------------------------
	// foCX̓擾
	// ----------------------------------------------------------------------------------------------------
<commit_msg>拡張機能の列挙名の変更<commit_after>#include "V3DDevice.h"
#include "V3DInstance.h"
#include "V3DAdapter.h"
#include "V3DFence.h"
#include "V3DQueryPool.h"
#include "V3DQueue.h"
#include "V3DCommandPool.h"
#include "V3DCommandBuffer.h"
#include "V3DSwapChain.h"
#include "V3DShaderModule.h"
#include "V3DResourceMemory.h"
#include "V3DBuffer.h"
#include "V3DImage.h"
#include "V3DBufferView.h"
#include "V3DImageView.h"
#include "V3DSampler.h"
#include "V3DRenderPass.h"
#include "V3DFrameBuffer.h"
#include "V3DDescriptorSetLayout.h"
#include "V3DDescriptorSet.h"
#include "V3DPipelineLayout.h"
#include "V3DGraphicsPipeline.h"
#include "V3DComputePipeline.h"

/**********************/
/* public - V3DDevice */
/**********************/

V3DDevice* V3DDevice::Create()
{
	return V3D_NEW_T(V3DDevice);
}

V3D_RESULT V3DDevice::Initialize(V3DInstance* pInstance, IV3DAdapter* pAdapter, const wchar_t* pDebugName)
{
	V3D_ASSERT(pAdapter != nullptr);

	m_pInstance = static_cast<V3DInstance*>(V3D_TO_ADD_REF(pInstance));
	m_pAdapter = static_cast<V3DAdapter*>(V3D_TO_ADD_REF(pAdapter));

	const V3DAdapter::Source& adapterSource = m_pAdapter->GetSource();

	// ----------------------------------------------------------------------------------------------------
	// C[̗
	// ----------------------------------------------------------------------------------------------------

	uint32_t vkLayerCount;
	VkResult vkResult = vkEnumerateDeviceLayerProperties(adapterSource.physicalDevice, &vkLayerCount, nullptr);
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<VkLayerProperties> vkLayerProps;
	vkLayerProps.resize(vkLayerCount);
	vkResult = vkEnumerateDeviceLayerProperties(adapterSource.physicalDevice, &vkLayerCount, vkLayerProps.data());
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<const char*> vkEnableLayers;
	if (m_pInstance->GetLayerType() == V3D_LAYER_STANDARD_VALIDATION)
	{
		if (std::find_if(vkLayerProps.begin(), vkLayerProps.end(), V3DFindLayer(V3D_LAYER_LUNARG_standard_validation)) != vkLayerProps.end())
		{
			vkEnableLayers.push_back(V3D_LAYER_LUNARG_standard_validation);
		}
	}

	// ----------------------------------------------------------------------------------------------------
	// GNXeV̗
	// ----------------------------------------------------------------------------------------------------

	uint32_t vkExtensionCount;
	vkResult = vkEnumerateDeviceExtensionProperties(adapterSource.physicalDevice, nullptr, &vkExtensionCount, nullptr);
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<VkExtensionProperties> vkExtensionProps;
	vkExtensionProps.resize(vkExtensionCount);
	vkResult = vkEnumerateDeviceExtensionProperties(adapterSource.physicalDevice, nullptr, &vkExtensionCount, vkExtensionProps.data());
	if (vkResult != VK_SUCCESS)
	{
		return V3D_ERROR_FAIL;
	}

	if (std::find_if(vkExtensionProps.begin(), vkExtensionProps.end(), V3DFindExtension(V3D_DEVICE_EXTENSION_swapchain)) == vkExtensionProps.end())
	{
		return V3D_ERROR_FAIL;
	}

	STLVector<const char*> vkEnableExtensions;
	vkEnableExtensions.reserve(vkExtensionCount);
	for (uint32_t i = 0; i < vkExtensionCount; i++)
	{
		vkEnableExtensions.push_back(vkExtensionProps[i].extensionName);
	}

	V3DFlags extensionFlags = 0;
	if (std::find_if(vkExtensionProps.begin(), vkExtensionProps.end(), V3DFindExtension(V3D_DEVICE_EXTENSION_push_descriptor)) != vkExtensionProps.end())
	{
		extensionFlags |= V3D_DEVICE_EXTENSION_PUSH_DESCRIPTOR_SETS;
	}

	// ----------------------------------------------------------------------------------------------------
	// foCX̓擾
	// ----------------------------------------------------------------------------------------------------

{'fraction_non_alphanumeric': 0.2756764032844259, 'fraction_numerical': 0.01642212949252928, 'mean_word_length': 2.765838824125697, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6418805', 'n_tokens_mistral': 2530, 'n_tokens_neox': 2406, 'n_words': 326}