Android Project
This commit is contained in:
@ -59,8 +59,14 @@ namespace ia::iae
|
||||
|
||||
VOID Renderer::Initialize()
|
||||
{
|
||||
if (!(s_gpuDevice = SDL_CreateGPUDevice(SDL_GPU_SHADERFORMAT_SPIRV, Engine::IsDebugMode(), nullptr)))
|
||||
SDL_PropertiesID deviceCreateProps = SDL_CreateProperties();
|
||||
SDL_SetStringProperty(deviceCreateProps, SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING, nullptr);
|
||||
SDL_SetBooleanProperty(deviceCreateProps, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN, true);
|
||||
SDL_SetBooleanProperty(deviceCreateProps, SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, Engine::IsDebugMode());
|
||||
SDL_SetBooleanProperty(deviceCreateProps, SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN, false);
|
||||
if (!(s_gpuDevice = SDL_CreateGPUDeviceWithProperties(deviceCreateProps)))
|
||||
THROW_UNKNOWN("Failed to create the SDL GPU Device: ", SDL_GetError());
|
||||
SDL_DestroyProperties(deviceCreateProps);
|
||||
|
||||
if (!SDL_ClaimWindowForGPUDevice(s_gpuDevice, g_windowHandle))
|
||||
THROW_UNKNOWN("Failed to initialize SDL GPU for the window: ", SDL_GetError());
|
||||
@ -172,9 +178,9 @@ namespace ia::iae
|
||||
#pragma pack(pop)
|
||||
|
||||
std::sort(s_drawEntries.begin(), s_drawEntries.end(), [](IN CONST DrawEntry &a, IN CONST DrawEntry &b) {
|
||||
if(a.Layer != b.Layer)
|
||||
if (a.Layer != b.Layer)
|
||||
return a.Layer < b.Layer;
|
||||
return a.SortIndex < b.SortIndex;
|
||||
return a.SortIndex < b.SortIndex;
|
||||
});
|
||||
|
||||
for (const auto &t : s_drawEntries)
|
||||
@ -312,10 +318,7 @@ namespace ia::iae
|
||||
{
|
||||
const auto t = (UINT16) (sortIndex + ((UINT16) s_state.PositionY * s_state.YSortingEnabled));
|
||||
s_drawEntries.pushBack(
|
||||
DrawEntry{.Layer = layer,
|
||||
.SortIndex = t,
|
||||
.DrawState = s_state,
|
||||
.GeometryHandle = handle});
|
||||
DrawEntry{.Layer = layer, .SortIndex = t, .DrawState = s_state, .GeometryHandle = handle});
|
||||
}
|
||||
|
||||
VOID Renderer::WaitForGPUIdle()
|
||||
|
||||
Reference in New Issue
Block a user