Ejemplo n.º 1
0
void ImageAttachment::ApplyShader( BufferIndex updateBufferIndex, Shader* shader )
{
  mShader = shader;

  // send the message to renderer
  SendShaderChangeMessage( updateBufferIndex );

  // tell derived class to do something
  ShaderChanged( updateBufferIndex );
}
Ejemplo n.º 2
0
void ImageAttachment::RemoveShader( BufferIndex updateBufferIndex )
{
  // return to default shader
  mShader = NULL;

  // send the message to renderer
  SendShaderChangeMessage( updateBufferIndex );

  // tell derived class to do something
  ShaderChanged( updateBufferIndex );
}
Ejemplo n.º 3
0
	void ChoiceForm::SelectedShaderChanged(GraphicsUI::UI_Base *)
	{
		SetCursor(LoadCursor(NULL, IDC_WAIT));
		int idx = GetSelIdx(shaderBox);
		if (idx != -1)
		{
			UpdateChoicePanel(shaderBox->GetTextItem(idx)->GetText());
			ShaderChanged(shaderBox->GetTextItem(idx)->GetText());
		}
		SetCursor(LoadCursor(NULL, IDC_ARROW));
	}
Ejemplo n.º 4
0
	void ChoiceForm::Autotune(float timeBudget)
	{
		bool countOnly = false;
		ResetButton_Clicked(nullptr);
		referenceFrame = ReadFrameData(choiceControl->RenderFrame());
		EnumerableDictionary<String, Spire::Compiler::ShaderChoiceValue> currentChoices;
		currentBestValue = 1e30f;
		currentBestChoices = currentChoices;
		HashSet<String> selectedChoices;
		for (auto & chk : choiceCheckBoxes)
			if (chk.Value->Checked)
				selectedChoices.Add(chk.Key);
		autotuningLog.Clear();
		auto startTimePoint = PerformanceCounter::Start();
		int count = AutotuneHelper(selectedChoices, currentChoices, timeBudget, countOnly);
		float time = PerformanceCounter::EndSeconds(startTimePoint);
		autotuningLog << L"time: " << time << EndLine;
		printf("variant count: %d\ntime: %f\n", count, time);
		File::WriteAllText(L"autotuneLog.txt", autotuningLog.ToString());
		if (!countOnly)
		{
			existingChoices = currentBestChoices;
			disableChoiceChangeCapture = true;
			for (auto & choice : existingChoices)
			{
				auto cmb = choiceComboBoxes[choice.Key].GetValue();
				int idxToSelect = 0;
				for (int i = 0; i < cmb->Items.Count(); i++)
					if (cmb->GetTextItem(i)->GetText() == choice.Value.ToString())
					{
						idxToSelect = i;
						break;
					}
				cmb->SetSelectedIndex(idxToSelect);
			}
			disableChoiceChangeCapture = false;
			Recompile();
			ShaderChanged(currentShaderName);
		}
			
	}
Ejemplo n.º 5
0
void cceMaterialShaderEditorDialog::Close ()
{
  if (ShaderChanged ())
    {
      int result = QMessageBox::question (this,
        "Shader changed - " CCE_TOOL_NAME,
				"The shader has unsaved changes. Save changes bevor closing?",
				QMessageBox::Save, QMessageBox::Close, QMessageBox::Cancel);
      switch (result)
        {
        case QMessageBox::Save:
          Save ();
          break;

        case QMessageBox::Cancel:
          return;

        case QMessageBox::Close:
          break;
        }

    }
  emit CloseEditor(_shader);
}
Ejemplo n.º 6
0
void cceMaterialShaderEditorDialog::CodeChanged()
{
  _updateBindingTime.start();
  SetChanged(ShaderChanged());
}
Ejemplo n.º 7
0
void cceMaterialShaderEditorDialog::on_lineEditName_textChanged(const QString &text)
{
  SetChanged(ShaderChanged());
}
Ejemplo n.º 8
0
void cceMaterialShaderEditorDialog::on_comboBoxType_currentIndexChanged(int index)
{
  SetChanged(ShaderChanged());
}